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

Re: Dylan Features




Gabor Greif <gabor@mac.com> wrote in message
8mfgov$ck6$1@rznews2.rrze.uni-erlangen.de">news:8mfgov$ck6$1@rznews2.rrze.uni-erlangen.de...
> but we have the block macro that provides an exit function:
>
> define function invoke(f :: <function>)
>     f(42*42)
> end;
>
> block(return)
>     invoke(return);
>     42
> end block;
>
>
>
> will evaluate to 42*42. (too lazy to compute it :-)
>
> In this respect it is similar to call/cc:
>
> (define (invoke f)
>     (f (* 42 42))
> )
>
> (define (block)
>     (call/cc invoke)
>     42
> )

Wow!!  I never thought about block() in that way.   But,  if I understand
this correctly, Dylan still doesn't have enough power to implement
coroutines.  Is that right?   If it did, I might ask whether it's possible
to use Dylan as an embedded extension language.  I've just recently been
looking for possible extension languages and thought only Scheme or Python
would pass my criteria.  Maybe Dylan could if...
 1) it could be made small enough to fit in about 1/2 meg for code and 1/2
meg heap
 2) allowed coroutines or lightweight threads .

Would it also have to have an "eval"-like function to allow for evaluating
arbitrary Dylan fragments called from the embedding program?





Follow-Ups: References: