[#539] A new discussion topic ;-) — Clemens Hintze <c.hintze@...>
Hi all,
[#546] Question concerning modules (1) — clemens.hintze@...
[#548] Bug: concerning Modules! — clemens.hintze@...
[#564] Ruby 1.3.7 — Yukihiro Matsumoto <matz@...>
Ruby 1.3.7 is out, check out:
[#567] New feature request! :-) — clemens.hintze@...
On 6 Aug, Yukihiro Matsumoto wrote:
Hi,
On 6 Aug, Yukihiro Matsumoto wrote:
[#590] Bug in Array#clone! — clemens.hintze@...
Hi,
Hi,
[#600] A `File' is not a `IO'????? — clemens.hintze@...
Hi,
On 10 Aug, Yukihiro Matsumoto wrote:
Hi,
Hi,
Hi,
On 11 Aug, GOTO Kentaro wrote:
Hi,
On 11 Aug, Yukihiro Matsumoto wrote:
Hi,
[#607] How to pass by `new' method of superclass? — clemens.hintze@...
[#626] Next misbehavior (sorry :-) — clemens.hintze@...
Hi,
[#634] ANN: testsupp.rb 0.1 — Clemens Hintze <c.hintze@...>
Hi,
[#637] Backtrace of SIGSEGV — Clemens Hintze <c.hintze@...>
Hi,
Hi,
On 12 Aug, Yukihiro Matsumoto wrote:
Hi,
On 12 Aug, Yukihiro Matsumoto wrote:
Hi,
[#655] Your wish is fulfilled (erhm, almost ;-) — Clemens Hintze <c.hintze@...>
Hi Gotoken,
[#667] How do I use `callcc' — Clemens Hintze <c.hintze@...>
Hi,
[#668] Way to intercept method calls? — Clemens Hintze <c.hintze@...>
Hi,
[#679] Documentation about RD? — Clemens Hintze <c.hintze@...>
Hi,
=begin
On 18 Aug, Toshiro Kuwabara wrote:
Hi,
On 18 Aug, GOTO Kentaro wrote:
Hi,
On 19 Aug, Toshiro Kuwabara wrote:
Hi,
On 19 Aug, Toshiro Kuwabara wrote:
Hi,
Hi,
On 19 Aug, Toshiro Kuwabara wrote:
Hi
Hi,
Hi,
Hi Tosh and all,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
Hi,
On 19 Aug, Yukihiro Matsumoto wrote:
Hi,
On 20 Aug, Toshiro Kuwabara wrote:
Hi,
On 21 Aug, Toshiro Kuwabara wrote:
Hi,
On 21 Aug, Toshiro Kuwabara wrote:
Hi,
Hi,
Hi,
On 24 Aug, Toshiro Kuwabara wrote:
Hi,
I thought people might be interested in this. Here's how I am plugging
On 31 Aug, Jonathan Aseltine wrote:
[#737] RD with multi charset — Minero Aoki <aamine@...>
Hi, I'm Minero Aoki. This is my first mail in this mailling list.
Hi,
Hi,
Hi,
Hi,
On 28 Aug, Minero Aoki wrote:
Hi,
[ruby-talk:00772] Re: Ugly behavior using /<r1>/ .. /<r2>/ construct.
Hi,
In message "[ruby-talk:00768] Ugly behavior using /<r1>/ .. /<r2>/ construct."
on 99/08/30, clemens.hintze@alcatel.de <clemens.hintze@alcatel.de> writes:
|Is there any difference between these two:
|
| (1) if /^start/ .. /^stop/; p "GOTCHA"; end
| (2) if /^start/ ... /^stop/; p "GOTCHA"; end
|
|There seems no difference! But `...' should behave a little bit
|different than `..', shouldn't it?
It does. Believe me.
From syntax.html:
If range expression appears in conditional expression, it gives
false until left hand side returns true, it stays true until right
hand side is true. .. acts like awk, ... acts like sed.
This behavior is inherited from Perl. See perlop.pod
In scalar context, ".." returns a boolean value. The operator is
bistable, like a flip-flop, and emulates the line-range (comma) operator
of B<sed>, B<awk>, and various editors. Each ".." operator maintains its
own boolean state. It is false as long as its left operand is false.
Once the left operand is true, the range operator stays true until the
right operand is true, I<AFTER> which the range operator becomes false
again. (It doesn't become false till the next time the range operator is
evaluated. It can test the right operand and become false on the same
evaluation it became true (as in B<awk>), but it still returns true once.
If you don't want it to test the right operand till the next evaluation
(as in B<sed>), use three dots ("...") instead of two.) The right
operand is not evaluated while the operator is in the "false" state, and
the left operand is not evaluated while the operator is in the "true"
state.
|I would assume, that the then case would not entered for a line that
|matches `/stop/' using `...'.
Comparing current `...' behavior out of conditions, it is bit
natural. But exclusive `...' behavior is rather new, lot newer than
sed style `...' in conditions. So I'm hesitating to change the
behavior, mostly because of compatibility.
|Furthermore the subpattern capturing doesn't work well. Please consider
|following code:
|
| if /^title(\s+(.*))?/ .. /^end/
| print "title=#$2\n";
| end
|
|Here the variable `$2' will *never* have any other value than `nil'. I
|assume, that this is because `$_' will be matched against both regexps.
|As the second regexp doesn't match the first time the first one match,
|`$2' will be reset to `nil'.
|
|My proposal would be, that in such `..' construct, the variables `$n'
|should only be set to the captured subpattern of the *matched* regexp.
|The one that *doesn't* match, should not reset them! Only if both
|doesn't match, they should be reset to `nil'.
|
|What do you think?
Let me take time to think about it. Suggestion, comments are welcome.
matz.