4 ms·
A "good" language might let you run "5 < x" when x is a list and return a list of booleans. This is what languages in the APL family do.
by mollmerx 11y ago
A "good" language might let you run "5 < x" when x is a list and return a list of booleans. This is what languages in the APL family do.
- awwaiid 11y agoI think Perl 6 gets to claim some APL-ness :) . Though you do sometimes need to be explicit: my @x = 3,4,5,6; say "yep" if 5 < @x.any; # yep! (5 < @x.any).perl.say # output: any(Bool::False, Bool::False, Bool::False, Bool::True) (edit: forgot to add the full junction output)
- mollmerx 11y agoAbsolutely! Also, the inclusion of non-ASCII operators harkens back to APL. Mind mind isn't yet made up on whether I like this. I anticipate code being easier to read and harder to type. Given perl5's reputation in this regard, I'm optimistic I'll find it to be an improvement.