[#11439] comments needed for Random class — "NAKAMURA, Hiroshi" <nakahiro@...>

-----BEGIN PGP SIGNED MESSAGE-----

15 messages 2007/06/12

[#11450] Re: new method dispatch rule (matz' proposal) — David Flanagan <david@...>

This is a late response to the very long thread that started back in

17 messages 2007/06/13

[#11482] Ruby Changes Its Mind About Non-Word Characters — James Edward Gray II <james@...>

Does this look like a bug to anyone else?

10 messages 2007/06/16

[#11505] Question about the patchlevel release cycle — Sylvain Joyeux <sylvain.joyeux@...4x.org>

1.8.6 thread support was broken in bad ways. It stayed for three months

20 messages 2007/06/20
[#11512] Re: Question about the patchlevel release cycle — Urabe Shyouhei <shyouhei@...> 2007/06/20

Hi, I'm the 1.8.6 branch manager.

[#11543] Re: Apple reportedly to ship with ruby 1.8.6-p36 unless informed what to patch — James Edward Gray II <james@...>

On Jun 27, 2007, at 4:47 PM, Bill Kelly wrote:

10 messages 2007/06/27

Re: currying in Ruby

From: "Victor \"Zverok\" Shepelev" <vshepelev@...>
Date: 2007-06-06 04:51:42 UTC
List: ruby-core #11421
From: David Flanagan [mailto:david@davidflanagan.com]
Sent: Wednesday, June 06, 2007 7:38 AM
>
>Thanks for your response, Victor.

BTW, I've noticed we are at ruby-core. I think, it's offtopic here. Maybe we
should go to ruby-talk?

>Could you clarify about currying and instance_eval?  What is the "usual
>problem"

class A
	def method(x); puts x end
end

test = lambda{|x| method(x)}
test1 = test << 7

A.new.instance_eval &test1

This shouldn't work, unfortunately.

>My complaints with rubymurray are:
>
>1) its overkill--just too long

As i've mentioned, it can be shortened to:

my_proc.curry(H, 7) #with H standing for HOLE
or something especially strange, like
my_proc.curry($__, 7)

Shorter, but cryptic a bit. Though, looking at this line only, I can suppos,
what's happening here (even if i don't know about library used, but know
about general "currying" concept).

IMHO, your variant (my_proc >> 7) is unreadable. Sorry.

Though, there was only one case in my practice, when I've really need
carrying (and still can't use ruby-murray because of instance_eval). No
other cases can remember.

OK, but if only currying can be "always here", and "look pretty", may'be I'd
use it more regularly.

>2) it bothers me that currying a Proc returns a Curry object rather than
>a Proc object.  And that the resulting Curry object is not itself
>Curryable.

Yeah, it's a real flaw!

V


In This Thread

Prev Next