=================================================================== RCS file: /home/cvs/OpenXM/src/asir-doc/parts/asir.texi,v retrieving revision 1.16 retrieving revision 1.18 diff -u -p -r1.16 -r1.18 --- OpenXM/src/asir-doc/parts/asir.texi 2004/07/04 00:16:43 1.16 +++ OpenXM/src/asir-doc/parts/asir.texi 2005/07/25 12:23:05 1.18 @@ -1,4 +1,4 @@ -@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.15 2004/07/03 15:50:34 ohara Exp $ +@comment $OpenXM: OpenXM/src/asir-doc/parts/asir.texi,v 1.17 2004/07/10 05:50:57 takayama Exp $ \BJP @node ユーザ言語 Asir,,, Top @chapter ユーザ言語 Asir @@ -1632,7 +1632,7 @@ The below is an example of demand loading. \E @example -if (!module_definep("stack")) load("stack.rr") $ +if (!module_definedp("stack")) load("stack.rr") $ @end example \BJP @@ -1682,6 +1682,38 @@ def demo() @{ module stack; /* The body of the module stack */ endmodule; +@end example + +\BJP +モジュールの中からトップレベルで定義されている関数を呼ぶには, +下の例のように @code{::} を用いる. +\E +\BEG +In order to call functions defined in the top level from the inside +of a module, we use @code{::} as in the example below. +\E +@example +def afo() @{ + S = "afo, afo"; + return S; +@} +module abc; +localf foo,afo $ + +def foo() @{ + G = ::afo(); + return G; +@} +def afo() @{ + return "afo, afo in abc"; +@} +endmodule; +end$ + +[1200] abc.foo(); +afo, afo +[1201] abc.afo(); +afo, afo in abc @end example @table @t