Page 1 of 1

Read Macro / Readtable Wish List

Posted: Sun Jan 03, 2010 10:13 am
by Suroy
I was just wondered what others, in their experience with lisp, have often wanted from read macros and readtables. Are you satisfied with what one can do with them now in the current standard or do you wish for something more? :?
Personally, I would like
(1) Readtables per package rather than a global one :mrgreen:
(2) Being able to read backward in the reader macro stream for context :twisted:

Re: Read Macro / Readtable Wish List

Posted: Sun Jan 03, 2010 11:56 am
by ramarren
There is a project to make managing readtables easier: named-readtables.

Re: Read Macro / Readtable Wish List

Posted: Sun Jan 03, 2010 12:02 pm
by dmitry_vk
Suroy wrote:I was just wondered what others, in their experience with lisp, have often wanted from read macros and readtables. Are you satisfied with what one can do with them now in the current standard or do you wish for something more? :?
Personally, I would like
(1) Readtables per package rather than a global one :mrgreen:
(2) Being able to read backward in the reader macro stream for context :twisted:
Personally, I wish for just one thing: dispatch based on a symbol. E.g., something like #!BAR and #!FOO:BAR will dispatch to read macro attached to FOO:BAR symbol.

Re: Read Macro / Readtable Wish List

Posted: Sun Jan 03, 2010 1:53 pm
by nuntius
dmitry_vk wrote:Personally, I wish for just one thing: dispatch based on a symbol. E.g., something like #!BAR and #!FOO:BAR will dispatch to read macro attached to FOO:BAR symbol.
Join the line of people who rediscover that syntax. Here's my implementation.
http://www.cliki.net/read-macros

See also this syntax invented for PLT scheme.
http://barzilay.org/misc/scribble-reader.pdf
http://docs.plt-scheme.org/scribble/

Re: Read Macro / Readtable Wish List

Posted: Sun Jan 03, 2010 2:45 pm
by Suroy
Oh, I have to add to my list :D
I would like a read-delimited-form which will read everything rather than read-delimited-list which doesn't like cons lists. Thats because I would like to implement a more natural interface to the dot-net framework using RDNZL rather than using brackets. I know, picky, picky :roll:

Re: Read Macro / Readtable Wish List

Posted: Sun Jan 03, 2010 9:41 pm
by Suroy
So like yesterday and today I copy and pasted sbcl's reader parsing code getting rid of any sbcl-specific code. Dont know if i broke anything cause i only tested it for the very simplest cases. I do know i commented out the #S reader macro definition. I imagine if someone wanted to, though, a better (?) reader macro system using this code could easily be produced which is , err.. better.

http://github.com/Eyaro/cl-reader

Now i shall go check out scheme 8-)