[plt-scheme] How to insert an element in empty list?

From: Majorinc, Kazimir (kazimir at chem.pmf.hr)
Date: Sun Aug 12 16:13:20 EDT 2007

If list is not empty, it is easy (although not really trivial). But how 
to do that with empty list, both set-first! and set-rest! complain they 
do not work with empty lists.

What does it mean, once list is empty it is empty forever?

Did I miss something obvious?

Thanks,
Kazimir Majorinc




Posted on the users mailing list.