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

How do you iterate over a map with the C API? #1190

Open
thommcgrath opened this issue Jan 2, 2025 · 1 comment
Open

How do you iterate over a map with the C API? #1190

thommcgrath opened this issue Jan 2, 2025 · 1 comment

Comments

@thommcgrath
Copy link

I see wrenGetMapCount for finding the number of items in a map, and wrenGetMapValue for getting a value into a slot using another slot, but I don't see any way to get a list of keys for a map so that I can actually use wrenGetMapValue. It seems like the C API only allows me to get map values that I already know ahead of time. Am I missing a function that would help with this task?

@ruby0x1
Copy link
Member

ruby0x1 commented Jan 3, 2025

It's not there just yet, that is a piece that is missing yep! it's common to solve it by passing the keys in with a small wrapper function as a list, then you iterate that in the C side. Not the best, but workable!

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