ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
From: Mauricio Fernandez <mfp@acm.org>
To: ruby-core@ruby-lang.org
Subject: Re: [BUG] Proc#arity regression or bug in RDoc
Date: Thu, 26 Apr 2007 19:40:19 +0900	[thread overview]
Message-ID: <20070426103955.GW17734@tux-chan> (raw)
In-Reply-To: <20070426095541.GU17734@tux-chan>

On Thu, Apr 26, 2007 at 06:55:46PM +0900, Mauricio Fernandez wrote:
> $ ruby19 -v -e "p proc{}.arity"
> ruby 1.9.0 (2007-02-07 patchlevel 0) [i686-linux]
> 0
> $ ./ruby19 -v -e "p proc{}.arity"
> ruby 1.9.0 (2007-04-26 patchlevel 0) [i686-linux]
> -1
> 
> However, the RDoc documentation attached to proc_arity still says that it
> should return 0, so there's a bug, either in the code (wrong iseq->argc ?) or
> in the docs (if the latter, the patch below should do).

It seems it's a regression after all; no time to fix it now, but I've found
when it happened:

ruby-trunk-12116$ ./ruby -v -e "p proc{}.arity"
ruby 1.9.0 (2007-03-21 patchlevel 0) [i686-linux]
0

ruby-trunk-12117$ ./ruby -v -e "p proc{}.arity"
ruby 1.9.0 (2007-03-21 patchlevel 0) [i686-linux]
-1

The regression was introduced in 

Wed Mar 21 20:05:07 2007  Koichi Sasada  <ko1@atdot.net>

	* compile.c, parse.y, eval.c, intern.h, iseq.c, lex.c, node.h,
	  proc.c, vm.c, vm_macro.def, vm_macro.def, yarvcore.c, yarvcore.h,
	  debug.c, debug.h: merge half-baked-1.9 changes.  The biggest change
	  is to change node structure around NODE_SCOPE, NODE_ARGS.  Every
	  scope (method/class/block) has own NODE_SCOPE node and NODE_ARGS
	  represents more details of arguments information.  I'll write a
	  document about detail of node structure.


PS: there's already a test in test/ruby/test_proc.rb
  def test_arity
      assert_equal(0, proc{}.arity)
      assert_equal(0, proc{||}.arity)
  ...
maybe it should also be added to sample/test.rb, so it gets executed on 
make test  w/o requiring a full  make test-all ?

-- 
Mauricio Fernandez  -   http://eigenclass.org   -  singular Ruby
                        ** Latest postings **
On GC and finalizers in Ruby, corrected weak hash table implementations
  http://eigenclass.org/hiki/deferred-finalizers-in-Ruby
simplefold: better vim folding (Ruby, Objective Caml, Perl, PHP, Java)
  http://eigenclass.org/hiki/simplefold

  reply	other threads:[~2007-04-26 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26  9:55 [BUG] Proc#arity regression or bug in RDoc Mauricio Fernandez
2007-04-26 10:40 ` Mauricio Fernandez [this message]
2007-04-27  5:12   ` [patch] " Adam Bozanich
2007-04-29  4:37     ` Adam Bozanich
2007-05-01  4:19     ` SASADA Koichi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.ruby-lang.org/en/community/mailing-lists/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070426103955.GW17734@tux-chan \
    --to=ruby-core@ruby-lang.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).