Gauche:Bugs:log2

Gauche:Bugs:log2

最新のもの: Gauche:Bugs


values-refがautoloadされない(0.7.4.1)

細かい話で申し訳ないのですが、src/autoloads.scmにvalues-refのautoloadの設定が入っていないようです。--teranishi 2004/05/14 04:13:42 PDT

srfi-1のpredを受け取るmember(0.7.4.1)

礼儀正しくないリストが対象のとき、 srfi-1のpredを受け取るmemberの挙動に一貫性が無いような気がします。--hira(2004/04/09 23:55:13 PDT)

(use srfi-1)
(define (my-equal? x y) (equal? x y))
(define spec '("--exclude-by-size" "-es" . required-argument))

;;実行例
(member "-e" spec) ;=> #f
(member "-e" spec equal?) ;=> #f
(member "-e" spec my-equal?)

*** ERROR: argument out of domain: required-argument
Stack Trace:
_______________________________________
  0  (null-list? list)
        At line 24 of "/usr/local/share/gauche/0.7.4.1/lib/srfi-1/finder.scm"
  1  (member "-e" spec my-equal?)
        At line 8 of "./member-test.scm"

;;礼儀正しくするとOK
(define spec '("--exclude-by-size" "-es")) ;=> spec
(member "-e" spec my-equal?) ;=> #f

Shiro: そうかぁ。pred無しのmemberはGauche組み込みの手続きを呼んでいて、 そっちは最後のcdrを無視するのに対し、pred有りのmemberはsrfi-1の実装 を呼んでいて、そっちは厳密にエラーをチェックしている、というのが原因ですね。

実は、srfi-1の参照実装は結構厳密にエラーチェックしてて、 一部、自前で書いたものと整合性が無いってのを指摘されて、 厳しくした経緯があります。統一性を求めるなら組み込みの方を 厳密化すべきかなあ。ユルいのはそれはそれで使いどころがあるんですが。

hira: 私は俄然ユル好みですねぇ。ここを厳しくしてもメリット無いような気がします。リストの末端まで行ってから「型が違います」なんて挙動のほうが矛盾してると思うし。型の違いを指摘するなら最初からエラーにすべきでしょう。Lispのリストは型というより形なので、最初に形チェックをするとコストが掛かり過ぎるから非現実的です。よってユルくするのが正しいと私は思っております。(atomを突っ込んだときもエラーにしないで単に#fを返してくれれば良いじゃん、て思うのは行き過ぎかしら)

hira: そんなヒトのためのmember*。

(define (make-kindly-member default-pred)
  (lambda (obj pair . pred)
    (if (null? pred)
        (set! pred default-pred)
        (set! pred (car pred)))
    (let loop ((pair pair))
      (if (pair? pair)
          (if (pred (car pair) obj)
              pair
              (loop (cdr pair)))
          #f))))

(define memq*   (make-kindly-member eq?   ))
(define memv*   (make-kindly-member eqv?  ))
(define member* (make-kindly-member equal?))

hira: いや、名前がmember*ならこっち方がスガスガしい。

(define (member* obj pair pred)
  (let loop ((pair pair))
    (if (pair? pair)
        (if (pred (car pair) obj)
            pair
            (loop (cdr pair)))
        #f)))

text.html-liteに、frame関連のタグが無いです(0.7.4.1)

2004/03/15 07:24:03 PST

frameset, frame, noframesの三つを追加して欲しいです。

syntax-rulesの(... template)形式のテンプレート(0.7.4.1)

2004/03/07 06:36:51 PST syntax-rulesの中で(... 何か)のようなテンプレートを書くとエラーになりました。具体的には

(define-syntax be-like-begin
  (syntax-rules ()
    ((_ name)
     (define-syntax name
       (syntax-rules ()
         ((_ e0 e1 (... ...))
          (begin e0 e1 (... ...))))))))

という感じです。 (これはケント・ディヴィグさんの「プログラミング言語SCHEME」に載ってたサンプルなので、もしまずかったら削除して下さい)

string-concatenate-reverseのオプショナル引数(0.7.4.1)

2004/02/24 16:18:05 PST 〜% string-concatenate-reverseにオプショナル引数を渡すとエラーになります。〜% Gaucheのマニュアルにはオプショナル引数を取ると書かれていないので

仕様かもしれないのですが、一応報告させていただきます。

text.html-liteのタグ出力 (0.7.2)

(2004/02/13 13:41:06 PST)

タグの出力が

 <tag></tag
 ><hr />

となる所を

 <tag></tag>
 <hr>

にするパッチ。

--- lib/text/html-lite.scm         5 Jul 2003 17:49:51
+++ lib/text/html-lite.scm        13 Feb 2004 14:49:30
@@ -90,10 +90,10 @@
           (receive (attr args) (get-attr args '())
             (unless (null? args)
               (error "element 〜s can't have content: 〜s" args))
-            (list "<" name attr " />")))
+            (list "<" name attr ">")))
         (lambda args
           (receive (attr args) (get-attr args '())
-            (list "<" name attr ">" args "</" name "\n>"))))))
+            (list "<" name attr ">" args "</" name ">\n"))))))
 
 (define-macro (define-html-elements . elements)
   (define (make-scheme-name name)

uri-decompose-authority (0.7.3)

Index: lib/rfc/uri.scm
===================================================================
RCS file: /cvsroot/gauche/Gauche/lib/rfc/uri.scm,v
retrieving revision 1.15
diff -u -r1.15 uri.scm
--- lib/rfc/uri.scm     24 Jul 2003 07:57:25 -0000      1.15
+++ lib/rfc/uri.scm     13 Jan 2004 09:03:37 -0000
@@ -82,8 +82,8 @@
 
 (define (uri-decompose-authority authority)
   (rxmatch-if
-      (#/^([^@]*@)?([^:]*)(:(?d*))?$/ authority)
-      (#f userinfo host #f port)
+      (#/^(([^@]*)@)?([^:]*)(:(?d*))?$/ authority)
+      (#f #f userinfo host #f port)
     (values userinfo host port)
     (values #f #f #f)))

こうしとかないと、UserInfoに@がくっついてしまいます。2004/01/13 01:09:11 PST

スーパークラスのアクセサメソッド (0.7.3)

例えば、 wrapperwrapper/inner という二つのクラスを作って、

 (use wrapper)
 (define hoge (make <wrapper>))
 (execute hoge)

すると、

 "slot-4 is 2"

と表示されます("slot-4 is 4"と表示されて欲しい)。

どうも、継承時に、スーパークラス側のメソッドの中からスロットを参照すると、スーパークラスのスロットと子クラスのスロットを混同してしまう?みたいです……。

nekoie Gauche-0.7.3 2004/01/11 10:14:59 PST

socket-output-portのバッファリングオプション判定 (0.7.3)

2004/01/04 21:02:46 PST

ふじさわ: socket-output-portのバッファリングオプション判定がsocket-input-portと同じになっていて、「(socket-output-port socket :buffering :line)」としようとしたとき、「*** ERROR: buffering mode must be one of :full, :modest or :none, but got :line」のエラーが出ます。次のほうが正解なのかなぁと。

--- ext/net/netlib.c    2004-01-05 13:53:25.000000000 +0900
+++ /usr/local/src/Gauche-0.7.3/ext/net/netlib.c  2004-01-05 13:46:17.000000000 +0900
@@ -423,7 +423,7 @@
   if (!SCM_FALSEP(bufferedP)) { /* for backward compatibility */
     bufmode = SCM_PORT_BUFFER_FULL;
   } else {
-    bufmode = Scm_BufferingMode(buffering, SCM_PORT_INPUT, SCM_PORT_BUFFER_LINE);
+    bufmode = Scm_BufferingMode(buffering, SCM_PORT_OUTPUT, SCM_PORT_BUFFER_LINE);
   }

   SCM_RETURN(Scm_SocketOutputPort(sock, bufmode));
   }

glob()の戻り値の判定 (0.7.3)

(2003/12/21 23:08:03 PST)

kou: glob()がうまくいったかどうかを判定するには以下のようにした方がいいと思います.

diff -u -r1.51 system.c
--- src/system.c        8 Dec 2003 21:13:17 -0000       1.51
+++ src/system.c        22 Dec 2003 06:59:45 -0000
@@ -183,7 +183,7 @@
     ScmObj head = SCM_NIL, tail = SCM_NIL;
     int i, r;
     SCM_SYSCALL(r, glob(Scm_GetStringConst(pattern), 0, NULL, &globbed));
-    if (r < 0) Scm_Error("Couldn't glob %S", pattern);
+    if (r != 0 && r != GLOB_NOMATCH) Scm_Error("Couldn't glob %S", pattern);
     for (i = 0; i < globbed.gl_pathc; i++) {
         ScmObj path = SCM_MAKE_STR_COPYING(globbed.gl_pathv[i]);
         SCM_APPEND1(head, tail, path);

なぜなら,手元にあったLinux(uname -r=2.4.20)ではGLOB_NOSPACE とかGLOB_ABORTEDは>0として定義されていて,手元にあった FreeBSD(uname -r=4.8-STABLE)では<0に定義されているからです.

some sxml functions are not exported (0.7.2)

(2003/11/05 02:48:22 PST)

sxml.sxpath モジュールの sxml:id-alist, sxml:not-equal? が使えないので、ソースを 見たら、この二つが export リストにありませんでした。

sxml.tools モジュールの sxml:string->xml も export リストから漏れています。 sxml:attr-list-node は、export リストに該当するものがありますが、「sxml:attri-list-node」とつづられています。

--nobsun

test/process.scm failed on Debian 3.0r1/i386 (0.7.2)

2003/10/12 17:18:43 CEST

Debian GNU/Linux 3.0r1/i386で、--enable-multibyte=utf8 を指定すると、make checkが失敗します。 失敗するのはtest/process.scmだけで、ログはこんな感じです。

Testing gauche.procses ...                                       failed.
discrepancies found.  Errors are:
test run-process (error pipe): expects #t => got #<error "encountered EOF in middle of a multibyte character from port #<iport (pipe) 0x81e3d80>">
test open-input-process-port (redirect): expects #t => got #<error "encountered EOF in middle of a multibyte character from port #<iport test1.o 0x8220630>">
test call-with-input-process (redirect): expects #t => got #<error "encountered EOF in middle of a multibyte character from port #<iport test1.o 0x823e240>">
test open-output-process-port (redirect): expects #t => got #<error "encountered EOF in middle of a multibyte character from port #<iport test1.o 0x8282360>">
test call-with-output-process (redirect): expects #t => got #<error "encountered EOF in middle of a multibyte character from port #<iport test1.o 0x82a3240>">
test call-with-process-io (redirect): expects #t => got #<error "encountered EOF in middle of a multibyte character from port #<iport test1.o 0x82fdc60>">

と、思ったら、どうやらロケールがja_JP.eucJPとかになっているせい のようでした。LANG=Cなら成功しました。 中でlsとか呼んでいるせいでしょうかね。 強制的にLANG等を指定した方が良いかもしれません。--okuji

threads on Redhat 9 (0.7.1)

2003/07/23 22:47:26 PDT

RedHat Linux 9 で、--enable-threads=pthreads で configure したものが make test で thread のテストでとまってしまいます。 "lock with timeout" のテストが返ってきません。それ以外のテストは pass する ようです。NPTL のせいかもしれませんが、詳しくは調べてません。とりあえず報告です。--nobsun

ども。Boehm GCのNPTL対応について調べてみます。Shiro

Shiro(2003/09/14 03:38:04 PDT): 判明しました。Boehm GCは悪くありません。 これと全く同様のケースです:

とりあえずの対策として、次のうちのいずれかで解決します。

これらの対策がとれない場合は、環境変数LD_ASSUME_KERNELを2.4.1にセット しておけば、NPTLではなくLinuxThreadを使うので問題は発生しません。

info作成時のエラー(CVS HEAD)

(2003/06/20 07:06:21 PDT): texiを分割した頃からだと思うのですが、--enable-multibyte=utf-8 で configure して make すると、gauche-refe.texi を生成する時に

../src/gosh -q -I../src -I../lib -lgauche-init ./extract -en -o gauche-refe.texi gauche-ref.texi
*** ERROR: invalid character sequence in the input stream
Stack Trace:
_______________________________________
  0  (close-output-port port)
        At line 194 of "../ext/charconv/charconv.scm"
  1  (display (regexp-replace-all #/@VERSION@/ line *version*))
        At line 67 of "././extract"
  2  ((with-module gauche with-input-from-port) port thunk)
        At line 187 of "../ext/charconv/charconv.scm"
  3  (with-input-from-file file (cut filter pattern-in pattern-out))
        At line 63 of "././extract"
  4  ((with-module gauche with-output-to-port) port thunk)
        At line 196 of "../ext/charconv/charconv.scm"
  5  ((with-module gauche with-input-from-port) port thunk)
        At line 187 of "../ext/charconv/charconv.scm"
  6  (with-input-from-file (car a) (lambda () (if *outfile* (with-outpu ...
        At line 142 of "././extract"
make[1]: *** [gauche-refe.texi] Error 70
make: *** [all] Error 2

というエラーになります。--enable-multibyte=euc-jp で configure すると問題なく make できます。

Shiro (2003/06/20 13:30:57 PDT): あっそうか。このパッチでどうですか。

RCS file: /cvsroot/gauche/Gauche/doc/extract,v
retrieving revision 1.11
diff -u -r1.11 extract
--- doc/extract 12 Jun 2003 07:17:31 -0000      1.11
+++ doc/extract 20 Jun 2003 20:29:46 -0000
@@ -49,7 +49,7 @@
             (push! *node-table* (cons current-node jn))
             (push! *header-table* (cons current-header jh))))
          (#/^@include?s+(?S+)/ (#f file)
-           (with-input-from-file file (cut scan-nodes)))
+           (with-input-from-file file (cut scan-nodes) :encoding 'euc-jp))
          ))
      read-line)))
 
@@ -60,7 +60,8 @@
       (pattern-in () (in (read-line)))
       (pattern-out () (out (read-line)))
       (#/^@include?s+(?S+)/ (#f file)
-        (with-input-from-file file (cut filter pattern-in pattern-out))
+        (with-input-from-file file (cut filter pattern-in pattern-out)
+                              :encoding 'euc-jp)
         (in (read-line)))
       (#/^@c COMMON$/ () (in (read-line)))
       (test (lambda _ (eq? *lang* 'en))

(2003/06/20 23:05:36 PDT): うまくいきました。が、texiにtypoを発見しました。

Index: doc/modsrfi.texi
===================================================================
RCS file: /cvsroot/gauche/Gauche/doc/modsrfi.texi,v
retrieving revision 1.6
diff -u -r1.6 modsrfi.texi
--- doc/modsrfi.texi    17 Jun 2003 03:12:19 -0000      1.6
+++ doc/modsrfi.texi    21 Jun 2003 06:02:53 -0000
@@ -1647,7 +1647,7 @@
 They are convenient to use with multiple values (@ref{srfi-11,,[SRFI-11]}).
 
 @c JP
-二つのマクロ、code{let-values} と @code{let*-values} を定義しています。
+二つのマクロ、@code{let-values} と @code{let*-values} を定義しています。
 これらは、多値とともに利用すると便利です。(@ref{srfi-11,,[SRFI-11]})
 
 @c COMMON

(2003/06/22 06:37:33 PDT): CVS HEADに上記が反映されましたが、さらに以下のパッチが必要だと思います。

Index: doc/modsrfi.texi
===================================================================
RCS file: /cvsroot/gauche/Gauche/doc/modsrfi.texi,v
retrieving revision 1.8
diff -u -r1.8 modsrfi.texi
--- doc/modsrfi.texi    21 Jun 2003 06:38:13 -0000      1.8
+++ doc/modsrfi.texi    22 Jun 2003 13:34:10 -0000
@@ -3525,7 +3525,7 @@
 @c JP
 ここで、@var{option} はマッチしたオプションオブジェクトで、@var{name}
 は実際にオプションを指定するのに使われた文字列、@var{arg} はそのオプション
-の引数(あるいは存在しなければ、@code{#f})、そして @var{seed} @dot{} は
+の引数(あるいは存在しなければ、@code{#f})、そして @var{seed} @dots{} は
 利用者側の状態情報です。@var{option-proc} は @var{seed} と同じ数だけ
 値を返さなければなりません。
 
@@ -3545,7 +3545,6 @@
 arguments of next invocation of those procedures.  The values
 returned from the last call to the procedures are returned
 from @code{args-fold}.
-@end defun
 @c JP
 @var{option-proc} は @var{seed} と同じ数だけ
 値を返さなければなりません。
@@ -3557,6 +3556,7 @@
 これらの手続きの最後の呼出しから返されたこの値は @code{args-fold} によって
 返されます。
 @c COMMON
+@end defun
 
 @defun option names require-arg? optional-arg? processor
 @c EN

extension moduleのロード時のエラー (0.7)

Shiro (2003/06/10 05:48:15 PDT): MLにも流しましたが、こちらにも貼っておきます。 0.7をインストール後にコンパイルした拡張モジュールをロードしようとすると 次のようなエラーが出てロードできない場合があります。 ("..." にはロードしようとしたモジュール名が入ります)。

  *** ERROR: failed to link "..." dynamically: libgauche-uvector.so: cannot open shared object file: No such file or directory

とりあえずの回避策は、該当モジュールをロードする前に

  (use gauche.uvector)

とするか、該当モジュールのリンク時のフラグに

  -Wl,-rpath -Wl,`gauche-config --sysarchdir`

を加えて下さい。

srfi-1 null-list? の挙動 (0.7)

nobsun 2003/06/09 01:34:39 PDT

  
  (null-list '(1 . 2)) ==> #f

となるのですが、 SRFI-1 によれば、これは、'(1 . 2) が真性リストではないので、エラーとなるのが 正しい挙動だと思います。

 Returns @code{#t} if @var{list} is the empty list @code{()},
 and @var{#f} otherwise.

privateというメンバ名 (0.7)

Shiro: Gauche Hacking Guide のおかげでソースを見直していて気がついた。 gauche.hのScmPortRecの中でprivateというメンバーを定義しているんだけど、 これC++だとエラーになるじゃないか。(予約語なんてキライだー)

ということでCVS版では直しました。

testing system ... failed. again (0.7)

nobsun 2003/06/02 21:03:11 PDT Gauche-0.7 でもでてますので報告です。

  # make test
  ...
  Testing system ..                                     failed.
  discrepancies found.  Errors are:
  test mkdir: expects "drwxr-x---" => "drwxr-s---"
  ...

back reference 間違えてgosh落ちる(0.7)

hidenao 2003/06/22 07:46:44 PDT

read.cのbackreferenceのコメントに書いてある例を実行しようとして間違えて、

正: (define a #0=#(1 2 3 #0#))
誤: (define a #0=(1 2 3 #0#))

としてしまうとgoshが落ちてしまいます

More ...