Picolisp question, segfault when manipulating lists of numbers (from a mailing list)

I am new to Picolisp.

I tried this and got segfault:

: ('(1 2) 6)
Segmentation fault

But if I try:

: ('(a b c) 6)
-> NIL

I basically understand why, but it was a surprise that PicoLisp responded instead of segfault instead of an error. Does this mean that Picolisp does not check if a number is a function, but does it when it is a character?

+3
source share
1 answer

(Retrieved from the picolisp mailing list .)

Yes, this is the expected behavior.

PicoLisp , , , . ( Lisp ) ( , asm, C). ( ), .

" ": (MMU) ?

(, ), PicoLisp , .

, , .

BTW, - , . :

   : (1 2 3)
   -> (1 2 3)

, .

: ('(a b c) 6)
-> NIL

, , Picolisp segfault . , Picolisp , ?

(a b c) : "a" ( ) .

   : (de foo a
      b
      c )
   -> foo

, (3) 'a', 'b' 'c'. 'c', NIL .

:

: (de foo H H) 

: (foo 1 2 3)
-> (1 2 3) 

: foo
-> (H H)

:

: ('(H H) 1 2 3)
-> (1 2 3)

.

, , ; , → ( , )

, . "1" .

   : (setq 7 5)  
   !? (setq 7 5)
   7 -- Variable expected
   ?
+3

Source: https://habr.com/ru/post/1722548/


All Articles