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

Function names evaluate as constants #211

Open
hackerb9 opened this issue Jan 25, 2023 · 2 comments
Open

Function names evaluate as constants #211

hackerb9 opened this issue Jan 25, 2023 · 2 comments

Comments

@hackerb9
Copy link

Some function names are buggy. If the user defines a function EIGhtieth, it will evaluate to iEIGeh^2t^2.

This seems to happen when a capital E is used in the name.

Screenshot_20230125-104207

@derei
Copy link

derei commented Jul 20, 2024

@hackerb9 ... I would expect more insight from someone whose username contains "hacker" 🤭.

Whilst I cannot give you a 100% confirmed answer for this particular situation, based on general programming practices and conventions, variables which start with capital letter are in general evaluated as constants.

... so, perhaps use lowercase to name your functions? 😁.

Peace!

@gustav-langer
Copy link

Note that this only happens if the function name starts with an E, i.e. you can name a function eIGHTIETH or eightiEth or whatever and it will still work fine.

I haven't really looked into this app's code yet but I can imagine this happening when the parser enters a special mode for detecting expressions like 1E10, and then fails to leave it correctly when it's part of a name.

This could probably be fixed but I personally have no idea how.

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

3 participants