home *** CD-ROM | disk | FTP | other *** search
/ Math Solutions 1995 October / Math_Solutions_CD-ROM_Walnut_Creek_October_1995.iso / pc / mac / docs_1 / std.doc < prev    next >
Encoding:
Text File  |  1995-07-17  |  109.1 KB  |  2,411 lines

  1.  
  2.  
  3.  
  4.                           Yorick Documentation
  5.                 for functions, variables, and structures
  6.                          defined in file std.i
  7.                    Printed: Sat Mar 18 22:51:20 1995
  8.  
  9.    Contents:
  10.  
  11.    _                   dbauto              legal               set_path
  12.    _init_clog          dbcont              library             show
  13.    _init_pdb           dbdis               log                 sign
  14.    _jc                 dbexit              log10               sin
  15.    _jr                 dbinfo              mac_primitives      sinh
  16.    _jt                 dbret               macl_primitives     sizeof
  17.    _not_cdf            dbskip              max                 sort
  18.    _not_pdb            dbup                median              span
  19.    _read               dec_primitives      merge               spanl
  20.    _set_pdb            digitize            merge2              sqrt
  21.    _write              dimsof              min                 sread
  22.    abs                 disassemble         nallof              strlen
  23.    acos                dump_clog           nameof              strmatch
  24.    add_member          edit_times          noneof              strpart
  25.    add_next_file       error               numberof            strtok
  26.    add_record          exit                open                struct_align
  27.    add_variable        exp                 open102             structof
  28.    allof               floor               openb               sum
  29.    am_subroutine       get_addrs           openb_hooks         sun3_primitives
  30.    anyof               get_argv            orgsof              sun_primitives
  31.    area                get_cwd             pc_primitives       swrite
  32.    array               get_env             pi                  symbol_def
  33.    asin                get_home            poly                symbol_set
  34.    asinh               get_member          pr1                 system
  35.    at_pdb_close        get_ncycs           print               tan
  36.    at_pdb_open         get_times           print_format        tanh
  37.    atan                get_vars            process_argv        timer
  38.    avg                 grow                ptcen               timer_print
  39.    backup              has_records         quit                timestamp
  40.    batch               help                random              transpose
  41.    bookmark            histogram           random_seed         typeof
  42.    call                include             randomize           uncen
  43.    cd                  indgen              rdline              updateb
  44.    ceil                info                read                use_origins
  45.    close               install_struct      read_clog           vax_primitives
  46.    close102            integ               read_n              vaxg_primitives
  47.    close102_default    interp              recover_file        volume
  48.    collect             is_array            remove              warranty
  49.    conj                is_func             rename              where
  50.    copyright           is_range            require             where2
  51.    cos                 is_stream           reshape             write
  52.    cosh                is_struct           restore             xdr_primitives
  53.    cray_primitives     is_void             save                yorick_stats
  54.    create              jc                  sech                zncen
  55.    createb             jr                  set_blocksize
  56.    data_align          jt                  set_filesize
  57.  
  58.                                                          FROM _ TO _not_pdb
  59.  
  60.                                                                           _
  61.     /* SEE grow     */
  62.  
  63.                                                                  _init_clog
  64. /* DOCUMENT _init_clog, file
  65.      initializes a Clog binary file.  Used after creating a new file --
  66.      must be called AFTER the primitive data formats have been set.
  67.  */
  68.  
  69.                                                                   _init_pdb
  70. /* DOCUMENT _init_pdb, file, at_pdb_close
  71.             _set_pdb, file, at_pdb_close
  72.      initializes a PDB binary file.  Used after creating a new file --
  73.      must be called AFTER the primitive data formats have been set.
  74.      The _set_pdb call only sets the CloseHook, on the assumption that
  75.      the file header has already been written (as in recover_file).
  76.    SEE ALSO: createb, recover_file, at_pdb_close
  77.  */
  78.  
  79.                                                                         _jc
  80.     /* SEE _jr     */
  81.  
  82.                                                                         _jr
  83. /* DOCUMENT _jt, file, time
  84.             _jc, file, ncyc
  85.         _jr, file
  86.      are raw versions of jt and jc provided to simplify redefining
  87.      the default jt and jc functions to add additional features.
  88.      For example, you could redefine jt to jump to a time, then
  89.      plot something.  The new jt can pass its arguments along to
  90.      _jt, then call the appropriate plotting functions.
  91.      There is a raw version of jr as well.
  92.  */
  93.  
  94.                                                                         _jt
  95.     /* SEE _jr     */
  96.  
  97.                                                                    _not_cdf
  98. /* DOCUMENT _not_cdf(file)
  99.      is like _not_pdb, but for netCDF files.
  100.  */
  101.  
  102.                                                                    _not_pdb
  103. /* DOCUMENT _not_pdb(file, familyOK)
  104.      returns 1 if FILE is not a PDB file, otherwise returns 0 after
  105.      setting the structure and data tables, and cataloguing any
  106.      history records.  Used to open an existing file.  Also detects
  107.      a file with an appended Clog description.
  108.      Before calling _not_pdb, set the variable yPDBopen to the value
  109.      of at_pdb_open you want to be in force.  (For historical reasons
  110.      -- in order to allow for the open102 keyword to openb -- _not_pdb
  111.      looks at the value of the variable yPDBopen, rather than at_pdb_open
  112.      directly.)
  113.  */
  114.  
  115.                                                    FROM _read TO add_member
  116.  
  117.                                                                       _read
  118. /* DOCUMENT _write, file, address, expression
  119.             _read, file, address, variable
  120.      or nbytes= _read(file, address, variable);
  121.      are low level read and write functions which do not "see" the
  122.      symbol table for the binary FILE.  The ADDRESS is the byte address
  123.      at which to begin the write or read operation.  The type and number
  124.      of objects of the EXPRESSION or VARIABLE determines how much data
  125.      to read, and what format conversion operations to apply.  In the
  126.      case of type char, no conversion operations are ever applied, and
  127.      _read will return the actual number of bytes read, which may be
  128.      fewer than the number implied by VARIABLE in this one case.
  129.      (In all other cases, _read returns numberof(VARIABLE).)
  130.      If the FILE has records, the ADDRESS is understood to be in the
  131.      file family member in which the current record resides.
  132.    SEE ALSO: openb, createb, updateb, save, restore
  133.  */
  134.  
  135.                                                                    _set_pdb
  136.     /* SEE _init_pdb     */
  137.  
  138.                                                                      _write
  139.     /* SEE _read     */
  140.  
  141.                                                                         abs
  142. /* DOCUMENT abs(x)
  143.          or abs(x, y, z, ...)
  144.      returns the absolute value of its argument.
  145.      In the multi-argument form, returns sqrt(x^2+y^2+z^2+...).
  146.   SEE ALSO: sign, sqrt, also note the rms range function
  147.  */
  148.  
  149.                                                                        acos
  150. /* DOCUMENT acos(x)
  151.      returns the inverse cosine of its argument, range [0, pi].
  152.   SEE ALSO: sin, cos, tan, asin, acos, atan
  153.  */
  154.  
  155.                                                                  add_member
  156. /* DOCUMENT add_member, file, struct_name, offset, name, type, dimlist
  157.      adds a member to a data type in the file FILE.  The data type name
  158.      (struct name) is STRUCT_NAME, which will be created if it does
  159.      not already exist.  The new member will be at OFFSET (in bytes)
  160.      from the beginning of an instance of this structure, and will
  161.      have the specified NAME, TYPE, and DIMLIST.  Use OFFSET -1 to
  162.      have add_member compute the next available offset in the structure.
  163.      The TYPE can be either a structure definition, or a string naming
  164.      a previously defined data type in FILE.  The optional DIMLIST is
  165.      as for the "array" function.
  166.      The STRUCT_NAME built from a series of add_member calls cannot be
  167.      used until it is installed with install_struct.
  168.      This function should be used very sparingly, mostly in code which
  169.      is building the structure of a foreign-format binary file.
  170.    SEE ALSO: add_variable, install_struct, struct_align
  171.  */
  172.  
  173.                                          FROM add_next_file TO add_variable
  174.  
  175.                                                               add_next_file
  176. /* DOCUMENT failure= add_next_file(file, filename, create_flag)
  177.      adds the next file to the FILE, which must contain history records.
  178.      If FILENAME is non-nil, the new file will be called that, otherwise
  179.      the next sequential filename is used.  If CREATE_FLAG is present
  180.      and non-zero, the new file will be created if it does not already
  181.      exist.  If omitted or nil, CREATE_FLAG defaults to 1 if the file has
  182.      write permission and 0 if it does not.
  183.      Returns 0 on success.
  184.    SEE ALSO: openb, updateb, createb, add_record
  185.  */
  186.  
  187.                                                                  add_record
  188. /* DOCUMENT add_record, file, time, ncyc
  189.          or add_record, file, time, ncyc, address
  190.          or add_record, file
  191.      adds a new record to FILE corresponding to the specified TIME and
  192.      NCYC (respectively a double and a long).  Either or both TIME
  193.      and NCYC may be nil or omitted, but the existence of TIME and
  194.      NCYC must be the same for every record added to one FILE.
  195.      If present, ADDRESS specifies the disk address of the new record,
  196.      which is assumed to be in the current file.  Without ADDRESS, or
  197.      if ADDRESS<0, the next available address is used; this may create
  198.      a new file in the family (see the set_filesize function).
  199.      The add_record function leaves the new record current
  200.      for subsequent save commands to actually write the data.
  201.  
  202.      The TIME, NCYC, and ADDRESS arguments may be equal length vectors
  203.      to add several records at once; in this case, the first of the
  204.      newly added records is the current one.  If all three of TIME,
  205.      NCYC, and ADDRESS are nil or omitted, no new records are added,
  206.      but the file becomes a record file if it was not already, and in
  207.      any case, no record will be the current record after such an
  208.      add_record call.
  209.  
  210.      After the first add_record call (even if no records were added),
  211.      subsequent add_variable commands will create record variables.
  212.      After the first record has been added, subsequent save commands
  213.      will create any new variables as record variables.
  214.      After a second record has been added using add_record, neither
  215.      save commands nor add_variable commands may be used to introduce
  216.      any new record variables.
  217.    SEE ALSO: save, createb, updateb, openb, set_filesize, set_blocksize
  218.              add_variable
  219.  */
  220.  
  221.                                                                add_variable
  222. /* DOCUMENT add_variable, file, address, name, type, dimlist
  223.      adds a variable NAME to FILE at the specified ADDRESS, with the
  224.      specified TYPE and dimensions given by DIMLIST.  The DIMLIST may
  225.      be zero or more arguments, as for the "array" function.  If the
  226.      ADDRESS is <0, the next available address is used. Note that,
  227.      unlike the save command, add_variable does not actually write any
  228.      data -- it merely changes Yorick's description of the contents of
  229.      FILE.
  230.  
  231.                                                  FROM add_variable TO array
  232.  
  233.      After the first add_record call, add_variable adds a variable to
  234.      the record instead of a non-record variable.  See add_record.
  235.    SEE ALSO: save, openb, createb, updateb, add_record,
  236.              add_member, install_struct, data_align
  237.  */
  238.  
  239.                                                                       allof
  240. /* DOCUMENT allof(x)
  241.             anyof(x)
  242.             nallof(x)
  243.             noneof(x)
  244.      Respectively:
  245.       returns 1 if every element of the array x is non-zero, else 0.
  246.       returns 1 if at least one element of the array x is non-zero, else 0.
  247.       returns 1 if at least one element of the array x is zero, else 0.
  248.       returns 1 if every element of the array x is zero, else 0.
  249.   SEE ALSO: allof, anyof, noneof, nallof, where, where2
  250.  */
  251.  
  252.                                                               am_subroutine
  253. /* DOCUMENT am_subroutine()
  254.      returns 1 if the current Yorick function was invoked as a subroutine,
  255.      else 0.  If am_subroutine() returns true, the result of the current
  256.      function will not be used, and need not be computed (the function
  257.      has been called for its side effects only).
  258.  */
  259.  
  260.                                                                       anyof
  261.     /* SEE allof     */
  262.  
  263.                                                                        area
  264. /* DOCUMENT area(y, x)
  265.      returns the zonal areas of the 2-D mesh (X, Y).  If Y and X are
  266.      imax-by-jmax, the result is (imax-1)-by-(jmax-1).  The area is
  267.      positive when, say, X increases with i and Y increases with j.
  268.      For example, area([[0,0],[1,1]],[[0,1],[0,1]]) is +1.
  269.    SEE ALSO: volume
  270.  */
  271.  
  272.                                                                       array
  273. /* DOCUMENT array(value, dimension_list)
  274.          or array(type, dimension_list)
  275.      returns an object of the same type as VALUE, consisting of copies
  276.      of VALUE, with the given DIMENSION_LIST appended to the dimensions
  277.      of VALUE.  Hence, array(1.5, 3, 1) is the same as [[1.5, 1.5, 1.5]].
  278.      In the second form, the VALUE is taken as scalar zero of the TYPE.
  279.      Hence, array(short, 2, 3) is the same as [[0s,0s],[0s,0s],[0s,0s]].
  280.      A DIMENSION_LIST is a list of arguments, each of which may be
  281.      any of the following:
  282.         (1) A positive scalar integer expression,
  283.     (2) An index range with no step field (e.g.-  1:10), or
  284.     (3) A vector of integers [number of dims, length1, length2, ...]
  285.         (that is, the format returned by the dimsof function).
  286.   SEE ALSO: reshape, is_array, dimsof, numberof, grow, span, use_origins
  287.  */
  288.  
  289.                                                    FROM asin TO at_pdb_open
  290.  
  291.                                                                        asin
  292. /* DOCUMENT asin(x)
  293.      returns the inverse sine of its argument, range [-pi/2, pi/2].
  294.   SEE ALSO: sin, cos, tan, asin, acos, atan
  295.  */
  296.  
  297.                                                                       asinh
  298. /* DOCUMENT asinh(x)
  299.             acosh(x)
  300.             atanh(x)
  301.      returns the inverse hyperbolic sine, cosine, or tangent of
  302.      its argument.  The range of acosh is >=0.0.
  303.   SEE ALSO: sinh, cosh, tanh, sech, csch
  304.  */
  305.  
  306.                                                                at_pdb_close
  307.     /* SEE at_pdb_open     */
  308.  
  309.                                                                 at_pdb_open
  310. /* DOCUMENT at_pdb_open
  311.             at_pdb_close
  312.      bits for optional behavior when a PDB file is opened or closed:
  313.  
  314.      at_pdb_open:
  315.      000  Major-Order:  value specified in file is correct
  316.      001  Major-Order:102 always 
  317.      002  Major-Order:  opposite from what file says
  318.      003  Major-Order:101 always
  319.  
  320.      004  Strip Basis @... suffices from variable names (when possible)
  321.           Danger!  If you do this and open a file for update, the variable
  322.       names will be stripped when you close the file!
  323.      010  Use Basis @history convention on input
  324.  
  325.      The 001 and 002 bits may be overridden by the open102 keyword.
  326.      The default value of at_pdb_open is 010.
  327.  
  328.      at_pdb_close (the value at the time the file is opened or created
  329.                    is remembered):
  330.      001  Write Major-Order 102 PDB file
  331.      002  Write PDB style history data
  332.         The following are no-ops unless bit 002 is set:
  333.      004  Use Basis @history convention on output
  334.      010  Do NOT pack all history record variables into
  335.           a single structure instance.
  336.  
  337.      The 001 bit may be overridden by the close102 keyword or if
  338.      close102_default is non-zero.
  339.      The default value of at_pdb_close is 007.
  340.  
  341.    SEE ALSO: close102_default
  342.  */
  343.  
  344.                                                       FROM atan TO bookmark
  345.  
  346.                                                                        atan
  347. /* DOCUMENT atan(x)
  348.          or atan(y, x)
  349.      returns the inverse tangent of its argument, range [-pi/2, pi/2].
  350.      In the two argument form, returns the angle from (1, 0) to (x, y),
  351.      in the range (-pi, pi], with atan(1, 0)==pi/2.  (If x>=0, this is
  352.      the same as atan(y/x).)
  353.   SEE ALSO: sin, cos, tan, asin, acos, atan
  354.  */
  355.  
  356.                                                                         avg
  357. /* DOCUMENT avg(x)
  358.      returns the scalar average of all elements of its array argument.
  359.   SEE ALSO: sum, min, max
  360.  */
  361.  
  362.                                                                      backup
  363.     /* SEE bookmark     */
  364.  
  365.                                                                       batch
  366. /* DOCUMENT batch, 1
  367.             batch, 0
  368.         batch()
  369.      turns on, turns off, or tests for batch mode, respectively.
  370.      If yorick is started with the command line:
  371.         yorick -batch batch_include.i ...
  372.      then batch mode is turned on, the usual custom.i startup file is
  373.      skipped, and the file batch_include.i is parsed and executed.  The
  374.      -batch and batch_include.i command line arguments are removed from
  375.      the list returned by get_argv().  These must be the first two
  376.      arguments on the command line.
  377.  
  378.      In batch mode, any error will terminate Yorick (as by the quit
  379.      function) rather than entering debug mode.
  380.  
  381.    SEE ALSO: process_argv, get_argv
  382.  */
  383.  
  384.                                                                    bookmark
  385. /* DOCUMENT backup, f
  386.          or bmark= bookmark(f)
  387.             ...
  388.             backup, f, bmark
  389.      back up the text stream F, so that the next call to the read
  390.      function returns the same line as the previous call to read
  391.      (note that you can only back up one line).  If the optional
  392.      second argument BMARK is supplied, restores the state of the
  393.      file F to its state at the time the bookmark function was
  394.      called.
  395.      After a matching failure in read, use the single argument form
  396.      of backup to reread the line containing the matching failure.
  397.    SEE ALSO: read, rdline, open, close
  398.  */
  399.  
  400.                                                       FROM call TO close102
  401.  
  402.                                                                        call
  403. /* DOCUMENT call, subroutine(arg1, arg2, arg3, arg4, arg5
  404.                              arg6, arg7, arg8);
  405.      allows a SUBROUTINE to be called with a very long argument list
  406.      as an alternative to:
  407.           subroutine, arg1, arg2, arg3, arg4, arg5,
  408.             arg6, arg7, arg8;
  409.      Note that the statement
  410.           subroutine(arg1, arg2, arg3, arg4, arg5,
  411.                      arg6, arg7, arg8);
  412.      will print the return value of subroutine, even if it is nil.
  413.      If invoked as a function, call simply returns its argument.
  414.  */
  415.  
  416.                                                                          cd
  417. /* DOCUMENT cd, directory_name
  418.          or cd(directory_name)
  419.      change current working directory to DIRECTORY_NAME, returning
  420.      the expanded path name (i.e.- with leading environment variables,
  421.      ., .., or ~ replaced by the actual pathname).  If called as a
  422.      function, returns nil to indicate failure, otherwise failure
  423.      causes a Yorick error.
  424.    SEE ALSO: get_cwd, get_home, get_env, get_argv
  425.  */
  426.  
  427.                                                                        ceil
  428. /* DOCUMENT ceil(x)
  429.      returns the smallest integer not less than x (no-op on integers).
  430.   SEE ALSO: floor
  431.  */
  432.  
  433.                                                                       close
  434. /* DOCUMENT close, f
  435.      closes the I/O stream F (returned earlier by the open function).
  436.      If F is a simple variable reference (as opposed to an expression),
  437.      the close function will set F to nil.  If F is the only reference
  438.      to the I/O stream, then "close, f" is equivalent to "f= []".
  439.      Otherwise, "close, f" will close the file (so that subsequent
  440.      I/O operations will fail) and print a warning message about the
  441.      outstanding ("stale") references.
  442.   SEE ALSO: open, read, write, rdline, bookmark, backup, save, restore,
  443.             rename, remove
  444.  */
  445.  
  446.                                                                    close102
  447. /* DOCUMENT close102  is a keyword for createb or updateb,
  448.             open102   is a keyword for openb or updateb
  449.         close102_default   is a global variable (initially 0)
  450.           ***Do not use close102_default -- use at_pdb_close
  451.              -- this is for backward compatibility only***
  452.  
  453.         close102=1  means to close the PDB file "Major-Order:102"
  454.         close102=0  means close it "Major-Order:101"
  455.            if not specified, uses 1 if close102_default non-zero,
  456.            otherwise the value specified in at_pdb_close
  457.  
  458.                                                    FROM close102 TO collect
  459.  
  460.  
  461.         open102=1   means to ignore what the PDB file says internally,
  462.                     and open it as if it were "Major-Order:102"
  463.         open102=0   (the default) means to assume the PDB file is
  464.                         correctly writen
  465.         open102=2   means to assume that the file is incorrectly
  466.                     written, whichever way it is marked
  467.         open102=3   means to ignore what the PDB file says internally,
  468.                     and open it as if it were "Major-Order:101"
  469.  
  470.      The PDB file format comes in two styles, "Major-Order:101", and
  471.      "Major-Order:102".  Yorick interprets these correctly by default,
  472.      but other codes may ignore them, or write them incorrectly.
  473.  
  474.      Unlike Yorick, not all codes are able to correctly read both
  475.      styles.  If you are writing a file which needs to be read by
  476.      a "102 style" code, create it with the close102=1 keyword.
  477.  
  478.      If you notice that a file you though was a history file isn't, or
  479.      that the dimensions of multi-dimensional variables are transposed
  480.      from the order you expected, the code which wrote the file probably
  481.      blew it.  Try openb("filename", open102=2).  The choices 1 and 3
  482.      are for cases in which you know the writing code was supposed to
  483.      write the file one way or the other, and you don't want to be
  484.      bothered.
  485.  
  486.      The open102 and close102 keywords, if present, override the
  487.      defaults in the variables at_pdb_open and at_pdb_close.
  488.  
  489.    SEE ALSO: at_pdb_open, at_pdb_close
  490.  */
  491.  
  492.                                                            close102_default
  493.     /* SEE close102     */
  494.  
  495.                                                                     collect
  496. /* DOCUMENT result= collect(f, name_string)
  497.      scans through all records of the history file F accumulating the
  498.      variable NAME_STRING into a single array with one additional
  499.      index varying from 1 to the number of records.
  500.  
  501.      NAME_STRING can be either a simple variable name, or a name
  502.      followed by up to four simple indices which are either nil, an
  503.      integer, or an index range with constant limits.  (Note that
  504.      0 or negative indices count from the end of a dimension.)
  505.  
  506.      Examples:
  507.         collect(f, "xle")        -- collects the variable f.xle
  508.     collect(f, "tr(2,2:)")   -- collects f.tr(2,2:)
  509.     collect(f, "akap(2,-1:0,)") -- collects f.akap(2,-1:0,)
  510.                  (i.e.- akap in the last two values of its
  511.                     second index)
  512.  
  513.    SEE ALSO: get_times
  514.  */
  515.  
  516.                                                        FROM conj TO createb
  517.  
  518.                                                                        conj
  519. /* DOCUMENT conj(x)
  520.      returns the complex conjugate of its argument.
  521.  */
  522.  
  523.                                                                   copyright
  524. /* DOCUMENT copyright, (no) warranty
  525.  
  526.      Copyright (c) 1994.  The Regents of the University of California.
  527.                    All rights reserved.
  528.  
  529.      Yorick is provided "as is" without any warranty, either expressed or
  530.      implied.  For a complete statement, type:
  531.  
  532.         legal
  533.  
  534.      at the Yorick prompt.
  535.  
  536.    SEE ALSO: legal
  537.  */
  538.  
  539.                                                                         cos
  540.     /* SEE sin     */
  541.  
  542.                                                                        cosh
  543.     /* SEE sinh     */
  544.  
  545.                                                             cray_primitives
  546. /* DOCUMENT cray_primitives, file
  547.      sets FILE primitive data types to be native to Cray 1, XMP, and YMP.
  548.  */
  549.  
  550.                                                                      create
  551. /* DOCUMENT f= create(filename)
  552.      is a synonym for       f= open(filename, "w")
  553.      Creates a new text file FILENAME, destroying any existing file of
  554.      that name.  Use the write function to write into the file F.
  555.    SEE ALSO: write, close, open
  556.  */
  557.  
  558.                                                                     createb
  559. /* DOCUMENT file= createb(filename)
  560.          or file= createb(filename, primitives)
  561.      creates FILENAME as a PDB file in "w+b" mode, destroying any
  562.      existing file by that name.  If the PRIMITIVES argument is
  563.      supplied, it must be the name of a procedure that sets the
  564.      primitive data types for the file.  The default is to create
  565.      a file with the native primitive types of the machine on which
  566.      Yorick is running.  The following PRIMITIVES functions are
  567.      predefined:
  568.         sun_primitives    -- appropriate for Sun, HP, IBM, and
  569.                          most other workstations
  570.         sun3_primitives   -- appropriate for old Sun-2 or Sun-3
  571.         dec_primitives    -- appropriate for DEC workstations
  572.         cray_primitives   -- appropriate for Cray 1, XMP, and YMP
  573.  
  574.                                                      FROM createb TO dbexit
  575.  
  576.     mac_primitives    -- appropriate for MacIntosh
  577.     macl_primitives   -- appropriate for MacIntosh, 12-byte double
  578.     pc_primitives     -- appropriate for IBM PC
  579.         vax_primitives    -- appropriate for VAXen only (H doubles)
  580.         vaxg_primitives   -- appropriate for VAXen only (G doubles)
  581.         xdr_primitives    -- appropriate for XDR files
  582.   SEE ALSO: openb, updateb, cd
  583.             save, add_record, set_filesize, set_blocksize
  584.         close102, close102_default, at_pdb_open, at_pdb_close
  585.  */
  586.  
  587.                                                                  data_align
  588. /* DOCUMENT data_align, file, alignment
  589.      in binary file FILE, align new variables to begin at a byte address
  590.      which is a multiple of ALIGNMENT.  (This affects placement of data
  591.      declared using save and add_variable.  For add_variable, data_align
  592.      has an effect only if the address is not specified.)  If ALIGNMENT
  593.      is <=0, new variables will be aligned as they would be if they were
  594.      data structure members.  The default value is 0.
  595.    SEE ALSO: save, add_variable
  596.  */
  597.  
  598.                                                                      dbauto
  599.     /* SEE dbexit     */
  600.  
  601.                                                                      dbcont
  602.     /* SEE dbexit     */
  603.  
  604.                                                                       dbdis
  605.     /* SEE dbexit     */
  606.  
  607.                                                                      dbexit
  608. /* DOCUMENT Debug mode.
  609.  
  610.    Yorick errors fall into two general categories: Syntax errors discovered
  611.    during parsing, and runtime errors discovered when a Yorick program is
  612.    actually running.  When a runtime error occurs, Yorick offers the
  613.    choice of entering "debug mode", which you can do by typing the <RETURN>
  614.    key immediately after the error occurs.  Typing a non-blank line exits
  615.    debug mode automatically by default.  In debug mode, the Yorick prompt
  616.    becomes "dbug>" instead of the usual ">".  When you see this prompt,
  617.    Yorick has halted "in the middle of" the function in which the error
  618.    occurred, and you can print, plot, modify, or save the local variables
  619.    in that function by means of ordinary Yorick commands.  Debug mode is
  620.    recursive; that is, you can debug an error which occurred during
  621.    debugging to any number of levels.
  622.  
  623.    You can exit from debug mode in several ways:
  624.  
  625.       dbexit            -- exit current debug level, discarding all
  626.                            active functions and their local variables
  627.       dbexit, 0         -- exit all debug levels
  628.       dbexit, n         -- exit (at most) N debug levels
  629.  
  630.       dbcont            -- continue execution of the current function
  631.  
  632.                                                         FROM dbexit TO dbup
  633.  
  634.          Continuing is useful if you have managed to repair the
  635.      problem which caused the error.  The expression in which the
  636.      error occurred will be evaluated a second time, so beware of
  637.      side effects.
  638.  
  639.       dbret, value      -- continue execution by returning VALUE (which
  640.                            may be nil or omitted) to the caller of the
  641.                function in which the error occurred.
  642.      This is useful if the function in which the error occurred is
  643.      hopelessly confounded, but you know the value it should return.
  644.  
  645.    Yorick does not allow "single stepping" directly, although you can
  646.    execute the statements in a function by copying them, then tell
  647.    Yorick to skip those statements you have executed "by hand".  There
  648.    are two functions for skipping execution:
  649.  
  650.       dbskip            -- skip the next logical line (This will be only
  651.                            a portion of a source line if several statements
  652.                are stacked on the source line.)
  653.       dbskip, n         -- skip next N (positive or negative) logical lines
  654.  
  655.       dbup              -- discard the current function, so that you are
  656.                            debugging its caller -- there is no way to go
  657.                back "down", so be careful
  658.  
  659.    There are two functions which print information (like other print
  660.    functions, if called as functions instead of subroutines, their
  661.    result is returned as a string array with one line per string):
  662.  
  663.       dbinfo            -- returns current function and source line
  664.  
  665.       dbdis             -- returns disassembled virtual machine code
  666.                            for the next line (use the disassemble function
  667.                to get the entire function)
  668.      This allows you to see exactly where in a line the error occurred.
  669.  
  670.    Finally,
  671.  
  672.       dbauto            -- toggles whether debug mode will be entered
  673.                            automatically when a runtime error occurs
  674.       dbauto, 1         -- enter debug mode automatically after an error
  675.       dbauto, 0         -- type <RETURN> after error to enter debug mode
  676.  */
  677.  
  678.                                                                      dbinfo
  679.     /* SEE dbexit     */
  680.  
  681.                                                                       dbret
  682.     /* SEE dbexit     */
  683.  
  684.                                                                      dbskip
  685.     /* SEE dbexit     */
  686.  
  687.                                                                        dbup
  688.     /* SEE dbexit     */
  689.  
  690.                                           FROM dec_primitives TO edit_times
  691.  
  692.                                                              dec_primitives
  693. /* DOCUMENT dec_primitives, file
  694.      sets FILE primitive data types to be native to DEC workstations.
  695.  */
  696.  
  697.                                                                    digitize
  698. /* DOCUMENT digitize(x, bins)
  699.      returns an array of longs with dimsof(X), and values i such that
  700.      BINS(i-1) <= X < BINS(i) if BINS is monotonically increasing, or
  701.      BINS(i-1) > X >= BINS(i) if BINS is monotonically decreasing.
  702.      Beyond the bounds of BINS, returns either i=1 or i=numberof(BINS)+1
  703.      as appropriate.
  704.    SEE ALSO: histogram, interp, integ, sort, where, where2
  705.  */
  706.  
  707.                                                                      dimsof
  708. /* DOCUMENT dimsof(object)
  709.          or dimsof(object1, object2, ...)
  710.      returns a vector of integers describing the dimensions of OBJECT.
  711.      The format of the vector is [number of dims, length1, length2, ...].
  712.      The orgsof function returns the origin of each dimension (normally 1).
  713.      If more than one argument is given, dimsof returns the dimension
  714.      list of the result of binary operations between all the objects,
  715.      or nil if the objects are not conformable.
  716.   SEE ALSO: typeof, structof, numberof, sizeof, orgsof
  717.  */
  718.  
  719.                                                                 disassemble
  720. /* DOCUMENT disassemble(function)
  721.          or disassemble, function
  722.      Disassembles the specified function.  If called as a function, the
  723.      result is returned as a vector of strings; if called as a subroutine,
  724.      the disassembly is printed at the terminal.  If the function is nil,
  725.      the current *main* program is disassembled -- you must include the
  726.      call to disassemble in the main program, of course, NOT on its own
  727.      line as a separate main program.
  728.  */
  729.  
  730.                                                                   dump_clog
  731. /* DOCUMENT dump_clog, file, clog_name
  732.      dumps a Contents Log of the binary file FILE into the text file
  733.      CLOG_NAME.  Any previous file named CLOG_NAME is overwritten.
  734.   SEE ALSO: openb
  735.  */
  736.  
  737.                                                                  edit_times
  738. /* DOCUMENT edit_times, file
  739.          or edit_times, file, keep_list
  740.          or edit_times, file, keep_list, new_times, new_ncycs
  741.      edits the records for FILE.  The KEEP_LIST is a 0-origin index list
  742.      of records to be kept, or nil to keep all records.  The NEW_TIMES
  743.      array is the list of new time values for the (kept) records, and
  744.      the NEW_NCYCS array is the list of new cycle number values for the
  745.      (kept) records.  Either NEW_TIMES, or NEW_NCYCS, or both, may be
  746.      nil to leave the corresponding values unchanged.  If non-nil,
  747.  
  748.                                                FROM edit_times TO get_addrs
  749.  
  750.      NEW_TIMES and NEW_NCYCS must have the same length as KEEP_LIST,
  751.      or, if KEEP_LIST is nil, as the original number of records in
  752.      the file.  If KEEP_LIST, NEW_TIME, and NEW_NCYCS are all omitted
  753.      or nil, then edit_times removes records as necessary to ensure
  754.      that the remaining records have monotonically increasing times,
  755.      or, if no times are present, monotonically increasing ncycs.
  756.      (The latest record at any given time/ncyc is retained, and earlier
  757.      records are removed.)
  758.      In no case does edit_times change the FILE itself; only Yorick's
  759.      in-memory model of the file is altered.
  760.    SEE ALSO: get_times, get_ncycs, jt, jc
  761.  */
  762.  
  763.                                                                       error
  764. /* DOCUMENT exit, msg
  765.             error, msg
  766.      Exits the current interpreted *main* program, printing the MSG.
  767.      (MSG can be omitted to print a default.)
  768.      In the case of exit, the result is equivalent to an immediate
  769.      return from every function in the current calling chain.
  770.      In the case of error, the result is the same as if an error had
  771.      occurred in a compiled routine.
  772.    SEE ALSO: print, write, batch
  773.  */
  774.  
  775.                                                                        exit
  776.     /* SEE error     */
  777.  
  778.                                                                         exp
  779. /* DOCUMENT exp(x)
  780.      returns the exponential function of its argument (inverse of log).
  781.   SEE ALSO: log, log10, sinh, cosh, tanh, sech, csch
  782.  */
  783.  
  784.                                                                       floor
  785. /* DOCUMENT floor(x)
  786.      returns the largest integer not greater than x (no-op on integers).
  787.   SEE ALSO: ceil
  788.  */
  789.  
  790.                                                                   get_addrs
  791. /* DOCUMENT addr_lists= get_addrs(file)
  792.      returns the byte addresses of the non-record and record variables
  793.      in the binary file FILE, and lists of the record addresses, file
  794.      indices, and filenames for file families with history records.
  795.           *addr_lists(1)   absolute addresses of non-record variables
  796.       *addr_lists(2)   relative addresses of record variables
  797.                        (add record address to get absolute address)
  798.          The order of these two address lists matches the
  799.          corresponding lists of names returned by get_vars.
  800.       *addr_lists(3)   absolute addresses of records
  801.  
  802.                                                 FROM get_addrs TO get_times
  803.  
  804.       *addr_lists(4)   list of file indices corresponding to
  805.                        addr_lists(3); indices are into addr_lists(5)
  806.       *addr_lists(5)   list of filenames in the family
  807.    SEE ALSO: openb, updateb, restore, jt, jc, has_records, get_vars
  808.  */
  809.  
  810.                                                                    get_argv
  811. /* DOCUMENT get_argv()
  812.      returns string array containing the argv from the command line.
  813.      The -batch and batch_include.i arguments are removed (not returned).
  814.    SEE ALSO: process_argv, cd, get_cwd, get_home, get_env, batch
  815.  */
  816.  
  817.                                                                     get_cwd
  818. /* DOCUMENT get_cwd()
  819.          or get_home()
  820.      returns the pathname of the current working directory or of your
  821.      home directory.
  822.    SEE ALSO: cd, get_env, get_argv
  823.  */
  824.  
  825.                                                                     get_env
  826. /* DOCUMENT get_env(environment_variable_name)
  827.      returns the environment variable (a string) associated with
  828.      ENVIRONMENT_VARIABLE_NAME (calls ANSI getenv routine).
  829.    SEE ALSO: cd, get_cwd, get_home, get_env, get_argv
  830.  */
  831.  
  832.                                                                    get_home
  833.     /* SEE get_cwd     */
  834.  
  835.                                                                  get_member
  836. /* DOCUMENT get_member(f_or_s, member_name)
  837.      returns F_OR_S member MEMBER_NAME, like F_OR_S.MEMBER_NAME syntax,
  838.      but MEMBER_NAME can be a computed string.  The F_OR_S may be a
  839.      binary file or a structure instance.
  840.    SEE ALSO: openb
  841.  */
  842.  
  843.                                                                   get_ncycs
  844.     /* SEE get_times     */
  845.  
  846.                                                                   get_times
  847. /* DOCUMENT times= get_times(file)
  848.             ncycs= get_ncycs(file)
  849.      returns the list of time or ncyc values associated with the records
  850.      if FILE, or nil if there are none.  The time values are not guaranteed
  851.      to be precise (but they should be good to at least 6 digits or so);
  852.      the precise time associated with each record may be stored as a record
  853.      variable.
  854.    SEE ALSO: collect, openb, updateb, restore, jt, jc, edit_times
  855.  */
  856.  
  857.                                                FROM get_vars TO has_records
  858.  
  859.                                                                    get_vars
  860. /* DOCUMENT name_lists= get_vars(file)
  861.      returns the lists of non-record and record variable names in the
  862.      binary FILE.  The return value is an array of two pointers to
  863.      arrays of type string; *name_lists(1) is the array of non-record
  864.      variable names (or nil if there are none), *name_lists(2) is the
  865.      array of record variable names.
  866.      The get_addrs function returns corresponding lists of disk
  867.      addresses; the get_member function can be used in conjunction
  868.      with the dimsof, structof, and typeof functions to determine
  869.      the other properties of a variable.
  870.    SEE ALSO: openb, updateb, restore, jt, jc, has_records, get_addrs
  871.  */
  872.  
  873.                                                                        grow
  874. /* DOCUMENT grow, x, xnext1, xnext2, ...
  875.          or grow(x, xnext1, xnext2, ...)
  876.      or    _(x, xnext1, xnext2, ...)
  877.      lengthens the array X by appending XNEXT1, XNEXT2, etc. to its
  878.      final dimension.  If X is nil, X is first redefined to the first
  879.      non-nil XNEXT, and the remainder of the XNEXT list is processed
  880.      normally.  Each XNEXT is considered to have the same number of
  881.      dimensions as X, by appending unit-length dimensions if necessary.
  882.      All but this final dimension of each XNEXT must be right-conformable
  883.      (that is, conformable in the sense of the right hand side of an
  884.      assignment statement) with all but the final dimension of X.
  885.      The result has a final dimension which is the sum of the final
  886.      dimension of X and all the final dimensions of the XNEXT.  Nil
  887.      XNEXT are ignored.  The value of the result is obtained by
  888.      concatenating all the XNEXT to X, after any required broadcasts.
  889.  
  890.      If invoked as a function, grow returns the new value of X; in
  891.      this case, X may be an expression.  X must be a simple variable
  892.      reference for the subroutine form of grow; otherwise there is
  893.      nowhere to return the result.  The subroutine form is slightly
  894.      more efficient than the function form for the common usage:
  895.           x= grow(x, xnext1, xnext2)           is the same as
  896.       grow, x, xnext1, xnext2              the preferred form
  897.  
  898.      The _ function is a synonym for grow, for people who want this
  899.      operator to look like punctuation in their source code, on analogy
  900.      with the array building operator [a, b, c, ...].
  901.    SEE ALSO: array, compare with the array building operator [...]
  902.  */
  903.  
  904.                                                                 has_records
  905. /* DOCUMENT has_records(file)
  906.      returns 1 if FILE has history records, 0 if it does not.
  907.  */
  908.  
  909.                                                      FROM help TO histogram
  910.  
  911.                                                                        help
  912. /* DOCUMENT help, topic
  913.          or help
  914.      Prints DOCUMENT comment from include file in which the variable
  915.      TOPIC was defined, followed by the line number and filename.
  916.      By opening the file with a text editor, you may be able to find
  917.      out more, especially if no DOCUMENT comment was found.
  918.      Examples:
  919.        help, set_path
  920.      prints the documentation for the set_path function.
  921.        help
  922.      prints the DOCUMENT comment you are reading.
  923.  
  924.      This copy of Yorick was launched from the directory:
  925.      **** Y_LAUNCH (computed at runtime) ****
  926.      Yorick's "site directory" at this site is:
  927.      **** Y_SITE (computed at runtime) ****
  928.      You can find out a great deal more about Yorick by browsing
  929.      through these directories.  Begin with the site directory,
  930.      and pay careful attention to the subdirectories doc/ (which
  931.      contains documentation relating to Yorick), and include/ and
  932.      contrib/ (which contain many examples of Yorick programs).
  933.      Look for files called README (or something similar) in any
  934.      of these directories -- they are intended to assist browsers.
  935.      The site directory itself contains std.i and graph.i, which
  936.      are worth reading.
  937.  
  938.      Type:
  939.        help, dbexit
  940.      for help on debug mode.  If your prompt is "dbug>" instead of
  941.      ">", dbexit will return you to normal mode.
  942.  
  943.    SEE ALSO: info, print, copyright, warranty, legal
  944.  */
  945.  
  946.                                                                   histogram
  947. /* DOCUMENT histogram(list)
  948.          or histogram(list, weight)
  949.      returns an array hist which counts the number of occurrences of each
  950.      element of the input index LIST, which must consist of positive
  951.      integers (1-origin index values into the result array):
  952.           histogram(list)(i) = number of occurrences of i in LIST
  953.  
  954.      A second argument WEIGHT must have the same shape as LIST; the result
  955.      will be the sum of WEIGHT:
  956.           histogram(list)(i) = sum of all WEIGHT(j) where LIST(j)==i
  957.  
  958.      The result of the single argument call will be of type long; the
  959.      result of the two argument call will be of type double (WEIGHT is
  960.      promoted to that type).  The input argument(s) may have any number
  961.      of dimensions; the result is always 1-D.
  962.  
  963.    KEYWORD: top=max_list_value
  964.      By default, the length of the result is max(LIST).  You may
  965.  
  966.                                                   FROM histogram TO include
  967.  
  968.      specify that the result have a larger length by means of the TOP
  969.      keyword.  (Elements beyond max(LIST) will be 0, of course.)
  970.  
  971.    SEE ALSO: digitize, sort
  972.  */
  973.  
  974.                                                                     include
  975. /* DOCUMENT #include "yorick_source.i"
  976.             require, filename
  977.             include, filename
  978.          or include, filename, now
  979.  
  980.      #include is a parser directive, not a Yorick statement.  Use it
  981.      to read Yorick source code which you have saved in a file; the
  982.      file yorick_source.i will be read one line at a time, exactly as
  983.      if you had typed those lines at the keyboard.  The following
  984.      directories are searched (in this order) to find yorick_source.i:
  985.  
  986.         .               (current working directory)
  987.     ~/Yorick        (your personal directory of Yorick functions)
  988.     Y_SITE/include  (Yorick distribution library)
  989.     Y_SITE/contrib  (contributed source at your site)
  990.  
  991.      To find out what is available in the Yorick/include directory,
  992.      type:
  993.          library
  994.      You can also type
  995.          Y_SITE
  996.      to find the name of the site directory at your site, go to the
  997.      include or contrib subdirectory, and browse through the *.i files.
  998.      This is a good way to learn how to write a Yorick program.  Be
  999.      alert for files like README as well.
  1000.  
  1001.      The require function checks to see whether FILENAME has already
  1002.      been included (actually whether any file with the same final
  1003.      path component has been included).  If so, require is a no-op,
  1004.      otherwise, the action is the same as the include function with
  1005.      NOW == 1.
  1006.  
  1007.      The include function causes Yorick to parse and execute FILENAME
  1008.      immediately.  The effect is similar to the #include parser
  1009.      directive, except the finding, parsing, and execution of FILENAME
  1010.      occurs at runtime.  If the NOW argument is given and positive,
  1011.      the include occurs immediately, if nil or 0, it occurs just before
  1012.      the next line would have been parsed.  If NOW is negative, the
  1013.      include file is pushed onto a stack, and will be popped off and
  1014.      parsed when all pending input has been processed.
  1015.  
  1016.      Unless you are writing a startup file, or have some truly bizarre
  1017.      technical reason for using the include function, use #include
  1018.      instead.  The functional form of include may involve recursive
  1019.  
  1020.                                              FROM include TO install_struct
  1021.  
  1022.      parsing, which you will not be able to understand without deep
  1023.      study.  Stick with #include.
  1024.  
  1025.    SEE ALSO: set_path, Y_SITE
  1026.  */
  1027.  
  1028.                                                                      indgen
  1029. /* DOCUMENT indgen(n)
  1030.          or indgen(start:stop)
  1031.          or indgen(start:stop:step)
  1032.      returns "index generator" list -- an array of longs running from
  1033.      1 to N, inclusive.  In the second and third forms, the index
  1034.      values specified by the index range are returned.
  1035.    SEE ALSO: span, spanl, array
  1036.  */
  1037.  
  1038.                                                                        info
  1039. /* DOCUMENT info, expr
  1040.      prints the data type and array dimensions of EXPR.
  1041.    SEE ALSO: help, print
  1042.  */
  1043.  
  1044.                                                              install_struct
  1045. /* DOCUMENT install_struct, file, struct_name
  1046.          or install_struct, file, struct_name, size, align, order
  1047.          or install_struct, file, struct_name, size, align, order, layout
  1048.      installs the data type named STRUCT_NAME in the binary FILE.  In
  1049.      the two argument form, STRUCT_NAME must have been built by one or
  1050.      more calls to the add_member function.  In the 5 and 6 argument calls,
  1051.      STRUCT_NAME is a primitive data type -- an integer type for the 5
  1052.      argument call, and a floating point type for the 6 argument call.
  1053.      The 5 argument form may also be used to declare opaque data types.
  1054.      SIZE is the size of an instance in bytes, ALIGN is its alignment
  1055.      boundary (also in bytes), and ORDER is the byte order.  ORDER is
  1056.      1 for most significant byte first, -1 for least significant byte
  1057.      first, and 0 for opaque (unconverted) data.  Other ORDER values
  1058.      represent more complex byte permutations (2 is the byte order for
  1059.      VAX floating point numbers).  If ORDER equals SIZE, then the data
  1060.      type is not only opaque, but also must be read sequentially.
  1061.      LAYOUT is an array of 7 long values parameterizing the floating
  1062.      point format, [sign_address, exponent_address, exponent_size,
  1063.      mantissa_address, mantissa_size, mantissa_normalized, exponent_bias]
  1064.      (the addresses and sizes are in bits, reduced to MSB first order).
  1065.      Use, e.g., nameof(float) for STRUCT_NAME to redefine the meaning
  1066.      of the float data type for FILE.
  1067.    SEE ALSO: add_variable, add_member
  1068.  */
  1069.  
  1070.                                                      FROM integ TO is_range
  1071.  
  1072.                                                                       integ
  1073. /* DOCUMENT integ(y, x, xp)
  1074.          or integ(y, x, xp, which)
  1075.      See the interp function for an explanation of the meanings of the
  1076.      arguments.  The integ function returns ypi which is the integral
  1077.      of the piecewise linear curve (X(i), Y(i)) (i=1, ..., numberof(X))
  1078.      from X(1) to XP.  The curve (X, Y) is regarded as constant outside
  1079.      the bounds of X.  Note that X must be monotonically increasing or
  1080.    SEE ALSO: interp, digitize, span
  1081.  */
  1082.  
  1083.                                                                      interp
  1084. /* DOCUMENT interp(y, x, xp)
  1085.          or interp(y, x, xp, which)
  1086.      returns yp such that (XP, yp) lies on the piecewise linear curve
  1087.      (X(i), Y(i)) (i=1, ..., numberof(X)).  Points beyond X(1) are set
  1088.      to Y(1); points beyond X(0) are set to Y(0).  The array X must be
  1089.      one dimensional, have numberof(X)>=2, and be either monotonically
  1090.      increasing or monotonically decreasing.  The array Y may have more
  1091.      than one dimension, but dimension WHICH must be the same length as
  1092.      X.  WHICH defaults to 1, the first dimension of Y.  WHICH may be
  1093.      non-positive to count dimensions from the end of Y; a WHICH of 0
  1094.      means the final dimension of Y.  The result yp has dimsof(XP)
  1095.      in place of the WHICH dimension of Y (if XP is scalar, the WHICH
  1096.      dimension is not present).  (The dimensions of the result are the
  1097.      same as if an index list with dimsof(XP) were placed in slot
  1098.      WHICH of Y.)
  1099.    SEE ALSO: integ, digitize, span
  1100.  */
  1101.  
  1102.                                                                    is_array
  1103. /* DOCUMENT is_array(object)
  1104.      returns 1 if OBJECT is an array data type (as opposed to a function,
  1105.      structure definition, index range, I/O stream, etc.), else 0.
  1106.      An array OBJECT can be written to or read from a binary file;
  1107.      non-array Yorick data types cannot.
  1108.   SEE ALSO: is_func, is_void, is_range, is_struct, is_stream
  1109.  */
  1110.  
  1111.                                                                     is_func
  1112. /* DOCUMENT is_func(object)
  1113.      returns 1 if OBJECT is a Yorick interpreted function, 2 if OBJECT
  1114.      is a built-in (that is, compiled) function, else 0.
  1115.   SEE ALSO: is_array, is_void, is_range, is_struct, is_stream
  1116.  */
  1117.  
  1118.                                                                    is_range
  1119. /* DOCUMENT is_range(object)
  1120.      returns 1 if OBJECT is an index range (e.g.-  3:5 or 11:31:2),
  1121.      else 0.
  1122.   SEE ALSO: is_array, is_func, is_void, is_struct, is_stream
  1123.  */
  1124.  
  1125.                                                        FROM is_stream TO jt
  1126.  
  1127.                                                                   is_stream
  1128. /* DOCUMENT is_stream(object)
  1129.      returns 1 if OBJECT is an I/O stream (usually a file), else 0.
  1130.   SEE ALSO: is_array, is_func, is_void, is_range, is_struct
  1131.  */
  1132.  
  1133.                                                                   is_struct
  1134. /* DOCUMENT is_struct(object)
  1135.      returns 1 if OBJECT is the definition of a Yorick struct, else 0.
  1136.      Thus, is_struct(double) returns 1, but is_struct(1.0) returns 0.
  1137.   SEE ALSO: is_array, is_func, is_void, is_range, is_stream
  1138.  */
  1139.  
  1140.                                                                     is_void
  1141. /* DOCUMENT is_void(object)
  1142.      returns 1 if OBJECT is nil (the one instance of the void data type),
  1143.      else 0.
  1144.   SEE ALSO: is_array, is_func, is_range, is_struct, is_stream
  1145.  */
  1146.  
  1147.                                                                          jc
  1148. /* DOCUMENT jc, file, ncyc
  1149.      jump to the record of FILE nearest the specified NCYC.
  1150.    SEE ALSO: jt, _jc, edit_times, show, jr
  1151.  */
  1152.  
  1153.                                                                          jr
  1154. /* DOCUMENT jr, file, i
  1155.          or _jr(file, i)
  1156.      Jump to a particular record number I (from 1 to n_records) in a
  1157.      binary file FILE.  The function returns 1 if such a record exists,
  1158.      0 if there is no such record.  In the latter case, no action is
  1159.      taken; the program halts with an error only if jr was invoked
  1160.      as a subroutine.  Record numbering wraps like array indices; use
  1161.      jr, file, 0  to jump to the last record, -1 to next to last, etc.
  1162.    SEE ALSO: jt, jc, edit_times, show
  1163.  */
  1164.  
  1165.                                                                          jt
  1166. /* DOCUMENT jt, time
  1167.          or jt, file, time
  1168.          or jt, file
  1169.          or jt, file, -
  1170.      jump to the record nearest the specified TIME.  If no FILE is
  1171.      specified, the current record of all open binary files containing
  1172.      records is shifted.
  1173.      If both FILE and TIME are specified and jt is called as a function,
  1174.      it returns the actual time of the new current record.
  1175.  
  1176.    N.B.: "jt, file" and "jt, file, -" are obsolete.  Use the jr function to
  1177.      step through a file one record at a time.
  1178.  
  1179.      If only the FILE is specified, increment the current record of that
  1180.      FILE by one.  If the TIME argument is - (the pseudo-index range
  1181.      function), decrement the current record of FILE by one.
  1182.  
  1183.                                                  FROM jt TO macl_primitives
  1184.  
  1185.      If the current record is the last, "jt, file" unsets the current record
  1186.      so that record variables will be inaccessible until another jt or jc.
  1187.      The same thing happens with "jt, file, -" if the current record was the
  1188.      first.
  1189.      If only FILE is specified, jt returns 1 if there is a new current
  1190.      record, 0 if the call resulted in no current record.  Thus "jt(file)"
  1191.      and "jt(file,-)" may be used as the condition in a while loop to step
  1192.      through every record in a file:
  1193.         file= openb("example.pdb");
  1194.         do {
  1195.       restore, file, interesting_record_variables;
  1196.       ...calculations...
  1197.     } while (jt(file));
  1198.  
  1199.    SEE ALSO: jc, _jt, edit_times, show, jr
  1200.  */
  1201.  
  1202.                                                                       legal
  1203. /* DOCUMENT legal
  1204.      Prints the legal details of Yorick's copyright, licensing,
  1205.      and lack of warranty.
  1206.    SEE ALSO: copyright, warranty
  1207.  */
  1208.  
  1209.                                                                     library
  1210. /* DOCUMENT library
  1211.      print the Y_SITE/include/README file at the terminal.
  1212.  */
  1213.  
  1214.                                                                         log
  1215. /* DOCUMENT log(x)
  1216.      returns the natural logarithm of its argument (inverse of exp).
  1217.   SEE ALSO: log10, exp, asinh, acosh, atanh
  1218.  */
  1219.  
  1220.                                                                       log10
  1221. /* DOCUMENT log10(x)
  1222.      returns the base 10 logarithm of its argument (inverse of 10^x).
  1223.   SEE ALSO: log, exp, asinh, acosh, atanh
  1224.  */
  1225.  
  1226.                                                              mac_primitives
  1227. /* DOCUMENT mac_primitives, file
  1228.      sets FILE primitive data types to be native to MacIntosh, 8 byte double.
  1229.  */
  1230.  
  1231.                                                             macl_primitives
  1232. /* DOCUMENT macl_primitives, file
  1233.      sets FILE primitive data types to be native to MacIntosh, long double.
  1234.  */
  1235.  
  1236.                                                           FROM max TO merge
  1237.  
  1238.                                                                         max
  1239. /* DOCUMENT max(x)
  1240.          or max(x, y, z, ...)
  1241.      returns the scalar maximum value of its array argument, or, if
  1242.      more than one argument is supplied, returns an array of the
  1243.      maximum value for each array element among the several arguments.
  1244.      In the multi-argument case, the arguments must be conformable.
  1245.   SEE ALSO: min, sum, avg
  1246.  */
  1247.  
  1248.                                                                      median
  1249. /* DOCUMENT median(x)
  1250.          or median(x, which)
  1251.      returns the median of the array X.  The search for the median takes
  1252.      place along the dimension of X specified by WHICH.  WHICH defaults
  1253.      to 1, meaning the first index of X.  The median function returns an
  1254.      array with one fewer dimension than its argument X (the WHICH
  1255.      dimension of X is missing in the result), in exact analogy with
  1256.      rank reducing index range functions.  If dimsof(X)(WHICH) is
  1257.      odd, the result will have the same data type as X; if even, the
  1258.      result will be a float or a double, since the median is defined
  1259.      as the arithmetic mean between the two central values in that
  1260.      case.
  1261.    SEE ALSO: sort, built-in index range functions such as avg, rms
  1262.  */
  1263.  
  1264.                                                                       merge
  1265. /* DOCUMENT merge(true_expr, false_expr, condition)
  1266.      returns the values TRUE_EXPR or FALSE_EXPR where CONDITION is
  1267.      non-zero or zero, respectively.  The result has the data type of
  1268.      TRUE_EXPR or FALSE_EXPR, promoted to the higher arithmetic type
  1269.      if necessary.  The result has the dimensions of CONDITION.
  1270.      The number of elements in TRUE_EXPR must match the number of
  1271.      non-zero elements of CONDITION, and the number of elements in
  1272.      FALSE_EXPR must match the number of zero elements of CONDITION.
  1273.      (TRUE_EXPR or FALSE_EXPR should be nil if there are no such
  1274.      elements of CONDITION.  Normally, TRUE_EXPR and FALSE_EXPR should
  1275.      be 1-D arrays if they are not nil.)
  1276.      This function is intended for vectorizing a function whose
  1277.      domain is divided into two or more parts, as in:
  1278.         func f(x) {
  1279.       big= (x>=threshhold);
  1280.       wb= where(big);
  1281.       ws= where(!big);
  1282.       if (is_array(wb)) {
  1283.         xx= x(wb);
  1284.         fb= <function of xx>
  1285.       }
  1286.       if (is_array(ws)) {
  1287.         xx= x(ws);
  1288.         fs= <function of xx>
  1289.  
  1290.                                                          FROM merge TO open
  1291.  
  1292.       }
  1293.       return merge(fb, fs, big);
  1294.     }
  1295.    SEE ALSO: merge2, where
  1296.  */
  1297.  
  1298.                                                                      merge2
  1299. /* DOCUMENT merge2(true_expr, false_expr, condition)
  1300.      returns the values TRUE_EXPR or FALSE_EXPR where CONDITION is
  1301.      non-zero or zero, respectively.  The result has the data type of
  1302.      TRUE_EXPR or FALSE_EXPR, promoted to the higher arithmetic type
  1303.      if necessary.  Unlike the merge function, TRUE_EXPR and FALSE_EXPR
  1304.      must be conformable with each other, and with the CONDITION.
  1305.    SEE ALSO: merge2, where
  1306.  */
  1307.  
  1308.                                                                         min
  1309. /* DOCUMENT min(x)
  1310.          or min(x, y, z, ...)
  1311.      returns the scalar minimum value of its array argument, or, if
  1312.      more than one argument is supplied, returns an array of the
  1313.      minimum value for each array element among the several arguments.
  1314.      In the multi-argument case, the arguments must be conformable.
  1315.   SEE ALSO: max, sum, avg
  1316.  */
  1317.  
  1318.                                                                      nallof
  1319.     /* SEE allof     */
  1320.  
  1321.                                                                      nameof
  1322. /* DOCUMENT nameof(object)
  1323.      If OBJECT is a function or a structure definition, returns the
  1324.      name of the func or struct as it was defined (not necessarily
  1325.      the name of the variable passed to the nameof function).
  1326.   SEE ALSO: typeof
  1327.  */
  1328.  
  1329.                                                                      noneof
  1330.     /* SEE allof     */
  1331.  
  1332.                                                                    numberof
  1333. /* DOCUMENT numberof(object)
  1334.      returns the number of elements if object is an array, or 0 if not.
  1335.   SEE ALSO: sizeof, dimsof, typeof, structof
  1336.  */
  1337.  
  1338.                                                                        open
  1339. /* DOCUMENT f= open(filename)
  1340.          or f= open(filename, filemode)
  1341.          or f= open(filename, filemode, errmode)
  1342.      opens the file FILENAME according to FILEMODE (both are strings).
  1343.      If ERRMODE is non-nil and non-zero, fail by returning nil F,
  1344.      otherwise failure to open or create the file is a runtime error.
  1345.  
  1346.      To use ERRMODE to check for the existence of a file:
  1347.  
  1348.                                                          FROM open TO openb
  1349.  
  1350.         if (open(filename,,1)) file_exists;
  1351.     else file_does_not_exist;
  1352.  
  1353.      The return value F is an IOStream (or just stream for short).  When
  1354.      the last reference to this return value is discarded, the file will
  1355.      be closed.  The file can also be explicitly closed with the close
  1356.      function.  The FILEMODE determines whether the file is to be
  1357.      opened in read, write, or update mode, and whether writes are
  1358.      restricted to the end-of-file (append mode).  FILEMODE also
  1359.      determines whether the file is opened as a text file or as a
  1360.      binary file.  FILEMODE can have the following values, which are
  1361.      the same as for the ANSI standard fopen function:
  1362.         "r"     - read only
  1363.         "w"     - write only, random access, existing file overwritten
  1364.     "a"     - write only, forced to end-of-file,
  1365.             existing file preserved
  1366.     "r+"    - read/write, random access, existing file preserved
  1367.     "w+"    - read/write, random access, existing file overwritten
  1368.     "a+"    - read/write, reads random access,
  1369.             writes forced to end-of-file, existing file preserved
  1370.     "rb"  "wb"  "ab"  "r+b"  "rb+"  "w+b"  "wb+"  "a+b"  "ab+"
  1371.             without b means text file, with b means binary file
  1372.      The default FILEMODE is "r" -- open an existing text file for
  1373.      reading.
  1374.  
  1375.      The read and write functions perform I/O on text files.
  1376.      I/O to binary files may be performed explicitly using the save
  1377.      and restore functions, or implicitly by using the stream variable
  1378.      F as if it were a data structure instance (e.g.- f.x refers to
  1379.      variable x in the binary file f).
  1380.   SEE ALSO: create, close, read, write, rdline, bookmark, backup,
  1381.             rename, remove, save, restore
  1382.  */
  1383.  
  1384.                                                                     open102
  1385.     /* SEE close102     */
  1386.  
  1387.                                                                       openb
  1388. /* DOCUMENT file= openb(filename)
  1389.          or file= openb(filename, clogfile)
  1390.      open the existing file FILENAME for read-only binary I/O.
  1391.      (Use updateb or createb, respectively, to open an existing file
  1392.       with read-write access or to create a new file.)
  1393.      If the CLOGFILE argument is supplied, it represents the structure
  1394.      of FILENAME in the Clog binary data description language.
  1395.      After an openb, the file variable may be used to extract variables
  1396.      from the file as if it were a structure instance.  That is, the
  1397.      expression "file.var" refers to the variable "var" in file "file".
  1398.      A complete list of the variable names present in the file may
  1399.      be obtained using the get_vars function.  If the file contains
  1400.      history records, the jt and jc functions may be used to set the
  1401.      current record -- initially, the first record is current.
  1402.      The restore function may be used to make memory copies of data
  1403.      in the file; this will be faster than a large number of
  1404.      references to "file.var".
  1405.  
  1406.                                                          FROM openb TO poly
  1407.  
  1408.    SEE ALSO: updateb, createb, open, cd
  1409.              show, jt, jc, restore
  1410.              get_vars, get_times, get_ncycs, get_member, has_records
  1411.              set_blocksize, dump_clog, read_clog, recover_file
  1412.          openb_hooks, open102, close102, get_addrs
  1413.  */
  1414.  
  1415.                                                                 openb_hooks
  1416. /* DOCUMENT openb_hooks
  1417.      array of names of functions to be tried by openb if the file to be
  1418.      opened is not a PDB file.  By default,
  1419.        openb_hooks= ["_not_pdbf", "_not_cdf"].
  1420.      The hook functions will be called with the file as argument
  1421.      (e.g.- _not_cdf(file)), beginning with openb_hooks(1), until
  1422.      one of them returns 0.  Note that a hook should return 0 if it
  1423.      "recognizes" the file as one that it should be able to open, but
  1424.      finds that the file is misformatted (alternatively, it could call
  1425.      error to abort the whole process).
  1426.  */
  1427.  
  1428.                                                                      orgsof
  1429. /* DOCUMENT orgsof(object)
  1430.      returns a vector of integers describing the dimensions of OBJECT.
  1431.      The format of the vector is [number of dims, origin1, origin2, ...].
  1432.      By default, dimension origins are ignored, but use_origins changes
  1433.      this.  The dimsof function returns the length of each dimension.
  1434.      *** NOTE NOTE NOTE ***
  1435.      Unless use_origins(1) is in effect, orgsof will always return
  1436.      1 for all of the originI in the list.  Thus, whether use_origins(1)
  1437.      is in effect or not, you are guaranteed that x(orgsof(x)(2)) is the
  1438.      first element of x.
  1439.   SEE ALSO: dimsof, typeof, structof, numberof, sizeof, use_origins
  1440.  */
  1441.  
  1442.                                                               pc_primitives
  1443. /* DOCUMENT pc_primitives, file
  1444.      sets FILE primitive data types to be native to IBM PC.
  1445.  */
  1446.  
  1447.                                                                          pi
  1448. /* DOCUMENT pi
  1449.      roughly 3.14159265358979323846264338327950288
  1450.  */
  1451.  
  1452.                                                                        poly
  1453. /* DOCUMENT poly(x, a0, a1, a2, ..., aN)
  1454.      returns the polynomial  A0 + A1*x + A2*x^2 + ... + AN*X^N
  1455.      The data type and dimensions of the result, and conformability rules
  1456.      for the inputs are identical to those for the expression.
  1457.  */
  1458.  
  1459.                                                    FROM pr1 TO process_argv
  1460.  
  1461.                                                                         pr1
  1462. /* DOCUMENT pr1(x)
  1463.      returns text representing expression X, equivalent to print(X)(1).
  1464.    SEE ALSO: print, swrite
  1465.  */
  1466.  
  1467.                                                                       print
  1468. /* DOCUMENT print, object1, object2, object3, ...
  1469.          or print(object1, object2, object3, ...)
  1470.      prints an ASCII representation of the OBJECTs, in roughly the format
  1471.      they could appear in Yorick source code.  When invoked as a subroutine
  1472.      (in the first form), output is to the terminal.  When invoked as a
  1473.      function (int the second form), the output is stored as a vector of
  1474.      strings, one string per line that would have been output.
  1475.      Printing a structure definition prints the structure definition;
  1476.      printing a function prints its "func" definition; printing files,
  1477.      bookmarks, and other objects generally provides some sort of
  1478.      useful description of the object.
  1479.   SEE ALSO: pr1, print_format, write, exit, error, nameof, typeof
  1480.  */
  1481.  
  1482.                                                                print_format
  1483. /* DOCUMENT print_format, line_length, char=, short=, int=, float=,
  1484.                           double=, complex=, pointer=
  1485.      sets the format string the print function will use for each of
  1486.      the basic data types.  Yorick format strings are the same as the
  1487.      format strings for the printf function defined in the ANSI C standard.
  1488.      The default strings may be restored individually by setting the
  1489.      associated format string to ""; all defaults are restored if
  1490.      print_format is invoked with no arguments.  The default format strings
  1491.      are:  "0x%02x", "%d", "%d", "%ld", "%g", "%g", and "%g%+gi".
  1492.      Note that char and short values are converted to int before being
  1493.      passed to printf, and that float is converted to double.
  1494.      If present, an integer positional argument is taken as the line
  1495.      length; <=0 restores the default line length of 80 characters.
  1496.   SEE ALSO: print, write, nameof, typeof
  1497.  */
  1498.  
  1499.                                                                process_argv
  1500. /* DOCUMENT remaining= process_argv()
  1501.        -or- remaining= process_argv("your startup message")
  1502.      Performs standard command line processing.  This function is
  1503.      invoked by the default custom.i file (in $Y_HOME/include); you
  1504.      can also invoke it from your personal ~/Yorick/custom.i file.
  1505.      The process_argv calls get_argv, removes any arguments of
  1506.      the form "-ifilename" or "-i filename" (the latter is a pair of
  1507.      arguments.  It returns any arguments not of this form as its
  1508.      result, after including any filenames it found in the order
  1509.      they appeared on the command line.
  1510.      The optional string argument may be an array of strings to print
  1511.      a multi-line message.
  1512.  
  1513.    SEE ALSO: batch
  1514.  */
  1515.  
  1516.                                                     FROM ptcen TO randomize
  1517.  
  1518.                                                                       ptcen
  1519. /* DOCUMENT ptcen(zncen)
  1520.          or ptcen(zncen, ireg)
  1521.      returns point centered version of the 2-D zone centered array ZNCEN.
  1522.      The result is imax-by-jmax if ZNCEN is (imax-1)-by-(jmax-1).
  1523.      If the region number array IREG is specified, zones with region
  1524.      number 0 are not included in the point centering operation.
  1525.      Note that IREG should have dimensions imax-by-jmax; the first
  1526.      row and column of IREG are ignored.
  1527.      Without IREG, ptcen(zncen) is equivalent to zncen(pcen,pcen).
  1528.   SEE ALSO: zncen, uncen
  1529.  */
  1530.  
  1531.                                                                        quit
  1532. /* DOCUMENT quit
  1533.      Exit YMainLoop when current task finishes.
  1534.      Normally this terminates the program.
  1535.  */
  1536.  
  1537.                                                                      random
  1538. /* DOCUMENT random(dimension_list)
  1539.             random_seed, seed
  1540.      returns an array of random double values with the given
  1541.      DIMENSION_LIST (nil for a scalar result), uniformly distributed
  1542.      on the interval from 0.0 to 1.0.
  1543.      The algorithm is from Press and Teukolsky, Computers in Physics,
  1544.      vol. 6, no. 5, Sep/Oct 1992 (ran2).  They offer a reward of $1000
  1545.      to anyone who can exhibit a statistical test that this random
  1546.      number generator fails in a "non-trivial" way.
  1547.      The random_seed call reinitializes the random number sequence;
  1548.      SEED should be between 0.0 and 1.0 non-inclusive; if SEED is
  1549.      omitted, nil, or out of range, the sequence is reinitialized as
  1550.      when Yorick starts.
  1551.      The numbers are actually at the centers of 2147483562 equal width
  1552.      bins on the interval [0,1].  Although only these 2 billion numbers
  1553.      are possible, the period of the generator is roughly 2.3e18.
  1554.  
  1555.    SEE ALSO: randomize
  1556.  */
  1557.  
  1558.                                                                 random_seed
  1559.     /* SEE random     */
  1560.  
  1561.                                                                   randomize
  1562. /* DOCUMENT randomize
  1563.             randomize()
  1564.      set the seed for random "randomly" (based on the timer clock
  1565.      and the current state of random).  As a function, returns the
  1566.      value of the seed passed to random_seed.
  1567.  
  1568.    SEE ALSO: random, random_seed
  1569.  */
  1570.  
  1571.                                                         FROM rdline TO read
  1572.  
  1573.                                                                      rdline
  1574. /* DOCUMENT rdline(f)
  1575.          or rdline(f, n, prompt= pstring)
  1576.      returns next line from stream F (stdin if F nil).  If N is non-nil,
  1577.      returns a string array containing the next N lines of F.  If
  1578.      end-of-file occurs, rdline returns nil strings.  If F is nil,
  1579.      uses the PSTRING to prompt for input (default "read> ").
  1580.    SEE ALSO: read, open, close, bookmark, backup, read_n
  1581.  */
  1582.  
  1583.                                                                        read
  1584. /* DOCUMENT n= read(f, format=fstring, obj1, obj2, ...)
  1585.          or n= read(prompt= pstring, format=fstring, obj1, obj2, ...)
  1586.      or n= sread(source, format=fstring, obj1, obj2, ...)
  1587.      reads text from I/O stream F (1st form), or from the keyboard (2nd
  1588.      form), or from the string or string array SOURCE (3rd form),
  1589.      interprets it according to the optional FSTRING, and uses that
  1590.      interpretation to assign values to OBJ1, OBJ2, ...  If the input
  1591.      is taken from the keyboard, the optional prompt PSTRING (default
  1592.      "read> ") is printed before each line is read.  The Yorick write
  1593.      function does not interact with the read function -- writes are
  1594.      always to end-of-file, and do not affect the sequence of lines
  1595.      returned by read.  The backup (and bookmark) function is the
  1596.      only way to change the sequence of lines returned by read.
  1597.  
  1598.      There must be one non-supressed conversion specifier (see below)
  1599.      in FSTRING for each OBJ to be read; the type of the conversion
  1600.      specifier must generally match the type of the OBJ.  That is,
  1601.      an integer OBJ requires an integer specifier (d, i, o, u, or x)
  1602.      in FSTRING, a real OBJ requires a real specifier (e, f, or g),
  1603.      and a string OBJ requires a string specifier (s or []).  An OBJ
  1604.      may not be complex, a pointer, a structure instance, or any non-
  1605.      array Yorick object.  If FSTRING is not supplied, or if it has
  1606.      fewer conversion specifiers than the number of OBJ arguments,
  1607.      then Yorick supplies default specifiers ("%ld" for integers,
  1608.      "%lg" for reals, and "%s" for strings).  If FSTRING contains more
  1609.      specifiers than there are OBJ arguments, the part of FSTRING
  1610.      beginning with the first specifier with no OBJ is ignored.
  1611.  
  1612.      The OBJ may be scalar or arrays, but the dimensions of every OBJ
  1613.      must be identical.  If the OBJ are arrays, Yorick behaves as
  1614.      if the read were called in a loop numberof(OBJ1) times, filling
  1615.      one array element of each of the OBJ according to FSTRING on
  1616.      each pass through the loop.  (Note that this behavior includes
  1617.      the case of reading columns of numbers by a single call to read.)
  1618.  
  1619.      The return value N is the total number of scalar assignments
  1620.      which were made as a result of this call.  (If there were 4
  1621.      OBJ arguments, and each was an array with 17 elements, a return
  1622.      value of N==35 would mean the following:  The first 8 elements
  1623.      of OBJ1, OBJ2, OBJ3, and OBJ4 were read, and the 9th element of
  1624.      OBJ1, OBJ2, and OBJ3 was read.)  The read function sets any
  1625.      elements of the OBJ which were not read to zero -- hence,
  1626.      independent of the returned N, the all of the old data in the
  1627.      OBJ arguments is overwritten.
  1628.  
  1629.                                                           FROM read TO read
  1630.  
  1631.  
  1632.      The read or sread functions continue reading until either:
  1633.      (1) all elements of all OBJ have been filled, or (2) end-of-file
  1634.      (or end of SOURCE for sread) is reached ("input failure"), or
  1635.      (3) part of FSTRING or a conversion specifier supplied by
  1636.      default fails to match the source text ("matching failure").
  1637.  
  1638.      The FSTRING is composed of a series of "directives" which are
  1639.      (1) whitespace -- means to skip any amount of whitespace in the
  1640.          source text
  1641.      (2) characters other than whitespace and % -- must match the
  1642.          characters in the source text exactly, or matching failure
  1643.      occurs and the read operation stops
  1644.      (3) conversion specifiers beginning with % and ending with a
  1645.          character specifying the type of conversion -- optionally
  1646.      skip whitespace, then convert as many characters as
  1647.      continue to "look like" the conversion type, possibly
  1648.      producing a matching failure
  1649.      The conversion specifier is of the form %*WSC, where:
  1650.      * is either the character '*' or not present
  1651.        A specifier beginning with %* does not correspond to any of
  1652.        the OBJ; the converted value will be discarded.
  1653.      W is either a positive decimal integer specifying the maximum
  1654.        field width (not including any skipped leading whitespace),
  1655.        or not present if any number of characters up to end-of-line
  1656.        is acceptable.
  1657.      S is either one of the characters 'h', 'l', or 'L', or not
  1658.        present.  Yorick allows this for compatibility with the C
  1659.        library functions, but ignores it.
  1660.      C is a character specifying the type of conversion:
  1661.        d   - decimal integer
  1662.        i   - decimal, octal (leading 0), or hex (leading 0x) integer
  1663.        o   - octal integer
  1664.        u   - unsigned decimal integer (same as d for Yorick)
  1665.        x, X            - hex integer
  1666.        e, f, g, E, G   - floating point real
  1667.        s   - string of non-whitespace characters
  1668.        [xxx]   - (xxx is any sequence of characters) longest string
  1669.                  of characters matching those in the list
  1670.        [^xxx]  - longest string of characters NOT matching those in
  1671.                  the list (this is how you can extend %s to be
  1672.          delimited by something other than whitespace)
  1673.        %   - the ordinary % character; complete conversion
  1674.              specification must be "%%"
  1675.  
  1676.      The read function is modeled on the ANSI standard C library
  1677.      fscanf and sscanf functions, but differs in several respects:
  1678.        (1) Yorick's read cannot handle the %c, %p, or %n conversion
  1679.            specifiers in FSTRING.
  1680.        (2) Yorick's read never results in a portion of a line
  1681.            being read -- any unused part of a line is simply discarded
  1682.        (end FSTRING with "%[^\n]" if you want to save the trailing
  1683.        part of an input line).
  1684.  
  1685.                                                        FROM read TO reshape
  1686.  
  1687.        (3) As a side effect of (2), there are some differences between
  1688.            fscanf and Yorick's read in how whitespace extending across
  1689.        newlines is handled.
  1690.    SEE ALSO: rdline, write, open, close, bookmark, backup, save, restore,
  1691.              read_n
  1692.  */
  1693.  
  1694.                                                                   read_clog
  1695. /* DOCUMENT file= read_clog(file, clog_name)
  1696.      raw routine to set the binary data structure of FILE according
  1697.      to the text description in the Contents Log file CLOG_NAME.
  1698.  */
  1699.  
  1700.                                                                      read_n
  1701. /* DOCUMENT read_n, f, n0, n1, n2, ...
  1702.      grabs the next numbers N0, N1, N2, ... from file F, skipping over
  1703.      any whitespace, comma, semicolon, or colon delimited tokens which
  1704.      are not numbers.  (Actually, only the first and last characters of
  1705.      the token have to look like a number -- 4xxx3 would be read as 4.)
  1706.      ***WARNING*** at most ten Ns are allowed
  1707.      The Ns can be arrays, provided all have the same dimensions.
  1708.    SEE ALSO: read, rdline
  1709.  */
  1710.  
  1711.                                                                recover_file
  1712. /* DOCUMENT recover_file, filename
  1713.          or recover_file, filename, clogfile
  1714.      writes the descriptive information at the end of a corrupted
  1715.      binary file FILENAME from its Contents Log file CLOGFILE, which
  1716.      is FILENAME+"L" by default.
  1717.  */
  1718.  
  1719.                                                                      remove
  1720.     /* SEE rename     */
  1721.  
  1722.                                                                      rename
  1723. /* DOCUMENT rename, old_filename, new_filename
  1724.             remove filename
  1725.      rename or remove a file.
  1726.    SEE ALSO: open, close, openb, closeb
  1727.  */
  1728.  
  1729.                                                                     require
  1730.     /* SEE include     */
  1731.  
  1732.                                                                     reshape
  1733. /* DOCUMENT reshape, reference, address, type, dimension_list
  1734.          or reshape, reference, type, dimension_list
  1735.          or reshape, reference
  1736.      The REFERENCE must be an unadorned variable, not an expression;
  1737.      reshape sets this variable to an LValue at the specified ADDRESS
  1738.      with the specified TYPE and DIMENSION_LIST.  (See the array
  1739.      function documentation for acceptable DIMENSION_LIST formats.)
  1740.      If ADDRESS is an integer (e.g.- a long), the programmer is
  1741.      responsible for assuring that the data at ADDRESS is valid.
  1742.  
  1743.                                               FROM reshape TO set_blocksize
  1744.  
  1745.      If ADDRESS is a (Yorick) pointer, Yorick will assure that the
  1746.      data pointed to will not be discarded, and the reshape will
  1747.      fail if TYPE and DIMENSION_LIST extend beyond the pointee
  1748.      bounds.  In the second form, ADDRESS is taken to be &REFERENCE;
  1749.      that is, the TYPE and DIMENSION_LIST of the variable are changed
  1750.      without doing any type conversion.  In the third form, REFERENCE
  1751.      is set to nil ([]).  (Simple redefinition will not work on a
  1752.      variable defined using reshape.)
  1753.   SEE ALSO: array, dimsof, numberof, is_array
  1754.  */
  1755.  
  1756.                                                                     restore
  1757.     /* SEE save     */
  1758.  
  1759.                                                                        save
  1760. /* DOCUMENT save, file, var1, var2, ...
  1761.             restore, file, var1, var2, ...
  1762.      saves the variables VAR1, VAR2, etc. in the binary file FILE,
  1763.      or restores them from that file.
  1764.      The VARi may be either non-record or record data in the case that
  1765.      FILE contains records.
  1766.  
  1767.      If one of the VARi does not already exist in FILE, it is created
  1768.      by the save command; after add_record, save adds or stores VARi to
  1769.      the current record.  See add_record for more.  The VARi may be
  1770.      structure definitions (for the save command) to declare data
  1771.      structures for the file.  This is necessary only in the case that
  1772.      a record variable is a pointer -- all of the potential data types
  1773.      of pointees must be known.  No data structures may be declared
  1774.      using the save command after the first record has been added.
  1775.  
  1776.      If no VARi are present, save saves all array variables, and
  1777.      restore restores every non-record variable in the file if there
  1778.      is no current record, and every variable in the current record if
  1779.      there is one.
  1780.    SEE ALSO: openb, createb, updateb, get_vars, add_record, get_addrs
  1781.              jt, jc, _read, _write, data_align
  1782.  */
  1783.  
  1784.                                                                        sech
  1785. /* DOCUMENT sech(x)
  1786.             csch(x)
  1787.      returns the hyperbolic secant (1/cosh) or cosecant (1/sinh) of
  1788.      its argument, without overflowing for large x.
  1789.   SEE ALSO: sinh, cosh, tanh, asinh, acosh, atanh
  1790.  */
  1791.  
  1792.                                                               set_blocksize
  1793. /* DOCUMENT set_blocksize, file, blocksize
  1794.      sets smallest cache block size for FILE to BLOCKSIZE.  BLOCKSIZE
  1795.      is rounded to the next larger number of the form 4096*2^n if
  1796.      necessary; cache blocks for this file will be multiples of
  1797.      BLOCKSIZE bytes long.  The default BLOCKSIZE is 0x4000 (16 KB).
  1798.    SEE ALSO: openb, updateb, createb, save, restore, _read, _write
  1799.  */
  1800.  
  1801.                                                   FROM set_filesize TO show
  1802.  
  1803.                                                                set_filesize
  1804. /* DOCUMENT set_filesize, file, filesize
  1805.      sets the new family member threshhold for FILE to FILESIZE.
  1806.      Whenever a new record is added (see add_record), if the current file
  1807.      in the FILE family has at least one record and the new record would
  1808.      cause the current file to exceed FILESIZE bytes, a new family
  1809.      member will be created to hold the new record.
  1810.      The default FILESIZE is 0x400000 (4 MB).
  1811.    SEE ALSO: openb, updateb, createb, add_record
  1812.  */
  1813.  
  1814.                                                                    set_path
  1815. /* DOCUMENT set_path, "dir1:dir2:dir3:..."
  1816.          or set_path
  1817.      sets the include file search path to the specified list of
  1818.      directories.  The specified directories are searched left to
  1819.      right for include files specified as relative file names in
  1820.      #include directives, or to the include or require functions.
  1821.      If the argument is omitted, restores the default search path,
  1822.      ".:~/Yorick:Y_LAUNCH/include:Y_SITE/include:Y_SITE/contrib",
  1823.      where y_site is the main Yorick directory for this site.
  1824.      The Y_LAUNCH directory is the directory which contains the
  1825.      executable; this directory is omitted if it is the same as
  1826.      Y_SITE.
  1827.  
  1828.      Only the "end user" should ever call set_path, and then only in
  1829.      his or her custom.i file, for the purpose of placing a more
  1830.      elaborate set of personal directories containing Yorick procedures.
  1831.      For example, if someone else maintains Yorick code you use, you
  1832.      might put their ~/Yorick on your include path.
  1833.  
  1834.    SEE ALSO: Y_LAUNCH, Y_SITE, include, require
  1835.  */
  1836.  
  1837.                                                                        show
  1838. /* DOCUMENT show, f
  1839.          or show, f, pat
  1840.          or show, f, 1
  1841.      prints a summary of the variables contained in binary file F.
  1842.      If there are too many variables, use the second form to select
  1843.      only those variables whose first few characters match PAT.
  1844.      In the third form, continues the previous show command where it
  1845.      left off -- this may be necessary for files with large numbers of
  1846.      variables.
  1847.      The variables are printed in alphabetical order down the columns.
  1848.      The print function can be used to obtain other information about F.
  1849.    SEE ALSO: openb, jt, jc
  1850.  */
  1851.  
  1852.                                                           FROM sign TO sort
  1853.  
  1854.                                                                        sign
  1855. /* DOCUMENT sign(x)
  1856.      returns algebraic sign of it argument, or closest point on the
  1857.      unit circle for complex x.  Guaranteed that x==sign(x)*abs(x).
  1858.      sign(0)==+1.
  1859.   SEE ALSO: abs
  1860.  */
  1861.  
  1862.                                                                         sin
  1863. /* DOCUMENT sin(x)
  1864.             cos(x)
  1865.             tan(x)
  1866.      returns the sine, cosine, or tangent of its argument,
  1867.      which is in radians.
  1868.   SEE ALSO: asin, acos, atan
  1869.  */
  1870.  
  1871.                                                                        sinh
  1872. /* DOCUMENT sinh(x)
  1873.             cosh(x)
  1874.             tanh(x)
  1875.      returns the hyperbolic sine, cosine, or tangent of its argument.
  1876.   SEE ALSO: sech, csch, asinh, acosh, atanh
  1877.  */
  1878.  
  1879.                                                                      sizeof
  1880. /* DOCUMENT sizeof(object)
  1881.      returns the size of the object in bytes, or 0 for non-array objects.
  1882.      sizeof(structure_definition) returns the number of bytes per instance.
  1883.   SEE ALSO: dimsof, typeof, structof, numberof
  1884.  */
  1885.  
  1886.                                                                        sort
  1887. /* DOCUMENT sort(x)
  1888.          or sort(x, which)
  1889.      returns an array of longs with dimsof(X) containing index values
  1890.      such that X(sort(X)) is a monotonically increasing array.  X can
  1891.      contain integer, real, or string values.  If X has more than one
  1892.      dimension, WHICH determines the dimension to be sorted.  The
  1893.      default WHICH is 1, corresponding to the first dimension of X.
  1894.      WHICH can be non-positive to count dimensions from the end of X;
  1895.      in particular a WHICH of 0 will sort the final dimension of X.
  1896.  
  1897.      WARNING: The sort function is non-deterministic if some of the
  1898.               values of X are equal, because the Quick Sort algorithm
  1899.           involves a random selection of a partition element.
  1900.  
  1901.      For information on sorting with multiple keys (and on making
  1902.      sort deterministic), type the following:
  1903.         #include "msort.i"
  1904.         help, msort
  1905.  
  1906.    SEE ALSO: median, digitize, interp, integ, histogram
  1907.  */
  1908.  
  1909.                                                       FROM span TO strmatch
  1910.  
  1911.                                                                        span
  1912. /* DOCUMENT span(start, stop, n)
  1913.          or span(start, stop, n, which)
  1914.      returns array of N doubles equally spaced from START to STOP.
  1915.      The START and STOP arguments may themselves be arrays, as long as
  1916.      they are conformable.  In this case, the result will have one
  1917.      dimension of length N in addition to dimsof(START, STOP).
  1918.      By default, the result will be N-by-dimsof(START, STOP), but
  1919.      if WHICH is specified, the new one of length N will be the
  1920.      WHICHth.  WHICH may be non-positive to position the new
  1921.      dimension relative to the end of dimsof(START, STOP); in
  1922.      particular WHICH of 0 produces a result with dimensions
  1923.      dimsof(START, STOP)-by-N.
  1924.    SEE ALSO: spanl, indgen, array
  1925.  */
  1926.  
  1927.                                                                       spanl
  1928. /* DOCUMENT spanl(start, stop, n)
  1929.          or spanl(start, stop, n, which)
  1930.      similar to the span function, but the result array have N points
  1931.      spaced at equal ratios from START to STOP (that is, equally
  1932.      spaced logarithmically).  See span for discussion of WHICH argument.
  1933.      START and STOP must have the same algebraic sign for this to make
  1934.      any sense.
  1935.    SEE ALSO: span, indgen, array
  1936.  */
  1937.  
  1938.                                                                        sqrt
  1939. /* DOCUMENT sqrt(x)
  1940.      returns the square root of its argument.
  1941.   SEE ALSO: abs, also note the rms range function
  1942.  */
  1943.  
  1944.                                                                       sread
  1945.     /* SEE read     */
  1946.  
  1947.                                                                      strlen
  1948. /* DOCUMENT strlen(string_array)
  1949.      returns an long array with dimsof(STRING_ARRAY) containing the
  1950.      lengths of the strings.  The null string (0) is considered to
  1951.      have length 0, just like "".
  1952.    SEE ALSO: strmatch, strpart, strtok
  1953.  */
  1954.  
  1955.                                                                    strmatch
  1956. /* DOCUMENT strmatch(string_array, pattern)
  1957.          or strmatch(string_array, pattern, case_fold)
  1958.      returns an int array with dimsof(STRING_ARRAY) with 0 where
  1959.      PATTERN was not found in STRING_ARRAY and 1 where it was found.
  1960.      If CASE_FOLD is specified and non-0, the pattern match is
  1961.      insensitive to case, that is, an upper case letter will match
  1962.      the same lower case letter and vice-versa.
  1963.    SEE ALSO: strtok, strpart, strlen
  1964.  */
  1965.  
  1966.                                                    FROM strpart TO structof
  1967.  
  1968.                                                                     strpart
  1969. /* DOCUMENT strpart(string_array, m:n)
  1970.       returns another string array with the same dimensions as
  1971.       STRING_ARRAY which consists of characters M through N of
  1972.       the original strings.  M and N are 1-origin indices; if
  1973.       M is omitted, the default is 1; if N is omitted, the default
  1974.       is the end of the string.  If M or N is non-positive, it is
  1975.       interpreted as an index relative to the end of the string,
  1976.       with 0 being the last character, -1 next to last, etc.
  1977.       Finally, the returned string will be shorter than N-M+1
  1978.       characters if the original doesn't have an Mth or Nth
  1979.       character, with "" (note that this is otherwise impossible)
  1980.       if neither an Mth nor an Nth character exists.  A 0
  1981.       is returned for any string which was 0 on input.
  1982.    SEE ALSO: strmatch, strtok, strlen
  1983.  */
  1984.  
  1985.                                                                      strtok
  1986. /* DOCUMENT strtok(string_array, delimiters)
  1987.          or strtok(string_array)
  1988.      strips the first token off of each string in STRING_ARRAY.
  1989.      A token is delimited by any of the characters in the string
  1990.      DELIMITERS.  If DELIMITERS is blank, nil, or not given, the
  1991.      default DELIMITERS is " \t\n" (blanks, tabs, or newlines).
  1992.      The result is a string array ts with dimensions
  1993.      2-by-dimsof(STRING_ARRAY); ts(1,) is the first token, and
  1994.      ts(2,) is the remainder of the string (the character which
  1995.      terminated the first token will be in neither of these parts).
  1996.      The ts(2,) part will be 0 (i.e.- the null string) if no more
  1997.      characters remain after ts(1,); the ts(1,) part will be 0 if
  1998.      no token was present.  A STRING_ARRAY element may be 0, in
  1999.      which case (0, 0) is returned for that element.
  2000.    SEE ALSO: strmatch, strpart, strlen
  2001.  */
  2002.  
  2003.                                                                struct_align
  2004. /* DOCUMENT struct_align, file, alignment
  2005.      in binary file FILE, align new struct members which are themselves
  2006.      struct instances to begin at a byte address which is a multiple of
  2007.      ALIGNMENT.  (This affects members declared explicitly by add_member,
  2008.      as well as implicitly by save or add_variable.)  If ALIGNMENT is <=0,
  2009.      returns to the default for this machine.  The struct alignment is in
  2010.      addition to the alignment implied by the most restrictively aligned
  2011.      member of the struct.  Most machines want ALIGNMENT of 1.
  2012.    SEE ALSO: add_member
  2013.  */
  2014.  
  2015.                                                                    structof
  2016. /* DOCUMENT structof(object)
  2017.      returns the data type of OBJECT, or nil for non-array OBJECTs.
  2018.      Use typeof(object) to get the ASCII name of a the data type.
  2019.   SEE ALSO: typeof, dimsof, numberof, sizeof, nameof
  2020.  */
  2021.  
  2022.                                                      FROM sum TO symbol_set
  2023.  
  2024.                                                                         sum
  2025. /* DOCUMENT sum(x)
  2026.      returns the scalar sum of all elements of its array argument.
  2027.   SEE ALSO: avg, min, max
  2028.  */
  2029.  
  2030.                                                             sun3_primitives
  2031. /* DOCUMENT sun3_primitives, file
  2032.      sets FILE primitive data types to be native to Sun-2 or Sun-3.
  2033.  */
  2034.  
  2035.                                                              sun_primitives
  2036. /* DOCUMENT sun_primitives, file
  2037.      sets FILE primitive data types to be native to Sun, HP, IBM, etc.
  2038.  */
  2039.  
  2040.                                                                      swrite
  2041.     /* SEE write     */
  2042.  
  2043.                                                                  symbol_def
  2044. /* DOCUMENT symbol_def(func_name)(arglist)
  2045.          or symbol_def(var_name)
  2046.      invokes the function FUNC_NAME with the specified ARGLIST,
  2047.      returning the return value.  ARGLIST may be zero or more arguments.
  2048.      In fact, symbol_def("fname")(arg1, arg2, arg3) is equivalent to
  2049.      fname(arg1, arg2, arg3), so that "fname" can be the name of any
  2050.      variable for which the latter syntax is meaningful -- interpreted
  2051.      function, built-in function, or array.
  2052.  
  2053.      Without an argument list, symbol_def("varname") is equivalent to
  2054.      varname, which allows you to get the value of a variable whose name
  2055.      you must compute.
  2056.  
  2057.      DO NOT OVERUSE THIS FUNCTION.  It works around a specific deficiency
  2058.      of the Yorick language -- the lack of pointers to functions -- and
  2059.      should be used for such purposes as hook lists (see openb).
  2060.  
  2061.    SEE ALSO: symbol_set
  2062.  */
  2063.  
  2064.                                                                  symbol_set
  2065. /* DOCUMENT symbol_set, var_name, value
  2066.      is equivalent to the redefinition
  2067.           varname= value
  2068.      except that var_name="varname" is a string which must be computed.
  2069.  
  2070.      DO NOT OVERUSE THIS FUNCTION.  It works around a specific deficiency
  2071.      of the Yorick language -- the lack of pointers to functions, streams,
  2072.      bookmarks, and other special non-array data types.
  2073.  
  2074.    SEE ALSO: symbol_def
  2075.  */
  2076.  
  2077.                                                  FROM system TO timer_print
  2078.  
  2079.                                                                      system
  2080. /* DOCUMENT system, "shell command line"
  2081.      Passes the command line string to a shell for execution.
  2082.      If the string is constant, you may use the special syntax:
  2083.          $shell command line
  2084.      (A long command line may be continued by ending the line with \
  2085.      as usual.)  The system function syntax allows Yorick to compute
  2086.      parts of the command line string, while the simple $ escape
  2087.      syntax does not.  In either case, the only way to get output
  2088.      back from such a command is to redirect it to a file, then
  2089.      read the file.  Note that Yorick does not regain control
  2090.      until the subordinate shell finishes.  (Yorick will get control
  2091.      back if the command line backgrounds the job.)
  2092.  */
  2093.  
  2094.                                                                         tan
  2095.     /* SEE sin     */
  2096.  
  2097.                                                                        tanh
  2098.     /* SEE sinh     */
  2099.  
  2100.                                                                       timer
  2101. /* DOCUMENT timer, elapsed
  2102.          or timer, elapsed, split
  2103.      updates the ELAPSED and optionally SPLIT timing arrays.  These
  2104.      arrays must each be of type array(double,3); the layout is
  2105.      [cpu, system, wall], with all three times measured in seconds.
  2106.      ELAPSED is updated to the total times elapsed since this copy
  2107.      of Yorick started.  SPLIT is incremented by the difference between
  2108.      the new values of ELAPSED and the values of ELAPSED on entry.
  2109.      This feature allows for primitive code profiling by keeping
  2110.      separate accounting of time usage in several categories, e.g.--
  2111.         elapsed= total= cat1= cat2= cat3= array(double, 3);
  2112.         timer, elapsed, total;
  2113.         ... category 1 code ...
  2114.     timer, elapsed, cat1;
  2115.         ... category 2 code ...
  2116.     timer, elapsed, cat2;
  2117.         ... category 3 code ...
  2118.     timer, elapsed, cat3;
  2119.         ... more category 2 code ...
  2120.     timer, elapsed, cat2;
  2121.         timer, elapsed, total;
  2122.      The wall time is not absolutely reliable, owning to possible
  2123.      rollover at midnight.
  2124.    SEE ALSO: timestamp, timer_print
  2125.  */
  2126.  
  2127.                                                                 timer_print
  2128. /* DOCUMENT timer_print, label1, split1, label2, split2, ...
  2129.          or timer_print
  2130.          or timer_print, label_total
  2131.      prints out a timing summary for splits accumulated by timer.
  2132.    SEE ALSO: timer
  2133.  */
  2134.  
  2135.                                                     FROM timestamp TO uncen
  2136.  
  2137.                                                                   timestamp
  2138. /* DOCUMENT timestamp()
  2139.      returns string of the form "Sun Jan  3 15:14:13 1988" -- always
  2140.      has 24 characters.
  2141.    SEE ALSO: timer
  2142.  */
  2143.  
  2144.                                                                   transpose
  2145. /* DOCUMENT transpose(x)
  2146.          or transpose(x, permutation1, permutation2, ...)
  2147.      transpose the first and last dimensions of array X.  In the second
  2148.      form, each PERMUTATION specifies a simple permutation of the
  2149.      dimensions of X.  These permutations are compounded left to right
  2150.      to determine the final permutation to be applied to the dimensions
  2151.      of X.  Each PERMUTATION is either an integer or a 1D array of
  2152.      integers.  A 1D array specifies a cyclic permutation of the
  2153.      dimensions as follows: [3, 5, 2] moves the 3rd dimension to the
  2154.      5th dimension, the 5th dimension to the 2nd dimension, and the 2nd
  2155.      dimension to the 3rd dimension.  Non-positive numbers count from the
  2156.      end of the dimension list of X, so that 0 is the final dimension,
  2157.      -1 in the next to last, etc.  A scalar PERMUTATION is a shorthand
  2158.      for a cyclic permutation of all of the dimensions of X.  The value
  2159.      of the scalar is the dimension to which the 1st dimension will move.
  2160.  
  2161.      Examples:  Let x have dimsof(x) equal [6, 1,2,3,4,5,6] in order
  2162.         to be able to easily identify a dimension by its length. Then:
  2163.     dimsof(x)                          == [6, 1,2,3,4,5,6]
  2164.     dimsof(transpose(x))               == [6, 6,2,3,4,5,1]
  2165.         dimsof(transpose(x,[1,2]))         == [6, 2,1,3,4,5,6]
  2166.     dimsof(transpose(x,[1,0]))         == [6, 6,2,3,4,5,1]
  2167.     dimsof(transpose(x,2))             == [6, 6,1,2,3,4,5]
  2168.     dimsof(transpose(x,0))             == [6, 2,3,4,5,6,1]
  2169.     dimsof(transpose(x,3))             == [6, 5,6,1,2,3,4]
  2170.     dimsof(transpose(x,[4,6,3],[2,5])) == [6, 1,5,6,3,2,4]
  2171.  */
  2172.  
  2173.                                                                      typeof
  2174. /* DOCUMENT typeof(object)
  2175.      returns a string describing the type of object.  For the basic
  2176.      data types, these are "char", "short", "int", "long", "float",
  2177.      "double", "complex", "string", "pointer", "struct_instance",
  2178.      "void", "range", "struct_definition", "function", "builtin",
  2179.      and "stream".
  2180.   SEE ALSO: structof, dimsof, sizeof, numberof, nameof
  2181.  */
  2182.  
  2183.                                                                       uncen
  2184. /* DOCUMENT uncen(ptcen)
  2185.          or uncen(ptcen, ireg)
  2186.      returns zone centered version of the 2-D zone centered array PTCEN.
  2187.      The result is (imax-1)-by-(jmax-1) if PTCEN is imax-by-jmax.
  2188.      If the region number array IREG is specified, zones with region
  2189.      number 0 are not included in the point centering operation.
  2190.      Note that IREG should have dimensions imax-by-jmax, like
  2191.      the input PTCEN array; the first row and column of IREG are ignored.
  2192.  
  2193.                                               FROM uncen TO vaxg_primitives
  2194.  
  2195.      Without IREG, uncen(ptcen) is equivalent to ptcen(uncp,uncp).
  2196.  
  2197.      Do not use uncen to zone center data which is naturally point
  2198.      centered -- use the zncen function for that purpose.  The uncen
  2199.      function is the (nearly) exact inverse of the ptcen function,
  2200.      so that uncen(ptcen(zncen, ireg), ireg) will return the original
  2201.      zncen array.  The uncen reconstruction is as exact as possible,
  2202.      given the finite precision of floating point operations.
  2203.   SEE ALSO: ptcen, zncen
  2204.  */
  2205.  
  2206.                                                                     updateb
  2207. /* DOCUMENT file= updateb(filename)
  2208.          or file= updateb(filename, primitives)
  2209.      open a binary date file FILENAME for update (mode "r+b").
  2210.      The optional PRIMITIVES argument is as for the createb function.
  2211.      If the file exists, it is opened as if by openb(filename),
  2212.      otherwise a new PDB file is created as if by createb(filename).
  2213.    SEE ALSO: openb, createb, cd, save, restore, get_vars, get_addrs
  2214.              close102, close102_default, open102, at_pdb_open, at_pdb_close
  2215.  */
  2216.  
  2217.                                                                 use_origins
  2218. /* DOCUMENT dummy= use_origins(dont_force)
  2219.      Yorick array dimensions have an origin as well as a length.
  2220.      By default, this origin is 1 (like FORTRAN arrays, unlike C
  2221.      arrays).  However, the array function and the pseudo-index (-)
  2222.      can be used to produce arrays with other origins.
  2223.  
  2224.      Initially, the origin of an array index is ignored by Yorick; the
  2225.      first element of any array has index 1.  You can change this
  2226.      default behavior by calling use_origins with non-zero DONT_FORCE,
  2227.      and restore the default behavior by calling use_origins(0).
  2228.  
  2229.      When the returned object DUMMY is destroyed, either by return from
  2230.      the function in which it is a local variable, or by explicit
  2231.      redefintion of the last reference to it, the treatment of array
  2232.      index origins reverts to the behavior prior to the call to
  2233.      use_origins.  Thus, you can call use_origins at the top of a
  2234.      function and not worry about restoring the external behavior
  2235.      before every possible return (including errors).
  2236.  
  2237.   SEE ALSO: array, dimsof, orgsof
  2238.  */
  2239.  
  2240.                                                              vax_primitives
  2241. /* DOCUMENT vax_primitives, file
  2242.      sets FILE primitive data types to be native to VAXen, H-double, only.
  2243.  */
  2244.  
  2245.                                                             vaxg_primitives
  2246. /* DOCUMENT vaxg_primitives, file
  2247.      sets FILE primitive data types to be native to VAXen, G-double, only.
  2248.  */
  2249.  
  2250.                                                        FROM volume TO write
  2251.  
  2252.                                                                      volume
  2253. /* DOCUMENT volume(r, z)
  2254.      returns the zonal volumes of the 2-D cylindrical mesh (R, Z).
  2255.      If R and Z are imax-by-jmax, the result is (imax-1)-by-(jmax-1).
  2256.      The volume is positive when, say, Z increases with i and R increases
  2257.      with j.  For example, volume([[0,0],[1,1]],[[0,1],[0,1]]) is +pi.
  2258.    SEE ALSO: area
  2259.  */
  2260.  
  2261.                                                                    warranty
  2262.     /* SEE copyright     */
  2263.  
  2264.                                                                       where
  2265. /* DOCUMENT where(x)
  2266.      returns the vector of longs which is the index list of non-zero
  2267.      values in the array x.  Thus, where([[0,1,3],[2,0,4]]) would
  2268.      return [2,3,4,6].  If noneof(x), where(x) is a special range
  2269.      function which will return a nil value if used to index an array;
  2270.      hence, if noneof(x), then x(where(x)) is nil.
  2271.      If x is a non-zero scalar, then where(x) returns a scalar value.
  2272.      The rather recondite behavior for scalars and noneof(x) provides
  2273.      maximum performance when the merge function to be used with the
  2274.      where function.
  2275.   SEE ALSO: where2, merge, merge2 allof, anyof, noneof, nallof, sort
  2276.  */
  2277.  
  2278.                                                                      where2
  2279. /* DOCUMENT where2(x)
  2280.      like where(x), but the returned list is decomposed into indices
  2281.      according to the dimensions of x.  The returned list is always
  2282.      2 dimensional, with the second dimension the same as the dimension
  2283.      of where(x).  The first dimension has length corresponding to the
  2284.      number of dimensions of x.  Thus, where2([[0,1,3],[2,0,4]]) would
  2285.      return [[2,1],[3,1],[1,2],[3,2]].
  2286.      If noneof(x), where2 returns [] (i.e.- nil).
  2287.   SEE ALSO: where, merge, merge2, allof, anyof, noneof, nallof, sort
  2288.  */
  2289.  
  2290.                                                                       write
  2291. /* DOCUMENT n= write(f, format=fstring, linesize=l, obj1, obj2, ...)
  2292.             n= write(format=fstring, linesize=l, obj1, obj2, ...)
  2293.      or strings= swrite(format=fstring, linesize=l, obj1, obj2, ...)
  2294.      writes text to I/O stream F (1st form), or to the terminal (2nd
  2295.      form), or to the STRINGS string array (3rd form), representing
  2296.      arrays OBJ1, OBJ2, ..., according to the optional FSTRING.  The
  2297.      optional linesize L defaults to 80 characters, and helps restrict
  2298.      line lengths when FSTRING is not given, or does not contain
  2299.      newline directives.  The write function always appends to the
  2300.      end of a text file; the position for a sequence of reads is
  2301.      not affected by intervening writes.
  2302.  
  2303.      There must be one conversion specifier (see below) in FSTRING for
  2304.      each OBJ to be written; the type of the conversion specifier must
  2305.      generally match the type of the OBJ.  That is, an integer OBJ
  2306.      requires an integer specifier (d, i, o, u, x, or c) in FSTRING,
  2307.  
  2308.                                                         FROM write TO write
  2309.  
  2310.      a real OBJ requires a real specifier (e, f, or g), a string OBJ
  2311.      requires the string specifier (s), and a pointer OBJ requires a
  2312.      the pointer specifier (p).  An OBJ may not be complex, a structure
  2313.      instance, or any non-array Yorick object.  If FSTRING is not
  2314.      supplied, or if it has fewer conversion specifiers than the
  2315.      number of OBJ arguments, then Yorick supplies default specifiers
  2316.      (" %8ld" for integers, " %14.6lg" for reals, " %s" for strings, and
  2317.      " %8p" for pointers).  If FSTRING contains more specifiers than
  2318.      there are OBJ arguments, the part of FSTRING beginning with the
  2319.      first specifier with no OBJ is ignored.
  2320.  
  2321.      The OBJ may be scalar or arrays, but the dimensions of the OBJ
  2322.      must be conformable.  If the OBJ are arrays, Yorick behaves as
  2323.      if he write were called in a loop dimsof(OBJ1, OBJ2, ...) times,
  2324.      writing one array element of each of the OBJ according to FSTRING
  2325.      on each pass through the loop.  The swrite function returns a
  2326.      string array with dimensions dimsof(OBJ1, OBJ2, ...).  The write
  2327.      function inserts a newline between passes through the array if
  2328.      the line produced by the previous pass did not end with a
  2329.      newline, and if the total number of characters output since the
  2330.      previous inserted newline, plus the number of characters about
  2331.      to be written on the current pass, would exceed L characters
  2332.      (L defaults to 80).  The write function returns the total
  2333.      number of characters output.
  2334.  
  2335.      The FSTRING is composed of a series of "directives" which are
  2336.      (1) characters other than % -- copied directly to output
  2337.      (2) conversion specifiers beginning with % and ending with a
  2338.          character specifying the type of conversion -- specify
  2339.      how to convert an OBJ into characters for output
  2340.      The conversion specifier is of the form %FW.PSC, where:
  2341.      F is zero or more optional flags:
  2342.        - left justify in field width
  2343.        + signed conversion will begin with either + or -
  2344.          (space) signed conversion  will begin with either space or -
  2345.        # alternate form (see description of each type below)
  2346.        0 pad field width with leading 0s instead of leading spaces
  2347.      W is either a decimal integer specifying the minimum field width
  2348.        (padded as specified by flags), or not present to use the
  2349.        minimum number of characters required.
  2350.      .P is either a decimal integer specifying the precision of the
  2351.        result, or not present to get the default.  For integers, this
  2352.        is the number of digits to be printed (possibly forcing leading
  2353.        zeroes), and defaults to 1.  For reals, this is the number of
  2354.        digits after the decimal point, and defaults to 6.  For strings,
  2355.        this is the maximum number of characters to print, and defaults
  2356.        to infinity.
  2357.      S is either one of the characters 'h', 'l', or 'L', or not
  2358.        present.  Yorick allows this for compatibility with the C
  2359.        library functions, but ignores it.
  2360.      C is a character specifying the type of conversion:
  2361.        d, i  - decimal integer
  2362.        o     - octal integer (# forces leading 0)
  2363.        u     - unsigned decimal integer (same as d for Yorick)
  2364.        x, X            - hex integer (# forces leading 0x)
  2365.  
  2366.                                                         FROM write TO zncen
  2367.  
  2368.        f     - floating point real in fixed point notation
  2369.                (# forces decimal)
  2370.        e, E  - floating point real in scientific notation
  2371.        g, G  - floating point real in fixed or scientific notation
  2372.                depending on the value converted (# forces decimal)
  2373.        s   - string of ASCII characters
  2374.        c   - integer printed as corresponding ASCII character
  2375.        p   - pointer
  2376.        %   - the ordinary % character; complete conversion
  2377.              specification must be "%%"
  2378.  
  2379.      The write function is modeled on the ANSI standard C library
  2380.      fprintf and sprintf functions, but differs in several respects:
  2381.        (1) Yorick's write cannot handle the %n conversion specifier
  2382.            in FSTRING.
  2383.        (2) Yorick's write may insert additional newlines if the OBJ
  2384.            are arrays, to avoid extremely long output lines.
  2385.    SEE ALSO: print, exit, error, read, rdline, open, close, save, restore
  2386.  */
  2387.  
  2388.                                                              xdr_primitives
  2389. /* DOCUMENT xdr_primitives, file
  2390.      sets FILE primitive data types to be XDR (external data representation).
  2391.  */
  2392.  
  2393.                                                                yorick_stats
  2394. /* DOCUMENT yorick_stats
  2395.      returns an array of longs describing Yorick memory usage.
  2396.      For debugging.  See ydata.c source code.
  2397.  */
  2398.  
  2399.                                                                       zncen
  2400. /* DOCUMENT zncen(ptcen)
  2401.          or zncen(ptcen, ireg)
  2402.      returns zone centered version of the 2-D point centered array PTCEN.
  2403.      The result is (imax-1)-by-(jmax-1) if PTCEN is imax-by-jmax.
  2404.      If the region number array IREG is specified, zones with region
  2405.      number 0 are not included in the point centering operation.
  2406.      Note that IREG should have dimensions imax-by-jmax, like
  2407.      the input PTCEN array; the first row and column of IREG are ignored.
  2408.      Without IREG, zncen(ptcen) is equivalent to ptcen(zcen,zcen).
  2409.   SEE ALSO: ptcen, uncen
  2410.  */
  2411.