Gauche > Archives > 2016/10/16

2016/10/16 09:37:55 UTCwtokuno
#
matchマクロでベクタとunquoteを組み合わせるとシンタックスエラーになります。

 $ rlwrap ./gosh -ftest
 gosh> (use util.match)
 gosh> (match '#(1 2 3) (`#(,a ,b ,c) (values a b c)))
 *** ERROR: syntax error in pattern (quasiquote #((unquote a) (unquote b) (unquote c)))
     While compiling "(standard input)" at line 1: (match '#(1 2 3) (`#(,a ,b ,c) (values a b c)))
 Stack Trace:
 _______________________________________
   0  (eval expr env)
         at "../lib/gauche/interactive.scm":282
 gosh> (match '#() (#() 3))
 3
 gosh> (match '#() (`#() 3))
 *** ERROR: pair required, but got ()
     While compiling "(standard input)" at line 1: (match '#() (`#() 3))
 Stack Trace:
 _______________________________________
   0  (eval expr env)
         at "../lib/gauche/interactive.scm":282
 gosh>
#
私の使い方が間違ってるでしょうか?
#
unquoteというかquasiquoteですね。
2016/10/16 09:51:29 UTCshiro
#
util.matchのバグっぽいですね
2016/10/16 10:18:15 UTCwtokuno
#
反応ありがとうございます。了解です。
2016/10/16 23:44:54 UTCshiro
#
Gaucheのサイトのオンラインドキュメントを新しいビルドに入れ替えました。?p=TOPIC を使わず直接以前のhtmlを参照してるURLはドキュメントトップにリダイレクトされます。