[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Make result of empty "else" clause undefin
Re: [Chicken-hackers] [PATCH] Make result of empty "else" clause undefined in `cond' and `case' forms
Thu, 12 Apr 2018 14:54:42 +0200
On Thu, Apr 12, 2018 at 01:40:42PM +0100, Alaric Snell-Pym wrote:
> I think this is good, and doesn't need a warning. I think it could be a
> legitimate statement of intent to create an empty else when writing
> imperative-style code.
> ((= guess target) (display "You guessed correctly!"))
> ((zero? guess) (display "You're not even trying!"))
> ((> guess 100) (display "C'mon, you know the number's never more than
> (else)) ;; in all other cases, do nothing
> It declares that an unhandled case is *meant* to do nothing, rather than
> being an omission on the part of the author.
> However, if others can think of likely situations where this is a
> mistake, I'll concede a warning :-)
I agree, this should not necessarily warn. We already will emit a
warning when you use the result of the expression in a procedure call
to a procedure which does not accept arguments of the void type.
Description: PGP signature