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

A way to retrieve the amount of entries in a literal define? #99

Closed
magneto538 opened this issue Apr 27, 2018 · 1 comment · Fixed by #416
Closed

A way to retrieve the amount of entries in a literal define? #99

magneto538 opened this issue Apr 27, 2018 · 1 comment · Fixed by #416

Comments

@magneto538
Copy link
Contributor

magneto538 commented Apr 27, 2018

define LITERALS := hello, world

We can use literals define and then run literate_macro to unroll each literal to a specific operation. Would it make any sense to have the ability to retrieve how many string entries are in a define? Of course you may do that by declaring another define with the amount of entries, but I've found myself needing this when working on big, reusable code where you want to be able to change as little values as possible. Does this make any sense?

@eitherys
Copy link
Collaborator

Yes, I think it would be easy to add an extra define constant automatically such as LITERALS.GET_LENGTH.

I also wanted a way of manually indexing them like LITERALS[0] but that would take a bit more work.

mkruselj added a commit to mkruselj/SublimeKSP that referenced this issue Dec 2, 2023
These contain the amount of entries in a literal define.
Example:

define FOO := apple, banana, pear, kiwi

Adds a FOO.SIZE define that has a value of 4.

Closes nojanath#99
mkruselj added a commit that referenced this issue Dec 2, 2023
These contain the amount of entries in a literal define.
Example:

define FOO := apple, banana, pear, kiwi

Adds a FOO.SIZE define that has a value of 4.

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

Successfully merging a pull request may close this issue.

3 participants