[#6363] Re: rescue clause affecting IO loop behavior — ts <decoux@...>

>>>>> "D" == David Alan Black <dblack@candle.superlink.net> writes:

17 messages 2000/11/14
[#6367] Re: rescue clause affecting IO loop behavior — David Alan Black <dblack@...> 2000/11/14

Hello again --

[#6582] best way to interleaf arrays? — David Alan Black <dblack@...>

Hello --

15 messages 2000/11/26

[#6646] RE: Array Intersect (&) question — Aleksi Niemel<aleksi.niemela@...>

Ross asked something about widely known and largely ignored language (on

23 messages 2000/11/29
[#6652] RE: Array Intersect (&) question — rpmohn@... (Ross Mohn) 2000/11/29

aleksi.niemela@cinnober.com (Aleksi Niemel) wrote in

[#6723] Re: Array Intersect (&) question — Mathieu Bouchard <matju@...> 2000/12/01

> >Use a hash. Here's code to do both and more. It assumes that

[#6656] printing/accessing arrays and hashes — raja@... (Raja S.)

I'm coming to Ruby with a Python & Common Lisp background.

24 messages 2000/11/30

[ruby-talk:6682] behavior of Proc#arity?

From: grady@... (Steven Grady)
Date: 2000-11-30 18:40:03 UTC
List: ruby-talk #6682
I was looking at the library reference, and I have to say I'm confused
about the behavior of Proc#arity.  First, note that the reference
is now wrong.  It says that Proc.new {|a|}.arity returns -2, when it
has been fixed (?) to return -1.  So given that, why do all the following
argument specifiers:
    ||
    |a|
    |*a|
return -1, while there is nothing that returns 0 or 1?  Following
the POLS, I would have expected:
    Proc.new {||}.arity 	-> 0
    Proc.new {|a|}.arity 	-> 1
    Proc.new {|a, b|}.arity 	-> 2
    Proc.new {|a, b, c|}.arity 	-> 3
    Proc.new {|*a|}.arity 	-> -1
    Proc.new {|a, *b|}.arity 	-> -2
    Proc.new {|a, b, *c|}.arity -> -3
Doesn't this make more sense?

BTW, as far as I can tell, nothing currently uses "arity", so if this
were a reasonable change, there shouldn't be any real problems with
backwards-compatibility..
--
	Steven
"Mind your manners, son!  I've got a tall pointy hat!"

In This Thread

Prev Next