[#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: "David A. Black" <dblack@...>
Date: 2004-03-01 18:23:41 UTC
List: ruby-core #2533
Hi --

On Tue, 2 Mar 2004, ts wrote:

> >>>>> "D" == David A Black <dblack@wobblini.net> writes:
> 
> D> I think Dave's explanation is about as good as one can give -- and
> D> that's what worries me.  In particular, the fact that Ruby is now
> D> doing something that requires the concept of "contexts" to explain
> D> strikes me as an indication of a possible problem.  
> 
>  Well, the problem is perhaps that he try to rationalize (he must be
>  cartesian :-)) when you must "visually" see the examples.

But there isn't any visual information to go on, once these objects
leave the site of origin.  Nor do the objects differentiate themselves
very clearly:

   irb(main):012:0> n.methods - m.methods
   => []
   irb(main):013:0> n.class == m.class
   => true
   irb(main):014:0> n.arity == m.arity
   => true
   irb(main):015:0> n.call
   ArgumentError: wrong number of arguments (0 for 2)
	   from (irb):15:in `x'
	   from (irb):8:in `call'
	   from (irb):15
   irb(main):016:0> m.call
   => nil
   irb(main):017:0> RUBY_VERSION
   => "1.9.0"

There's nothing wrong with having code blocks/closures that behave
differently.  But it isn't represented in the language the way that
other such differences between built-ins are.  (And the actual rules
having to do with arity also seem very complex to me.)


David

-- 
David A. Black
dblack@wobblini.net


In This Thread