in reply to functional "given...when..."?
Is there another way to use given...when... in a "functional" way which avoids introducing a do statement and a dummy lexical?No, in the same way you cannot do
ormy $r = if ($foo) then {"bar"} else {"baz"};
But you can in ALGOL 68! ;-)my $r = for (1, 2, 3) {$_ + 4};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: functional "given...when..."?
by BrowserUk (Patriarch) on Mar 16, 2010 at 11:42 UTC |