[#6660] Ruby on Neko ? — Nicolas Cannasse <ncannasse@...>

Hi folks,

14 messages 2005/11/19

[#6672] testing for hardlink with "test(?-, ...)" flawed on Windows — noreply@...

Bugs item #2858, was opened at 2005-11-20 16:35

13 messages 2005/11/20

[#6684] semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...>

Hi all,

81 messages 2005/11/21
[#6685] Re: semenatics of if/unless/while statement modifiers — Mauricio Fern疣dez <mfp@...> 2005/11/22

On Tue, Nov 22, 2005 at 08:22:59AM +0900, Stefan Kaes wrote:

[#6686] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

Mauricio Fern疣dez wrote:

[#6687] Re: semenatics of if/unless/while statement modifiers — Eric Hodel <drbrain@...7.net> 2005/11/22

On Nov 21, 2005, at 4:37 PM, Stefan Kaes wrote:

[#6689] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

Eric Hodel wrote:

[#6693] Re: semenatics of if/unless/while statement modifiers — Yukihiro Matsumoto <matz@...> 2005/11/22

Hi,

[#6695] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

Yukihiro Matsumoto wrote:

[#6718] Re: semenatics of if/unless/while statement modifiers — mathew <meta@...> 2005/11/22

[#6722] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

mathew wrote:

[#6707] Re: semenatics of if/unless/while statement modifiers — "David A. Black" <dblack@...> 2005/11/22

Hi --

[#6708] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

David A. Black wrote:

[#6714] Re: semenatics of if/unless/while statement modifiers — "David A. Black" <dblack@...> 2005/11/22

Hi --

[#6717] Re: semenatics of if/unless/while statement modifiers — Stefan Kaes <skaes@...> 2005/11/22

David A. Black wrote:

[#6798] ruby 1.8.4 preview2 — Yukihiro Matsumoto <matz@...>

Hi,

37 messages 2005/11/30

Re: alarming changes

From: "Ara.T.Howard" <ara.t.howard@...>
Date: 2005-11-17 12:40:21 UTC
List: ruby-core #6648
On Thu, 17 Nov 2005, David A. Black wrote:

>> i went through the ChangeLog but didn't see anything that jumped out.  the
>> change makes sense - but will in continue to be this way?  is the move to
>> return appropriate sub-classed values meant to be pervasive?
>
> I think the appropriateness is questionable.  I guess the point would be to
> make it easier to subclass built-in classes.  But it actually sort of
> constrains what you can do.
>
> For example:
>
> irb(main):012:0> def C.new(str); raise ArgumentError, "C's can't be
> shorter than 5 characters" if str.size < 5; super(str); end
> => nil
> irb(main):013:0> C.new('abcde')[0,2]
> => "ab"
> irb(main):014:0> C.new('abcde')[0,2].class
>
> So it doesn't really provide a whole mechanism for building on
> built-ins.  There's probably more to the rationale for it, though.

i don't understand how it's supposed to work unless copy constructor semantics
are worked out.  for example


   harp:~ > cat a.rb
   require "md5"

   class C < ::String
     attr "md5"
     def initialize *a, &b
       super
       @md5 = MD5::md5 self
     end
   end

   c = C::new 'forty-two'
   p c.class
   p c.md5

   cu = c.upcase
   p cu.class
   p cu.md5

   harp:~ > ruby a.rb
   C
   a16ca146e5e432fa7e30319121ea7473
   C
   nil


so, while it seems simple to return an instance of the String sub-class as a
return value, how can it possible without having some sort of rule/hook for
initialization in these cases?  as the above shows the return value will be
half baked.

regards.

-a
-- 
===============================================================================
| ara [dot] t [dot] howard [at] gmail [dot] com
| all happiness comes from the desire for others to be happy.  all misery
| comes from the desire for oneself to be happy.
| -- bodhicaryavatara
===============================================================================


In This Thread

Prev Next