[Push] Code.Nth
Lee Spector
lspector at hampshire.edu
Sun Jun 20 18:12:02 EDT 2010
In the Common Lisp implementation if the code into which you're indexing is an empty list then the pushed result is itself an empty list. That is, nth of () with any index is (), so you'd get another () on top of the code stack. Maybe that just made sense to me because of the equivalence of () and nil (= empty list = nothing) in Common Lisp. I could see that other answers (e.g. noop) might be just as good, and as long as you're consistent I wouldn't expect it to matter much (except for porting programs between implementations!).
-Lee
On Jun 20, 2010, at 3:54 PM, PerPlex Ed wrote:
> Hello.
>
> What should do Code.Nth when the input code item is an empty sequence instruction?
>
> Should it perform a no op (re-pushing the inputs on the stack)?
> Should it push nothing on the code stack as result?
>
> I'm trying to read the original implementation but my ability to follow lisp code is not very good.
>
> Thanks.
>
>
>
>
> _______________________________________________
> Push mailing list
> Push at lists.hampshire.edu
> https://lists.hampshire.edu/mailman/listinfo/push
--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspector at hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438
Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.com/
More information about the Push
mailing list