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

Token Optimized Call to Split() Not Supported #8

Open
jloiterman opened this issue Mar 17, 2022 · 1 comment
Open

Token Optimized Call to Split() Not Supported #8

jloiterman opened this issue Mar 17, 2022 · 1 comment

Comments

@jloiterman
Copy link

Pico8 supports some unusual lua syntax that allows users to save on tokens. In particular, you can call split() on a string without using the parenthesis.

I have a program that throws this error when run in tac08

col=split"2,13,6,7,14,8,14,7,6,13" [time()*5\1%10+1]: ']' expected near '\'

But the same line will run correctly in Pico8. There are a few token-optimization tricks in this line, so I'm not quite sure if it's split"...." or something else, but this definitely runs correctly on Pico-8 0.2.4.

@merwok
Copy link

merwok commented Mar 17, 2022

It’s a standard lua thing: you can call any function and omit the parentheses if there’s only one argument of type string or table.

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