[#8484] strptime fails to properly parse certain inputs — <noreply@...>

Bugs item #5263, was opened at 2006-08-01 23:14

13 messages 2006/08/02
[#8485] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — Yukihiro Matsumoto <matz@...> 2006/08/02

Hi,

[#8538] Re: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs — nobu@... 2006/08/06

Hi,

[#8561] sandbox timers & block scopes — why the lucky stiff <ruby-core@...>

Two puzzles I am trying to solve:

28 messages 2006/08/08
[#8624] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

raise ThisDecayingInquisition, "anyone? anyone at all?"

[#8627] Re: sandbox timers & block scopes — MenTaLguY <mental@...> 2006/08/15

On Wed, 2006-08-16 at 00:35 +0900, why the lucky stiff wrote:

[#8628] Re: sandbox timers & block scopes — why the lucky stiff <ruby-core@...> 2006/08/15

On Wed, Aug 16, 2006 at 02:46:30AM +0900, MenTaLguY wrote:

[#8629] Re: sandbox timers & block scopes — "Charles O Nutter" <headius@...> 2006/08/15

On 8/15/06, why the lucky stiff <ruby-core@whytheluckystiff.net> wrote:

[#8690] a ruby-core primer — why the lucky stiff <ruby-core@...>

Hello, all. I've been working on the ruby-core page for the new Ruby site.

21 messages 2006/08/22

Re: [ ruby-Bugs-5273 ] range ===

From: nobu@...
Date: 2006-08-03 13:48:29 UTC
List: ruby-core #8506
Hi,

At Thu, 3 Aug 2006 19:04:23 +0900,
Ondrej Bilka wrote in [ruby-core:08503]:
> I would replace numeric restriction to something like
> if val.is_a? String || ! val.comparable
>    member? val 
> else
>    cover? val
> end

It might make a sense.

> I would change String#succ to eat leading whitespace and
> raise error when there isnt. This also helps avoid things
> like ("1.1"..."1.10").to_a

Disallowing "9".succ?  It doesn't sound nice.

> also succ!  is faster because directly changes string.  succ is clone,succ!  

You have to move OBJ_INFECT() also, like as followings.
# The document exchange is omitted.


Index: string.c
===================================================================
RCS file: /cvs/ruby/src/ruby/string.c,v
retrieving revision 1.255
diff -p -U 2 -r1.255 string.c
--- string.c	26 Jul 2006 07:43:16 -0000	1.255
+++ string.c	3 Aug 2006 13:46:05 -0000
@@ -1347,13 +1347,10 @@ succ_char(char *s)
 
 static VALUE
-rb_str_succ(VALUE orig)
+rb_str_succ_bang(VALUE str)
 {
-    VALUE str;
     char *sbeg, *s;
     int c = -1;
     long n = 0;
 
-    str = rb_str_new5(orig, RSTRING(orig)->ptr, RSTRING(orig)->len);
-    OBJ_INFECT(str, orig);
     if (RSTRING(str)->len == 0) return str;
 
@@ -1398,9 +1395,10 @@ rb_str_succ(VALUE orig)
 
 static VALUE
-rb_str_succ_bang(VALUE str)
+rb_str_succ(VALUE orig)
 {
-    rb_str_shared_replace(str, rb_str_succ(str));
+    VALUE str = rb_str_new5(orig, RSTRING(orig)->ptr, RSTRING(orig)->len);
 
-    return str;
+    OBJ_INFECT(str, orig);
+    return rb_str_succ_bang(str);
 }
 


-- 
Nobu Nakada

In This Thread

Prev Next