[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Translator and R5RS
From: |
Karl M. Hegbloom |
Subject: |
Re: Translator and R5RS |
Date: |
15 Oct 2000 11:58:37 -0700 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.2 (Nike) |
>>>>> "Michael" == Michael Livshin <address@hidden> writes:
>> As another example, someone would translate the following C-like
>> code
>>
>> foo (flag)
>> {
>> if (flag) return 1;
>> /* something */
>> }
>>
>> into
>>
>> (define-function-with-block (foo flag)
>> (if flag (return 1))
>> ;; something
>> )
>>
>> and implement `return' by using a continuation or throw.
Michael> implementing `return' in terms of `throw' is workable, I guess.
fwiw,
Michael> Common Lisp has a `return-from' primitive, which is supposed to be
Michael> understood by the compiler and to not require an extra-lexical
Michael> run-time mechanism (i.e. throw) to implement.
There is a good discussion of this in "Lisp in Small Peices" by
Christian Queinnec.