Hi Alex,

> All functions ignore atomic CDRs of the last argument cell. You could
> also try (onOff A B . X), the 'X' will be simply ignored.

so why is not NIL in the (onOff . NIL) ignored? ;-)

> zero arguments (as in 'onOff') are not to be expected, the function goes
> straight on and "takes" the first argument, which happens to be NIL in
> this case. So 'onOff' does not distinguish (nor even check) the
> difference between
>
>    (onOff)
>
> and
>
>    (onOff NIL)
>
> There is no practical reason to do so, because calling 'onOff' without
> arguments makes no sense. Remember, it is a non-evaluating function, and
> cannot be called in a less predictable way (e.g. being passed through
> 'apply', mappings etc.).

Ok.

> I think that most functions in PicoLisp behave like this. Try 'list',
> for example:
>
>    : (list NIL)
>    -> (NIL)
>    : (list)    
>    -> (NIL)
>
> It does not care to check for the first argument.

'list' is a good example where I find this behaviour rather strange.

>    : (list)    
>    -> (NIL)

Here I would expect NIL and not (NIL).  Any other lisp I know works this
way and it also makes sense.  I.e.  the command says make a list of
nothing (not even a NIL) and an empty list is NIL so this behaviour
seems broken to me.  Do you have any example or code in picolisp that
takes advantage of this behaviour?

Thank you,

Tomas
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to