functions in std.i - i

 
i86_primitives

    i86_primitives, file  


sets FILE primitive data types to be native to Linux i86 machines.  
Interpreted function, defined at i0/std.i   line 2929  

 

im_part

    im_part(z)  


returns the imaginary part of its argument.  
Unlike z.im, works if z is not complex (returns zero).  
Interpreted function, defined at i0/std.i   line 749  

 

include

    #include "yorick_source.i"  
    require, filename  
    include, filename  
 or include, filename, now  


#include is a parser directive, not a Yorick statement.  Use it  
to read Yorick source code which you have saved in a file; the  
file yorick_source.i will be read one line at a time, exactly as  
if you had typed those lines at the keyboard.  The following  
directories are searched (in this order) to find yorick_source.i:  
   .               (current working directory)  
   ~/yorick        (your personal directory of Yorick functions)  
   ~/Yorick        (your personal directory of Yorick functions)  
   Y_SITE/i        (Yorick distribution library)  
   Y_SITE/contrib  (contributed source at your site)  
   Y_SITE/i0       (Yorick startup and package include files)  
   Y_HOME/lib      (Yorick architecture dependent include files)  
To find out what is available in the Y_SITE/i directory,  
type:  
    library  
You can also type  
    Y_SITE  
to find the name of the site directory at your site, go to the  
include or contrib subdirectory, and browse through the *.i files.  
This is a good way to learn how to write a Yorick program.  Be  
alert for files like README as well.  
The require function checks to see whether FILENAME has already  
been included (actually whether any file with the same final  
path component has been included).  If so, require is a no-op,  
otherwise, the action is the same as the include function with  
NOW == 1.  
The include function causes Yorick to parse and execute FILENAME  
immediately.  The effect is similar to the #include parser  
directive, except the finding, parsing, and execution of FILENAME  
occurs at runtime.  The NOW argument has the following meanings:  
  NOW == -1   filename pushed onto stack, popped and parsed  
              when all pending input is exhausted  
  NOW == 0    (or nil, default) parsed just before next input  
              line would be parsed  
  NOW == 1    parsed immediately, resuming current interpreted  
              program when finished (like require)  
  NOW == 2    like 0, except no error if filename does not exist  
  NOW == 3    like 1, except no error if filename does not exist  
Unless you are writing a startup file, or have some truly bizarre  
technical reason for using the include function, use #include  
instead.  The functional form of include may involve recursive  
parsing, which you will not be able to understand without deep  
study.  Stick with #include.  
Builtin function, documented at i0/std.i   line 2254  

SEE ALSO: set_path,   Y_SITE,   plug_in,   autoload,   include_all  
 
 
 

include_all

    include_all, dir1, dir2, ...  


include all files in directories DIR1, DIR2, ..., with names  
ending in the ".i" extension.  (This is mostly for use to load  
the i-start directories when yorick starts; see i0/stdx.i.)  
If any of the DIRi do not exist, or are empty, they are  
silently skipped.  Filenames beginning with "." are also skipped,  
even if they end in ".i".  The files are included in alphabetical  
order, DIR1 first, then DIR2, and so on.  
Interpreted function, defined at i0/std.i   line 2313  

SEE ALSO: include,   autoload  
 
 
 

indgen

    indgen(n)  
 or indgen(start:stop)  
 or indgen(start:stop:step)  


returns "index generator" list -- an array of longs running from  
1 to N, inclusive.  In the second and third forms, the index  
values specified by the index range are returned.  
Builtin function, documented at i0/std.i   line 1084  

SEE ALSO: span,   spanl,   array  
 
 
 

info

    info, expr  


prints the data type and array dimensions of EXPR.  
Interpreted function, defined at i0/std.i   line 157  

SEE ALSO: help,   print  
 
 
 

install_struct

    install_struct, file, struct_name  
 or install_struct, file, struct_name, size, align, order  
 or install_struct, file, struct_name, size, align, order, layout  


installs the data type named STRUCT_NAME in the binary FILE.  In  
the two argument form, STRUCT_NAME must have been built by one or  
more calls to the add_member function.  In the 5 and 6 argument calls,  
STRUCT_NAME is a primitive data type -- an integer type for the 5  
argument call, and a floating point type for the 6 argument call.  
The 5 argument form may also be used to declare opaque data types.  
SIZE is the size of an instance in bytes, ALIGN is its alignment  
boundary (also in bytes), and ORDER is the byte order.  ORDER is  
1 for most significant byte first, -1 for least significant byte  
first, and 0 for opaque (unconverted) data.  Other ORDER values  
represent more complex byte permutations (2 is the byte order for  
VAX floating point numbers).  If ORDER equals SIZE, then the data  
type is not only opaque, but also must be read sequentially.  
LAYOUT is an array of 7 long values parameterizing the floating  
point format, [sign_address, exponent_address, exponent_size,  
mantissa_address, mantissa_size, mantissa_normalized, exponent_bias]  
(the addresses and sizes are in bits, reduced to MSB first order).  
Use, e.g., nameof(float) for STRUCT_NAME to redefine the meaning  
of the float data type for FILE.  
Builtin function, documented at i0/std.i   line 3376  

SEE ALSO: add_variable,   add_member  
 
 
 

integ

    integ(y, x, xp)  
 or integ(y, x, xp, which)  


See the interp function for an explanation of the meanings of the  
arguments.  The integ function returns ypi which is the integral  
of the piecewise linear curve (X(i), Y(i)) (i=1, ..., numberof(X))  
from X(1) to XP.  The curve (X, Y) is regarded as constant outside  
the bounds of X.  Note that X must be monotonically increasing or  
Builtin function, documented at i0/std.i   line 1197  

SEE ALSO: interp,   digitize,   span  
 
 
 

interp

    interp(y, x, xp)  
 or interp(y, x, xp, which)  


returns yp such that (XP, yp) lies on the piecewise linear curve  
(X(i), Y(i)) (i=1, ..., numberof(X)).  Points beyond X(1) are set  
to Y(1); points beyond X(0) are set to Y(0).  The array X must be  
one dimensional, have numberof(X)>=2, and be either monotonically  
increasing or monotonically decreasing.  The array Y may have more  
than one dimension, but dimension WHICH must be the same length as  
X.  WHICH defaults to 1, the first dimension of Y.  WHICH may be  
non-positive to count dimensions from the end of Y; a WHICH of 0  
means the final dimension of Y.  The result yp has dimsof(XP)  
in place of the WHICH dimension of Y (if XP is scalar, the WHICH  
dimension is not present).  (The dimensions of the result are the  
same as if an index list with dimsof(XP) were placed in slot  
WHICH of Y.)  
Builtin function, documented at i0/std.i   line 1178  

SEE ALSO: integ,   digitize,   span  
 
 
 

is_array

    is_array(object)  


returns 1 if OBJECT is an array data type (as opposed to a function,  
structure definition, index range, I/O stream, etc.), else 0.  
An array OBJECT can be written to or read from a binary file;  
non-array Yorick data types cannot.  
Builtin function, documented at i0/std.i   line 506  

SEE ALSO: is_func,   is_void,   is_range,   is_struct,   is_stream  
 
 
 

is_func

    is_func(object)  


returns 1 if OBJECT is a Yorick interpreted function, 2 if OBJECT  
is a built-in (that is, compiled) function, 3 if OBJECT is an  
autoload (will become either 1 or 2 on reference), else 0.  
Builtin function, documented at i0/std.i   line 515  

SEE ALSO: is_array,   is_void,   is_range,   is_struct,   is_stream,   autoload  
 
 
 

is_range

    is_range(object)  


returns 1 if OBJECT is an index range (e.g.-  3:5 or 11:31:2),  
else 0.  
Builtin function, documented at i0/std.i   line 530  

SEE ALSO: is_array,   is_func,   is_void,   is_struct,   is_stream  
 
 
 

is_stream

    is_stream(object)  


returns 1 if OBJECT is a binary I/O stream (usually a file), else 0.  
The _read and _write functions work on object if and only if  
is_stream returns non-zero.  Note that is_stream returns 0 for a  
text stream -- you need the typeof function to test for those.  
Builtin function, documented at i0/std.i   line 544  

SEE ALSO: is_array,   is_func,   is_void,   is_range,   is_struct  
 
 
 

is_struct

    is_struct(object)  


returns 1 if OBJECT is the definition of a Yorick struct, else 0.  
Thus, is_struct(double) returns 1, but is_struct(1.0) returns 0.  
Builtin function, documented at i0/std.i   line 537  

SEE ALSO: is_array,   is_func,   is_void,   is_range,   is_stream  
 
 
 

is_void

    is_void(object)  


returns 1 if OBJECT is nil (the one instance of the void data type),  
else 0.  
Builtin function, documented at i0/std.i   line 523  

SEE ALSO: is_array,   is_func,   is_range,   is_struct,   is_stream