[Push] "list" a.k.a. "Sequence instruction"

PerPlex Ed edperplex at yahoo.com
Sun Jun 20 10:58:36 EDT 2010


Lee said: "BTW I notice also that all of your generated code is flat -- 
no sublist 
structures. This probably means that you're not doing things according 
to the spec and it may also have at least two kinds of effects: 1) the 
standard mutation/crossover operators will only be able to replace 
single instructions/literals, since there won't be nested expressions to select for replacement, and 2) instructions that manipulate code 
(either CODE or EXEC instructions) will only be able to manipulate 
instructions/literals, so for example you wouldn't be able to use 
EXEC.IF to switch between two large subprograms."

Thanks. Actually I was aware of the issues and it was something I wanted to ask about it. What I didn't understand is that the spec actually 
says it pretty clearly.

When I read "list" I think of a lisp list. When I think of the "(...)" 
construct I call it "the Sequence instruction" which, when executed, 
pushes its content on the Exec stack in reverse order. Of course in the 
original implementation the two concept overlap completely.
There are several places in the language description that I had to 
re-read few times to understand what you meant. For example, if you say 
something like "a pair of parenthesis count as one point"... that's 
obvious if your think of it as the Sequence instruction which, as any 
other instruction, counts as 1 point. So I wondered what you meant for 
few seconds.

Anyway, thanks for the warning. I fixed my implementation.

Now the the previous code looks like this:

((((Code.Yank Exec.YankDup Boolean.And) Integer.% Boolean.FromFloat) 
Env.Types Code.DoStar (Float.Tan Exec.Define Code.Pop) Code.YankDup) 
Float.Pop)

(((Code.Do*Times Code.Nth) Exec.If) Name.Quote)

((Code.List Env.MinRandomFloat) Integer.Define)

((Float.Tan Float.FromInteger) Float.-)

(((Boolean.Not Code.FromBoolean) Code.Position Name.Yank 0.0) (Exec.K 
Integer.Shove <name>535059314 Code.FromName) Name.Rot Float.Rand)

PerPlexEd


      



More information about the Push mailing list