klisp

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

klisp.1 (4088B)


      1 .TH KLISP 1 "$Date: 2011/11/23 06:35:03 $"
      2 .SH NAME
      3 klisp \- Kernel Programming Language interpreter
      4 .SH SYNOPSIS
      5 .B klisp
      6 [
      7 .I options
      8 ]
      9 [
     10 .I script
     11 [
     12 .I args
     13 ]
     14 ]
     15 .SH DESCRIPTION
     16 .B klisp
     17 is a stand-alone interpreter for 
     18 the Kernel Programming Language.
     19 It loads and evaluates Kernel programs
     20 in textual source form.
     21 .B klisp
     22 can be used as a batch interpreter and also interactively.
     23 .LP
     24 The given
     25 .I options
     26 (see below)
     27 are evaluated and then
     28 the klisp program in file
     29 .I script
     30 is loaded and evaluated.
     31 All evaluations mentioned, including the initialization 
     32 that is described below, take place in the same
     33 (initially) standard environment. All values that
     34 result from these evaluation are discarded, but
     35 if the root continuation or error continuation
     36 are passed a value, the evaluation of options
     37 is interrupted and the EXIT_STATUS is as described 
     38 in the corresponding section.
     39 The string
     40 .I script
     41 together with all
     42 .I args
     43 are available as a list of strings
     44 via the applicative
     45 .RI ' get-script-arguments '.
     46 If these arguments contain spaces or other characters special to the shell,
     47 then they should be quoted
     48 (but note that the quotes will be removed by the shell).
     49 The complete command line,
     50 including the name of the interpreter, options,
     51 the script, and its arguments
     52 are available as a list of strings
     53 via the applicative
     54 .RI ' get-interpreter-arguments '.
     55 .LP
     56 At the very beginning,
     57 before even handling the command line,
     58 .B klisp
     59 reads and evaluates the contents of the environment variable
     60 .BR KLISP_INIT ,
     61 if it is defined.
     62 To use an init file, just define 
     63 .B KLISP_INIT
     64 to the following form
     65 .RI '(load
     66 "/path/to/init-file")'.
     67 .LP
     68 Options start with
     69 .B '\-'
     70 and are described below.
     71 You can use
     72 .B "'\--'"
     73 to signal the end of options.
     74 .LP
     75 If no arguments are given,
     76 then
     77 .B "\-v \-i"
     78 is assumed when the standard input is a terminal;
     79 otherwise,
     80 .B "\-"
     81 is assumed.  If no
     82 .IR script ,
     83 or option
     84 .BR "\-e" ,
     85 or
     86 .BR "\-l" ,
     87 is given, 
     88 .B "\-i"
     89 is assumed.
     90 .LP
     91 In interactive mode,
     92 .B klisp
     93 prompts the user,
     94 reads expressions from the standard input,
     95 and evaluates them as they are read.
     96 The default prompt is "klisp> ".
     97 .SH OPTIONS
     98 .TP
     99 .B \-
    100 load and execute the standard input as a file,
    101 that is,
    102 not interactively,
    103 even when the standard input is a terminal.
    104 .TP
    105 .BI \-e " expr"
    106 evaluate expression
    107 .IR expr .
    108 You need to quote
    109 .I expr 
    110 if it contains spaces, quotes,
    111 or other characters special to the shell.
    112 .TP
    113 .B \-i
    114 enter interactive mode after
    115 .I script
    116 is executed.
    117 .TP
    118 .BI \-l " name"
    119 evaluate
    120 .BI (load " name")
    121 before
    122 .I script
    123 is executed.
    124 Typically used to do environment initialization.
    125 .TP
    126 .BI \-r " name"
    127 evaluate
    128 .BI (require " name")
    129 before
    130 .I script
    131 is executed.
    132 Typically used to load libraries.
    133 .TP
    134 .B \-v
    135 show version and copyright information.
    136 .SH EXIT STATUS
    137 If the 
    138 .I script
    139 or 
    140 .I stdin 
    141 reach EOF or if there is no script,
    142 .B EXIT_SUCCESS 
    143 is returned.
    144 If the root continuation is passed an object during
    145 init, arguments or script evaluation 
    146 .B EXIT_FAILURE
    147 is returned.
    148 If the 
    149 .I root-continuation 
    150 is passed an object,
    151 .B klisp 
    152 tries to convert the value passed to the 
    153 .I root-continuation
    154 to an exit status as follows:
    155 .TP
    156 If the value is an integer it is used as exit status.
    157 .TP
    158 If the value is a boolean then 
    159 .B EXIT_SUCCESS 
    160 is returned for 
    161 .I #t 
    162 and 
    163 .B EXIT_FAILURE 
    164 for 
    165 .I #f.
    166 .TP
    167 If the value is inert, then
    168 .B EXIT_SUCCESS 
    169 is returned.
    170 .TP
    171 In any other case 
    172 .B EXIT_FAILURE
    173 is returned.
    174 .SH ENVIRONMENT
    175 .br
    176 .TP
    177 .BI KLISP_INIT
    178 .br
    179 A Kernel expression to be evaluated before
    180 any arguments to the interpreter.
    181 .br
    182 To use an init file, just define 
    183 .B KLISP_INIT
    184 to the following form
    185 .RI '(load
    186 "/path/to/init-file")'.
    187 .br
    188 .TP
    189 .BI KLISP_PATH
    190 .br
    191 A semicolon separated list of templates for 
    192 controlling the search of required files. 
    193 Each template can use the char '?' to
    194 be replaced by the required name at run-time.
    195 .SH "SEE ALSO"
    196 .br
    197 http://klisp.org/
    198 .br
    199 The klisp Manual (info & html versions available).
    200 .SH DIAGNOSTICS
    201 Error messages should be self explanatory.
    202 .SH AUTHORS
    203 Andres Navarro
    204 and
    205 Oto Havle
    206 .\" EOF