What is the main point of reader macros? Is it so you can define your own short-hand syntax, or is it the ability to get more direct access to the reader? If it is the first point, then I'd be happy to not have them - to me shorthand doesn't buy much. If it is the second point then why not simply have the reader pipe raw text into a reader macro? Ie, usage would be like (def-reader-macro pass-through [raw-string] (read-string raw-string))
Usage would be (pass-through (+ 1 2)). The pass-through call would be given "(+ 1 2)" in the raw-string argument and must return a value that can be eval'd. More complex "reader" macros could be (infix x + y + z / 3). Thoughts? Brad On Aug 13, 2:23 pm, Aaron Cohen <remled...@gmail.com> wrote: > On Thu, Aug 13, 2009 at 5:14 PM, Meikel Brandmeyer<m...@kotka.de> wrote: > > Hi, > > > Am 13.08.2009 um 22:30 schrieb Brian Hurt: > > >> Now, I can certainly see a lot of potiential downsides to this. > >> Redefining what #{} or #() means is just the start. > > > I think, this is the reason Rich is not very positive for that idea: because > > nobody came up with a way of defining "namespaces" for reader macros, so > > that they don't interfere with each other. > > >> But it'd make it a lot easier to do things with DSLs. > > > I'm happy with macros for DSLs. Actually the macros just quasiquote their > > arguments and pass them on to actual functions. > > >> So, what are people's thoughts? > > > I've yet to see the desire for a self-defined reader macro. But I'm no > > Common Lisper (a Schemer actually). So I'm not used to reader macros. Maybe > > I'm missing the paradise. > > > I'm not necessarily opposed to the idea. But I wouldn't give it high > > priority either. > > > Sincerely > > Meikel > > Would it make any difference if the scope of the reader macro was > limited to the file which defines/uses it? Any file that wanted to > use a custom reader macro would then have to add its own > (use-reader-macro ...) statements, and there'd be no possibility for > conflicts. > > Something like: > > (defn comment-block-begin [] > "Dispatch function for beginning of block comments") > > (use-reader-macro '#| comment-block-begin) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---