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

Built-ins functions are not reserved keywords or known identifiers #16

Open
anouard24 opened this issue Apr 15, 2021 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@anouard24
Copy link
Contributor

I tried that:

>> println
Comet error:

        Identifier (println) is not bounded to any value, have you tried declaring it?
>> var println = 5
CometNop
>> println
CometInt(5)
>> println("Hello, World!")
Hello, World!
CometNop

As a Python developer, I'm expecting that:

>> println
<func builtins.println>

They are two options:

  • Let the developer overwrite builtins functions like user's functions:
>> func add(n) {2*n}
<func add(n)>
>> add = 70
CometInt(70)
  • Make builtins functions reserved keywords
@chermehdi
Copy link
Owner

Yes, I am aware of the current issue, this hasn't been tackled yet because we don't have a module system in place, taking an action now to resolve this, might be a little bit early, as we don't know what are the requirements of the module system, and whether we can have a different solution once that has been implemented.

That being said, I will be leaving this issue open to fix it later. Thanks for pointing this out.

@chermehdi chermehdi self-assigned this Apr 15, 2021
@chermehdi chermehdi added the bug Something isn't working label Apr 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants