=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/asir.texi,v retrieving revision 1.8 retrieving revision 1.11 diff -u -p -r1.8 -r1.11 --- OpenXM/src/asir-doc/parts/asir.texi 2003/10/21 09:17:57 1.8 +++ OpenXM/src/asir-doc/parts/asir.texi 2003/12/01 02:13:38 1.11 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.7 2003/04/20 08:01:25 noro Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.10 2003/11/27 12:23:58 ohara Exp $ \BJP @node ユーザ言語 Asir,,, Top @chapter ユーザ言語 Asir @@ -349,6 +349,16 @@ def c(N) @} return A; @} + +@tex +/* $A+B$ */ +@end tex + +def add(A,B) +"add two numbers." +@{ + return A+B; +@} @end example @noindent @@ -374,6 +384,18 @@ ICJ @noindent \BJP +3 つ目の例では, 引数並びのあとに文字列が置かれているが、これは +Emacs-Lisp の関数定義に類似の機能で、ヘルプ用の文字列である。 +この例の場合、@code{help(add)} によってこの文字列が出力される。 +\E +@table @t +\JP @item 参照 +\EG @item References +@fref{help}. +@end table + +@noindent +\BJP 以下では, C によるプログラミングの経験がない人のために, @b{Asir} 言語 によるプログラムの書き方を解説する. \E @@ -838,6 +860,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} @@ -1272,6 +1307,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 オプション指定,,, ユーザ定義函数の書き方