Upgrade NotePad++?
-
@thomthom said:
Does the
{ ... }
syntax work instead ofdo ... end
?Yes, but braces are a B to type unless you've spent too many years writing a C-derivative language.
-
Or if you're on a Norwegian Keyboard Layout. Then they are accessed by AltGr+7/0 which is not a friendly key combo. I switch to English layout when I code.
-
I think you might not need the "do" in there. I don't use that syntax ever, but looking at the Programming Ruby manual, it does not use "do" in its example. Give that a shot,
Chris
PS I use the:
entities.each do |e| ...code... end
syntax
-
Not sure about other non-English layouts, but Norwegian layout sure isn't friendly for programmers. http://en.wikipedia.org/wiki/Keyboard_layout#Norwegian
Before using Ruby I've used Javascript, PHP, CSS and C# which also use curly bracket - so I got sued to it. But after switching to English layout I feel it flows better. And I like my curly brackets. Though, the very first language I tried was Visual Basic 5.0 - at that time, curly brackets looked dark and mysterious.
Hey! - it is that off-topic time again?
-
I always use NotePad++.
You probably noticed I often use stuff likeentities.each{|e|...}
: I hadn't appreciated that {...} were so difficult to type on some non-English keyboard layouts ! -
And oddly Martin has not even come by to see if my fix worked for him....I guess he's away from his keyboard this afternoon (or evening or whatever).
Chris
-
@chris fullmer said:
I guess [Martin]'s away from his keyboard this afternoon (or evening or whatever).Chris
Mornings are my thing.
I'm doing the tutorial.
for e in entities do ... end
strikes me as a lot more beginner-friendly thanentities.each { |e| ... }
. Guess I'll have to try some editors.There's an old saying, something like: "An editor a day keeps the productivity away."
-
But I think your usage of "
do
" might be incorrect syntax in any ruby editor. It looks like thedo
should not be included with thefor
loop.http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#UK
Chris
-
hm.. it does look like the
do
is redundant infor ... in
syntax... But Ruby doesn't throw any errors... -
Tried SciTE. Excellent text editor. High marks for ".properties" files, one per language, that make it easy to customize.
Downside: exact same bug as NotePad++.
The two forms of
for/in
that load without errors are:for x in foo do ... end for x in foo # no do ... end
-
That's odd because NPP and Scite (as well as many others) are based in the same editor core Scintilla.
-
Odd? They both use Scintilla and both have the same syntax issues?
-
Oh sorry - I mis-read Martin's post.
-
I guess I would recommend using it without the do, since ruby syntaxd seems to think its redundant (which I do find odd as it does not fit their other loop syntaxes).
Or if it helps, I learned the
array.each do |e| ... end
method first and I was able to understand it fairly quickly. And I hve zero programming experience outside of Ruby for Sketchup.Another bonus to teaching that method is that all the API uses it, as apposed to the
for in end
loop. So it might help readers transition into the API smoother. But that is just a thought,Chris
Advertisement