pyth
pyth copied to clipboard
Feature request: variable of whole array in mapping functions
e.g. in the lambda of m
, what if we used b
to refer to the whole array and d
to each item?
The same goes with f
, and o
.
That's a neat idea. Might be rather tricky to implement, however. Also, I'd like to do it without using up more variables, if possible. The last time this came up, we did it with ;. Can you think of any other characters that are invalid inside a lambda? Also, can you give some sample code using this feature?
fq2/bT[1 1 2 2 3)
should give [1,1,2,2]
.
How about a 2-char variable. (@isaacg1 Is this possible?)
Alternatively (
is available.
Why is (
available?
(
was (or is) the tuple constructor. And tuples don't have any purpose in Pyth any more, Pyth only uses lists.
When Pyth was created, some methods worked differently, when applied to a tuple instead of a list. But at some point isaacg1 changed it, so that there is no difference between both types any more. Also he change all methods, such that they will return lists instead of tuples. For instance appending a number to a tuple will return a list. The only thing he didn't removed was (
. And now this token has been useless for quite some time.
I agree with this feature request. Moreover that could be implemented for .e
as well.