On 16 Nov 2013 21:05:11 +0100, Jörg F. Wittenberger 
<joerg.wittenber...@softeyes.net> wrote:
> Replying publicly.
> I decided that the way of least resistance to solve this is to introduce a 
> new namespace and keep the backward compatible code. See also 
> http://askemos.org/A0cd6168e9408c9c095f700d7c6ec3224?_v=search&_id=1550 for 
> the XSLT/XML embedding.

That makes sense.  Good solution.

> However I have something else in mind atop. I'd like to look into mixing 
> markdown as a "front end syntax" and re-parse / pattern match data content 
> from the resulting XML syntax tree. See: 
> http://askemos.org/A0cd6168e9408c9c095f700d7c6ec3224?_v=search&_id=756 
> (Note: there's also a related remark: neither basic Scheme `read` nor 
> sweet-read and friends will include comments. For some reason I'd like to 
> be able transform source code _including_ comments into derived versions, 
> which will then be the new version presented for edits by human authors. 
> Ergo: I need those comment nodes to be retained and included with the 
> corresponding "write" alike operation.)

Hmm.  The current reader obviously doesn't support that.
Our current reader does call "attach-sourceinfo" to allow
attaching line/column positions to objects as they are read in.
That makes debugging more pleasant, when it's implemented
as something other than a no-op.
However, comments are not objects, so that won't help you.

Are you sure you need it, though?  Why not have two readers,
once that reads sweet-expressions, and a separate one that
skims looking for specially-formatted comments?
Then you don't need to figure out how to make them work together.
After all, you can control the acceptable input format... just choose an easy 
one.

And if that doesn't work... I guess we could add a
nonstandard mode that inserted special objects so you can
record comments. I don't know if that would meet your needs,
and it'd clearly be a special case not normally used.
I'm not even sure how to generate all cases nicely.
Most people expect "read" to DROP comments :-).

--- David A. Wheeler

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to