in reply to Re: Re: Brainfuck Interpreter
in thread Brainfuck Interpreter
That depends on your definition of "better".
That's my definition. @_[0] is an array slice, which happens to have a single value, and just happens to work because of that. For example:2;0 juerd@ouranos:~$ perl -we'@_[0]' Scalar value @_[0] better written as $_[0] at -e line 1.
When you want a scalar, USE a scalar :)my @foo = qw(a b c d e f g h i j); my @bar = @foo[1, 5, 6, 4]; # @bar is now qw(b f g e) my $bar = $foo[0];
If you're writing code to parse a language which is deliberately confusing, it's arguably better to parse it in as confusing a way as possible.
Perhaps, but I don't agree. And even if you were right, there's no need to use PERL for that. (note: "PERL" ne "Perl").
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
|
|---|