On Fri, 2009-09-11 at 08:13 +0200, leppie wrote:
> ----- Original Message -----
> From: "Derick Eddington" <[email protected]>
> >
> > (define fib
> > (Q dup 1 <= (Q drop 1) (Q dup 1 - fib swap 2 - fib +) if))
> >
>
> It might be an idea to use QUOTE here. Then the expression can be:
>
> '(dup 1 <= '(drop 1) '(dup 1 - fib swap 2 - fib) if)
No, because then those "words" would be symbols and not lexically scoped
identifiers; and no, because then I'd have to make a slow interpreter
for the quoted forms instead of leveraging Ikarus-compiled lambda; and
no, because I want stack-lang to also accept arbitrary Scheme
expressions whose return value(s) get pushed on the data stack and that
requires lexical scoping too; and no, because I wouldn't be able to know
if a list is a stack-lang "quotation" to interpret or a list to use as a
value.
If stack-lang "quotations" were allowed to only be inside an (S ---)
form, then quote could be use the same as Q, but this is not acceptable
because I want stack-lang to also accept arbitrary Scheme expressions
whose return value(s) get pushed on the data stack and quote'ed lists as
expressions whose value to push on the stack to be used as a list would
conflict with using quote for Q. And I want Q to be usable outside S as
shown for the above definition of fib.
> (S '(1 2 3) print)
(1 2 3)
> (S (let-syntax ((M (lambda (_) 1)))
(M))
print)
1
>
--
: Derick
----------------------------------------------------------------