Hi Kazimir,

> Your answer demonstrates how Lisp dialects have grown in different
> directions. For instance, in two currently most popular Common Lisp
> books "Practical Common Lisp" and "Land of Lisp", function
> make-symbol is not mentioned at all.

OK, I see. Right.


> Could you demonstrate technique you'd use implementing this simple,
> but hard example on a 'safe way' in Picolisp:
> 
> (define (hard-example f)
>    (inc hard-example-calls)  ;it would be inc ' in Pico
>    (for(i 1 3)
>      (if (= hard-example-calls 1)
>          (hard-example '(lambda(x)i))) ; passes i as a free var
>      (print (f i) " ")))
> 
> (setq hard-example-calls 0)
> (hard-example (lambda(x)x))
> 
> Intended output is              1 1 1 1 2 3
> Accidental overshadowing gives  1 2 3 1 2 3

The equivalent would be

   (de hard-example (F)
      (inc 'Hard-example-calls)
      (for I 3
        (if (= Hard-example-calls 1)
            (hard-example (list '(X) I)) )
        (prin (F I) " ") ) )

   (zero Hard-example-calls)
   (hard-example '((X) X))
   (prinl)

   1 1 1 1 2 3 
   : 

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to