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

Consider getting rid of the [] symbols from the OpCodes in the source #351

Open
MichalMarsalek opened this issue Jan 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@MichalMarsalek
Copy link
Collaborator

MichalMarsalek commented Jan 4, 2024

I refactored the code so that opcodes are now heavily used as object keys. However, the brackets in some of them mean that they cannot be used as identifiers in object literals nor dot access. So one does
return op.leq(a, b) but return op["eq[Int]"](a, b), {leq: "<="} but {"eq[Int]": "=="}.
I suggest we keep the brackets in the Polygolf frontend language, but rename the opcodes in the Polygolf typescript source. There are couple of ways of doing that. at_back[Ascii] could be referred to as

  • at_back__Ascii
  • at_back$Ascii
  • at_back$Ascii$
  • at_backAscii
@MichalMarsalek MichalMarsalek added the enhancement New feature or request label Jan 4, 2024
@MichalMarsalek
Copy link
Collaborator Author

Nested objects have been suggested, so op.eq.Int(a, b) and {eq: {Int: "=="}}.

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

No branches or pull requests

1 participant