=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/asir.texi,v retrieving revision 1.14 retrieving revision 1.15 diff -u -p -r1.14 -r1.15 --- OpenXM/src/asir-doc/parts/asir.texi 2003/12/21 17:36:29 1.14 +++ OpenXM/src/asir-doc/parts/asir.texi 2004/07/03 15:50:34 1.15 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.13 2003/12/20 13:38:44 ohara Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.14 2003/12/21 17:36:29 ohara Exp $ \BJP @node ユーザ言語 Asir,,, Top @chapter ユーザ言語 Asir @@ -1451,6 +1451,34 @@ After @samp{|} one can append any number of options se [100] xxx(1,2,x^2-1,[1,2,3]|proc=1,index=5); @end example +\BJP +さらに, オプションを @code{key1=value1,key2=value2,...} のように +@samp{,} で区切って渡す代わりに, 特別なキーワード @code{option_list} +とオプションリスト @code{[["key1",value1],["key2",value2],...]} +を用いて渡すことも可能である. + +@example +[101] dp_gr_main([x^2+y^2-1,x*y-1]|option_list=[["v",[x,y]],["order",[[x,5,y,1]]]]); +@end example + +特に, 引数なしの @code{getopt()} はオプションリストを返すので, +オプションをとる関数から, オプションをとる関数を呼び出すときには有用である. + +@example +% cat foo.rr +def foo(F) +@{ + OPTS=getopt(); + return factor(F|option_list=OPTS); +@} +@end example + +@example +[3] load("foo.rr")$ +[4] foo(x^5-1|mod=11); +[[1,1],[x+6,1],[x+2,1],[x+10,1],[x+7,1],[x+8,1]] +@end example +\E \BJP @node モジュール,,, ユーザ定義函数の書き方