home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
util
/
edit
/
jade
/
man
/
jade.info-4
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-10-16
|
50KB
|
1,074 lines
This is Info file jade.info, produced by Makeinfo-1.55 from the input
file jade.texi.
START-INFO-DIR-ENTRY
* Jade: (jade). An editor for X11 and AmigaDOS
END-INFO-DIR-ENTRY
This is Edition 1.3, last updated 7 October 1994, of `The Jade
Manual', for Jade, Version 3.2.
Jade is a text editor for X11 (on Unix) and the Amiga.
Copyright 1993, 1994 John Harper.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
File: jade.info, Node: Characters, Prev: Numeric Predicates, Up: Numbers
Characters
----------
In Jade characters are stored in integers. Their read syntax is a
question mark followed by the character itself which may be an escape
sequence introduced by a backslash. For details of the available escape
sequences see *Note Strings::.
?a
=> 97
?\n
=> 10
?\177
=> 127
- Function: alpha-char-p CHARACTER
This function returns `t' when CHARACTER is one of the alphabetic
characters.
(alpha-char-p ?a)
=> t
- Function: upper-case-p CHARACTER
When CHARACTER is one of the upper-case characters this function
returns `t'.
- Function: lower-case-p CHARACTER
Returns `t' when CHARACTER is lower-case.
- Function: digit-char-p CHARACTER
This function returns `t' when CHARACTER is one of the decimal
digit characters.
- Function: alphanumericp CHARACTER
This function returns `t' when CHARACTER is either an alphabetic
character or a decimal digit character.
- Function: space-char-p CHARACTER
Returns `t' when CHARACTER is a white-space character (space, tab,
newline or form feed).
- Function: char-upcase CHARACTER
This function returns the upper-case equivalent of CHARACTER. If
CHARACTER is already upper-case or has no upper-case equivalent it
is returned unchanged.
(char-upcase ?a)
=> 65 ;`A'
(char-upcase ?A)
=> 65 ;`A'
(char-upcase ?!)
=> 33 ;`!'
- Function: char-downcase CHARACTER
Returns the lower-case equivalent of the character CHARACTER.
File: jade.info, Node: Sequences, Next: Symbols, Prev: Numbers, Up: Programming Jade
Sequences
=========
Sequences are ordered groups of objects, there are several primitive
types which can be considered sequences, each with its own good and bad
points.
A sequence is either an array or a list, where an array is either a
vector or a string.
- Function: sequencep OBJECT
This function returns `t' if OBJECT is a sequence, `nil' otherwise.
* Menu:
* Cons Cells:: An ordered pair of two objects
* Lists:: Chains of cons cells
* Vectors:: A chunk of memory holding a number of objects
* Strings:: Strings are efficiently-stored vectors
* Array Functions:: Accessing elements in vectors and strings
* Sequence Functions:: These work on any type of sequence
File: jade.info, Node: Cons Cells, Next: Lists, Up: Sequences
Cons Cells
----------
A "cons cell" is an ordered pair of two objects, the "car" and the
"cdr".
The read syntax of a cons cell is an opening parenthesis followed by
the read syntax of the car, a dot, the read syntax of the cdr and a
closing parenthesis. For example a cons cell with a car of 10 and a cdr
of the string `foo' would be written as,
(10 . "foo")
- Function: cons CAR CDR
This function creates a new cons cell. It will have a car of CAR
and a cdr of CDR.
(cons 10 "foo")
=> (10 . "foo")
- Function: consp OBJECT
This function returns `t' if OBJECT is a cons cell and `nil'
otherwise.
(consp '(1 . 2))
=> t
(consp nil)
=> nil
(consp (cons 1 2))
=> t
In Lisp an "atom" is any object which is not a cons cell (and is,
therefore, atomic).
- Function: atom OBJECT
Returns `t' if OBJECT is an atom (not a cons cell).
Given a cons cell there are a number of operations which can be
performed on it.
- Function: car CONS-CELL
This function returns the object which the car of the cons cell
CONS-CELL.
(car (cons 1 2))
=> 1
(car '(1 . 2))
=> 1
- Function: cdr CONS-CELL
This function returns the cdr of the cons cell CONS-CELL.
(cdr (cons 1 2))
=> 2
(cdr '(1 . 2))
=> 2
- Function: rplaca CONS-CELL NEW-CAR
This function sets the value of the car in the cons cell CONS-CELL
to NEW-CAR. The value returned is NEW-CAR.
(setq x (cons 1 2))
=> (1 . 2)
(rplaca x 3)
=> 3
x
=> (3 . 2)
- Function: rplacd CONS-CELL NEW-CDR
This function is similar to `rplacd' except that the cdr slot of
CONS-CELL is modified.
File: jade.info, Node: Lists, Next: Vectors, Prev: Cons Cells, Up: Sequences
Lists
-----
A list is a sequence of zero or more objects, the main difference
between lists and vectors is that lists are more dynamic: they can
change size, be split, reversed, concatenated, etc... very easily.
In Lisp lists are not a primitive type; instead singly-linked lists
are created by chaining cons cells together (*note Cons Cells::.).
- Function: listp OBJECT
This functions returns `t' when its argument, OBJECT, is a list
(i.e. either a cons cell or `nil').
* Menu:
* List Structure:: How lists are built from cons cells
* Building Lists:: Dynamically creating lists
* Accessing List Elements:: Getting at the elements which make the list
* Modifying Lists:: How to alter the contents of a list
* Association Lists:: Lists can represent relations
* Infinite Lists:: Circular data structures in Lisp
File: jade.info, Node: List Structure, Next: Building Lists, Up: Lists
List Structure
..............
Each element in a list is given its own cons cell and stored in the
car of that cell. The list object is then constructed by making the cdr
of a cell contain the cons cell of the next element (and hence the
whole tail of the list). The cdr of the cell containing the last
element in the list is `nil'. A list of zero elements is represented by
the symbol `nil'.
The read syntax of a list is an opening parenthesis, followed by the
read syntax of zero or more space-separated objects, followed by a
closing parenthesis. Alternatively, lists can be constructed `manually'
using dotted-pair notation.
All of the following examples result in the same list of five
elements: the numbers from zero to four.
(0 1 2 3 4)
(0 . (1 . (2 . (3 . (4 . nil)))))
(0 1 2 . (3 4))
An easy way to visualise lists and how they are constructed is to
see each cons cell in the list as a separate "box" with pointers to its
car and cdr,
+-----+-----+
| o | o----> cdr
+--|--+-----+
|
--> car
Complex box-diagrams can now be drawn to represent lists. For
example the following diagram represents the list `(1 2 3 4)'.
+-----+-----+ +-----+-----+ +-----+-----+ +-----+-----+
| o | o----> | o | o----> | o | o----> | o | o----> nil
+--|--+-----+ +--|--+-----+ +--|--+-----+ +--|--+-----+
| | | |
--> 1 --> 2 --> 3 --> 4
A more complex example, the list `((1 2) (foo bar))' can be drawn as,
+-----+-----+ +-----+-----+
| o | o---------------------------> | o | o----> nil
+--|--+-----+