[Push] Push2 Fibonacci Code

Lee Spector lspector at hampshire.edu
Sat Nov 1 15:41:43 EST 2003


Rud,

Sounds like you pulled this new implementation together very quickly! Yes,
the code manipulation instructions may be a bit of a pain -- Push's Lisp
roots show here, as most of those instructions are available "for free" in
Lisp. One may be able to get by with a much restricted subset, however --
for example, I don't think we've yet bothered to implement SUBST or a
couple of others in our C++ version yet.

DO and DO* each evaluate only the top item on the code stack (and pop one
item from the code stack, after or before the evaluation, respectively).
However, if the evaluated code itself includes a DO or DO*, as in the
factorial example, then it might APPEAR at first glance to be doing more.

 -Lee



At 1:27 PM -0600 11/1/03, Rud Merriam wrote:
>I'm working with my own C++ code.
>
>Question: If there are multiple items on the Code stack will DO and DO*
>evaluate only the top item or continue until the stack is empty? It seems
>something continues until the stack is empty but I'm not sure if it is these
>operators or an outer interpreter of some type.
>
>I don't know where the Fibonacci came from since it is factorial. <sigh>
>
>I now have most of the examples in examples.program working. I even
>implemented an outer interpreter to handle "runpush" and "print-stacks". I
>just have to implement some of the type specific operations. I probably
>should retract the "most" since I haven't done any of the Code list
>operations. Those will be a bit of a challenge.
>
>Thanks for the Float.% URL. I was wondering about it mathematically. Who
>knows what a genetic program will use to get a result. The code modification
>solutions in some of your papers are intriguing.
>
>Rud Merriam
>K5RUD

--
Lee Spector
Dean, School of Cognitive Science
Associate Professor of Computer Science    lspector at hampshire.edu
Cognitive Science, Hampshire College       http://hampshire.edu/lspector/
Amherst, MA 01002                          413-559-5352, Fax: 413-559-5438




More information about the Push mailing list