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>
+2


source to share


2 answers


It was a red herring, there was no mistake. Sorry HN wrong call. In addition, it is now under the MIT (X11) license, the most liberal open source license.



0


source


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.

+1


source







All Articles