From: William Djaja Tjokroaminata Date: 2002-09-26T22:14:25+09:00 Subject: Re: call for commentary: review of Ruby for a magazine (long, sorry!) Aha, someone caught my post. Yes, I love Ruby very much, but I should take care of my hands and eyes too. One thing that I miss from Python is its syntax terseness. You are absolutely correct regarding the preprocessor. As I don't have the capability (for now) of writing/changing a parser, I just wrote a "SRuby to Ruby" translator. (Probably SRuby stands for "small Ruby" or "subset of Ruby".) It is similar to Python syntax, without the ending colons. It is for my own experimentation only. So far I have been enjoying writing (regular Ruby code) #begin_rbs -------------------------------------- class MyClass def initialize (obj) if obj.nil?: puts "warning" def do_something (arg) while true do_1 () do_2 () class AnotherClass .... #end_rbs ---------------------------------------- (regular Ruby code) You see, the translator works only between "#begin_rbs" and "#end_rbs", so I can mix and match between the Ruby and SRuby syntax. My "rbs2rb.rb" translates a .rbs file to a .rb file. For any syntax error, I just examine the resulting .rb file. I think I have minimized my typing (good for my hands) and more easily find the code blocks (good for my eyes), because as in English documents, as someone has pointed out previously, there is no closing tag in a paragraph, but only an opening tag, which is usually the reverse-indenting of programming languages. Regards, Bill ============================================================================ Mauricio Fern?ndez wrote: > What do you mean by "[your] own syntax"? > Have you changed Ruby's parser or (I suspect) written a preprocessor? > Could you elaborate a little more on the parts of the syntax you didn't like? > I've been lately thinking of the coolness of having several different > syntaxes for the same underlying "language", especially if some tool is > able to translate between them... Imagine having a Python-esque syntax > w/ significant spaces in Ruby. That could for sure lure some pythonists ;) > I think many people care too much about syntax, as it's only a > superficial feature of the language you can quickly get used to. I'd be > great to preemptively abort any further flamewars on such shallow topics > as "syntax by indentation rules!!!" or " '() suck!".