PicoLisp language: onOff question
This question is really moot, I think I must have got into a bug in my program or something. If you are still looking for PicoLisp and onOff behavior take a look.
is this supposed to happen?
: (show NIL)
NIL NIL
-> NIL
: (onOff)
-> T
: (show NIL)
T T
-> T
: (=T NIL)
-> T
:
(onOff sym ..) -> flg
Logical negates the VAL of all argument symbols sym. Returns the
new value of the last symbol.
- Shouldn't the symbol names be passed explicitly?
- Why is it returning the value of the last character? Strike>
source to share
This is a bug in the PicoLisp implementation with the macro onOff
...
Function parameters onOff
:(onOff var ..) -> flg
It takes var and many other variables and logically negates them (true becomes false, false becomes true). I'm willing to bet that the macroonOff
takes one list of arguments. This means that if given any arguments, this argument list is empty, which means that the symbol assigned to this function is NIL.
The macro is in bold because that's where the problem is. Using a macro makes it so that you can pass characters without quotes. Thus, the macro onOff
generates incorrect code.
source to share