On Wed, Dec 23, 2020 at 01:35:58PM +0100, Alexander Burger wrote:
> > (eval (cons 'circ (range 1 200000)))
> Yes, this is a known issue. It is a stack overflow.

Building a long list with 'range' just to apply it (e.g. to 'circ') is rather
inefficient.

In this case, I would recommend 'fifo' to build large circular structures:

   (let L NIL
      (for I 200000
         (fifo 'L I) )
      ...


The result is a little different though:

   : (let L NIL (for I 7 (fifo 'L I)) L)
   -> (7 1 2 3 4 5 6 .)

Depends on the use case.

☺/ A!ex

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

Reply via email to