[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Making apostrophe, backtick, etc. hygienic?
From: |
Taylan Ulrich Bayırlı/Kammer |
Subject: |
Re: Making apostrophe, backtick, etc. hygienic? |
Date: |
Mon, 31 Aug 2015 15:10:59 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Panicz Maciej Godek <address@hidden> writes:
> I think that this is the case for R6RS or R7RS, but as far as I can
> tell, in R5RS it would be problematic.
I think the R5RS is implicitly silent on that by virtue of not having a
library system. It says that a literal in a pattern will match "if it
has the same lexical binding" and if an extension to R5RS provides a way
to create different identifiers with the "same lexical binding" then
that wouldn't contradict the standard. :-)
I don't think we should obsess over compliance that much anyway though.
The unhygienic 'foo is one of the few very strange things in Scheme IMO.
> You'll never know. While it may seem unlikely to fix quote to mean
> minus, in mathematical analysis the symbol is often used to mean the
> derivative of a unary function, so it is quite possible that someone
> would wish to write in some context
>
> (let ((quote deriv))
> (+ (f x) ('f x) (''f x)))
>
> On the other hand, your soultion would work if someone decided to
> write
>
> (let ('deriv)
> (+ (f x) ('f x) (''f x)))
>
> (which is IMO more elegant)
IMO the rarity of such code, plus the easiness of fixing it, make that a
non-issue.
> Nevertheless, I think that even if 'x would map to (__quote__ x), it
> could still happen that someone was using the __double_underscore__
> convention in her code (for some reason), and your allegations would
> apply to this new situation as well.
That's much less likely, and it needn't be underscores either. E.g. it
could be %%quote instead. (Maybe we already have a convention for this,
I don't know.)
Anyway, if people don't like the idea for whatever reason then I won't
push it. I just thought it would be neat to uphold the hygiene a little
farther, and not make it break when a user binds an identifier that's a
plain word like quote or syntax.
Taylan
- Making apostrophe, backtick, etc. hygienic?, Taylan Ulrich Bayırlı/Kammer, 2015/08/30
- Re: Making apostrophe, backtick, etc. hygienic?, Panicz Maciej Godek, 2015/08/30
- Re: Making apostrophe, backtick, etc. hygienic?, Taylan Ulrich Bayırlı/Kammer, 2015/08/30
- Re: Making apostrophe, backtick, etc. hygienic?, Panicz Maciej Godek, 2015/08/30
- Re: Making apostrophe, backtick, etc. hygienic?, Taylan Ulrich Bayırlı/Kammer, 2015/08/30
- Re: Making apostrophe, backtick, etc. hygienic?, Panicz Maciej Godek, 2015/08/31
- Re: Making apostrophe, backtick, etc. hygienic?,
Taylan Ulrich Bayırlı/Kammer <=