> On Mon, Aug 19, 2002 at 07:24:38AM +0900, Paul J. Sanchez wrote: > > To me, that missing "e" is a human factors issue. I realize that > > changing the syntax would break virtually all existing code, but would > > it be possible to add "elseif" as an alternate syntax? Or add synonyms, and not break existing code. > > Or am I making a mountain out of a mole hill? I think it's a valid point. I've tripped up on it myself. Shell: elif. Tcl: elseif. Python: dunno. Perl: elsif. Oooohhhh. I see. :-) 0) Go to your Ruby source directory. 1) Add new entries to the 'keywords' file elseif, kELSIF, kELSIF, EXPR_BEG elif, kELSIF, kELSIF, EXPR_BEG 2) Regenerate the hashed lookup table (see comments at the top of 'lex.c'): gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' ./keywords >lex.c 3) Add code to parse.y (nothing to do in this case) (Optional: generate warning/usage message for synonyms?) 4) Re-make 'ruby' make 5) Test a = 3 if a == 1 puts 'one' elseif a == 2 puts 'two' elif a == 3 puts 'three' end 'three' OK, I've polluted this group enough for this week. Take care! -- Mike Hall http://www.enteract.com/~mghall