2

This question is really moot, I think I must have hit a bug in my program or something. If you are still looking for PicoLisp and onOff behaviour, look here.




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's of all argument symbols sym. Returns the
new value of the last symbol.
  • Should not the symbol names be passed explicitly?
  • Why does it return value of the last symbol?
Prof. Falken
  • 24,226
  • 19
  • 100
  • 173

2 Answers2

1

It's a bug in the PicoLisp implementation with the onOff macro.

The parameters of the onOff function are: (onOff var ..) -> flg

It takes a var and many more variables and logically negates them (true becomes false, false becomes true). I'm willing to bet that the onOff macro takes a single list of arguments. Which means that if NO arguments are given to it, that list of arguments is empty which means the symbol given to the function is NIL.

Macro is bolded because that's where the problem lies. Using a macro makes it so you can pass the symbols to it without quoting. So the onOff macro is generating incorrect code.

0

This was a red herring, there was no bug. Sorry, HN wrong call. Also, it is now under the MIT (X11) license, the most liberal of open source licenses.

Prof. Falken
  • 24,226
  • 19
  • 100
  • 173