Comments (1)
This is an interesting behaviour of many BASICs, including BBC BASIC (which is one of the main BASICs I was considering when researching the mechanics of atto). See what happens in BBC BASIC:
The syntax highlighting of the bbcmic.ro editor demonstrates the conflict:
The main rationale behind this behaviour is to enable the ability to collapse spaces in code, making lines shorter (which is particularly useful for fitting code in Tweets to send to our Twitter bot).
I might consider preventing this behavour, though — I agree that it's a bit counter-intuitive in some situations! There might be a few issues with regards to backward compatibility, but to be honest, there aren't going to be many programs that will suffer from this issue.
There are cases in documentation where the reference to conflicting variable names has been avoided (eg. see pi
- atto guide), so I have been aware about this problem for some time! I think that there's two things to think about before fixing this issue though — how frequent conflicting variable identifiers appear (eg. how many frequently-used variable names will start with rad
or to
?), and whether freedom will be lost in making projects that are designed to fit in a tight character space (eg. Twitter's 280 char limit).
Thankfully, keywords for constants don't cause conflicting variable names — not being able to start a variable name with e
(Euler's number) would be frustrating to many! It could be possible to add some smart variable name vs keyword detection system, though behaviour might be hard to predict as a user.
Thanks for the issue, though. I'll have to have a think about it, and I'd love to know what others think about conflicting variables!
from atto.
Related Issues (20)
- gosub does not work as expected not ending nicely the program HOT 1
- sqrt(0) returns Maths error HOT 5
- Unicode support HOT 2
- Add more courses HOT 3
- Add command reference for shell commands
- Allow for boolean variable conditions without equality check in `if` HOT 1
- [Announcement] atto is moving to a new home soon! HOT 2
- Add more functions, and document them
- Docs UX improvements
- Extload doesn't work HOT 9
- "random" in "draw" works incorrectly HOT 3
- Line cursor's position doesn't update sometimes HOT 2
- Can't use `renum` HOT 6
- Make mathematical operators and functions automatically cast string operands/arguments to numbers HOT 5
- mid$ doesn't work with 0,0 arguments HOT 2
- Make last argument to `mid$` optional
- Input lag on Firefox HOT 1
- Add how to delete lines for beginner's guide HOT 1
- Add home and close buttons for help, and popout option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atto.