Artifact 40464a18ab67936e09bb0cfa63b90e6734d11384859ceaac94fdd53da321c009:
- Executable file
r37/lisp/csl/html/r37_0196.html
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1533) [annotate] [blame] [check-ins using] [more...]
<A NAME=INFIX> <TITLE>INFIX</TITLE></A> <b><a href=r37_idx.html>INDEX</a></b><p><p> <B>INFIX</B> _ _ _ _ _ _ _ _ _ _ _ _ <B>declaration</B><P> <P> <P> <P> <em>infix</em>declares identifiers to be infix operators. <P> <H3> syntax: </H3> <P> <P> <em>infix</em><identifier>{,<identifier>}* <P> <P> <P> <identifier> can be any valid REDUCE identifier, which has not already been declared an operator, array or matrix, and is not reserved by the system. <P> <P> <P> <H3> examples: </H3> <P><PRE><TT> infix aa; for all x,y let aa(x,y) = cos(x)*cos(y) - sin(x)*sin(y); x aa y; COS(X)*COS(Y) - SIN(X)*SIN(Y) pi/3 aa pi/2; SQRT(3) - ------- 2 aa(pi,pi); 1 </TT></PRE><P>A <A HREF=r37_0199.html>let</A> statement must be used to attach functionality to the operator. Note that the operator is defined in prefix form in the <em>let</em> statement. After its definition, the operator may be used in either prefix or infix mode. The above operator aa finds the cosine of the sum of two angles by the formula <P> <P> cos(x+y) = cos(x)*cos(y) - sin(x)*sin(y). <P> <P> Precedence may be attached to infix operators with the <A HREF=r37_0213.html>precedence</A> declaration. <P> <P> User-defined infix operators may be used in prefix form. If they are used in infix form, a space must be left on each side of the operator to avoid ambiguity. Infix operators are always binary. <P> <P> <P>