comterp(1)
NAME
comterp - distributed command interpreter demonstrator
SYNOPSIS
comterp comterp remote comterp server 'portnum' comterp logger 'portnum' comterp client 'host' 'portnum' ['file'] comterp telcat 'host' 'portnum' ['file'] comterp run 'file'
DESCRIPTION
Arrayables can be created on the fly with an assignment operator (i.e
"ball=1" creates a integer "ball" variable set to 1). Unterminated expressions cause an automatic command line extension (until the parser determines the expression is complete). "(),
"{}", and "[]" can all be used interchangeably.
COMMAND OPTIONS
comterp
Arraycomterp remote
Arraymode.
comterp server 'portnum'
Arrayconnection.
comterp logger 'portnum'
Arraynewlines. For debugging purposes, not really a use of the interpreter.
comterp client 'host' 'portnum' ['file']
Arrayuse of the interpreter.
comterp telcat 'host' 'portnum' ['file']
Arraycomterp run 'file'
Run contents of file then exit.
OPERATOR TABLE
- Array; seq 10 L-to-R bi
- nary
MATHEMATICAL COMMANDS:
n=min(a b) -- return minimum of a and b
n=max(a b) -- return maximum of a and b
n=abs(a) -- return absolute value of a
Arraydbl=log(x) -- returns the natural logarithm of x
dbl=log10(x) -- returns the base-10 logarithm of x
Arraydbl=acos(x) -- returns the arc cosine of x in radians
dbl=asin(x) -- returns the arc sine of x in radians
dbl=atan(x) -- returns the arc tangent of x in radians
dbl=atan2(y x) -- returns the arc tangent of y over x
dbl=cos(x) -- returns the cosine of x radians
dbl=sin(x) -- returns the sine of x radians
dbl=tan(x) -- returns the tangent of x radians
dbl=sqrt(x) -- returns square root of x
dbl=pi() -- returns the value of pi
dbl=radtodeg(dbl) -- convert radians to degrees
dbl=degtorad(dbl) -- convert degrees to radians
Arraynum=round(num) -- return closest integer value
AFFINE TRANSFORM AND MATRIX COMMANDS:
Arraymatrix=xpose(matrix) -- transpose an arbitrary matrix
matrix=matrix*matrix -- matrix multiplication
STATISTICAL/RANDOM COMMANDS:
sum(val1[,val2[,...,valn]]) -- return sum of values
mean(val1[,val2[,...,valn]]) -- return mean of values
var(val1[,val2[,...,valn]]) -- return variance of values
Arraysrand(seedval) -- seed random number generator
LIST COMMANDS:
Arraynum=size(list|attrlist) -- return size of a list
STREAM COMMANDS:
val=next(stream) -- return next value from stream
strm=stream(ostrm|list) -- copy stream or convert list
- cnt=each(strm) -- traverse the stream returning its
- length
CONTROL COMMANDS (using post evaluation):
- Arrayval=while([testexpr [bodyexpr]] :nilchk :until :body expr
- ) -- while loop
OTHER COMMANDS
Arrayval=trace([flag] :get) -- toggle or set trace mode
Array[str]=print(val :string|:str :err) -- print value
Arraybool=eq(str1 str2 :n len) -- partial string comparison
bool=eq(sym1 sym2 :sym) -- symbol comparison
Arraydotlst=dot(name) -- construct empty dotted pair list
quit() -- quit the interpreter
exit() -- exit entire application
val=run(filename) -- run commands from file
Arrayval=shell(cmdstr) -- evaluate command in shell
nil([...]) -- accept any arguments and return nil
c=char(num) -- convert any numeric to a char
s=short(num) -- convert any numeric to a short
i=int(num) -- convert any numeric to an int
l=long(num) -- convert any numeric to a long
f=float(num) -- convert any numeric to a float
d=double(num) -- convert any numeric to a double
- Arraysym|lst=class(val [val ...]) -- return class symbol(s)
- for value(s) of object type
ONLY IN SERVER MODE
- str=timeexpr(comstr :sec n) -- command string to execute
- at intervals
SEE ALSO
comdraw
WEB PAGES
- http://www.ivtools.org/ivtools/comterp.html