Message from discussion
Request for Discussion: user created reader macros
Received: by 10.210.89.7 with SMTP id m7mr361648ebb.14.1250198588094;
Thu, 13 Aug 2009 14:23:08 -0700 (PDT)
Received: by 10.210.89.7 with SMTP id m7mr361647ebb.14.1250198588070;
Thu, 13 Aug 2009 14:23:08 -0700 (PDT)
Return-Path: <remled...@gmail.com>
Received: from mail-bw0-f209.google.com (mail-bw0-f209.google.com [209.85.218.209])
by gmr-mx.google.com with ESMTP id 15si157589ewy.0.2009.08.13.14.23.06;
Thu, 13 Aug 2009 14:23:07 -0700 (PDT)
Received-SPF: pass (google.com: domain of remled...@gmail.com designates 209.85.218.209 as permitted sender) client-ip=209.85.218.209;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of remled...@gmail.com designates 209.85.218.209 as permitted sender) smtp.mail=remled...@gmail.com; dkim=pass (test mode) header...@gmail.com
Received: by bwz5 with SMTP id 5so894006bwz.3
for <clojure@googlegroups.com>; Thu, 13 Aug 2009 14:23:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:reply-to:in-reply-to
:references:date:message-id:subject:from:to:content-type
:content-transfer-encoding;
bh=HSxiJ6/PuFNhpFb125xTgYagcVoKwviZOqbZOCtfbJE=;
b=pKvOXPXxiZKy874nvvRweXgeZY+9OSB2hvxL5lrCnHuHFJAmhaaiAW2Ba494s14mhI
4S4yAKiRAGqNjn/hh+d9YMq2KF+OBVhHVjt5le+lq2fVW0rlmD96bXxT/gTvMoyQ2BPw
c8Pg7lC1TErpkDWFzucg1/gZdruQJ0z1/76Js=
DomainKey-Signature: a=rsa-sha1; c=nofws;
d=gmail.com; s=gamma;
h=mime-version:reply-to:in-reply-to:references:date:message-id
:subject:from:to:content-type:content-transfer-encoding;
b=Pr5uLK5N3riapui+V4KbylcY4UkmH05iHVDXPOYg8v8idztwyei88J/ZH5MVOddOiK
4r7Fr1GM3P6XMbIo7ZuN++RPy7o3VoYbAL5A5q0CRhiDDr8N5WzrvYsO/mQ/zhBjFH31
pmJhIv1WjT/3VeGEHfucp5ZZGcXhFfNUUS/KM=
MIME-Version: 1.0
Received: by 10.204.21.12 with SMTP id h12mr853069bkb.20.1250198586464; Thu,
13 Aug 2009 14:23:06 -0700 (PDT)
Reply-To: aa...@assonance.org
In-Reply-To: <A685C4C3-1120-4420-A2F9-641C4BB1D...@kotka.de>
References: <9baa98e00908131330y24bb810bp56e3a86dfc102...@mail.gmail.com>
<A685C4C3-1120-4420-A2F9-641C4BB1D...@kotka.de>
Date: Thu, 13 Aug 2009 17:23:06 -0400
Message-ID: <727e50150908131423g3d394190r7e1ed11034c94...@mail.gmail.com>
Subject: Re: Request for Discussion: user created reader macros
From: Aaron Cohen <remled...@gmail.com>
To: clojure@googlegroups.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
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.
>> =C2=A0Redefining what #{} or #() means is just the start.
>
> I think, this is the reason Rich is not very positive for that idea: beca=
use
> 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. May=
be
> 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)