=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/asir.texi,v retrieving revision 1.9 retrieving revision 1.13 diff -u -p -r1.9 -r1.13 --- OpenXM/src/asir-doc/parts/asir.texi 2003/11/27 12:08:58 1.9 +++ OpenXM/src/asir-doc/parts/asir.texi 2003/12/20 13:38:44 1.13 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.8 2003/10/21 09:17:57 takayama Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.12 2003/12/18 10:26:20 ohara Exp $ \BJP @node ユーザ言語 Asir,,, Top @chapter ユーザ言語 Asir @@ -371,6 +371,16 @@ In the second example, @code{c(N)} returns a vector, s @code{N+1}. @code{A[I]} is a vector of length @code{I+1}, and each element is again a vector which contains \E +@iftex +@tex +${_I}C_J$ +@end tex +@end iftex +@ifinfo +ICJ +@end ifinfo +\JP を要素とする配列である. +\EG as its elements. @noindent \BJP @@ -378,24 +388,12 @@ each element is again a vector which contains Emacs-Lisp の関数定義に類似の機能で、ヘルプ用の文字列である。 この例の場合、@code{help(add)} によってこの文字列が出力される。 \E - @table @t \JP @item 参照 \EG @item References @fref{help}. @end table -@iftex -@tex -${_I}C_J$ -@end tex -@end iftex -@ifinfo -ICJ -@end ifinfo -\JP を要素とする配列である. -\EG as its elements. - @noindent \BJP 以下では, C によるプログラミングの経験がない人のために, @b{Asir} 言語 @@ -462,7 +460,8 @@ All the program variables are initialized to the value \BJP @item 不定元 -小文字で始まり, アルファベット, 数字, @samp{_} からなる文字列 +小文字で始まり, アルファベット, 数字, @samp{_} からなる文字列, +またはシングルクオートで囲まれた文字列. 不定元とは, 多項式環を構成する際に添加される変数をいう. @b{Asir} に おいては, 不定元は値をもたない超越的な元であり, 不定元への値の代入は @@ -483,6 +482,8 @@ An indeterminate cannot have any value. No assignment x [4] X^2+X+1; x^2+x+1 +[5] A='Dx'*(x-1)+x*y-y; +(y+Dx)*x-y-Dx @end example @end table @@ -862,6 +863,19 @@ if ( expression1 ) @{ @noindent \JP としなければならない. +\BJP +@noindent +関数の中でなく, top level で @code{if} 文を用いるときは @code{$} または @code{;} +で終了する必要がある. +これらがないと次の文がよみとばされる. +\E +\BEG +@noindent +When @code{if} is used in the top level, the @code{if} expression should be +terminated with @code{$} or @code{;}. +If there is no terminator, the next expression will be skipped to be evaluated. +\E + \BJP @node ループ break return continue,,, ユーザ定義函数の書き方 @subsection ループ, @code{break}, @code{return}, @code{continue} @@ -1029,6 +1043,9 @@ statement, and the termination condition will be evalu \BJP 構造体とは, 各成分の要素が名前でアクセスできる固定長配列と思ってよい. 各構造体は名前で区別される. 構造体は, @code{struct} 文により宣言される. +構造体が宣言されるとき, asir は内部で構造体のそれぞれの型に固有の識別 +番号をつける. この番号は, 組み込み関数 @code{struct_type} により取得 +できる. ある型の構造体は, 組み込み関数 @code{newstruct} により生成される. 構造体の各メンバは, 演算子 @code{->} によりアクセスする. メンバが構造体の場合, @code{->} による指定は入れ子にできる. @@ -1055,8 +1072,16 @@ by @code{->} can be nested. 2 [5] A; @{1,2@} +[6] struct_type(A); +1 @end example +@table @t +\JP @item 参照 +\EG @item References +@fref{newstruct}, @fref{struct_type} +@end table + \BJP @node さまざまな式,,, ユーザ定義函数の書き方 @subsection さまざまな式 @@ -1226,8 +1251,11 @@ through @code{cpp}. This enables @b{Asir} user to use @code{#include} @* \BJP -@code{cpp} に特に引数を渡さないため, インクルードファイルは, -@code{#include} が書かれているファイルと同じディレクトリでサーチされる. +UNIX では インクルードファイルは, Asir のライブラリディレクトリ +(環境変数 @b{ASIR_LIBDIR} で指定されたディレクトリ) +と @code{#include} が書かれているファイルと同じディレクトリをサーチする. +UNIX 以外では @code{cpp} に特に引数を渡さないため, +@code{#include} が書かれているファイルと同じディレクトリのみをサーチする. \E \BEG Include files are searched within the same directory as the file @@ -1296,6 +1324,21 @@ because such comments cannot be nested. #define MAX(a,b) ((a)>(b)?(a):(b)) @end example +\BJP +@noindent +C のプリプロセッサを流用しているため, プリプロセッサは @code{$} を正しく処理できない. +たとえば @code{LIST} が定義されていても +@code{LIST$}は置換されない. @code{$} の前に空白をおいて +@code{LIST $} と書かないといけない. +\E +\BEG +@noindent +Since we are utilizing the C preprocessor, it cannot properly preprocess expressions +with @code{$}. +For example, even if @code{LIST} is defined, @code{LIST} in the expression +@code{LIST$} is not replaced. Add a blank before @code{$}, i.e., +write as @code{LIST $} to make the proprocessor replace it properly. +\E \BJP @node オプション指定,,, ユーザ定義函数の書き方 @@ -1437,6 +1480,7 @@ def demo() @{ \BJP モジュールは @code{module} モジュール名 〜 @code{endmodule}で囲む. +モジュールは入れ子にはできない. モジュールの中だけで使う大域変数は @code{static} で宣言する. この変数はモジュールの外からは参照もできないし変更もできない. モジュールの外の大域変数は @code{extern} で宣言する. @@ -1566,3 +1610,9 @@ module stack; /* The body of the module stack */ endmodule; @end example + +@table @t +\JP @item 参照 +\EG @item References +@fref{module_list}, @fref{module_definedp}, @fref{remove_module}. +@end table