===================================================================
RCS file: /home/cvs/OpenXM/doc/OpenXM-specs/stackmachine.tex,v
retrieving revision 1.3
retrieving revision 1.13
diff -u -p -r1.3 -r1.13
--- OpenXM/doc/OpenXM-specs/stackmachine.tex 2000/01/21 08:44:55 1.3
+++ OpenXM/doc/OpenXM-specs/stackmachine.tex 2016/08/22 09:08:50 1.13
@@ -1,6 +1,7 @@
+%% $OpenXM: OpenXM/doc/OpenXM-specs/stackmachine.tex,v 1.12 2004/03/08 03:08:12 takayama Exp $
//&jp \section{ OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó }
-//&eg \section{ OX stackmachine } (This section has not yet been translated.)
-
+//&eg \section{ OX stack machine }
+\label{sec:stackmachine}
/*&jp
¤³¤ÎÀá¤Ç¤Ï, OX ¥¹¥¿¥Ã¥¯¥Þ¥·¥ó operator ¤ÎÀâÌÀ
(TCP/IP ¥½¥±¥Ã¥È¾å¤Ç¤Îɸ½à encoding Ë¡ ¤òÍѤ¤¤ë),
@@ -39,11 +40,11 @@ that for event-driven programming.
{\tt oxserver00.c} is implemented as a sample server.
If you want to implement you own server,
write the following functions and use them instead of
-those in {\tt nullstackmachine.c }.
+those in {\tt nullstackmachine.c}.
*/
-//&jp \subsubsection{¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î¥°¥ë¡¼¥× SMobject/Basic0 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿}
-//&eg \subsubsection{Operators in the group SMobject/Basic0}
+//&jp \subsubsection{¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Î¥°¥ë¡¼¥× SMobject/Primitive ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿}
+//&eg \subsubsection{Operators in the group SMobject/Primitive}
/*&jp
\noindent
@@ -78,8 +79,9 @@ CMObject ¤ËÂФ¹¤ëºÇÂç¸øÌó¿ôŪ¤Ê¥á¥Ã¥»¡¼¥¸¤Î»ÅÍͤòconte
°Õ. CMO ·Á¼°¤Ç½ñ¤¤¤Æ¤¢¤Ã¤Æ¤â, ¤½¤ì¤Ï¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Îlocal ·Á¼°
¤Ç¥¹¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤È²ò¼á¤·¤Æ²¼¤µ¤¤.)
-¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ï°Ê²¼¤Î´Ø¿ô¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤±¤Ê¤¤.
-
+¤¹¤Ù¤Æ¤Î¥µ¡¼¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤Ï°Ê²¼¤ÎÁàºî¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤±¤Ê¤¤.
+³ÆÁàºî¤ËÂФ·, ¤½¤ÎÁ°¸å¤Ë¤ª¤±¤ë¥¹¥¿¥Ã¥¯¤Î¾õÂÖ¤ò¼¨¤¹. ¿Þ¤Ë¤ª¤¤¤Æ,
+±¦Ã¼¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬¥¹¥¿¥Ã¥¯¤Î¥È¥Ã¥×¤ËÂбþ¤¹¤ë.
*/
/*&eg
@@ -90,39 +92,44 @@ Object xxx_OperandStack[SIZE];
\end{verbatim}
Here {\tt Object} may be local to the system {\tt xxx} wrapped by the stack
machine.
-That is, the server may translate CMObjects into local its
-objects and push them onto the stack. However, it is preferable that
+That is, the server may translate CMObjects into its local
+objects and push them onto the stack. It is preferable that
the composition of such a translation and its inverse is equal to the
-identity map. The translation scheme is called the phrase book of the
+identity map. The translation scheme is called the {\it phrase book} of the
server and it should be documented for each stack machine. In OpenXM,
-any message is private. In future we will provide a content
+any message is private to a connection. In future we will provide a content
dictionary (CD; see OpenMath \cite{openmath}) for basic specifications
of CMObjects.
In the following, \verb+ xxx_ + may be omitted if no confusion occurs.
As the names of functions and tags are long, one may use abbreviated
-names. Message packets are represented as follows. Each field is
-shown as \fbox{data type \quad data}. For example {\tt int32
-OX\_DATA} denotes a number {\tt OX\_DATA} which is represented by a 32
-bit network byte order. If a field is displayed by italic characters,
-it should be defined elsewhere or its meaning should be clear. For
-example {\it String commandName} denotes a local object {\it
-commandName} whose data type is String. Note that an object on the
-stack may have a local data type even if it is represented as CMO.
+names. Message packets are represented as follows.
+Each field is shown as \fbox{data type \quad data}. For example {\tt
+int32 OX\_DATA} denotes a number {\tt OX\_DATA} which is represented
+by a 32 bit integer with the network byte order. If a field is
+displayed by italic characters, it should be defined elsewhere or its
+meaning should be clear. For example {\it String commandName} denotes
+a local object {\it commandName} whose data type is String. Note that
+an object on the stack may have a local data type even if it is
+represented as CMO.
+
Any server stack machine has to implement the following operations.
+For each operation we show the states of the stack before and after
+the operation. In the figures the rightmost object corresponds to the
+top of the stack. Only the modified part of the stack are shown.
*/
\begin{enumerate}
\item
/*&jp
-CMObject/Basic0 ¤Î CMO ¥Ç¡¼¥¿¤Î¤¦¤Áɬ¿Ü¤Î¤â¤Î, {\tt CMO\_ERROR2}, {\tt
+CMObject/Primitive ¤Î CMO ¥Ç¡¼¥¿¤Î¤¦¤Áɬ¿Ü¤Î¤â¤Î, {\tt CMO\_ERROR2}, {\tt
CMO\_NULL}, {\tt CMO\_INT32}, {\tt CMO\_STRING}, {\tt CMO\_LIST}¤¬¤ª¤¯
¤é¤ì¤ÆÍ褿¾ì¹ç¤½¤ì¤ò¥¹¥¿¥Ã¥¯¤Ë push ¤¹¤ë. ¤¿¤È¤¨¤Ð, {\tt CMO\_NULL}
¤¢¤ë¤¤¤Ï {\tt CMO\_String} ¤Î¾ì¹ç¼¡¤Î¤è¤¦¤Ë¤Ê¤ë.
*/
/*&eg
-Any server should accept CMObjects in the group CMObject/Basic0.
+Any server should accept CMObjects in the group CMObject/Primitive.
The server pushes such data onto the stack.
The following examples show the states of the stack after receiving
{\tt CMO\_NULL} or {\tt CMO\_String} respectively.
@@ -140,9 +147,9 @@ Stack after the request:
\hline
\end{tabular}
-Result: none.
+Output: none.
-Request:
+Request:\\
\begin{tabular}{|c|c|c|c|c|c|} \hline
{\tt int32 OX\_DATA} & {\tt int32 CMO\_String} &{\tt int32} {\rm size}
&{\tt byte} {\rm s1} & $\cdots$ &{\tt byte} {\rm ssize}\\
@@ -155,10 +162,10 @@ Stack after the request:
\hline
\end{tabular}
-Result: none.
+Output: none.
//&jp CMO ¥Ç¡¼¥¿¤Î¼õ¤±¼è¤ê¤Ë¼ºÇÔ¤·¤¿»þ¤Î¤ß \\
-//&eg If the server fails to receive a CMO data,
+//&eg If the server fails to receive a CMO data,\\
\begin{tabular}{|c|c|c|} \hline
{\tt int32 OX\_DATA} & {\tt int32 CMO\_ERROR2} & {\it CMObject} ob\\
\hline
@@ -190,8 +197,8 @@ SM_mathcap
/*&jp
¤³¤Î¥µ¡¼¥Ð¤Î mathcap ¤ò¤â¤É¤¹ (termcap ¤Î¤Þ¤Í). ¥µ¡¼¥Ð¤Î¥¿¥¤¥×, ¥µ¡¼
¥Ð¥¹¥¿¥Ã¥¯¥Þ¥·¥ó¤ÎǽÎϤòÃΤ뤳¤È¤¬¤Ç¤¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï,
-mathCap ¤Î¹½Â¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤÎ
-¥Ý¥¤¥ó¥¿¤òÌ᤹. (open sm1 ¤Ç¤Ï {\tt struct mathCap} ¤òÍѤ¤¤Æ¤¤¤ë.
+mathcap ¤Î¹½Â¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤÎ
+¥Ý¥¤¥ó¥¿¤òÌ᤹. (open sm1 ¤Ç¤Ï {\tt struct mathcap} ¤òÍѤ¤¤Æ¤¤¤ë.
*/
/*&eg
It requests a server to push the mathcap of the server.
@@ -212,17 +219,17 @@ Stack after the request:
\hline
\end{tabular}
-Result: none.
+Output: none.
\item
\begin{verbatim}
-SM_setMathCap
+SM_setMathcap
\end{verbatim}
/*&jp
¼õ¤±¼è¤Ã¤¿ Mathcap {\tt m} ¤ò¼«Ê¬¤Î¥·¥¹¥Æ¥à¤ËÀßÄꤷ¤Æ, Áê¼ê¦¤¬Íý²òÉÔ
-ǽ¤Ê CMO ¤ò¤ª¤¯¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, mathCap ¤Î¹½
+ǽ¤Ê CMO ¤ò¤ª¤¯¤é¤Ê¤¤¤è¤¦¤Ë¤¹¤ë. C ¸À¸ì¤Ç¼ÂÁõ¤¹¤ë¾ì¹ç¤Ï, mathcap ¤Î¹½
¤ÂΤò¥·¥¹¥Æ¥àËè¤Ë¤¤á¤ë¤â¤Î¤È¤·,¤³¤Î´Ø¿ô¤Ï¤½¤Î¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò°ú
-¿ô¤È¤¹¤ë. (open sm1 ¤Ç¤Ï {\tt struct mathCap} ¤òÍѤ¤¤Æ¤¤¤ë.
+¿ô¤È¤¹¤ë. (open sm1 ¤Ç¤Ï {\tt struct mathcap} ¤òÍѤ¤¤Æ¤¤¤ë.
*/
/*&eg
It requests a server to register the peer's mathcap {\tt m} in the server.
@@ -230,14 +237,19 @@ The server can avoid to send OX messages unknown to it
*/
@plugin/mathcap.h)
+Stack before the request:
+\begin{tabular}{|c|} \hline
+{\it Mathcap m} \\
+\hline
+\end{tabular}\\
Request:
\begin{tabular}{|c|c|} \hline
{\tt int32 OX\_DATA} & {\sl Mathcap} m \\ \hline
-{\tt int32 OX\_COMMAND} & {\tt int32 SM\_setMathCap} \\
+{\tt int32 OX\_COMMAND} & {\tt int32 SM\_setMathcap} \\
\hline
\end{tabular}
-Result: none.
+Output: none.
/*&jp
\noindent
Ãí°Õ: mathcap ¤Ï°ìÈ̤˥¯¥é¥¤¥¢¥ó¥È¼çÂΤÇÀßÄꤹ¤ë.
@@ -246,14 +258,14 @@ Result: none.
¤½¤ì¤ò, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¤½¤Î¥µ¡¼¥Ð¤ËÉտ路¤¿ mathcap ¤È¤·¤Æ
ÀßÄꤹ¤ë.
¼¡¤Ë, ¥¯¥é¥¤¥¢¥ó¥È¤Ï¥µ¡¼¥Ð¤Ë¼«Ê¬¤Î mathcap ¤ò
-{\tt SM\_setMathCap} ¤Ç¤ª¤¯¤ê, ¼«Ê¬¤Î mathcap ¤òÀßÄꤵ¤»¤ë.
+{\tt SM\_setMathcap} ¤Ç¤ª¤¯¤ê, ¼«Ê¬¤Î mathcap ¤òÀßÄꤵ¤»¤ë.
*/
/*&eg
\noindent
Remark: In general the exchange of mathcaps is triggered by a client.
A client sends {\tt SM\_mathcap} to a server and obtains the server's
mathcap. Then the client registers the mathcap. Finally the client
-sends its own mathcap by {\tt SM\_setMathCap} and the server
+sends its own mathcap by {\tt SM\_setMathcap} and the server
registers it.
*/
@@ -273,13 +285,13 @@ OpenXM ¤Ç¤Ï, ¸½ºß¤Î¤È¤³¤í´Ø¿ô̾¤Îɸ½à²½¤Ï¤ª¤³¤Ê¤Ã¤Æ¤¤¤
/*&eg
It requests a server to pop a character string {\tt s}, to
parse it by the local parser of the stack machine, and
-to interprete by the local interpreter.
-If the exececution produces a result, it is pushed onto
+to interpret by the local interpreter.
+If the execution produces a Output, it is pushed onto
{\tt OperandStack}.
-If an error has occured, Error2 Object is pushed onto the stack.
+If an error has occurred, Error2 Object is pushed onto the stack.
OpenXM does not provide standard function names.
If this operation and {\tt SM\_popString} is implemented, the stack machine
-can be used as an OX server.
+is ready to be used as an OX server.
*/
Stack before the request:
@@ -295,11 +307,11 @@ Request:
\hline
\end{tabular}
-Result: none.
+Output: none.
/*&jp
\noindent
»²¹Í: \ ¼Â¹ÔÁ°¤Î¥¹¥¿¥Ã¥¯¤Î¥Ç¡¼¥¿¤Ï,
-{\it String commandString} ¤Ê¤ë local stackmachine ¤Î object ¤È¤·¤Æ¥¹
+{\it String commandString} ¤Ê¤ë local stack machine ¤Î object ¤È¤·¤Æ¥¹
¥¿¥Ã¥¯¾å¤Ë¤¢¤ë¤¬, TCP/IP ¤ÎÄÌ¿®Ï©¤Ç¤Ï, ¼¡¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¤¬¤Þ¤º¤Ê¤¬¤ì¤Æ
{\it commandName} ¤¬¥¹¥¿¥Ã¥¯¤Ë push ¤µ¤ì¤ë:
*/
@@ -325,7 +337,7 @@ SM_executeStringByLocalParserInBatchMode
/*&eg
This is the same request as {\tt SM\_executeStringByLocalParser}
except that it does not modify the stack. It pushes an Error2 Object
-if an error has occured.
+if an error has occurred.
*/
\item
\begin{verbatim}
@@ -342,8 +354,8 @@ It requests a server to pop an object from {\tt Operan
to convert it into a character string according to the output format
of the local system, and to send the character string via TCP/IP stream.
{\tt (char *)NULL} is returned when the stack is empty.
-The returned strings is sent as a CMO string data.
-{\tt CMO\_ERROR2} should be returned if an error has occured.
+The returned string is sent as a CMO string data.
+{\tt CMO\_ERROR2} should be returned if an error has occurred.
*/
Stack before the request:
@@ -358,7 +370,7 @@ Request:
\hline
\end{tabular}
-Result:
+Output:
\begin{tabular}{|c|c|c|} \hline
{\tt int32 OX\_DATA} & {\tt int32 CMO\_STRING} & {\it size and the string s} \\
\hline
@@ -397,7 +409,7 @@ Stack after the request:
\hline
\end{tabular}
-Result: none.
+Output: none.
\item
\begin{verbatim}
@@ -411,29 +423,58 @@ SM_dupErrors
It requests a server to push a list object containing all error objects on the stack.
*/
-Stack before the request:
-\begin{tabular}{|c|} \hline
-{\it Object} \\
+Request:
+\begin{tabular}{|c|c|} \hline
+{\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\
\hline
\end{tabular}
+Stack after the request:
+\begin{tabular}{|c|c|c|} \hline
+{\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\
+\hline
+\end{tabular}
+
+Output: none.
+
+\item
+\begin{verbatim}
+SM_pushCMOtag
+\end{verbatim}
+/*&jp
+¥¹¥¿¥Ã¥¯¤ÎÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤¬ CMO ¤ËÊÑ´¹¤µ¤ì¤¿¾ì¹ç¤Î CMO tag ¤ò
+{\tt CMO\_INT32} ¤È¤·¤Æ¥¹¥¿¥Ã¥¯¤Ø push ¤¹¤ë.
+ÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤Ï¥¹¥¿¥Ã¥¯¤Ëα¤Þ¤ë.
+ÀèƬ¥ª¥Ö¥¸¥§¥¯¥È¤òCMO ¤ØÊÑ´¹¤¹¤ëÊýË¡¤¬Ìµ¤¤¾ì¹ç¤Ï, ¥¨¥é¡¼ object ¤òÀѤà.
+*/
+/*&eg
+It requests a server to push the CMO tag of the top object on the server
+stack. The tag is pushed as {\tt CMO\_INT32}.
+The top object remains on the stack.
+If there is no way to translate the object into CMO,
+push an error object.
+*/
+
Request:
\begin{tabular}{|c|c|} \hline
-{\tt int32 OX\_COMMAND} & {\tt int32 SM\_dupErrors} \\
+{\tt int32 OX\_COMMAND} & {\tt int32 SM\_pushCMOtag} \\
\hline
\end{tabular}
Stack after the request:
\begin{tabular}{|c|c|c|} \hline
-{\tt int32 OX\_DATA} & {\sl CMObject} \ a list of errors\\
+{\tt int32 OX\_DATA} & {\sl CMO\_INT32} \ tag\\
\hline
\end{tabular}
-Result: none.
+Output: none.
\end{enumerate}
\medbreak
\noindent
+
+//&C \subsubsection{ MathCap } \label{subsubsection:mathcap}
+
/*&jp
{\bf Îã}: \
mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦¤ËÅú¤¨¤ë.
@@ -442,7 +483,7 @@ mathcap ¤ÎÌ䤤¹ç¤ï¤»¤ËÂФ·¤Æ, {\tt ox\_sm1} ¤Ï¼¡¤Î¤è¤¦
{\bf Example}: \
{\tt ox\_sm1} returns the following data as its mathcap.
*/
-%%Prog: [(cmoMathCap)] extension ::
+%%Prog: [(cmoMathcap)] extension ::
\begin{verbatim}
Class.mathcap
[ [199909080 , $Ox_system=ox_sm1.plain$ , $Version=2.990911$ ,
@@ -453,33 +494,137 @@ Class.mathcap
\end{verbatim}
/*&jp
-mathcap ¤Ï 3¤Ä¤ÎÍ×ÁǤò¤â¤Ä¥ê¥¹¥È¤Ç¤¢¤ë. ¤Þ¤Å, ºÇ½é¤ÎÍ×ÁǤò¸«¤è¤¦.
-Ox\_system ¤Ï open xxx ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤¥Ö¥é¥ê¤¬¤Á¤¬¤Ã¤Æ
+mathcap ¤Ï 3¤Ä°Ê¾å¤ÎÍ×ÁǤò¤â¤Ä¥ê¥¹¥È¤Ç¤¢¤ë. ¤Þ¤Å, ºÇ½é¤ÎÍ×ÁÇ(¤³¤ì¤â¥ê¥¹¥È)¤ò¸«¤è¤¦.
+¥ê¥¹¥È¤ÎÀèƬ¤Î¿ô»ú¤Ï OpenXM ¥×¥í¥È¥³¥ë¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤¢¤ë.
+Ox\_system ¤Ï openXM ¥·¥¹¥Æ¥à̾¤Ç¤¢¤ë. Æɤ߹þ¤à¥é¥¤¥Ö¥é¥ê¤¬¤Á¤¬¤Ã¤Æ
¤¤¤Æ, ´Ø¿ô̾(¤Þ¤¿¤Ï ¥·¥ó¥Ü¥ë)¤Î°ÕÌ£¤¬¤Á¤¬¤¦¤È¤¤Ï¤³¤Î̾Á°¤â¤«¤¨¤ë. ¤¿
¤È¤¨¤Ð, open math ¤Î basic content dictionary Âбþ¤Î´Ø¿ôÄêµÁ¥Þ¥¯¥í¤òÆÉ
-¤ß¤³¤ó¤À sm1 ¤Ï, ox\_sm1\_basicCD ¤Ê¤ë̾Á°¤Ë¤¹¤ë. HOSTTYPEÃͤÏ, CPU
+¤ß¤³¤ó¤À sm1 ¤Ï, ox\_sm1\_basicCD ¤Ê¤ë̾Á°¤Ë¤¹¤ë. HOSTTYPE ÃͤÏ, CPU
¤Î¼ïÎà¤ò¤¢¤é¤ï¤·unix ¤Ç¤Ï´Ä¶ÊÑ¿ô\verb+$HOSTTYPE+ ¤ÎÃͤǤ¢¤ë. 2 ÈÖÌÜ
¤ÎÍ×ÁÇ¤Ï ÍøÍѲÄǽ¤Ê SM ¥³¥Þ¥ó¥É¤ò¤¢¤Ä¤á¤¿¥ê¥¹¥È¤Ç¤¢¤ë. 3 ÈÖÌܤΥꥹ¥È
¤Ï, ½èÍý²Äǽ¤Ê¿ô³Ø¥Ç¡¼¥¿¤Î·Á¼°, ¤ª¤è¤ÓCMO¤Î¾ì¹ç¤Ê¤é½èÍý²Äǽ¤ÊCMO¤Î¥¿¥°
¤Î¥ê¥¹¥È¤¬Â³¤¯. ¾å¤ÎÎã¤Ç¤Ï, 514 ¤Ï {\tt OX\_DATA} ¤ò¤¢¤é¤ï¤·, ¿ô³Ø¥Ç¡¼
¥¿¤Î¥Õ¥©¥Þ¥Ã¥È¤Ï(¥µ¥¤¥º¾ðÊó¤Ê¤·¤Î) CMO ¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹.
+»ÍÈÖÌܤΥꥹ¥È¤Ï optinal ¤Ç, CMO string ¤Î¥ê¥¹¥È¤Ç¤¢¤ë.
+ʸ»úÎó¤Ï option̾, ¤Þ¤¿¤Ï option̾=ÃÍ, ¤Ê¤ë·Á¼°¤ÇÍ¿¤¨¤ë.
+option ̾¤Ï±Ñ¿ô»ú¤ª¤è¤Ó¥¢¥ó¥À¡¼¥Ð¡¼¤Çµ½Ò. = °Ê²¼¤Ï utf-8 ʸ»ú¥³¡¼¥É¤òÍøÍѤ·¤Æ¤è¤¤.
*/
/*&eg
-A mathcap has three components. The first one contains informations
-to identify the system and hosts on which the application runs.
-In the above example, Ox\_system denotes the system name.
-HOSTTYPE represents the OS type and taken from \verb+$HOSTTYPE+
+A mathcap has three or more than three components.
+The first one, which is also a list,
+contains informations
+to identify the version number of the OpenXM protocol,
+the system and hosts on which the application runs.
+In the above example, {\tt Ox\_system} denotes the system name.
+{\tt HOSTTYPE} represents the OS type and taken from \verb+$HOSTTYPE+
enviroment variable.
The second component consists of avaiable SM commands.
The third component is a list of pairs. Each pair consists
-of an OX message tag and the available message tags.
+of an OX message tag and the list of available message tags.
Again in the above example, 514 is the value of {\tt OX\_DATA}
and it indicates that the server accepts CMO (without size information)
as mathematical data messages. In this case the subsequent
list represents available CMO tags.
+The fourth list is optinal.
+This is a list of cmo strings.
+Each string has the formats ``an option name'' or ``an optionname=value''.
+The option name must consists only of alphabets, numbers, and under bars.
+The symbol = may be followed by a string in the utf-8 character codes.
*/
+/*&C
+\noindent
+OpenXM/XML expression of the example above:
+\begin{verbatim}
+
+
+
+
+ 4
+ 001001003
+ Ox_system=ox_sm1.plain
+ Version=2.990911
+ HOSTTYPE=i386
+
+
+
+ 11
+ 262
+ 263
+ ...
+
+
+
+ 2
+
+ 1
+ 514
+
+
+ 21
+ 2130706434
+ 1
+ ....
+
+
+
+
+
+\end{verbatim}
+*/
+
+/*&C
+\noindent
+Example of the use of the fourth argument (optional parameter).
+\begin{verbatim}
+
+
+
+
+ 4
+ 001001003
+ Ox_system=ox_sm1.plain
+ Version=2.990911
+ HOSTTYPE=i386
+
+
+
+ 11
+ 262
+ 263
+ ...
+
+
+
+ 2
+
+ 1
+ 514
+
+
+ 21
+ 2130706434
+ 1
+ ....
+
+
+
+
+ 2
+ no_ox_reset
+ opt_sample=Hello world.
+
+
+
+
+\end{verbatim}
+*/
+
\medbreak
+
+//&jp \subsubsection{ Îã }
+//&eg \subsubsection{ Examples }
+
\noindent
//&jp {\bf Îã}: \
//&eg {\bf Example}: \
@@ -549,8 +694,8 @@ Each data has the following meaning.
(OX\_DATA, (CMO\_STRING, 7, "12345 ;")).
\end{enumerate}
-//&jp \subsubsection{¥°¥ë¡¼¥× SMobject/Basic1 ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿}
-//&eg \subsubsection{Operators in the group SMobject/Basic1}
+//&jp \subsubsection{¥°¥ë¡¼¥× SMobject/Basic ¤Ë°¤¹¤ë¥ª¥Ú¥ì¡¼¥¿}
+//&eg \subsubsection{Operators in the group SMobject/Basic}
\begin{enumerate}
\item
@@ -558,18 +703,18 @@ Each data has the following meaning.
SM_pops
\end{verbatim}
/*&jp
-operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn})
+operand stack ¤è¤ê, {\it n} ¸Ä¤Î¸µ ({\it obj1, obj2, $\ldots$, objn}
¤ò pop ¤·¤Æ¼Î¤Æ¤ë.
*/
/*&eg
It requests a server to pop {\it n} and to discard elements {\it obj1, obj2,
-$\ldots$, objn}) from the stack.
+$\ldots$, objn} from the stack.
*/
-//&jp Stack before the request: (±¦¤¬ stack ¤Î¥È¥Ã¥×¤Ç¤¢¤ë.) \\
-//&eg Stack before the request: (The rightmost one is the top of the stack.) \\
+//&jp Stack before the request: \\
+//&eg Stack before the request: \\
\begin{tabular}{|c|c|c|c|c|} \hline
-{\it obj1} & {\it obj2} & $\cdots$ & {\it objn} &{\it INT32 n} \\
+{\it obj1} & {\it obj2} & $\cdots$ & {\it objn} &{\it Integer32 n} \\
\hline
\end{tabular}
@@ -579,7 +724,7 @@ Request:
\hline
\end{tabular}
-Result: none.
+Output: none.
\item
@@ -594,11 +739,12 @@ bind ¤¹¤ë. Àµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê¤é -1 ¤ò¤â¤É¤
*/
/*&eg
It requests a server to pop {\it name}, to pop {\it obj}, and to
-bind {\it obj} to a variable {\it name} in the current name space.
-If an error has occured {\tt CMO\_ERROR2} is pushed to the stack.
+bind {\it obj} to a variable {\it name} in the current name space
+of the server.
+If an error has occurred {\tt CMO\_ERROR2} is pushed onto the stack.
*/
-//&jp Stack before the request: (±¦¤¬ stack ¤Î top.)
-//&eg Stack before the request: (The rightmost one is the top of the stack.)
+//&jp Stack before the request:
+//&eg Stack before the request:
\begin{tabular}{|c|c|} \hline
{\it obj} & {\it String name} \\
\hline
@@ -610,7 +756,7 @@ Request:
\hline
\end{tabular}
-Result: none.
+Output: none.
\item
\begin{verbatim}
@@ -619,20 +765,20 @@ SM_evalName
/*&jp
¸½ºß¤Î̾Á°¶õ´Ö¤ÇÊÑ¿ô {\it name} ¤òɾ²Á¤¹¤ë. ɾ²Á¤Î·ë²Ì {\it
-resultObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê
+OutputObj} ¤ò¥¹¥¿¥Ã¥¯¤ØÌ᤹. ´Ø¿ô¼«ÂΤÏÀµ¾ï½ªÎ»¤Ê¤é 0 ¤ò, °Û¾ï½ªÎ»¤Ê
¤é -1 ¤ò¤â¤É¤¹. TCP/IP ¤Î¾ì¹ç, °Û¾ï½ªÎ»¤Î¾ì¹ç¤Î¤ß {\tt CMO\_ERROR2}
¤ò stack ¤Ø push ¤¹¤ë.
*/
/*&eg
It requests a server to pop {\it name} and to evaluate a variable
-{\it name} in the current name space. The result of the evaluation
-{\it resultObj} is pushed to the stack.
-If an error has occured {\tt CMO\_ERROR2} is pushed to the stack.
+{\it name} in the current name space. The Output of the evaluation
+{\it OutputObj} is pushed to the stack.
+If an error has occurred {\tt CMO\_ERROR2} is pushed onto the stack.
*/
-//&jp Stack before the request: (±¦¤¬ stack ¤Î top.)
-//&eg Stack before the request: (The rightmost one is the top of the stack.)
+//&jp Stack before the request:
+//&eg Stack before the request:
\begin{tabular}{|c|} \hline
{\it String name} \\
\hline
@@ -644,14 +790,14 @@ Request:
\hline
\end{tabular}
-//&jp Stack after the request: (±¦¤¬ stack ¤Î top.)
-//&eg Stack after the request: (The rightmost one is the top of the stack.)
+//&jp Stack after the request:
+//&eg Stack after the request:
\begin{tabular}{|c|} \hline
-{\it resultObj} \\
+{\it OutputObj} \\
\hline
\end{tabular}
-Result: none.
+Output: none.
\item
\begin{verbatim}
@@ -667,11 +813,11 @@ It requests a server to pop {\it s} as a function name
to pop {\it n} as the number of arguments and to execute
a local function {\it s} with {\it n} arguments popped from
the stack.
-If an error has occured {\tt CMO\_ERROR2} is pushed to the stack.
+If an error has occurred {\tt CMO\_ERROR2} is pushed to the stack.
*/
-//&jp Stack before the request: (±¦¤¬ stack ¤Î top.) \\
-//&eg Stack before the request: (±¦¤¬ stack ¤Î top.) \\
+//&jp Stack before the request: \\
+//&eg Stack before the request: \\
\begin{tabular}{|c|c|c|c|c|} \hline
{\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it String s} \\
\hline
@@ -684,9 +830,9 @@ Request:
\end{tabular}
//&jp Stack after the request: ´Ø¿ô¼Â¹Ô¤Î·ë²Ì.
-//&eg Stack after the request: The result of the execution.
+//&eg Stack after the request: The Output of the execution.
-Result: none.
+Output: none.
\item
\begin{verbatim}
@@ -730,11 +876,57 @@ Request:
\hline
\end{tabular}
-Result:
+Output:
\begin{tabular}{|c|c|} \hline
{\tt int32 OX\_DATA} & {\it Serialized CMO} \\
\hline
\end{tabular}
+
+
+\item
+\begin{verbatim}
+SM_executeFunctionWithOptionalArgument
+\end{verbatim}
+/*&jp
+¥¹¥¿¥Ã¥¯¤è¤ê {\it n} ¸Ä¤Î¥Ç¡¼¥¿¤ª¤è¤Ó°ì¤Ä¤Î optional °ú¿ô {\it opt} ¤ò pop ¤·¤Æ,
+¥µ¡¼¥Ð¤Î¥í¡¼¥«¥ë´Ø¿ô{\it s} ¤ò¼Â¹Ô¤¹¤ë. ¥¨¥é¡¼¤Î¤È¤¤Î¤ß {\tt CMO\_ERROR2} ¤ò stack ¤Ø push ¤¹
+¤ë.
+{\it opt} ¤Ï¥¡¼¥ï¡¼¥É¤ÈÃͤΥꥹ¥È¤Î¥ê¥¹¥È¤Ç¤¢¤ë. ¥¡¼¥ï¡¼¥É¤Ïʸ»úÎ󷿤Ǥ¢¤ë.
+*/
+/*&eg
+It requests a server to pop {\it s} as a function name,
+to pop an optional argument {\it opt},
+to pop {\it n} as the number of arguments and to execute
+a local function {\it s} with {\it n} arguments popped from
+the stack.
+If an error has occurred {\tt CMO\_ERROR2} is pushed to the stack.
+{\it opt} is a list of lists of a keyword and a value.
+Keywords are strings.
+*/
+
+//&jp Stack before the request: \\
+//&eg Stack before the request: \\
+\begin{tabular}{|c|c|c|c|c|c|} \hline
+{\it objn} & $\cdots$ & {\it obj1} & {\it INT32 n} & {\it Obj opt} & {\it String s} \\
+\hline
+\end{tabular}
+
+Request:
+\begin{tabular}{|c|c|} \hline
+{\tt int32 OX\_COMMAND} & {\tt int32 SM\_executeFunctionWithOptionalArgument} \\
+\hline
+\end{tabular}
+
+//&jp Stack after the request: ´Ø¿ô¼Â¹Ô¤Î·ë²Ì.
+//&eg Stack after the request: The Output of the execution.
+
+Output: none.
+
+\noindent
+Example of {\it opt} : \verb@ (("p", 13),("vars",("x","y")))@
+
+\noindent
+[Added in 2004-3-8]
\end{enumerate}