Closed GoogleCodeExporter closed 8 years ago
Well spotted. :) Actually, there are similar problems with the __case__,
__when__ and __with__ macros as well.
In the case of __lambda__, __when__ and __with__ one might argue that the
corner cases with an empty list argument should evaluate to just the target
expression (or body of the lambda, respectively). But I think that for
consistency these cases should all be left undefined since these constructs
aren't permitted in the language either.
Also, this gives the programmer the opportunity to define these cases any way
he likes. So if you want to just eliminate trivial 'when' blocks then you may
want to have:
def x __when__ [] = x;
But for __lambda__ it may be preferable to emulate a parameterless closure
using a thunk, so you'd define:
def __lambda__ [] x = x&;
I'm currently giving this a try, so stay tuned.
Original comment by aggraef@gmail.com
on 16 Jun 2012 at 7:46
This issue was closed by revision 372995eb1c1c.
Original comment by aggraef@gmail.com
on 16 Jun 2012 at 8:19
Terrific turnaround time!
Original comment by dubious...@gmail.com
on 16 Jun 2012 at 12:29
Original issue reported on code.google.com by
dubious...@gmail.com
on 16 Jun 2012 at 1:07