There seems to be a possibility for further unification.
This works for both:
Code: Select all
(setq l (sequence 1 10)
a (array 10 l))
;;
;; Applying refs works for both lists and arrays:
(setq r (ref 5 l))
(l r)
(a r)
Code: Select all
> (ref 5 a)
ERR: list expected in function ref : (1 2 3 4 5 6 7 8 9 10)
Then this would work, too:
Code: Select all
(setq r (ref 5 a))
(l r)
(a r)
Such unification would be good for functions operating on containers - being agnostic against the array/list difference.
Because there already is setf for arrays, I'm assuming that most machinery to get this done already exists.