[#41918] [Feature #3647] Array#sample(n, replace=false) — Kenta Murata <redmine@...>
Feature #3647: Array#sample(n, replace=false)
チケット #3647 が更新されました。 (by Masaya Tarui)
まつもと ゆきひろです
[#41925] Ruby committers Q&A at RubyKaigi — Shugo Maeda <shugo@...>
前田です。
2010/8/3 Shugo Maeda <shugo@ruby-lang.org>:
前田です。
[#41931] [Bug #3657] make cleanがファイルを削除しすぎ — Takahiro Kambe <redmine@...>
Bug #3657: make cleanがファイルを削除しすぎ
[#41933] *array で異常終了 — 小田 利通 <oda@...>
[#41957] 1.9.2でtest_require_too_long_filename(TestRequire)がFailureになる — kimura wataru <kimuraw@...>
木村(わ)といいます。
[#41962] Re: [ruby-cvs:36129] Ruby:r28927 (ruby_1_9_2): merges r28835 from trunk into ruby_1_9_2. — Masaki Suketa <masaki.suketa@...>
助田です。
[#41966] [Bug #3673] PTY.getpty with IO.pipe doesn't finish on FreeBSD — Yui NARUSE <redmine@...>
Bug #3673: PTY.getpty with IO.pipe doesn't finish on FreeBSD
2010年8月10日10:53 Yui NARUSE <redmine@ruby-lang.org>:
[#41969] [Feature #3675] String#prepend, String#>> — Sora Harakami <redmine@...>
Feature #3675: String#prepend, String#>>
まつもと ゆきひろです
[#41971] Re: [ruby-cvs:36152] Ruby:r28950 (trunk): [ruby-core:31658] — "NARUSE, Yui" <naruse@...>
成瀬です。
> なお、unused variable で警告するのはおかしいという主張もありえるでしょう。
[#41972] [Bug #3676] CMath.cbrt(-8)の結果が複素数にならない — tadayoshi funaba <redmine@...>
Bug #3676: CMath.cbrt(-8)の結果が複素数にならない
まつもと ゆきひろです
> 現在のCMath.cbrt(-8)の結果は-2で、これは3乗すると-8になるとい
[#41974] Re: [ruby-cvs:36157] Ruby:r28955 (trunk): * complex.c (nucomp_to_[ifr]): don't allow complex with in-exact — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
> これを戻されたということは、(1+0.0i)は整数に変換できてはいけ
まつもと ゆきひろです
> なるほど。動機は分かりました。ただ、今回の変更はいずれも明示
まつもと ゆきひろです
[#41995] Re: [ruby-core:31672] [Bug #3678] CMath.sqrt(1.i) results to 0.0+0.0i — Urabe Shyouhei <shyouhei@...>
-devに振ります。
[#42003] WEBrickに関するセキュリティ修正 (CVE-2010-0541) — Hideki Yamane <henrich@...>
2010/8/11 Hideki Yamane <henrich@debian.or.jp>:
こんにちは、なかむら(う)です。
2010/8/12 U.Nakamura <usa@garbagecollect.jp>:
こんにちは、なかむら(う)です。
2010/8/12 U.Nakamura <usa@garbagecollect.jp>:
[#42022] [Bug #3693] visibility hidden functions — Narihiro Nakamura <redmine@...>
Bug #3693: visibility hidden functions
ささだです.
[#42038] [Bug: trunk] Fwd: [ruby-list:47272] case when 整数と実数の比較 (ruby 1.9) — SASADA Koichi <ko1@...>
ささだです.
[#42040] [Bug #3674] dRuby サーバプロセスを停止する時に時間がかかることがある — Tomoyuki Chikanaga <redmine@...>
チケット #3674 が更新されました。 (by Tomoyuki Chikanaga)
遠藤です。
[#42057] rdf generated by rss library is not valid — Tanaka Akira <akr@...>
ふと、rss ライブラリのチュートリアルの
[#42067] [Bug #3708] Array#permutation がおかしな結果を返す — Shumpei Akai <redmine@...>
Bug #3708: Array#permutation がおかしな結果を返す
[#42079] Re: [ruby-cvs:36248] Ruby:r29048 (trunk): * backport r28621 and r28632 from ruby_1_8; — "NARUSE, Yui" <naruse@...>
このコミットで OpenSSL のテスト失敗が増えています。
2010/8/19 NARUSE, Yui <naruse@airemix.jp>:
2010/8/19 Hiroshi Nakamura <nakahiro@gmail.com>:
(2010/08/19 18:58), Hiroshi Nakamura wrote:
[#42090] Math::atan2(0, 0) on ruby 1.9.2 — KUBO Takehiro <kubo@...>
久保です。
=1B$B$`$i$?$G$9!#=1B(B
遠藤です。
久保です。
=1B$B$`$i$?$G$9!#=1B(B
[#42093] version.hのRUBY_VERSION_TEENYが古いのでは? — Moru <lateau@...>
44KC44KL44Go55Sz44GX44G+44GZ44CCCgokIGhlYWQgcnVieS0xLjkuMi1wMC92ZXJzaW9uLmgK
[#42100] make distclean時エラーメッセージ — Moru <lateau@...>
=E3=82=82=E3=82=8B=E3=81=A7=E3=81=99=E3=80=82
[#42125] vc9 x64でtrunk dlがコンパイルできない — kuwamoto shintaro <beuniv@...>
こんにちわ
[#42166] Ruby'sライセンスの、BSDLとのデュアルライセンスへの変更 — "NARUSE, Yui" <naruse@...>
Ruby's ライセンスは BSDL と Ruby's のデュアルライセンスになります。
(2010/09/01 1:48), NARUSE, Yui wrote:
[ruby-dev:42129] Re: [Feature:trunk] argument delegation
遠藤です。
2010年6月17日6:31 Yukihiro Matsumoto <matz@ruby-lang.org>:
> が、もともとの動機とは別として、「&」1文字でそのコンテキスト
> のブロックを渡すのは、面白いアイディアだと思います。この場合
> は、仮引数リストのブロック引数がなくても、ブロックを渡すこと
> になるんですかね。
パッチを書いてみました。思ったより小さく書けました。
def foo
yield
end
def bar
foo(&)
end
bar { p 1 } #=> 1
カッコを省略した場合、
foo &
bar
というのが foo & bar なのか foo(&); bar なのか曖昧という問題が
ありました。が、互換性重視で foo & bar と解釈するようになってい
ます。というか書いてみたらそうなった。conflict は出ません。
diff --git a/compile.c b/compile.c
index 2fd804c..3f8c331 100644
--- a/compile.c
+++ b/compile.c
@@ -2863,8 +2863,13 @@ setup_args(rb_iseq_t *iseq, LINK_ANCHOR *args,
NODE *argn, unsigned long *flag)
INIT_ANCHOR(arg_block);
INIT_ANCHOR(args_splat);
if (argn && nd_type(argn) == NODE_BLOCK_PASS) {
- COMPILE(arg_block, "block", argn->nd_body);
- *flag |= VM_CALL_ARGS_BLOCKARG_BIT;
+ if ((VALUE)argn->nd_body != (VALUE)-1) {
+ COMPILE(arg_block, "block", argn->nd_body);
+ *flag |= VM_CALL_ARGS_BLOCKARG_BIT;
+ }
+ else {
+ *flag |= VM_CALL_ARGS_BLOCKTRGH_BIT;
+ }
argn = argn->nd_head;
}
diff --git a/node.c b/node.c
index 65bc541..85574b4 100644
--- a/node.c
+++ b/node.c
@@ -621,7 +621,12 @@ dump_node(VALUE buf, VALUE indent, int comment, NODE *node)
ANN("example: foo(x, &blk)");
F_NODE(nd_head, "other arguments");
LAST_NODE;
- F_NODE(nd_body, "block argument");
+ if ((VALUE)node->nd_body != (VALUE)-1) {
+ F_NODE(nd_body, "block argument");
+ }
+ else {
+ F_MSG(nd_body, "block argument", "-1 (anonymous)");
+ }
break;
case NODE_DEFN:
diff --git a/parse.y b/parse.y
index e085088..b0b946b 100644
--- a/parse.y
+++ b/parse.y
@@ -2459,6 +2459,14 @@ block_arg : tAMPER arg_value
$$ = $2;
%*/
}
+ | tAMPER
+ {
+ /*%%%*/
+ $$ = NEW_BLOCK_PASS(-1);
+ /*%
+ $$ = dispatch0(anonymous_block_arg);
+ %*/
+ }
;
opt_block_arg : ',' block_arg
diff --git a/vm_core.h b/vm_core.h
index 7676b2f..f0fa3a3 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -544,6 +544,7 @@ typedef struct {
#define VM_CALL_TAILRECURSION_BIT (0x01 << 6)
#define VM_CALL_SUPER_BIT (0x01 << 7)
#define VM_CALL_OPT_SEND_BIT (0x01 << 8)
+#define VM_CALL_ARGS_BLOCKTRGH_BIT (0x01 << 9)
#define VM_SPECIAL_OBJECT_VMCORE 0x01
#define VM_SPECIAL_OBJECT_CBASE 0x02
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 985a2fb..2a127d7 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -261,6 +261,10 @@ caller_setup_args(const rb_thread_t *th,
rb_control_frame_t *cfp, VALUE flag,
*block = blockptr;
}
}
+ else if (flag & VM_CALL_ARGS_BLOCKTRGH_BIT) {
+ rb_control_frame_t *reg_cfp = cfp;
+ *block = GET_BLOCK_PTR();
+ }
else if (blockiseq) {
blockptr = RUBY_VM_GET_BLOCK_PTR_IN_CFP(cfp);
blockptr->iseq = blockiseq;
--
Yusuke Endoh <mame@tsg.ne.jp>