[Push] Type literals

PerPlex Ed edperplex at yahoo.com
Fri Jun 18 10:10:04 EDT 2010


A numeric or symbolic literal is executed pushing its value in the respective stack (boolean, float, integer or name stack). How should type literal executed?

As far as I understand you dropped the type stack.
The only use for types is in "configuration code" like in this examples (from P3.0PLD):

CODE.QUOTE ( FLOAT ) ENV.TYPES

It means that, if not quoted, the FLOAT type literal would be executed and there would be no mean for ENV.TYPES to collect the type anywhere, so you quote it and ENV.TYPES pops an item from the code stack. Does it mean that FLOAT is supposed to be a no-op?

I was finishing the the configuration code of my implementation and I realized I was missing type literals, implemented them just like the other literals - it pushes type value in the type stack - and made ENV.TYPES collect the types  there.
I forgot that the type stack was supposed to not exist and actually it was natural for me to do that.

I realize that wheter it's "natural" or not may depend on the internals of the intepreter too.
In my implementation I have a "float value", a "float stack" which is a stack of float values and a "float literal" which is an "instruction" that pushes a value on the float stack. "float value" and "float literal" are not the same thing. I think I understand that the lisp implementation doesn't make any difference (and so will probably do any implementation that is internally strongly typed for a reason or another).

What if I keep using the type stack?
Will it have any impact on the results that the genetic programming system will yield?

It doesn't make any significant difference in the implementation. I spent more time writing this message than what is needed to implement this feature in any of the two ways. I'm just worried about the "impact on the evolutionary process" more than about a different in behaviour of the implementation in executing some specific code. I don't have experience in this field.

Thanks.


      



More information about the Push mailing list