klisp

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

commit 7b33ec2288862677ffd476749a4c21e92fbc2c73
parent 66f18437abc098b23c29f93c1a49687e0471b851
Author: Andres Navarro <canavarro82@gmail.com>
Date:   Thu, 24 Nov 2011 15:37:55 -0300

Added simple manpage derived from the one of lua. Renamed documentation directory to doc/

Diffstat:
Rmanual/html/A-Sample-Applicative-Description.html -> doc/html/A-Sample-Applicative-Description.html | 0
Rmanual/html/Acknowledgements.html -> doc/html/Acknowledgements.html | 0
Rmanual/html/Alphabetical-Index.html -> doc/html/Alphabetical-Index.html | 0
Rmanual/html/Booleans.html -> doc/html/Booleans.html | 0
Rmanual/html/Caveats.html -> doc/html/Caveats.html | 0
Rmanual/html/Characters.html -> doc/html/Characters.html | 0
Rmanual/html/Combiners.html -> doc/html/Combiners.html | 0
Rmanual/html/Continuations.html -> doc/html/Continuations.html | 0
Rmanual/html/Control.html -> doc/html/Control.html | 0
Rmanual/html/Conventions.html -> doc/html/Conventions.html | 0
Rmanual/html/Encapsulations.html -> doc/html/Encapsulations.html | 0
Rmanual/html/Environments.html -> doc/html/Environments.html | 0
Rmanual/html/Equivalence.html -> doc/html/Equivalence.html | 0
Rmanual/html/Error-Messages.html -> doc/html/Error-Messages.html | 0
Rmanual/html/Evaluation-Notation.html -> doc/html/Evaluation-Notation.html | 0
Rmanual/html/Format-of-Descriptions.html -> doc/html/Format-of-Descriptions.html | 0
Rmanual/html/Introduction.html -> doc/html/Introduction.html | 0
Rmanual/html/Kernel-History.html -> doc/html/Kernel-History.html | 0
Rmanual/html/Keyed-Variables.html -> doc/html/Keyed-Variables.html | 0
Rmanual/html/License.html -> doc/html/License.html | 0
Rmanual/html/Numbers.html -> doc/html/Numbers.html | 0
Rmanual/html/Pairs-and-lists.html -> doc/html/Pairs-and-lists.html | 0
Rmanual/html/Ports.html -> doc/html/Ports.html | 0
Rmanual/html/Printing-Notation.html -> doc/html/Printing-Notation.html | 0
Rmanual/html/Promises.html -> doc/html/Promises.html | 0
Rmanual/html/Some-Terms.html -> doc/html/Some-Terms.html | 0
Rmanual/html/Strings.html -> doc/html/Strings.html | 0
Rmanual/html/Symbols.html -> doc/html/Symbols.html | 0
Rmanual/html/index.html -> doc/html/index.html | 0
Adoc/klisp.1 | 163+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rmanual/klisp.info -> doc/klisp.info | 0
Rmanual/src/Makefile -> doc/src/Makefile | 0
Rmanual/src/booleans.texi -> doc/src/booleans.texi | 0
Rmanual/src/characters.texi -> doc/src/characters.texi | 0
Rmanual/src/combiners.texi -> doc/src/combiners.texi | 0
Rmanual/src/continuations.texi -> doc/src/continuations.texi | 0
Rmanual/src/control.texi -> doc/src/control.texi | 0
Rmanual/src/encapsulations.texi -> doc/src/encapsulations.texi | 0
Rmanual/src/environments.texi -> doc/src/environments.texi | 0
Rmanual/src/equivalence.texi -> doc/src/equivalence.texi | 0
Rmanual/src/index.texi -> doc/src/index.texi | 0
Rmanual/src/intro.texi -> doc/src/intro.texi | 0
Rmanual/src/keyed_vars.texi -> doc/src/keyed_vars.texi | 0
Rmanual/src/klisp.texi -> doc/src/klisp.texi | 0
Rmanual/src/numbers.texi -> doc/src/numbers.texi | 0
Rmanual/src/pairs_lists.texi -> doc/src/pairs_lists.texi | 0
Rmanual/src/ports.texi -> doc/src/ports.texi | 0
Rmanual/src/promises.texi -> doc/src/promises.texi | 0
Rmanual/src/strings.texi -> doc/src/strings.texi | 0
Rmanual/src/symbols.texi -> doc/src/symbols.texi | 0
Dsrc/rep_op_c.sed | 78------------------------------------------------------------------------------
Dsrc/rep_op_h.sed | 32--------------------------------
52 files changed, 163 insertions(+), 110 deletions(-)

diff --git a/manual/html/A-Sample-Applicative-Description.html b/doc/html/A-Sample-Applicative-Description.html diff --git a/manual/html/Acknowledgements.html b/doc/html/Acknowledgements.html diff --git a/manual/html/Alphabetical-Index.html b/doc/html/Alphabetical-Index.html diff --git a/manual/html/Booleans.html b/doc/html/Booleans.html diff --git a/manual/html/Caveats.html b/doc/html/Caveats.html diff --git a/manual/html/Characters.html b/doc/html/Characters.html diff --git a/manual/html/Combiners.html b/doc/html/Combiners.html diff --git a/manual/html/Continuations.html b/doc/html/Continuations.html diff --git a/manual/html/Control.html b/doc/html/Control.html diff --git a/manual/html/Conventions.html b/doc/html/Conventions.html diff --git a/manual/html/Encapsulations.html b/doc/html/Encapsulations.html diff --git a/manual/html/Environments.html b/doc/html/Environments.html diff --git a/manual/html/Equivalence.html b/doc/html/Equivalence.html diff --git a/manual/html/Error-Messages.html b/doc/html/Error-Messages.html diff --git a/manual/html/Evaluation-Notation.html b/doc/html/Evaluation-Notation.html diff --git a/manual/html/Format-of-Descriptions.html b/doc/html/Format-of-Descriptions.html diff --git a/manual/html/Introduction.html b/doc/html/Introduction.html diff --git a/manual/html/Kernel-History.html b/doc/html/Kernel-History.html diff --git a/manual/html/Keyed-Variables.html b/doc/html/Keyed-Variables.html diff --git a/manual/html/License.html b/doc/html/License.html diff --git a/manual/html/Numbers.html b/doc/html/Numbers.html diff --git a/manual/html/Pairs-and-lists.html b/doc/html/Pairs-and-lists.html diff --git a/manual/html/Ports.html b/doc/html/Ports.html diff --git a/manual/html/Printing-Notation.html b/doc/html/Printing-Notation.html diff --git a/manual/html/Promises.html b/doc/html/Promises.html diff --git a/manual/html/Some-Terms.html b/doc/html/Some-Terms.html diff --git a/manual/html/Strings.html b/doc/html/Strings.html diff --git a/manual/html/Symbols.html b/doc/html/Symbols.html diff --git a/manual/html/index.html b/doc/html/index.html diff --git a/doc/klisp.1 b/doc/klisp.1 @@ -0,0 +1,163 @@ +.TH KLISP 1 "$Date: 2011/11/23 06:35:03 $" +.SH NAME +klisp \- Kernel Programming Language interpreter +.SH SYNOPSIS +.B klisp +[ +.I options +] +[ +.I script +[ +.I args +] +] +.SH DESCRIPTION +.B klisp +is a stand-alone klisp interpreter for +the Kernel Programming Language. +It loads and evaluates Kernel programs +in textual source form. +.B klisp +can be used as a batch interpreter and also interactively. +.LP +The given +.I options +(see below) +are evaluated and then +the klisp program in file +.I script +is loaded and evaluated. +All evaluations, including the initialization +that is described below, take place in the same +(initially) standard environment. +The given +.I args +are available to +.I script +as a list of strings via the applicative +.RI ' get-script-arguments '. +If these arguments contain spaces or other characters special to the shell, +then they should be quoted +(but note that the quotes will be removed by the shell). +The arguments in the returned string start with the string +.RI ' script '. +The arguments given in the command line before +.IR script , +including the name of the interpreter, +are available via the applicative +.RI ' get-command-line '. +.LP +At the very beginning, +before even handling the command line, +.B klisp +reads and evaluates the contents of the environment variable +.BR KLISP_INIT , +if it is defined. +To use an init file, just define +.B KLISP_INIT +to the following form +.RI '(load +"/path/to/init-file")'. +.LP +Options start with +.B '\-' +and are described below. +You can use +.B "'\--'" +to signal the end of options. +.LP +If no arguments are given, +then +.B "\-v \-i" +is assumed when the standard input is a terminal; +otherwise, +.B "\-" +is assumed. +.LP +In interactive mode, +.B klisp +prompts the user, +reads expressions from the standard input, +and evaluates them as they are read. +The default prompt is "klisp> ". +.SH OPTIONS +.TP +.B \- +load and execute the standard input as a file, +that is, +not interactively, +even when the standard input is a terminal. +.TP +.BI \-e " expr" +evaluate expression +.IR expr . +You need to quote +.I expr +if it contains spaces, quotes, +or other characters special to the shell. +.TP +.B \-i +enter interactive mode after +.I script +is executed. +.TP +.\" .BI \-l " name" +.\" call +.\" .BI require(' name ') +.\" before executing +.\" .IR script . +.\" Typically used to load libraries. +.\" .TP +.B \-v +show version information. +.SH EXIT STATUS +If the +.I script +or +.I stdin +reach EOF or if there is no script, +.B EXIT_SUCCESS +is returned. +If there is an error during the evaluation of +the options, +.B EXIT_FAILURE +is returned. +If the +.I root-continuation +is passed an object, +.B klisp +tries to convert the value passed to the +.I root-continuation +to an exit status as follows: +.TP +If the value is an integer it is used as exit status. +.TP +If the value is a boolean then +.B EXIT_SUCCESS +is returned for +.I #t +and +.B EXIT_FAILURE +for +.I #f. +.TP +If the value is inert, then +.B EXIT_SUCCESS +is returned. +.TP +In any other case +.B EXIT_FAILURE +is returned. +.SH "SEE ALSO" +.br +http://klisp.org/ +.br +The klisp Manual (info & html versions available). +.SH DIAGNOSTICS +Error messages should be self explanatory. +.SH AUTHORS +Andres Navarro +and +Oto Havle +.\" EOF diff --git a/manual/klisp.info b/doc/klisp.info diff --git a/manual/src/Makefile b/doc/src/Makefile diff --git a/manual/src/booleans.texi b/doc/src/booleans.texi diff --git a/manual/src/characters.texi b/doc/src/characters.texi diff --git a/manual/src/combiners.texi b/doc/src/combiners.texi diff --git a/manual/src/continuations.texi b/doc/src/continuations.texi diff --git a/manual/src/control.texi b/doc/src/control.texi diff --git a/manual/src/encapsulations.texi b/doc/src/encapsulations.texi diff --git a/manual/src/environments.texi b/doc/src/environments.texi diff --git a/manual/src/equivalence.texi b/doc/src/equivalence.texi diff --git a/manual/src/index.texi b/doc/src/index.texi diff --git a/manual/src/intro.texi b/doc/src/intro.texi diff --git a/manual/src/keyed_vars.texi b/doc/src/keyed_vars.texi diff --git a/manual/src/klisp.texi b/doc/src/klisp.texi diff --git a/manual/src/numbers.texi b/doc/src/numbers.texi diff --git a/manual/src/pairs_lists.texi b/doc/src/pairs_lists.texi diff --git a/manual/src/ports.texi b/doc/src/ports.texi diff --git a/manual/src/promises.texi b/doc/src/promises.texi diff --git a/manual/src/strings.texi b/doc/src/strings.texi diff --git a/manual/src/symbols.texi b/doc/src/symbols.texi diff --git a/src/rep_op_c.sed b/src/rep_op_c.sed @@ -1,78 +0,0 @@ -# This is a collection of sed commands to refactor operatives underlying -# functions to just take a kernel state pointer (instead of also taking extra -# params, ptree and denv). - -# All these tests are run one at a time with sed -n - -# This is a collection of sed commands to refactor operatives underlying -# functions to just take a kernel state pointer (instead of also taking extra -# params, ptree and denv). - -# All these tests are run one at a time with sed -n - -# detect single line function definition -# There are 0 -#/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)];/P - -# All the single line definitions done - -# try to detect multi line function definition -# There are 1, do_int_repl_error -#/^void \(.*\)[(]klisp_State \*K,/{ -#N -#/^void \(.*\)[(]klisp_State \*K,[[:space:]]*TValue \*xparams,[[:space:]]*TValue ptree,[[:space:]]*TValue denv);/P -#} - -# replace it -#/^void \(.*\)[(]klisp_State \*K,/{ -#N -#s/^void \(.*\)[(]klisp_State \*K,[[:space:]]*TValue \*xparams,[[:space:]]*TValue ptree,[[:space:]]*#TValue denv);/void \1(klisp_State *K);/ -#} - -# done! - -# Detect all with simple brace -# There are 101 -#/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)]/{ -#N -#/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)].*\n[{]/P -#} - -# replace them -# This is used to modify in place with sed -i -f <this-file> *.c -#/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)]/{ -#N -#s/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)].*\n[{]/void \1(klisp_State *K)\ -#\{\ -# TValue *xparams = K->next_xparams;\ -# TValue ptree = K->next_value;\ -# TValue denv = K->next_env;\ -# klisp_assert(ttisenvironment(K->next_env));/ -#} - -# Detect the ones in two lines (with braces) -# There are 84 -#/^void \(.*\)[(]klisp_State \*K,/{ -#N -#N -#/^void \(.*\)[(]klisp_State \*K,[[:space:]]*TValue \*xparams,[[:space:]]*TValue ptree,[[:space:]]*TValue denv[)][[:space:]]*[{]/P -#} - -# replace them -# This is used to modify in place with sed -i -f <this-file> *.c -/^void \(.*\)[(]klisp_State \*K,/{ -N -N -s/^void \(.*\)[(]klisp_State \*K,[[:space:]]*TValue \*xparams,[[:space:]]*TValue ptree,[[:space:]]*TValue denv[)][[:space:]]*[{]/void \1(klisp_State *K)\ -\{\ - TValue *xparams = K->next_xparams;\ - TValue ptree = K->next_value;\ - TValue denv = K->next_env;\ - klisp_assert(ttisenvironment(K->next_env));/ -} - -# keval_ofn was changed manually because the name of denv was env -# (denv was reserved for the den param in ptree) -# do_vau was changed manually because the name of ptree was obj -# (ptree was reserved for the ptree param) -# ffi_type_ref and ffi_type_ref were changed manually (were static) diff --git a/src/rep_op_h.sed b/src/rep_op_h.sed @@ -1,31 +0,0 @@ -# This is a collection of sed commands to refactor operatives underlying -# functions to just take a kernel state pointer (instead of also taking extra -# params, ptree and denv). - -# All these tests are run one at a time with sed -n - -# detect single line function definition -# There are 97 -/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)];/P - -# Replace them in place with sed -i -f <this-file> *.h -#s/^void \(.*\)[(]klisp_State \*K, TValue \*xparams, TValue ptree, TValue denv[)];/void \1(klisp_State *K);/ - -# All the single line definitions done - -# try to detect multi line function definition -# There are 62 -#/^void \(.*\)[(]klisp_State \*K,/{ -#N -#/^void \(.*\)[(]klisp_State \*K,[[:space:]]*TValue \*xparams,[[:space:]]*TValue ptree,[[:space:]]*TValue denv);/P -#} - -# replace them -# equalp had a type (was xparas instead of xparams), correct first -s/xparas/xparams/ -/^void \(.*\)[(]klisp_State \*K,/{ -N -s/^void \(.*\)[(]klisp_State \*K,[[:space:]]*TValue \*xparams,[[:space:]]*TValue ptree,[[:space:]]*TValue denv);/void \1(klisp_State *K);/ -} - -# Done! -\ No newline at end of file