chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] patch: treat #t as alternative to else in cond


From: Peter Bex
Subject: Re: [Chicken-hackers] patch: treat #t as alternative to else in cond
Date: Fri, 15 Nov 2013 20:35:35 +0100
User-agent: Mutt/1.4.2.3i

On Fri, Nov 15, 2013 at 02:28:40PM -0500, John Cowan wrote:
> Peter Bex scripsit:
> > This should probably be handled in the scrutinizer, but for now I guess
> > it's okay to warn on constants.  Attached is a patch that detects other
> > constants as well, because that could be an even more common mistake
> > than a plain #t.
> 
> It arises as a result of overly literal translations from Common Lisp,
> where there is no analogue of "else" and people commonly use T as the
> condition for else-clauses.

I guess that much is true.  But it doesn't hurt to catch other similar
mistakes as well.

> > The problem is that its comparison with quote is unhygienic (I guess
> > it's normally used in the compiler after it's been normalised).
> 
> Rebinding quote gets you into trouble anyway, because the lexical syntax
> 'x is unhygienic.

Is it in CHICKEN?  Does it have to be?  You could equally well rename it
upon encountering it, so it can never get captured.  If you really wanted
"the local quote", you should've expressly spelled it out.

> Anyone who rebinds any of quote, quasiquote, unquote,
> or splicing-unquote deserves to lose.

I disagree there.  What if you don't import them from their module?
I think the quotation stuff should always work, regardless of whether
you've imported the right thing or rebound it.  As long as it's available
in the "core" it should work.  And AFAIK in CHICKEN, 'foo gets read as
(##core#quote foo) anyway.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]