\begindata{text,538387096}
\textdsversion{12}
\template{help}
\define{global
}
\chapter{BGLisp

A Bare-Bones Lisp Interpreter based on ELI, the Embedded Lisp Interpreter

}
\section{What BGLisp is

}\leftindent{
BGLisp is an interactive Lisp interpreter which deliberately omits certain 
features of other Lisp interpreters for the sake of speed.  BGLisp is an 
interface to ELI, the Embedded Lisp Interpreter, which is the same Lisp 
that FLAMES (the Filtering Language for the Andrew Message System) uses. 
 BGLisp is therefore a useful utility for testing FLAMES code before 
putting it into actual use.

}
\section{Starting BGLisp

}\leftindent{
BGLisp can be started by typing \



\leftindent{\bold{bglisp }}\



at the command prompt.  A brief introduction will be displayed along with a 
prompt.  Lisp expressions are entered at the prompt, where they are 
evaluated and displayed.  \



To exit BGLisp, type \typewriter{^D} (control-D) at the BGLisp prompt.

}
\section{Warnings

}\leftindent{
As mentioned above, BGLisp is a very stripped-down Lisp interpreter.  Some 
fairly common Lisp features which are not supported are: \



\leftindent{macros

destructive list operations

dotted pairs

the "go" function}


Also, the interpreter itself lacks a "break" loop, which in other 
interpreters allows the user to examine and modify faulty Lisp expressions 
when their evaluation fails. \



Finally, some Lisp interpreters indicate the current level of 
parenthesization when the user puts a newline in the middle of a Lisp 
expression.  Although BGLisp allows newlines to be embedded in 
parenthesized expressions, it will not indicate how many parentheses remain 
to be closed, nor will it offer additional prompts on each line until after 
the current expression has been completely entered and evaluated.

}
\section{How BGLisp works

}
\leftindent{BGLisp is basically a standard Lisp interpreter, minus certain 
features which are not strictly necessary (as they can be simulated using 
existing features), and whose absence speeds up BGLisp tremendously in 
comparison to other Lisps.  Most of BGLisp works like Common Lisp; the 
curious novice is referred to the excellent text, \italic{Common Lisp: The 
Language}, by Guy Steele, Jr.  Certain BGLisp functions behave in ways 
either slightly or very different from their Common Lisp counterparts.  See 
the file \



\leftindent{/usr/andrew/doc/eli/procs.doc}


for complete documentation for all BGLisp functions.


BGLisp supports the following types of expressions:


\indent{\description{\bold{Integers}.  A BGLisp integer consists of an 
optional plus- or minus-sign, followed by a string of digits.


\bold{Strings}.  A BGLisp string is introduced and ended with a 
quotation-mark (").  Within the string, certain "escapes" are recognized. 
 For instance, \\n within the string places a new-line, \\" places a 
quotation-mark, \\\\ places a single backslash (\\), etc.  All of the 
standard `C' backslash-escapes are recognized.


\bold{Symbols}.  A symbol is any sequence of characters that does not 
include whitespace, parentheses, backward- or forward-apostrophes, commas, 
quotation-marks or semi-colons.  Note that a symbol may begin with or 
contain any number of digits; however, if it contains \italic{only} digits, 
it will be interpreted as an integer.


\bold{Lists}.  A list begins with a left-parenthesis, ends with a 
right-parenthesis, and contains zero-or-more expressions, which may be of 
any type (integers, strings, symbols, lists).  The construct 
\typewriter{'expression} (where expression is any type of BGLisp 
expression) is shorthand for \typewriter{(QUOTE expression)}.}}


BGLisp also incorporates a library facility via the LOAD function.  This 
function searches the sequence of directories given in your *.elipath 
preference for a file that you name.  See the section on "Preferences" 
below, and the documentation for the LOAD function in procs.doc.

}
\section{Using BGLisp

}
\leftindent{To start BGLisp, type \typewriter{bglisp} at the command 
prompt.  You will be greeted with a brief introductory message, and then 
the BGLisp prompt ("BGLisp>") will appear.  You may enter a Lisp expression 
at this prompt.  When you hit the ENTER key, it will be evaluated, and the 
result will be displayed.  If the expression you are entering is a list, 
the expression will not be evaluated until the last parenthesis is closed 
and the ENTER key is depressed.  This allows you to embed carriage-returns 
within the expression for readability.  You may also embed spaces and tabs 
to your heart's content.  Finally, placing a semi-colon (;) on a line tells 
BGLisp to ignore the remainder of the line until the next carriage-return. 
 Everything on a line after a semi-colon is a comment.  To end the session 
of BGLisp, type \typewriter{^D} (control-D) at the BGLisp prompt.

}
\section{Classifying mail

}
\leftindent{As mentioned above, BGLisp uses the same internal Lisp 
interpreter used by FLAMES, the Filtering Language for the Andrew MEssage 
System.  FLAMES allows you to automatically classify incoming mail; see the 
 \italic{\helptopic{flames}}  help file to learn more about FLAMES.  Using 
BGLisp, you can test your FLAMES functions before they are put into actual 
use.  The ELI library \



\leftindent{/usr/andrew/lib/eli/flames.eli }\



contains Lisp functions to help in testing FLAMES functions.  To load these 
functions, type \typewriter{(load "flames")} while in BGLisp.  Again, see 
the file


\leftindent{/usr/andrew/doc/ams/Flames.pgr}


to learn more about testing FLAMES functions in BGLisp.

}
\section{Preferences

}
\leftindent{The elipath preference in your preferences file is a 
colon-separated list of directories that BGLisp will search when trying to 
load ELI libraries.  You may not need this preference if you only intend to 
use libraries in /usr/andrew/lib/eli; however, if you wish to search other 
directories, you may wish to add this preference.  If your preferences file 
contains the line


\display{elipath: /afs/andrew/usr/bobg/lib/eli:/usr/andrew/lib/eli}


then when you execute the BGLisp "load" function, first the directory 
/afs/andrew/usr/bobg/lib/eli will be checked for the library you wish to 
load; if it is not found there, the directory /usr/andrew/lib/eli will be 
checked.

}
\section{Quick reference

}\leftindent{
To start BGLisp, type \typewriter{bglisp} at the command prompt.  To exit 
BGLisp, type \typewriter{^D} (control-D) at the BGLisp prompt.  There are a 
number of command-line switches that you can give to BGLisp; you probably 
don't need any of them.  They are:


\display{\description{\bold{-r}  This causes BGLisp to print out technical 
statistics about various Lisp objects in use after each Lisp expression is 
evaluated.


\bold{-t}  This causes BGLisp to run in "terse" mode; no prompts or 
messages are printed, only the results of evaluations.


\bold{-f}  This causes BGLisp to "free" certain chunks of memory that it 
uses, when that memory is not in use.  This may slow BGLisp down a bit, but 
may make it slightly more memory-efficient.


\bold{-m}  This causes BGLisp to use an alternate memory-usage scheme.  The 
one that it uses by default is just fine; stick with that one.}}

}
\section{Program Author}

\leftindent{
Bob Glickstein

}
\section{Related tools}  \



Select (highlight) one of the italicized names and choose "Show Help on 
Selected Word" from the pop-up menu to see the help file for:


\leftindent{\italic{\helptopic{flames}

\helptopic{eli}}}


\begindata{bp,538210560}
\enddata{bp,538210560}
\view{bpv,538210560,0,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,538387096}
