[#4567] Re: What's the biggest Ruby development? — Aleksi Niemel<aleksi.niemela@...>

Dave said:

18 messages 2000/08/23
[#4568] Q's on Marshal — Robert Feldt <feldt@...> 2000/08/23

[#4580] RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/25

[#4584] Re: RubyUnit testcase run for different init params? — Dave Thomas <Dave@...> 2000/08/25

Robert Feldt <feldt@ce.chalmers.se> writes:

[#4623] Re: RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/28

On Sat, 26 Aug 2000, Dave Thomas wrote:

[#4652] Andy and Dave's European Tour 2000 — Dave Thomas <Dave@...>

24 messages 2000/08/30
[#4653] Re: Andy and Dave's European Tour 2000 — matz@... (Yukihiro Matsumoto) 2000/08/30

Hi,

[#4657] Ruby tutorials for newbie — Kevin Liang <kevin@...> 2000/08/30

Hi,

[ruby-talk:04331] Re: TABWTDI and Hash.new([])

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-08-07 15:25:37 UTC
List: ruby-talk #4331
Hmm.  that took me a while to figure out!  I think that is good.

	Hugh.
	hgs@dmu.ac.uk

On Mon, 7 Aug 2000, ts wrote:

> >>>>> "H" == Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> writes:
> 
> H> I agree with those sentiments as well.  I wonder if this would be worth
> H> extending more gnerally, so user-created classes can use it?
> 
>  Something like this ?
> 
> pigeon% cat b.rb
> #!/usr/bin/ruby
> class A
>    def initialize
>       @a = []
>       @obj = if iterator?
>                 Proc.new
>              else
>                 nil
>              end
>    end
>    def add(*args)
>       @a += if @obj &&  args.size == 0
>                @obj.call
>             else
>                args
>             end
>    end
> end
>  
> a = A.new {[1, 2] + 1}
> a.add
> p a
> a.add [12, 24]
> p a
>  
> pigeon% b.rb
> #<A: @a=[1, 2, 1], @obj=#<Proc:0x401675d0>>
> #<A: @a=[1, 2, 1, [12, 24]], @obj=#<Proc:0x401675d0>>
> pigeon% 
> 
> 
> Guy Decoux
> 
> 


In This Thread

Prev Next