[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-hackers] patch: treat #t as alternative to else in cond
From: |
Jörg F. Wittenberger |
Subject: |
[Chicken-hackers] patch: treat #t as alternative to else in cond |
Date: |
Thu, 14 Nov 2013 14:31:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 |
Hi all,
attached a single statement patch. It makes "cond" expand clauses with
"#t" as condition like "else".
That is
(define (testcase x)
(cond
((eq? x 'a) 1)
(#t 2)
((eq? x 'b) 3)))
will result in a warning:
Warning: non-`else' clause following `else' clause in `cond': ((eq? x
(quote b)) 3)
and generate the same code as
(define (testcase x)
(cond
((eq? x 'a) 1)
(else 2)))
BTW: I ran into this when compiling the SRFI-110 reference implementation.
Best Regards
/Jörg
cond-true-else-alias.diff
Description: Text Data
Re: [Chicken-hackers] patch: treat #t as alternative to else in cond, Evan Hanson, 2013/11/15