#1151 Int api suggestion: yields

Akcelisto Mon 19 Jul 2010

sys::Int have useful sys::Int.times: z.times{...} is (0..<z).each{...}

My suggestion: sys::Int.yields: z.yields{...} is (0..<z).map{...}

I need yields no less frequently than times.

brian Mon 19 Jul 2010

I would say that case is best addressed by (0..<z).each{}

helium Tue 20 Jul 2010

I would say that case is best addressed by (0..<z).each{}

I don't get it? How is (0..<z).map{...} best addressed by (0..<z).each{}?

brian Tue 20 Jul 2010

Sorry, I misunderstood the request.

I can see the value for something like yields (not sure I like taking that name for this though).

What do others think? Is this a common use for others?

helium Tue 20 Jul 2010

AFAIR I never encountered it, but I'll look for it.

Login or Signup to reply.