On Mon, Jul 2, 2012 at 1:05 AM, David A. Wheeler <[email protected]> wrote:
>> Attached please find a modern-expressions (NOT full sweet-expr, this
>> is just partial implementation) implementation.
>
> You're more than welcome to start with the code here:
> http://readable.svn.sourceforge.net/viewvc/readable/trunk/
>
> In particular, "modern.scm" implements modern-expressions, and you can use 
> its implementation of I-expressions (as I've corrected it) to implement 
> sweet-expressions.
>
> In general, all the files, etc., are here:
> http://sourceforge.net/projects/readable/
>
> Can you compare your implementation to mine?
>
> --- David A. Wheeler

Well, my implementation has an actual parser spec, and follows the
structure of the parser spec as closely as it can.  Of course,
curly-infix doesn't have a parser spec - anyone want to write one?

Also, parsers can return:

1.  An expression (or whatever it is the parser returns on success,
cf. post-mdn-expr)

2.  A sentinel "nothing" value which means "I didn't find what I was
looking for, go look for something else".

3.  An error, basically means "the user screwed up!"

I'm integrating the mdn-expr parser with swt-expr because my planned
implementation of swt-expr will need to check for the sentinel
"nothing" value.  Originally I didn't have the nothing value, but
adding it in made some processing easier, and made the code more
regular.  The sweet-reader wrapper then also guards against this
sentinel escaping, transforming sentinel returns to errors (and
assuming that it's because of a character-level error).

If you really want a split implementation we could just factor out the
nothing sentinel into a separate file and import it.  But currently
I'm leaning towards a single file because of module handling worries.

I want to use macros in my implementation (solely for use within the
parser) but I have some worries about the module system and
portability across various schemes.  Sigh.

Also, my implementation has some code to support source information
extraction.  Hopefully judicious use of cond-expand (SRFI 0) should
help make source information portable across schemes.

Sincerely,
AmkG

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to