Bug with Espruino IDE #4590
Replies: 1 comment
-
Posted at 2015-04-19 by @allObjects A variable can never be a literal number or begin with a digit (or sign or...) or be one of the language reserved words. So it is not an IDE thing, it is a language thing, and the IDE is so helpful to point the coding mistake out. Make it PS: After reading your post and watching the video a second time closely, I notice, that you did not replace the 1 (one) with a 1 (one), you replaced the letter l (for led) with number 1. . Line 3 and 4 they all use letter l. If you change it there as well to one, IDE will complain there as well. I'm saddened(***) by font selections insensitive to this issue... sorry @gfwilliams for this rant - and for that one too: even though the forum does a mixed-better job with letter l and digit 1 - l1,
, it could do a better job with the o letters and 0 (zero) digit: Oo0,
, it could be more pronounced. That's why the
is there to avoid any ambiguity - more so for o and 0 with the dot in the center, a bit less the l and 1. (****) After being wasted over and over by similar font selections in the past, the politically correct I'm saddened feels more like I 'hate' insensitive font selection... nevertheless, for both you need a shrink to fix-ya, but with the latter you are left alone and get no empathy... Understanding now the challenge, I suggest that you - @jackjameshoward - change the conversation title to - for example - Watch out, 1 (number/digit) looks like l (letter), but they are really not the same! - Mr Obvious ;-) - and it will become a great help for many others... Attachments: Posted at 2015-04-20 by @gfwilliams Thanks @allObjects, and @jackjameshoward thanks for the video - it would have been way harder to spot otherwise! @allObjects if there's another font that could be used for CodeMirror and the terminal then I'm open to changing to it (as long as it's fixed-width!). I'll make sure that the next time I update the Web IDE I change the sample code to use Posted at 2015-04-20 by @allObjects When reviewing my last post's code example, I felt a bit uncomfortable withe the choice of 'on' as a variable name. It became such an overloaded (prefix)word, so there may even a better solution. Btw, the example was not related to the font thing: I just verified my basic understanding of onInit() - save() code, re-plug power or press reset and see how Espruino 'reboots' and goes into my code - and it was still laying around in my scratch pad... and it became unintentionally the perfect match for situation. So only the last comment line was situation intended... ;) Other font for IDE: For sure it has to be fixed font... would have to look how it is pulled, because it should work nicely in available environments: Windows, OSX, Linux (even though OSX is a Unix as well, it goes its own ways). Regarding forum's font: I'm aware that the forum (code) was built for a different audience than programmers, and it turned out pretty good also for programmers, especially the letter o and digit 0 (zero) solution in text paragraphs, but not so much for the letter l and the digit 1 (one) in both text paragraphs and in code blocks. It's livable. @gfwilliams, btw, I knew that you could not have made that mistake in the 'get started sample', because I know that code you publish runs... because you ran it more that once... and I - and everyone else - appreciates this fact: it saves everyone aeons (cumulated) of time. Posted at 2015-04-20 by TrapperBob looks to me that the variable name was meant to be an 'l' (el) not a 1 (one) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-04-19 by JackJamesHoward
I noticed a possible bug with the IDE, either that or I really don't understanding what i'm doing wrong.
If I open up the IDE for the first time (i.e. there is no code saved in the right hand window and the default blink function appears), if I delete the "1" assigned "var 1", then replace it with "1" again. I get an error.
If I change the "var 1" to "var 2" I also get the same error.
I uploaded a short screencast of the problem.
Any idea whats wrong?
https://www.youtube.com/watch?v=9YX4HVM9u6A
Beta Was this translation helpful? Give feedback.
All reactions