klisp

an open source interpreter for the Kernel Programming Language.
git clone http://git.hanabi.in/repos/klisp.git
Log | Files | Refs | README

System.html (6822B)


      1 <html lang="en">
      2 <head>
      3 <title>System - klisp Reference Manual</title>
      4 <meta http-equiv="Content-Type" content="text/html">
      5 <meta name="description" content="klisp Reference Manual">
      6 <meta name="generator" content="makeinfo 4.13">
      7 <link title="Top" rel="start" href="index.html#Top">
      8 <link rel="prev" href="Libraries.html#Libraries" title="Libraries">
      9 <link rel="next" href="Alphabetical-Index.html#Alphabetical-Index" title="Alphabetical Index">
     10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
     11 <meta http-equiv="Content-Style-Type" content="text/css">
     12 <style type="text/css"><!--
     13   pre.display { font-family:inherit }
     14   pre.format  { font-family:inherit }
     15   pre.smalldisplay { font-family:inherit; font-size:smaller }
     16   pre.smallformat  { font-family:inherit; font-size:smaller }
     17   pre.smallexample { font-size:smaller }
     18   pre.smalllisp    { font-size:smaller }
     19   span.sc    { font-variant:small-caps }
     20   span.roman { font-family:serif; font-weight:normal; } 
     21   span.sansserif { font-family:sans-serif; font-weight:normal; } 
     22 --></style>
     23 <link rel="stylesheet" type="text/css" href="css/style.css">
     24 </head>
     25 <body>
     26 <div class="node">
     27 <a name="System"></a>
     28 <p>
     29 Next:&nbsp;<a rel="next" accesskey="n" href="Alphabetical-Index.html#Alphabetical-Index">Alphabetical Index</a>,
     30 Previous:&nbsp;<a rel="previous" accesskey="p" href="Libraries.html#Libraries">Libraries</a>,
     31 Up:&nbsp;<a rel="up" accesskey="u" href="index.html#Top">Top</a>
     32 <hr>
     33 </div>
     34 
     35 <!-- node-name,  next,  previous,  up -->
     36 <h2 class="chapter">22 System</h2>
     37 
     38 <p><a name="index-system-406"></a>
     39 Module System contains some useful features for interacting with the
     40 host environment.
     41 
     42    <p>SOURCE NOTE: most of these come from r7rs.
     43 
     44 <div class="defun">
     45 &mdash; Applicative: <b>get-current-second</b> (<var>get-current-second</var>)<var><a name="index-get_002dcurrent_002dsecond-407"></a></var><br>
     46 <blockquote><p>Applicative <code>get-current-second</code> returns the number of seconds
     47 elapsed since the UNIX/POSIX epoch (that is midnight January 1st,
     48 1970, UTC).
     49 
     50         <p>NOTE: r7rs specifies TAI seconds, but for now we are sticking to POSIX
     51 here. 
     52 </p></blockquote></div>
     53 
     54 <div class="defun">
     55 &mdash; Applicative: <b>get-current-jiffies</b> (<var>get-current-jiffies</var>)<var><a name="index-get_002dcurrent_002djiffies-408"></a></var><br>
     56 <blockquote><p>Applicative <code>get-current-jiffies</code> returns the number of jiffies
     57 (fractions of a second) elapsed since an arbitrary epoch that may
     58 change in each run of the klisp interpreter.  Applicative
     59 <code>get-jiffies-per-second</code> can be used to determine which fraction
     60 of a second a jiffy represents. 
     61 </p></blockquote></div>
     62 
     63 <div class="defun">
     64 &mdash; Applicative: <b>get-jiffies-per-second</b> (<var>get-jiffies-per-second</var>)<var><a name="index-get_002djiffies_002dper_002dsecond-409"></a></var><br>
     65 <blockquote><p>Applicative <code>get-jiffies-per-second</code> returns a constant
     66 representing the number of jiffies that correspond to one second. 
     67 </p></blockquote></div>
     68 
     69 <div class="defun">
     70 &mdash; Applicative: <b>file-exists</b> (<var>file-exists string</var>)<var><a name="index-file_002dexists-410"></a></var><br>
     71 <blockquote><p>Predicate <code>file-exists?</code> checks to see if a file named
     72 <code>string</code> exists. 
     73 </p></blockquote></div>
     74 
     75 <div class="defun">
     76 &mdash; Applicative: <b>delete-file</b> (<var>delete-file string</var>)<var><a name="index-delete_002dfile-411"></a></var><br>
     77 <blockquote><p><code>string</code> should be the name/path for an existing file.
     78 
     79         <p>Applicative <code>delete-file</code> deletes the file named <code>string</code>. 
     80 If it doesn't exists or can't be deleted, an error is signaled. The
     81 result returned by <code>delete-file</code> is inert. 
     82 </p></blockquote></div>
     83 
     84 <div class="defun">
     85 &mdash; Applicative: <b>rename-file</b> (<var>rename-file string1 string2</var>)<var><a name="index-rename_002dfile-412"></a></var><br>
     86 <blockquote><p><code>string1</code> should be the name/path for an existing file,
     87 <code>string2</code> should be the name/path for a non existing file.
     88 
     89         <p>Applicative <code>rename-file</code> renames the file named <code>string1</code>
     90 to <code>string2</code>. If the file doesn't exists or can't be renamed for
     91 any reason, an error is signaled. The result returned by
     92 <code>rename-file</code> is inert.
     93 
     94         <p>SOURCE NOTE: this is missing from r7rs, it is taken from C, being
     95 quite similar to <code>delete-file</code>. 
     96 </p></blockquote></div>
     97 
     98 <div class="defun">
     99 &mdash; Applicative: <b>get-script-arguments</b> (<var>get-script-arguments</var>)<var><a name="index-get_002dscript_002darguments-413"></a></var><br>
    100 &mdash; Applicative: <b>get-interpreter-arguments</b> (<var>get-interpreter-arguments</var>)<var><a name="index-get_002dinterpreter_002darguments-414"></a></var><br>
    101 <blockquote><p>These applicatives return respectively the script and interpreter
    102 arguments.  The script arguments are a list of the arguments passed to
    103 the klisp interpreter starting from (and including) the script name. 
    104 The interpreter arguments are the complete list of arguments passed to
    105 the klisp interpreter (including the name of the interpreter as the
    106 first item in the list, the interpreter flag arguments and the script
    107 name and arguments. 
    108 </p></blockquote></div>
    109 
    110 <div class="defun">
    111 &mdash; Applicative: <b>defined-environment-variable?</b> (<var>defined-environment-variable? string</var>)<var><a name="index-defined_002denvironment_002dvariable_003f-415"></a></var><br>
    112 <blockquote><p>Predicate <code>defined-environment-variable?</code> returns true iff
    113 <code>string</code> represents a defined envrionment variable. 
    114 </p></blockquote></div>
    115 
    116 <div class="defun">
    117 &mdash; Applicative: <b>get-environment-variable</b> (<var>get-environment-variable string</var>)<var><a name="index-get_002denvironment_002dvariable-416"></a></var><br>
    118 <blockquote><p>Applicative <code>get-environment-variable</code> returns the value of the
    119 environment variable represented by <code>string</code>.  If <code>string</code>
    120 doesn't represent a defined environment variable an error is signaled. 
    121 </p></blockquote></div>
    122 
    123 <div class="defun">
    124 &mdash; Applicative: <b>get-environment-variables</b> (<var>get-environment-variables</var>)<var><a name="index-get_002denvironment_002dvariables-417"></a></var><br>
    125 <blockquote><!-- TODO xref to alist -->
    126         <p>Applicative <code>get-environment-variable</code> returns an alist
    127 representing the defined environment variables and their values.  The
    128 alist is a list of <code>(variable . value)</code> entries, where both
    129 <code>variable</code> and <code>value</code> are strings. 
    130 </p></blockquote></div>
    131 
    132 <!-- appendices -->
    133 <!-- TODO -->
    134 <!-- *-texinfo-*- -->
    135 <!-- TODO correct prev node -->
    136    </body></html>
    137