Hi Lindsay.

AFAIK there is only one empty `list' in PL, and that is `NIL'.  So
after `conc'atenating to it's end it would no longer be empty.

How about:

[de ex1 []
  [make
    [do 10
      [link 'A] ] ] ]

[de ex2 []
  [let [R [list]]
    [do 10
      [conc R [list 'A]] ]
        # Will have to find the end of `R' each time!!
        # Even worse if `R' is `circ'ular, which will result in
infinite recursion and out of stack memory.
        # In Your second implementation `'[A]' was `conc'ed to itself,
which resulted in `circ'ular list `[A .]'.
          # : [setq L1 '[A]] [conc [] L1 L1]
          # -> [A .]
        # To avoid that it was corrected to `[list 'A]'.
    (cdr R) ] ]

[de ex3 [N]
  [default N 10]
  [let [R []]
    [for I 10
      [fifo 'R I] ]
    [prog1 (cdr R)
      (con R []) ] ] ]
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to