Read Macro / Readtable Wish List

Discussion of Common Lisp
Post Reply
Suroy
Posts: 46
Joined: Sat Dec 19, 2009 11:20 am

Read Macro / Readtable Wish List

Post by Suroy » Sun Jan 03, 2010 10:13 am

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:

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: Read Macro / Readtable Wish List

Post by ramarren » Sun Jan 03, 2010 11:56 am

There is a project to make managing readtables easier: named-readtables.

dmitry_vk
Posts: 96
Joined: Sat Jun 28, 2008 8:01 am
Location: Russia, Kazan
Contact:

Re: Read Macro / Readtable Wish List

Post by dmitry_vk » Sun Jan 03, 2010 12:02 pm

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.

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: Read Macro / Readtable Wish List

Post by nuntius » Sun Jan 03, 2010 1:53 pm

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/

Suroy
Posts: 46
Joined: Sat Dec 19, 2009 11:20 am

Re: Read Macro / Readtable Wish List

Post by Suroy » Sun Jan 03, 2010 2:45 pm

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:

Suroy
Posts: 46
Joined: Sat Dec 19, 2009 11:20 am

Re: Read Macro / Readtable Wish List

Post by Suroy » Sun Jan 03, 2010 9:41 pm

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

Post Reply