guile-devel
[Top][All Lists]
Advanced

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

Re: Defining Functions With Syntax


From: Andy Wingo
Subject: Re: Defining Functions With Syntax
Date: Wed, 21 Sep 2011 20:40:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

On Wed 21 Sep 2011 20:03, Noah Lavine <address@hidden> writes:

>> It is complicated though.  The other option is to write a PEG
>> interpreter or compiler in Scheme.  An interpreter would interpret the
>> s-expressions directly, or some simplified form of them.  A compiler
>> would pre-process the s-expressions to produce a procedure, built from
>> closures.
>
> Yes indeed. The thing is, we already have a compiler written in
> Scheme. The trouble is that it compiles S-expressions to syntax, and
> then it takes some trouble to get that syntax into a procedure. I
> think it might be cleaner if I could directly convert syntax into a
> procedure. For instance, what about doing
>
>   (compile (peg-sexp-compile <some-s-expression>) #:from scheme-syntax
> #:to value)
>
> ? That seems like a nice API to me.

You could do the same with #:from 'scheme, no?

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]