4 ms·
>Common Lisp has multiple return values and it's quite useful: Ditto for Perl: sub f { 1..$_[0] } my ($x) = f(12); # $x = first value, rest a
by draegtun 13y ago
>Common Lisp has multiple return values and it's quite useful:
Ditto for Perl:
sub f { 1..$_[0] }
my ($x) = f(12); # $x = first value, rest are dropped
...
my ($x, $y) = f(12); # $x & $y have first two values, rest are dropped
...
my ($x, $y, @rest) = f(12); # $x=1, $y=2 & @rest=3..12