[#42369] [BUG: trunk] Lazy sweep and ObjectSpace.each_object — SASADA Koichi <ko1@...>

 ささだです。

14 messages 2010/10/13

[#42375] [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — Yui NARUSE <redmine@...>

Feature #3946: Array#packのqQ指定子に機種依存サイズフラグ!を追加

19 messages 2010/10/14
[#42380] Re: [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — Tanaka Akira <akr@...> 2010/10/14

2010年10月14日15:36 Yui NARUSE <redmine@ruby-lang.org>:

[#42381] Re: [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — "NARUSE, Yui" <naruse@...> 2010/10/14

(2010/10/14 21:07), Tanaka Akira wrote:

[#42619] [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加 — Usaku NAKAMURA <redmine@...> 2010/11/25

チケット #3946 が更新されました。 (by Usaku NAKAMURA)

[#42376] [Ruby 1.9-Feature#3947][Open] Array#packのにエンディアン指定修飾子</>を追加 — Yui NARUSE <redmine@...>

Feature #3947: Array#packのにエンディアン指定修飾子</>を追加

9 messages 2010/10/14

[#42464] [Ruby 1.9-Bug#3990][Assigned] tests of rexml/rss reports many errors and failures without iconv — Usaku NAKAMURA <redmine@...>

Bug #3990: tests of rexml/rss reports many errors and failures without iconv

40 messages 2010/10/27
[#42500] [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <redmine@...> 2010/10/30

チケット #3990 が更新されました。 (by Kouhei Sutou)

[#42510] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/01

成瀬です。

[#42514] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/02

須藤です。

[#42515] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/02

(2010/11/02 21:50), Kouhei Sutou wrote:

[#42516] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/02

須藤です。

[#42517] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/02

成瀬です。

[#42518] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/02

須藤です。

[#42519] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/03

成瀬です。

[#42543] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/06

須藤です。

[#42548] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/07

(2010/11/06 12:10), Kouhei Sutou wrote:

[#42549] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/07

須藤です。

[#42572] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/13

成瀬です。

[#42592] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/18

須藤です。

[#42593] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/18

成瀬です。

[#42607] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/20

須藤です。

[#42608] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/20

成瀬です。

[#42610] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/20

須藤です。

[#42611] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/20

成瀬です。

[#42613] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — Kouhei Sutou <kou@...> 2010/11/21

須藤です。

[#42614] Re: [Ruby 1.9-Bug#3990][Closed] tests of rexml/rss reports many errors and failures without iconv — "NARUSE, Yui" <naruse@...> 2010/11/21

成瀬です。

[ruby-dev:42390] Re: [Ruby 1.9-Feature#3946][Open] Array#packのqQ指定子に機種依存サイズフラグ!を追加

From: "NARUSE, Yui" <naruse@...>
Date: 2010-10-15 07:27:08 UTC
List: ruby-dev #42390
2010年10月15日9:28 KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>:
>> (2010/10/14 21:07), Tanaka Akira wrote:
>> >> さて、q/Q は 64bit signed/unsigned int なのですが、機種依存の long long (厳密には LONG_LONG) の
>> >> サイズが必要な場合、現状 Ruby レベルから取る手段が一切ありません。
>> >> すでに s/S/i/I/l/L (16bit/32bit/32bit) は、! をつけることでその機種の short/int/long の
>> >> サイズになるため、これを q/Q に拡張すると唯一の手段が提供される事になります。
>> >
>> > おそらく long long がない場合にはエラーになるべきだと思うんですが、
>> > その場合のエラーを決めないといけないんじゃないでしょうか。
>>
>> ふむ。
>> 現実的には 64bit 以上の整数型がない環境ですよね。
>> rb_raise(rb_eArgError, "this machine doesn't have long long int");
>> あたりになりますかねぇ。
>
> あんまりRubyのexceptionのルールを知らないんですが、
>
> ・引数が間違っている
>
> だと、暗黙にプログラムがバグっているというニュアンスを持つので
>
> ・そのプラットフォームは未対応
>
> ってのは、違うエラーが一般的な気がします。Unix errnoルールでいうと
>
> EINVAL: 引数が待ちガットル
> ENOSYS: 未実装システムコール
>
> みたいな。
>
> 余談に走りますがglibc関係者がkernel開発者に以前この件で苦情を言ってきた
> 事があって、それは
>
> ・ユーザが引数を間違えて渡してきた時はエラーを返したい
> ・カーネルが古くて、新しめのシステムコールが未実装の時は
>  代替処理にfallbackしたい
>
> という事はわりとありがちなので混同しないで、とかいう話でした。
> 今回の件に当てはまるかどうかは分かりませんが。

一理あるとは思うのですが、
* packは後述の通り間違った指定子は無視する
* NotImplementedError が一見それに見えて確か違う……と見せかけてrdocみるとこれっぽいな

というわけで、rb_eNotImpError かも。

> ああ、でもこのへんもperlにあわせたほうがいいのかな?

Perl を見ると、
>     (Quads are available only if your system supports 64-bit
>      integer values _and_ if Perl has been compiled to support those.
>          Raises an exception otherwise.)
> http://perldoc.perl.org/functions/pack.html
などとあり、実際試しても以下の通りエラーですね。
% perl -e'print pack("q",1)'
Invalid type 'q' in pack at -e line 1.

ちなみに、全く非対応な文字を食わせた場合、
% perl -e'print pack("o",1)'
Invalid type 'o' in pack at -e line 1.
% ruby -e'p [1].pack("O")'
""
すごく……仕様変更したいです……

-- 
NARUSE, Yui
naruse@airemix.jp

In This Thread