Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dummy Variables #1417

Open
reserveword opened this issue Nov 13, 2024 · 4 comments
Open

Dummy Variables #1417

reserveword opened this issue Nov 13, 2024 · 4 comments

Comments

@reserveword
Copy link

Issue type:

  • ➕ Feature request

Short description:

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.

@rubensworks
Copy link
Member

Thanks for the suggestion!

@github-project-automation github-project-automation bot moved this to Options in Features Nov 13, 2024
@Jack-McKalling
Copy link
Contributor

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?

@reserveword
Copy link
Author

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)

@Jack-McKalling
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Options
Development

No branches or pull requests

3 participants