[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re : set in Scheme



In reply to David Chin about "set in Scheme".  I'd have to agree with
Pavel that it's better to recode without passing around different symbols.  
However, there's a lot of code out there, UCILISP for natural language
processing for example, which uses "set" all over the place.  If you just
want to get some simple examples from a text or article running, you
may not consider it worth your time to recode everything; fortunately the
problems described by Pavel may not be that critical either for this type of
code.  If so, why not just forget about elegance for a little while and save
yourself some trouble. Just hack out a horrible little ugly macro like the
following:

(macro set
   (lambda (e) `(eval ,`(set! ,(eval (cadr e)) ,(caddr e)))))

But I don't think I'd be "sticking my neck out" by saying that THIS doesn't
adhere to the "Scheme philosophy", so I would use it only in emergencies.

-- Brad Pierce

<pierce@cs.ucla.edu>