[#2529] concerns about Proc,lambda,block — "David A. Black" <dblack@...>

Hi --

39 messages 2004/03/01
[#2531] Re: concerns about Proc,lambda,block — ts <decoux@...> 2004/03/01

>>>>> "D" == David A Black <dblack@wobblini.net> writes:

[#2533] Re: concerns about Proc,lambda,block — "David A. Black" <dblack@...> 2004/03/01

Hi --

[#2537] Re: concerns about Proc,lambda,block — matz@... (Yukihiro Matsumoto) 2004/03/01

Hi,

[#2542] Re: concerns about Proc,lambda,block — Mathieu Bouchard <matju@...> 2004/03/02

[#2545] Re: concerns about Proc,lambda,block — matz@... (Yukihiro Matsumoto) 2004/03/02

Hi,

[#2550] Re: concerns about Proc,lambda,block — Mauricio Fern疣dez <batsman.geo@...> 2004/03/03

On Wed, Mar 03, 2004 at 07:51:10AM +0900, Yukihiro Matsumoto wrote:

[#2703] Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...>

This patch adds support to Net::POP for doing POP over SSL. Modeled on how

19 messages 2004/03/27
[#2704] Re: Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...> 2004/03/27

This is v2 of the patch. Cleaned up a bit and added some more docs.

[#2707] Re: Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...> 2004/03/28

v3 of the patch:

[#2721] Re: Proposed patch to add SSL support to net/pop.rb — Minero Aoki <aamine@...> 2004/03/30

Hi,

Re: concerns about Proc,lambda,block

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2004-03-04 15:52:39 UTC
List: ruby-core #2573
On Thu, 4 Mar 2004, Yukihiro Matsumoto wrote:

> Hi,
>
> In message "Re: concerns about Proc,lambda,block"
>     on 04/03/04, Hugh Sasse Staff Elec Eng <hgs@dmu.ac.uk> writes:
>
> |I'm not sure what the right thing to do would be: sometimes
> |simplicity is acheived by similarity, other times by difference.
> |However, I think some kind of reflection would be useful, whatever
> |you decide.  Maybe a wrapped?() method might be useful, so at least
> |when debugging we can ask the code "Are you a wrapped proc or not?"
>
> I don't know.  I wonder why you care if wrapped or not, where you
> cannot get the definition of the proc body.  For debugging purpose,

Because it affects how return and errors are handled. The method
that does something with this may be able to decide (based on what it
has received) how to deal with failures, it may wrap the proc in a
Thread.new(...){...}.value or something.  Also it improves clarity
of code in the same way that block_given? does.  I can't really
think of an example, but I think that is more my lack of imagination
than anything else.

Reflection in code is a good thing, isn't it?

> you can get the source position of the Proc, for example,
>
>   #<Proc:0x401ce0d8@example.rb:128>

But it's difficult to do anything programmatically with that, and it
is not so readable as most ruby! :-)
>
> by Proc#inspect.
> 							matz.
>
        Hugh

In This Thread