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
A dummy variable that can be bound later so that some cards can be reused in recursing
For example, I have a list of Items A and an item B, I want to get the index of B within A. In Pseudo code we can say
match_index(X, Y) := if head(X) == Y then 0 else 1 + match_index(tail(X), Y)
then we get the index with match_index(A, B). However the variable cards don't allow us to pass dummy variables(X, Y), instead we must pass real variables(A, B) so it is hard to get match_index(tail(X), Y) part.
I think some combinatory logic may be able to implement this, but that would be too complicated, a dummy variable can be much easier.
Are you aware that it is possible to create a custom operator (using pipe(), flip() and apply()) without any A or B applied yet, that you can apply to it later using the operator apply2(operator, A, B)?
Or are you suggesting this to complement the ability to do it that way, just for the convenience?
Are you aware that it is possible to create a custom operator (using pipe(), flip() and apply()) without any A or B applied yet, that you can apply to it later using the operator apply2(operator, A, B)?
these operators are not flexible enough, for example when we have three binary operators +, - and *, and we want to build them into (a + b) * (a - b) then these operators does not seem to help, at least not intuitive. (please tell me if you know how)
That kind of operation should definitely be possible to make as an operator though. It may indeed be more complicated than you might intuitively expect, but you can always ask for help in the discord. I suggest you go there if you have a specific scenario you'd need this mechanic for.
But I'll leave this open for the reason that your suggestion could make things a little more convenient, if this is possible to implement.
Activity
rubensworks commentedon Nov 13, 2024
Thanks for the suggestion!
Jack-McKalling commentedon Nov 13, 2024
Are you aware that it is possible to create a custom operator (using
pipe(),flip()andapply()) without anyAorBapplied yet, that you can apply to it later using the operatorapply2(operator, A, B)?Or are you suggesting this to complement the ability to do it that way, just for the convenience?
reserveword commentedon Nov 13, 2024
these operators are not flexible enough, for example when we have three binary operators
+,-and*, and we want to build them into(a + b) * (a - b)then these operators does not seem to help, at least not intuitive. (please tell me if you know how)Jack-McKalling commentedon Nov 13, 2024
That kind of operation should definitely be possible to make as an operator though. It may indeed be more complicated than you might intuitively expect, but you can always ask for help in the discord. I suggest you go there if you have a specific scenario you'd need this mechanic for.
But I'll leave this open for the reason that your suggestion could make things a little more convenient, if this is possible to implement.