You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realized that we can special case the meta-ops depending on the operators passed into them. The specific motivating example I have is *F.
We can first of all make the multiplicative identity be 1 so that *FY gives 1. Additionally, we can also make ints passed into it no do U but instead S so that it is equivalent to factorial.
We can even take this a step further and make floats return gamma, removing the need for .! altogether.
The last example I have for this is when you *F 2D lists. Right now it applies itertools.product multiple time, which screws everything up. If we can special case, we can just do a itertools.product(*a).
I'm not sure how this would be implemented, but it seems it would be very useful, both for *F in specific, and others in general(maybe &F and |F for all and any).
Thoughts?
The text was updated successfully, but these errors were encountered:
I realized that we can special case the meta-ops depending on the operators passed into them. The specific motivating example I have is
*F
.We can first of all make the multiplicative identity be
1
so that*FY
gives1
. Additionally, we can also make ints passed into it no doU
but insteadS
so that it is equivalent to factorial.We can even take this a step further and make floats return
gamma
, removing the need for.!
altogether.The last example I have for this is when you
*F
2D lists. Right now it appliesitertools.product
multiple time, which screws everything up. If we can special case, we can just do aitertools.product(*a)
.I'm not sure how this would be implemented, but it seems it would be very useful, both for
*F
in specific, and others in general(maybe&F
and|F
forall
andany
).Thoughts?
The text was updated successfully, but these errors were encountered: