Dummy Variables · Issue #1417 · CyclopsMC/IntegratedDynamics · GitHub
Skip to content

Dummy Variables #1417

Open
Open

Description

@reserveword

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.

Activity

  1. rubensworks commented on Nov 13, 2024

    @rubensworks
    Member

    Thanks for the suggestion!

  2. Jack-McKalling commented on Nov 13, 2024

    @Jack-McKalling
    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?

  3. reserveword commented on Nov 13, 2024

    @reserveword
    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)

  4. Jack-McKalling commented on Nov 13, 2024

    @Jack-McKalling
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      Options

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions