From: Matthew Diephouse Date: 2002-06-06T11:22:07+09:00 Subject: Re: How might "Apocalypse 5" affect Ruby? > Unfortunately, Larry seems to be putting quite a bit of effort into > embedding Perl directly into the regexp system with expressions like: > > /(\d+) { $1 < 582 or fail }/ > > /(.*) { print .pos }/ > > / (\S*) { let $x = .pos } \s* foo / > > / @x := [ (\S+) (\s*) ]* / > > / <@rule_from_array> <%rule_from_hash> <&rule_from_sub()> / > > These sorts of expressions litter A5, and I think will make other > languages adopting them quite painful. There's nothing to say that ruby couldn't just as easily be implemented. And remember, as A5 pointed out, regexes are a language of their own. /(\d+) { $1 < 582 or fail }/ /(.*) { print .pos }/ / (\S*) { let x = .pos } \s* foo / / #{x} := [ (\S+) (\s*) ]* / / <#{rule_from_array}> <#{rule_from_hash}> <#{rule_from_sub()}> / > I'm not conviced by his other changes; pushing most common things into > the shortest possible set of characters is a very Perlish desire, and in > making such changes everyone's going to have to re-learn their syntax > and how they write regexp while keeping the old stuff around for pretty > much every other tool in existance. You say perlish, I say huffman coding. > I can see lots of people looking at the new-style Perl expressions and > wasting time thinking "Uh?" before they remember [..] is not a character > class anymore, and that . really is matching everything, and that > whitespace needs to be escaped, and... Ahh, but it's so much clearer. I would assume that a ruby user would like clearer, especially one who's complaining about perl being unreadable. >>But is it worth breaking quite a bit of previously written code? > > > No. Larry wants to do this now because he's breaking everything anyway; > unless Rite contains a similar amount of breakage I wouldn't like to see > our regexp engine copy Perl 6. Even then, I'm not convinced it's a good > idea to blindly follow them. Yes. Just think... the power of full grammars in ruby. What power that is! It'd be a shame not to fix the shortcomings in regexes (again... they're a language, not just a string). > Well, there's no code to worry about yet; Perl 6 is, um, ages away, so > there's no reason to panic. We may even find Perl 6 flops as it's users > discover it's easier just to switch to Python/Ruby/Java/Cobol/Assm than > learn all the stuff that's changing (*grin*). Well a year to a year and a half may seem ages away to you, but not to me. And it won't flop. Perl is much powerful than the languages you listed, including ruby, and especially the joking suggestions. md |- m:att d:iephouse