X_lisp_help.pdf

(306 KB) Pobierz
XLISP-PLUS: Another Object-oriented Lisp
Version 3.0
January 18, 1997
Tom Almy
almy@teleport.com
Portions of this manual and software are from XLISP which is Copyright (c) 1988, by David Michael
Betz, all rights reserved. Mr. Betz grants permission for unrestricted non-commercial use. Portions of
XLISP-PLUS from XLISP-STAT are Copyright (c) 1988, Luke Tierney. UNIXSTUF.C is from Winterp
1.0, Copyright 1989 Hewlett-Packard Company (by Niels Mayer). Other enhancements and bug fixes
are provided without restriction by Tom Almy, Mikael Pettersson, Neal Holtz, Johnny Greenblatt, Ken
Whedbee, Blake McBride, Pete Yadlowsky, and Richard Zidlicky. See source code for details.
Table Of Contents
Index
Converted to Windows Help format by:
Rob Duff
- rduff@wimsey.com
15 December 1995
Table Of Contents
Introduction
Xlisp Command Loop
Break Command Loop
Data Types
The Evaluator
Hook Functions
Lexical Conventions
8 Bit Ascii Characters
Readtables
Symbol Case Control
Packages
Lambda Lists
Generalized Variables
Objects
Symbols
Evaluation Functions
Multiple Value Functions
Symbol Functions
Generalized Variable Functions
Package Functions
Property List Functions
Hash Table Functions
Array Functions
Sequence Functions
List Functions
Destructive List Functions
Arithmetic Functions
Bitwise Logical Functions
String Functions
Character Functions
Structure Functions
Object Functions
Predicate Functions
Control Constructs
Looping Constructs
The Program Feature
Input/Output Functions
The Format Function
File I/O Functions
String Stream Functions
Debugging And Error Handling Functions
System Functions
Screen Functions
Additional Functions And Utilities
Compilation Options
Bug Fixes And Extensions
Examples: File I/O Functions
Introduction
XLISP-PLUS is an enhanced version of David Michael Betz's XLISP to have additional features of
Common Lisp. XLISP-PLUS is distributed for the IBM- PC family and for UNIX, but can be easily
ported to other platforms. Complete source code is provided (in "C") to allow easy modification and
extension.
Since XLISP-PLUS is based on XLISP, most XLISP programs will run on XLISP- PLUS. Since
XLISP-PLUS incorporates many more features of Common Lisp, many small Common Lisp
applications will run on XLISP-PLUS with little modification. See the section starting on page 95 for
details of the differences between XLISP and XLISP-PLUS.
Many Common Lisp functions are built into XLISP-PLUS. In addition, XLISP defines the objects
Object
and
Class
as primitives.
Object
is the only class that has no superclass and hence is the root
of the class heirarchy tree.
Class
is the class of which all classes are instances (it is the only object
that is an instance of itself).
This document is a brief description of XLISP-PLUS. It assumes some knowledge of LISP and some
understanding of the concepts of object-oriented programming.
You will probably also need a copy of "Common Lisp: The Language" by Guy L. Steele, Jr., published
by Digital Press to use as a reference for some of the Common Lisp functions that are described only
briefly in this document.
XLISP-PLUS has a number of compilation options to to eliminate groups of functions and to tailor
itself to various environments. Unless otherwise indicated this manual assumes all options are
enabled and the system dependent code is as complete as that provided for the MS/DOS
environment. Assistance for using or porting XLISP-PLUS can be obtained on the USENET
newsgroup comp.lang.lisp.x, or by writing to Tom Almy at the Internet address almy@teleport.com.
You can also reach Tom by writing to him at 17830 SW Shasta Trail, Tualatin, OR 97062, USA.
Xlisp Command Loop
When XLISP is started, it first tries to load the workspace "xlisp.wks", or an alternative file specified
with the "-wfilename" option, from the current directory. If that file doesn't exist, or the "-w" flag is in
the command line, XLISP builds an initial workspace, empty except for the built-in functions and
symbols.
Then, providing no workspace file was loaded, XLISP attempts to load "init.lsp" from a path in
XLPATH or the current directory. This file can be modified to suit the user's requirements. It contains
a number of preference items.
If
*startup-functions*
is non-nil (default is
NIL),
it is taken as a list of functions with no arguments
which are executed in sequence at this time. This allows automatically starting applications stored in
workspaces.
If the variable
*load-file-arguments*
is non-nil (default is
T),
it then loads any files named as
parameters on the command line (after appending ".lsp" to their names). If the "-v" flag is in the
command line, then the files are loaded verbosely.
The option "-tfilename" will open a transcript file of the name "filename". At this time the top level
command loop is entered. This is the function
top-level-loop,
by default.
XLISP then issues the following prompt (unless standard input has been redirected):
>
This indicates that XLISP is waiting for an expression to be typed. If the current package is other
than
user,
the the package name is printed before the ">".
When a complete expression has been entered, XLISP attempts to evaluate that expression. If the
expression evaluates successfully, XLISP prints the result and then returns for another expression.
The following control characters can be used while XLISP is waiting for input:
Backspace
Del
tab
ctrl-C
ctrl-G
ctrl-Z
ctrl-P
ctrl-T
delete last character
delete last character
tabs over (treated as space by XLISP reader)
goto top level
cleanup and return one level
end of file (returns one level or exits program)
proceed (continue)
print information
Under MS-DOS or OS/2 (at least) the following control characters can be typed while XLISP is
executing (providing standard input has not been redirected away from the console):
ctrl-B
ctrl-S
ctrl-C
ctrl-T
BREAK -- enter break loop
Pause until another key is struck
go to top level
print information
Under MS-DOS if the global variable
*dos-input*
is set non-nil, DOS is used to read entire input lines.
Operation this way is convenient if certain DOS utilities, such as CED, are used, or if XLISP is run
under an editor like
epsilon.
In this case, normal command line editing is available, but the control
keys will not work (in particular, ctrl-C will cause the program to exit!). Use the XLISP functions
top-level, clean-up, and continue instead of ctrl-C, ctrl-G, and ctrl-P.
Under MS-DOS if the global variable
*dos-input*
is
NIL,
or under OS/2 or Windows, a special
internal line editor is used. In this case the last 20 lines are saved, and can be recalled and viewed
using the up and down arrow keys. Duplicate lines are not saved.
An additional feature is symbol name lookup. This command takes what appears to be an
incomplete symbol name to the left of the cursor and prints all interned symbol names that match.
The control keys for the editor are:
Up Arrow
Down Arrow
Left Arrow
Right Arrow
Home
End
Delete
Backspace
Escape
Tab
Previous command in queue
Next command in queue
Move cursor to left
Move cursor to right
Move cursor to start of line
Move cursor to end of line
Delete character at cursor
Delete character to left of cursor
Delete current line
Look up partial symbol name to left of cursor
Characters are inserted at the current cursor position. Lines are limited in length to the width of the
display, and invalid keystrokes cause the bell to ring.
Zgłoś jeśli naruszono regulamin