[#10492] Ruby 1.8.6 preview3 has been released — "Akinori MUSHA" <knu@...>

Hi,

26 messages 2007/03/04
[#10500] Re: Ruby 1.8.6 preview3 has been released — Hugh Sasse <hgs@...> 2007/03/05

On Mon, 5 Mar 2007, Akinori MUSHA wrote:

[#10507] Dynamic Array#join with block — <noreply@...>

Patches item #9055, was opened at 2007-03-05 19:57

12 messages 2007/03/05
[#10520] Re: [ ruby-Patches-9055 ] Dynamic Array#join with block — Nobuyoshi Nakada <nobu@...> 2007/03/06

Hi,

[#10594] grave bug in 1.8.6's thread implementation — Sylvain Joyeux <sylvain.joyeux@...4x.org>

In ext/thread/thread.c, remove_one leaves the list in an inconsistent state.

15 messages 2007/03/14
[#10596] Re: [PATCH] grave bug in 1.8.6's thread implementation — MenTaLguY <mental@...> 2007/03/14

On Thu, 15 Mar 2007 00:15:57 +0900, Sylvain Joyeux <sylvain.joyeux@m4x.org> wrote:

[#10597] Re: [PATCH] grave bug in 1.8.6's thread implementation — Sylvain Joyeux <sylvain.joyeux@...4x.org> 2007/03/14

> > The fix is in thread-mutex-remove_one.diff.

[#10598] Re: [PATCH] grave bug in 1.8.6's thread implementation — MenTaLguY <mental@...> 2007/03/14

On Thu, 15 Mar 2007 01:19:04 +0900, Sylvain Joyeux <sylvain.joyeux@m4x.org> wrote:

[#10599] Re: [PATCH] grave bug in 1.8.6's thread implementation — Sylvain Joyeux <sylvain.joyeux@...4x.org> 2007/03/14

On Wednesday 14 March 2007 17:29, MenTaLguY wrote:

[#10600] Re: [PATCH] grave bug in 1.8.6's thread implementation — MenTaLguY <mental@...> 2007/03/14

On Thu, 15 Mar 2007 01:48:42 +0900, Sylvain Joyeux <sylvain.joyeux@m4x.org> wrote:

[#10615] Multiton in standard library — TRANS <transfire@...>

Hi--

16 messages 2007/03/15
[#10619] Re: Multiton in standard library — Tom Pollard <tomp@...> 2007/03/16

[#10620] Re: Multiton in standard library — TRANS <transfire@...> 2007/03/16

On 3/15/07, Tom Pollard <tomp@earthlink.net> wrote:

[#10646] Marshal.dump shouldn't complain about singletons if the _dump method is defined — <noreply@...>

Bugs item #9376, was opened at 2007-03-19 15:58

12 messages 2007/03/19
[#10647] Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined — Urabe Shyouhei <shyouhei@...> 2007/03/19

noreply@rubyforge.org wrote:

[#10648] Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined — Sylvain Joyeux <sylvain.joyeux@...4x.org> 2007/03/19

On Monday 19 March 2007 18:01, Urabe Shyouhei wrote:

[#10651] Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined — Yukihiro Matsumoto <matz@...> 2007/03/19

Hi,

[#10665] Re: [ ruby-Bugs-9376 ] Marshal.dump shouldn't complain about singletons if the _dump method is defined — "Chris Carter" <cdcarter@...> 2007/03/20

On 3/19/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#10712] Ruby Method Signatures (was Re: Multiton in standard library) — "Rick DeNatale" <rick.denatale@...>

On 3/19/07, TRANS <transfire@gmail.com> wrote:

10 messages 2007/03/21
[#10715] Re: Ruby Method Signatures (was Re: Multiton in standard library) — Jos Backus <jos@...> 2007/03/22

On 3/19/07, TRANS <transfire@gmail.com> wrote:

[#10798] Virtual classes and 'real' classes -- why? — "John Lam (CLR)" <jflam@...>

I was wondering if someone could help me understand why there's a parallel =

12 messages 2007/03/28
[#10799] Re: Virtual classes and 'real' classes -- why? — MenTaLguY <mental@...> 2007/03/28

On Thu, 29 Mar 2007 04:44:16 +0900, "John Lam (CLR)" <jflam@microsoft.com> wrote:

Re: Ruby Method Signatures (was Re: Multiton in standard library)

From: "Rick DeNatale" <rick.denatale@...>
Date: 2007-03-23 11:08:03 UTC
List: ruby-core #10753
On 3/22/07, Paul Brannan <pbrannan@atdesk.com> wrote:
> On Thu, Mar 22, 2007 at 10:26:38PM +0900, Rick DeNatale wrote:
> > >As for the signature, it would have to be a special class of object
> > >that has the qualities of Ruby's arguments -- the ordered list, the
> > >default params and etc. With that object a few things could be
> > >queried, such as arity, maybe a list of parameter names, whether it
> > >has a * parameter or a &block parameter, etc. Importantly it could
> > >output a string representation or the args (whether with the original
> > >names or not). Eg.
> > >
> > >  def a(x,y)
> > >    this.signature.to_s  #=>  "x,y" -or- "a1,a2"
> >
> > This isn't the conventional meaning of signature, which is usually a
> > type construct describing what the caller needs to know about calling
> > the method. A method signature usually contains:
> >
> >   1. The name of the method.
> >   2. The return type (which in Ruby is always anything)
> >   3. The type of each argument (again in Ruby always anything).
> >   4. If needed, an indication of argument optionality.
> >
> > Note that the caller has no need to know the formal argument names.
>
> I agree that the signature must contain at least the above information
> (though it doesn't really need the name, since the name isn't needed to
> call the method).
>
> However, in the spirit of OO, it seems reasonable to allow a signature
> object to contain additional information.  Equality between signatures
> can ignore the extra information, while it can still be available for
> generating a string representation, e.g. for documentation purposes.

My point though is that in common Computer Science terms, methods
signatures, which are a special case of the more general term
signatures don't include  this additional information.

> > I think here that you're really talking about getting at the methods
> > prototype.  Prototypes are like signatures but often include formal
> > argument names.  In a way you can think of them as the source code
> > version of a signature.
>
> Ruby doesn't have prototypes, though.  If a method is defined, it has a
> body.

But it doesn't have signature either.  I was trying to make an analogy.

Trans' suggestion seemed to be to use whatever we call this thing as a
way to reuse the formal parameter list definition from one method in
another.  I don't know that I've seen that in any other language, and
if it exists what it's called. When this is done it's typically
cobbled together with macros and the like.

On reflection though, I don't think that this is a good idea anyway.
Given that Ruby allows dynamic re-definition what should this do?

def foo(x)
   end

 def bar(*=method(:foo).signature)
     p x   # or  p a1
  end

  bar(1)  #=> 1

  def foo(y)
  end

  bar(1) #=> ?

I suppose that the answer is 1, and that the signature is just used as
it is when bar is defined, but then I'm not sure that this is really a
useful feature, it certainly doesn't make the definition of bar EASIER
to read.

> Additionally, a prototype doesn't really contain argument names either.
> In C, for example, it is legal to specify them, but they have no
> meaning.  The argument names only have meaning in the function
> definition (and the names in the definition need not match the names in
> the declaration/prototype).

But they can specify them, whereas signatures in all of the languages
I'm familiar with hold only interface type information.

> Perhaps there is a third word that could be used?

Perhaps.  I'm just suggesting that the term signature has an accepted
meaning and I'd rather avoid defining a special meaning for Ruby.

-- 
Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

In This Thread