Stop array from creating global symbol

This commit is contained in:
Mike Cifelli 2018-02-10 12:27:23 -05:00
parent 76b1f987a2
commit 737502c4de
1 changed files with 8 additions and 10 deletions

View File

@ -14,9 +14,10 @@
(let* ((this (gensym))
(index-prefix (fuse this 'index))
(indices (call static :create-indices length))
(index-bindings (map (lambda (i) (list (fuse index-prefix i))) indices)))
(index-bindings (map (lambda (i) `(,(fuse index-prefix i))) indices))
(scope `((,this) ,@index-bindings)))
`(let ,index-bindings
`(let ,scope
(setq ,this
(dlambda
(:get (i)
@ -31,13 +32,10 @@
,length)
(t ()
((lambda (indices accumulator)
(if (null? indices)
((lambda (length accumulator)
(if (< length 1)
accumulator
(recur
(rest indices)
(cons
(call ,this :get (first indices))
accumulator))))
(reverse ',indices)
nil))))))))
(- length 1)
(cons (call ,this :get (- length 1)) accumulator))))
,length nil))))))))