From: Rich Hickey <richhic...@gmail.com>
Date: Fri, 14 Mar 2008 06:12:36 -0700 (PDT)
Local: Fri, Mar 14 2008 9:12 am
Subject: Re: Clojure reader macros
On Mar 13, 9:21 pm, "Darshan Shaligram" <scinti...@gmail.com> wrote:
> On Wed, Mar 12, 2008 at 9:35 PM, Rich Hickey <richhic...@gmail.com> wrote:
That's what I mean by interoperability.
> [...]
> > As time goes by I become more entrenched in my decision not to
> I believe Clojure can provide reader macros that do not affect
> * Two different libraries may use the same dispatch characters by
> but this can be solved easily if the libraries allow the
I would dread having to read code in libraries that did this.
> client code to specify the dispatch characters they should attach > their reader macros to. For instance: > (enable-interpolate-syntax \I) ; Uses #I"" for interpolating strings.
> If the libraries do not allow choosing the dispatch character, they
I wouldn't want to encourage that either.
> cannot be used together in the same source file, but that can be > easily fixed (presuming you have the source, or don't mind > re-modifying the read-table after the library has done its thing), and > that little inconvenience is preferable to not having any reader macro > support. :-) > As you note, reader macros provide a lot of power, and while most code
I am unconvinced that reader macros are needed in Clojure at this
> will never need reader macros, some code can benefit powerfully from > them. It is possible to fake reader macros in very roundabout ways > (provide custom definitions of load and read that check characters > against a dispatch table, and call the underlying read for characters > not in the custom dispatch table), but life would be a lot easier if > the language supports them directly. > What do you think of this proposal? If there's no interest in (safe)
time. They greatly reduce the readability of code that uses them (by people who otherwise know Clojure), encourage incompatible custom mini- languages and dialects (vs namespace-partitioned macros), and complicate loading and evaluation. To the extent I'm willing to accommodate common needs different from
Clojure is arguably a very simple language, and in that simplicity
I'm going to pass on pursuing this for now,
Rich
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||