guile-devel
[Top][All Lists]
Advanced

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

Re: Defining Functions With Syntax


From: Noah Lavine
Subject: Re: Defining Functions With Syntax
Date: Wed, 21 Sep 2011 14:03:45 -0400

Hello,

> 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.

Noah



reply via email to

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