On Wed, Sep 26, 2018 at 11:03 PM Mark H Weaver <m...@netris.org> wrote:


> To initialize an alist that will be mutated, you must instead do
> something like this:
>
>   (define capitals (list (cons "New York" "Albany")
>                          (cons "Oregon"   "Salem")
>                          (cons "Florida"  "Miami")))
>

More simply, you can wrap the literal in a call to copy-tree.  This returns
a deep copy of the literal that is fully mutable.

-- 
John Cowan          http://vrici.lojban.org/~cowan        co...@ccil.org
Here lies the Christian, judge, and poet Peter,
Who broke the laws of God and man and metre.

Reply via email to