\begindata{text,539390056}
\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 }}


in the typescript window.  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} in the typescript 
window.  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} in the typescript window.  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,537558784}
\enddata{bp,537558784}
\view{bpv,537558784,1759,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: This software is part of version 6.1 of the 

Andrew User Interface System and is 

the property of IBM, Carnegie Mellon University, 

and the other copyright holders.  The source 

code of this version is for the sole use of 

the individual named in ./config/allsys.h.  

This source code is not to be redistributed.  

Binary object code compiled or derived from 

these sources is not to be distributed to non-

members.  Members may have additional 

distribution rights granted by prior written 

permission of Carnegie Mellon University.



IBM, CARNEGIE MELLON UNIVERSITY, 

AND THE OTHER COPYRIGHT HOLDERS

 DISCLAIM ALL WARRANTIES WITH 

REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANT-

ABILITY AND FITNESS. IN 

NO EVENT SHALL  IBM, CARNEGIE 

MELLON UNIVERSITY, OR ANY OTHER 

COPYRIGHT HOLDER BE LIABLE FOR 

ANY SPECIAL, INDIRECT OR CONSE-

QUENTIAL 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,539390056}
