On Dec 12, 1:35 am, Mon Key <s...@derbycityprints.com> wrote:
> > Clojure does not allow for programmer-defined
> > reader macros (unlike other lisps).
>
> I know this has been touched upon last Spring - and Stu Halloway refs
> at least one discussion of this in his book.
>
> From a practical standpoint I am beginning to understand more why the
> choice was made to not support reader macros.
>
> But can someone (RH?) clarify the following?
>
> Is it possible to introduce reader macros (albeit unsupported frowned
> upon ones).
>
> > You could define a different reader and completely different text-based 
> > syntax for the language.
>
> Given the suggestion that Clojure could potentially be reimplemented
> with a different text-based syntax utilizing an alternate reader does
> this imply that reader macros are possible under a modified REPL?.
>
> From a purely speculative standpoint, if this is possible - the
> assertion that "Clojure does not allow for..." may be misplaced.
>
> I'm wondering to the extent that it *may* be possible to 'Rig the
> REPL' where would/does the Clojure license stand on this?
>
> I ask, because I remember reading in one of P. Graham's books '.*
> LISP' that some commercial LISPs were/are distributed with exceptions
> for calling `eval' at the top level - presumably to prevent one from
> modifying the REPL with some combination of macros/reader macros.
>
> Has Clojure taken an alternate approach whereby code distributed under
> license simply doesn't permit user defined reader macros?
>
> And if so - would it not be more appropriate to communicate (as a
> matter of policy - and stakeholder prudence) - "The Clojure License
> agreement doesn't *permit* user introduction of reader macros which
> when expanded  at compile time attempt to modify the designer(s)
> intended specification of Clojure's REPL"?
>
> I tend to recoil at the use of the phrase, "not allowed", and while
> I'm not personally even remotely capable of even beginning an attempt
> to endeavor to introduce any sort of modification as envisioned above
> I can certainly imagine situations/environments where such an attempt
> might be made - advocate(s) of competitive open source license models
> being one of the more benign examples...
>
> If I have mis-characterized something or have otherwise misunderstood
> the situation/possibilities I apologize.
>

I'm not going to rehash reader macros or licensing again - they've
been discussed here at length, except to say the two are unrelated.
The license doesn't say anything about the reader or repls - it's the
standard CPL.

People are going to put their Clojure programs in text files they
expect to be read by the standard reader and evaluated, and it is a
design goal of Clojure that programs by different people be able to be
combined. User-defined reader macros don't compose, they clash.

If you did so under Clojure's license, you could make a version of
Clojure with a modified reader - the reader source is there. But the
programs you wrote to your version of the reader would be incompatible
with those written by someone else who did the same thing. So, it has
less to do with technical or licensing issues than it has to do with
it being a bad idea, if you don't want to encourage programmers to
create islands. CL has this feature and it is very rarely used for
that exact reason - programs that require custom reader macros are a
pain.

People have mentioned wanting to use the reader to read programs in
other languages or data formats, and while I'm not generally opposed
to the idea of a data reader whose output is not destined for the
compiler, I'm also skeptical of the generality of such a thing. A lisp-
style reader is a page or two of Clojure code. People are making
parser combinator libs etc. There are ways to solve this problem
without making the standard reader fungible, with the added complexity
of providing an API and semantics for reader macros, and permanently
leaving characters available for customization that that entails.

If you want to modify the reader to create syntax for yourself,
convince me and the community that the syntax has wide utility and
I'll consider putting it in the standard reader so everyone can use it
portably.

Rich

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

Reply via email to