Hello all, I've implemented the settable-functions thingy on the arc-wiki.git. To use, just require or load lib/settable-fn.arc Now you can start building your own collection-like objects. It won't have amenities like (keys ...) and (ontable k v ...) and (len ....) yet, but I think it may be possible to extend the "attachment" concept further down that road if it becomes necessary. (= *test-settable-fn
(let (x y) nil
(add-attachment '=
;setterfunction
(fn (v s)
(case s
x (= x v)
y (= y v)
(err:string "Disallowed key: " s)))
;readerfunction
(fn (s)
(case s
x x
y y)))))
|