[#4522] Undefined Errno::EPROTO and the like raises NameError — "Florian Frank" <flori@...>
Hi,
[#4533] giving acces readline to rl_line_buffer — "Cs. Henk" <csaba-ml@...>
Hi!
[#4548] Ruby 1.8.2 array of hash entries functions incorrectly — noreply@...
Bugs item #1613, was opened at 2005-03-09 19:49
[#4561] rb_reg_quote weirdness — Nikolai Weibull <mailing-lists.ruby-core@...>
(Two weirdnesses in one day.)
Hi,
[#4567] Immutable Ropes — Nikolai Weibull <mailing-lists.ruby-core@...>
Note how I didn't write "Immutable Strings" in the subject.
[#4575] Allowing "?" in struct members — "Berger, Daniel" <Daniel.Berger@...>
Hi all,
[#4587] 0**0==1? — Bertram Scharpf <lists@...>
Hi,
[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>
I'm really sorry if this isn't the place to talk about this. I've
Daniel Amelang wrote:
Hi --
On Monday 21 March 2005 16:17, David A. Black wrote:
Hi --
Hey David, I think that we've had some misunderstandings due to
Hi --
On Wednesday 30 March 2005 20:55, David A. Black wrote:
On Sunday 20 March 2005 21:31, Daniel Amelang wrote:
[#4601] Re: New block syntax — "Berger, Daniel" <Daniel.Berger@...>
> -----Original Message-----
[#4611] want_object? - possible? — "Berger, Daniel" <Daniel.Berger@...>
Hi all,
[#4619] Re: want_object? - possible? — Daniel Berger <djberg96@...>
--- nobu.nokada@softhome.net wrote:
Hi --
On 3/24/05, David A. Black <dblack@wobblini.net> wrote:
Hi --
On 4/14/05, David A. Black <dblack@wobblini.net> wrote:
On 14 Apr 2005, at 22:20, Mark Hubbart wrote:
On 4/15/05, Eric Hodel <drbrain@segment7.net> wrote:
[#4622] tempfile.rb — Tilman Sauerbeck <tilman@...>
Hi,
[#4648] about REXML::Encoding — speakillof <speakillof@...>
Hi.
On Thursday 31 March 2005 09:44, speakillof wrote:
Hi.
I've tested, applied, and committed your Encoding patch, Nobu.
Hi,
Re: rb_reg_quote weirdness
Quoting matz@ruby-lang.org, on Tue, Mar 15, 2005 at 02:35:31AM +0900:
> Hi,
>
> In message "Re: rb_reg_quote weirdness"
> on Mon, 14 Mar 2005 06:42:37 +0900, Nikolai Weibull <mailing-lists.ruby-core@rawuncut.elitemail.org> writes:
>
> |My documentation for Regexp::quote(str) says that a copy of str is
> |returned, yet if str doesn't contain any metacharacters, str itself is
> |returned:
>
> |is this how it should be, or should str be copied at this point?,
>
> For efficiency, avoiding unnecessary copy is sought. For consistency,
> and safety (from in-place string modification), all time copy is
> better. I chose the former. But I'm still open for input.
I think your choice is right. If people want to duplicate the string,
they can do str.quote.copy, or something.
However, the docs are wrong, they strongly imply a new string will be
returned.
Cheers,
Sam
Index: re.c
===================================================================
RCS file: /src/ruby/re.c,v
retrieving revision 1.114.2.12
diff -u -r1.114.2.12 re.c
--- re.c 6 Feb 2005 03:23:40 -0000 1.114.2.12
+++ re.c 15 Mar 2005 00:48:58 -0000
@@ -1801,11 +1801,12 @@
/*
* call-seq:
- * Regexp.escape(str) => new_str
- * Regexp.quote(str) => new_str
+ * Regexp.escape(str) => a_str
+ * Regexp.quote(str) => a_str
*
* Escapes any characters that would have special meaning in a regular
- * expression. For any string,
+ * expression. Returns a new escaped string, or self if no characters are
+ * escaped. For any string,
* <code>Regexp.escape(<i>str</i>)=~<i>str</i></code> will be true.
*
* Regexp.escape('\\*?{}.') #=> \\\\\*\?\{\}\.