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

applyPairs for lists #3603

Open
mahrud opened this issue Nov 29, 2024 · 2 comments
Open

applyPairs for lists #3603

mahrud opened this issue Nov 29, 2024 · 2 comments

Comments

@mahrud
Copy link
Member

mahrud commented Nov 29, 2024

This:

hashTable applyPairs({10,20,30}, identity)

should act like this:

i12 : hashTable toList apply(pairs {10,20,30}, identity)

o12 = HashTable{0 => 10}
                1 => 20
                2 => 30
@d-torrance
Copy link
Member

Probably the same for selectPairs and scanPairs.

Would it be better to turn this into methods, or implement the list versions in the interpreter?

@mahrud
Copy link
Member Author

mahrud commented Dec 5, 2024

Between methods or interpreter, I'm not sure which is better.

By the way, you could define pairs Iterator to give a new iterator and define applyPairs for an iterator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants