[#19261] lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@...

なかだです。

29 messages 2003/01/01
[#19360] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "K.Kosako" <kosako@...> 2003/01/15

nobu.nakada@nifty.ne.jpさんの

[#19361] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/15

なひです。

[#19364] Re: lstripped here-document (Re: comments and continuing strings on the next line) — nobu.nakada@... 2003/01/17

なかだです。

[#19366] Re: lstripped here-document (Re: comments and continuing strings on the next line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2003/01/17

なひです。

[#19299] [BUG] errno == 0 — Kazuhiro Yoshida <moriq@...>

もりきゅうです。win32だけかもしれません。

22 messages 2003/01/04
[#19301] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19302] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19303] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19304] Re: [BUG] errno == 0 — "U.Nakamura" <usa@...> 2003/01/04

こんにちは、なかむら(う)です。

[#19306] Re: [BUG] errno == 0 — nobu.nakada@... 2003/01/05

なかだです。

[ruby-dev:19343] Re: [Ruby/DL] 'S', 's'

From: WATANABE Hirofumi <eban@...>
Date: 2003-01-09 14:50:56 UTC
List: ruby-dev #19343
わたなべです。

Takaaki Tateishi <ttate@kt.jaist.ac.jp> writes:

> Cのプロトタイプ宣言で 'const' と修飾されていれば 'S' 使って下さいと言う
> ことがドキュメントで書きたかったことです.逆に C や Ruby の文字列を
> 'const' 相当にしたいなら 'S' を使えいう意味とは違います.
> 
> たぶん,わたなべさんは後者を指しているのですよね?

わたし自身は前者のつもりでした。
現在の実装では'S'を指定すれば文字列の中身が書き換わるわけですよね?

たとえば
  void foo(char *str)
  {
      strcpy(str, "foo");
  }
のようにstrの指す先を書き換えるような関数に
  foo = handle.sym("foo", "0S")
と'S'を使えば
  buf = " " * 4
  foo.call(buf)
  p foo.cproto
  p buf
当然bufは書き換わります。
  "void foo(const char *);"
  "foo\000"
でなぜconstなのかと。
立石さんの説明は矛盾してませんか?
  
> > を最初に読んだので、素直に実装のほうが間違っていると思いました。
> >     S : an immutable string (const char *)
> >     s : a mutable string (char *)
> 
> 申し訳ないです.ドキュメント側は最近全く触っておらず不備が多くあります.
> ちょうど一段落ついたところなのでこれを機に少し手を入れます.

ということは現在の実装が正しいんですよね?
     S : an mutable string (const char *)
     s : a immutable string (char *)
なんですか?この際'S'と's'はどうでもいいとして、わたしは
     an immutable string (const char *)
     a mutable string (char *)
となるべきと考えてます。

-- 
わたなべひろふみ

In This Thread

Prev Next