On Wed, 23 Feb 2005 nobu.nokada / softhome.net wrote:
> At Tue, 22 Feb 2005 04:28:37 +0900,
> Ryan Davis wrote in [ruby-core:04458]:
> > Can we make the fact that it is of limited use more obvious? Like, 
> > maybe add a warning if that shorthand is used?
>   $ echo 'while gets; print if /^b/../^c/;end' > foo.rb
>   $ ruby -w foo.rb
>   foo.rb:1: warning: range literal in condition
> > What enables it to work in the shorthand (-e) from, but not in regular 
> > use?
> In old versions, it worked in regular use, as well as Perl.

How old? I recall it's in the Pickaxe 1 (Ruby 1.6.2) and it was not even
deprecated back then.

I'd rather have a feature generalised instead of confined like
this. However I understand that some features have to be weeded out, lest
it looks like PERL-6.

  http://www.ozonehouse.com/mark/blog/code/PeriodicTable.pdf

However, I am wondering whether that code (the flipflop regexp code) could
be mostly extracted out of eval.c and put in a class. It's usually better
to have complexity outside of the evaluator than inside. (That's what
BASIC does too little and LISP does too much... if there's a "too much")

What I really *don't* like is that the semantics are different depending
on whether the code is in -e or not. I'd vote for either making a
generalised feature out of it, or removing it completely right now.

(BTW: I think that every time I used that feature in Ruby, Perl, or Awk,
it always was for multiline scripts, typically 10-30 lines, so the current
situation sounds quite stupid to me)

_____________________________________________________________________
Mathieu Bouchard -=- Montr?al QC Canada -=- http://artengine.ca/matju