diff --git a/doc/lispintro/Makefile.in b/doc/lispintro/Makefile.in index 411a6f1a473..f941d8166db 100644 --- a/doc/lispintro/Makefile.in +++ b/doc/lispintro/Makefile.in @@ -84,9 +84,37 @@ ps: $(PS_TARGETS) ${buildinfodir}: ${MKDIR_P} $@ +auxfiles = \ + ${buildinfodir}/cons-1.png \ + ${buildinfodir}/cons-1.txt \ + ${buildinfodir}/cons-2.png \ + ${buildinfodir}/cons-2.txt \ + ${buildinfodir}/cons-2a.png \ + ${buildinfodir}/cons-2a.txt \ + ${buildinfodir}/cons-3.png \ + ${buildinfodir}/cons-3.txt \ + ${buildinfodir}/cons-4.png \ + ${buildinfodir}/cons-4.txt \ + ${buildinfodir}/cons-5.png \ + ${buildinfodir}/cons-5.txt \ + ${buildinfodir}/drawers.png \ + ${buildinfodir}/drawers.txt \ + ${buildinfodir}/lambda-1.png \ + ${buildinfodir}/lambda-1.txt \ + ${buildinfodir}/lambda-2.png \ + ${buildinfodir}/lambda-2.txt \ + ${buildinfodir}/lambda-3.png \ + ${buildinfodir}/lambda-3.txt + +${buildinfodir}/%.txt: ${srcdir}/%.txt | ${buildinfodir} + cp $< $@ + +${buildinfodir}/%.png: ${srcdir}/%.png | ${buildinfodir} + cp $< $@ + # The file name eintr must fit within 5 characters, to allow for # -NN extensions to fit into DOS 8+3 limits without clashing. -${buildinfodir}/eintr.info: ${srcs} | ${buildinfodir} +${buildinfodir}/eintr.info: ${srcs} ${auxfiles} | ${buildinfodir} $(AM_V_GEN)$(MAKEINFO) $(MAKEINFO_OPTS) $(INFO_OPTS) -o $@ $< emacs-lisp-intro.dvi: ${srcs} @@ -117,6 +145,7 @@ infoclean: rm -f \ $(buildinfodir)/eintr.info \ $(buildinfodir)/eintr.info-[1-9] + rm -f $(auxfiles) bootstrap-clean maintainer-clean: distclean infoclean rm -f TAGS diff --git a/doc/lispintro/cons-1.png b/doc/lispintro/cons-1.png new file mode 100644 index 00000000000..34fc524120b Binary files /dev/null and b/doc/lispintro/cons-1.png differ diff --git a/doc/lispintro/cons-1.txt b/doc/lispintro/cons-1.txt new file mode 100644 index 00000000000..78f684d94bc --- /dev/null +++ b/doc/lispintro/cons-1.txt @@ -0,0 +1,5 @@ + ___ ___ ___ ___ ___ ___ + |___|___|--> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup diff --git a/doc/lispintro/cons-2.png b/doc/lispintro/cons-2.png new file mode 100644 index 00000000000..61364db3faf Binary files /dev/null and b/doc/lispintro/cons-2.png differ diff --git a/doc/lispintro/cons-2.txt b/doc/lispintro/cons-2.txt new file mode 100644 index 00000000000..5146cc9e3a3 --- /dev/null +++ b/doc/lispintro/cons-2.txt @@ -0,0 +1,7 @@ + bouquet + | + | ___ ___ ___ ___ ___ ___ + --> |___|___|--> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup diff --git a/doc/lispintro/cons-2a.png b/doc/lispintro/cons-2a.png new file mode 100644 index 00000000000..741430349ff Binary files /dev/null and b/doc/lispintro/cons-2a.png differ diff --git a/doc/lispintro/cons-2a.txt b/doc/lispintro/cons-2a.txt new file mode 100644 index 00000000000..03c26ec1d91 --- /dev/null +++ b/doc/lispintro/cons-2a.txt @@ -0,0 +1,7 @@ + bouquet + | + | -------------- --------------- ---------------- + | | car | cdr | | car | cdr | | car | cdr | + -->| rose | o------->| violet | o------->| butter- | nil | + | | | | | | | cup | | + -------------- --------------- ---------------- diff --git a/doc/lispintro/cons-3.png b/doc/lispintro/cons-3.png new file mode 100644 index 00000000000..655d01d2800 Binary files /dev/null and b/doc/lispintro/cons-3.png differ diff --git a/doc/lispintro/cons-3.txt b/doc/lispintro/cons-3.txt new file mode 100644 index 00000000000..c8d46d46532 --- /dev/null +++ b/doc/lispintro/cons-3.txt @@ -0,0 +1,8 @@ + bouquet flowers + | | + | ___ ___ | ___ ___ ___ ___ + --> | | | --> | | | | | | + |___|___|----> |___|___|--> |___|___|--> nil + | | | + | | | + --> rose --> violet --> buttercup diff --git a/doc/lispintro/cons-4.png b/doc/lispintro/cons-4.png new file mode 100644 index 00000000000..0e86d245ba4 Binary files /dev/null and b/doc/lispintro/cons-4.png differ diff --git a/doc/lispintro/cons-4.txt b/doc/lispintro/cons-4.txt new file mode 100644 index 00000000000..34ccdf14834 --- /dev/null +++ b/doc/lispintro/cons-4.txt @@ -0,0 +1,8 @@ + bouquet flowers + | | + | ___ ___ ___ ___ | ___ ___ ___ ___ + --> | | | | | | --> | | | | | | + |___|___|----> |___|___|----> |___|___|---->|___|___|--> nil + | | | | + | | | | + --> lily --> rose --> violet --> buttercup diff --git a/doc/lispintro/cons-5.png b/doc/lispintro/cons-5.png new file mode 100644 index 00000000000..cc63f1248d9 Binary files /dev/null and b/doc/lispintro/cons-5.png differ diff --git a/doc/lispintro/cons-5.txt b/doc/lispintro/cons-5.txt new file mode 100644 index 00000000000..62216753195 --- /dev/null +++ b/doc/lispintro/cons-5.txt @@ -0,0 +1,12 @@ + kill-ring kill-ring-yank-pointer + | | + | ___ ___ | ___ ___ ___ ___ + ---> | | | --> | | | | | | + |___|___|----> |___|___|--> |___|___|--> nil + | | | + | | | + | | --> "yet more text" + | | + | --> "a different piece of text" + | + --> "some text" diff --git a/doc/lispintro/drawers.png b/doc/lispintro/drawers.png new file mode 100644 index 00000000000..fcfdbaad561 Binary files /dev/null and b/doc/lispintro/drawers.png differ diff --git a/doc/lispintro/drawers.txt b/doc/lispintro/drawers.txt new file mode 100644 index 00000000000..9c2c7a40e49 --- /dev/null +++ b/doc/lispintro/drawers.txt @@ -0,0 +1,22 @@ + Chest of Drawers Contents of Drawers + + __ o0O0o __ + / \ + --------------------- + | directions to | [map to] + | symbol name | bouquet + | | + +---------------------+ + | directions to | + | symbol definition | [none] + | | + +---------------------+ + | directions to | [map to] + | variable value | (rose violet buttercup) + | | + +---------------------+ + | directions to | + | property list | [not described here] + | | + +---------------------+ + |/ \| diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index 50e253ece4b..fc5a7d972b6 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -41,16 +41,6 @@ @clear largebook @end ifset -@c ================ Included Figures ================ - -@c If you clear this, the figures will be printed as ASCII diagrams -@c rather than PostScript/PDF. -@c (This is not relevant to Info, since Info only handles ASCII.) -@iftex -@set print-postscript-figures -@end iftex -@c clear print-postscript-figures - @comment %**end of header @c per rms and peterb, use 10pt fonts for the main text, mostly to @@ -9567,25 +9557,10 @@ which holds the address for the atom @samp{buttercup}. @need 1200 This sounds more complicated than it is and is easier seen in a diagram: - -@c clear print-postscript-figures @c !!! cons-cell-diagram #1 -@ifset print-postscript-figures @sp 1 @center @image{cons-1} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group - ___ ___ ___ ___ ___ ___ - |___|___|--> |___|___|--> |___|___|--> nil - | | | - | | | - --> rose --> violet --> buttercup -@end group -@end smallexample -@end ifclear @noindent In the diagram, each box represents a word of computer memory that @@ -9610,26 +9585,10 @@ evaluation of the expression @need 1250 @noindent creates a situation like this: - @c cons-cell-diagram #2 -@ifset print-postscript-figures @sp 1 @center @image{cons-2} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group -bouquet - | - | ___ ___ ___ ___ ___ ___ - --> |___|___|--> |___|___|--> |___|___|--> nil - | | | - | | | - --> rose --> violet --> buttercup -@end group -@end smallexample -@end ifclear @noindent In this example, the symbol @code{bouquet} holds the address of the first @@ -9638,26 +9597,10 @@ pair of boxes. @need 1200 This same list can be illustrated in a different sort of box notation like this: - @c cons-cell-diagram #2a -@ifset print-postscript-figures @sp 1 @center @image{cons-2a} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group -bouquet - | - | -------------- --------------- ---------------- - | | car | cdr | | car | cdr | | car | cdr | - -->| rose | o------->| violet | o------->| butter- | nil | - | | | | | | | cup | | - -------------- --------------- ---------------- -@end group -@end smallexample -@end ifclear (Symbols consist of more than pairs of addresses, but the structure of a symbol is made up of addresses. Indeed, the symbol @code{bouquet} @@ -9681,29 +9624,10 @@ evaluation of the following expression @need 800 @noindent produces this: - @c cons-cell-diagram #3 -@ifset print-postscript-figures @sp 1 @center @image{cons-3} @sp 1 -@end ifset -@ifclear print-postscript-figures -@sp 1 -@smallexample -@group -bouquet flowers - | | - | ___ ___ | ___ ___ ___ ___ - --> | | | --> | | | | | | - |___|___|----> |___|___|--> |___|___|--> nil - | | | - | | | - --> rose --> violet --> buttercup -@end group -@end smallexample -@sp 1 -@end ifclear @noindent The value of @code{flowers} is @code{(violet buttercup)}, which is @@ -9731,29 +9655,11 @@ the expression @need 1500 @noindent produces: - @c cons-cell-diagram #4 -@ifset print-postscript-figures @sp 1 @center @image{cons-4} @sp 1 @end ifset -@ifclear print-postscript-figures -@sp 1 -@smallexample -@group -bouquet flowers - | | - | ___ ___ ___ ___ | ___ ___ ___ ___ - --> | | | | | | --> | | | | | | - |___|___|----> |___|___|----> |___|___|---->|___|___|--> nil - | | | | - | | | | - --> lily --> rose --> violet --> buttercup -@end group -@end smallexample -@sp 1 -@end ifclear @need 1200 @noindent @@ -9810,43 +9716,10 @@ Reference Manual}.) @need 1500 Here is a fanciful representation: - @c chest-of-drawers diagram -@ifset print-postscript-figures @sp 1 @center @image{drawers} @sp 1 -@end ifset -@ifclear print-postscript-figures -@sp 1 -@smallexample -@group - Chest of Drawers Contents of Drawers - - __ o0O0o __ - / \ - --------------------- - | directions to | [map to] - | symbol name | bouquet - | | - +---------------------+ - | directions to | - | symbol definition | [none] - | | - +---------------------+ - | directions to | [map to] - | variable value | (rose violet buttercup) - | | - +---------------------+ - | directions to | - | property list | [not described here] - | | - +---------------------+ - |/ \| -@end group -@end smallexample -@sp 1 -@end ifclear @node List Exercise @section Exercise @@ -9959,32 +9832,10 @@ by both the @code{kill-ring} and the @code{kill-ring-yank-pointer}. The words ``a different piece of text'' and ``yet more text'' are not duplicated. Instead, the two Lisp variables point to the same pieces of text. Here is a diagram: - @c cons-cell-diagram #5 -@ifset print-postscript-figures @sp 1 @center @image{cons-5} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group -kill-ring kill-ring-yank-pointer - | | - | ___ ___ | ___ ___ ___ ___ - ---> | | | --> | | | | | | - |___|___|----> |___|___|--> |___|___|--> nil - | | | - | | | - | | --> "yet more text" - | | - | --> "a different piece of text" - | - --> "some text" -@end group -@end smallexample -@sp 1 -@end ifclear Both the variable @code{kill-ring} and the variable @code{kill-ring-yank-pointer} are pointers. But the kill ring itself is @@ -20706,24 +20557,10 @@ equivalent of @code{multiply-by-seven} is: @need 1250 @noindent If we want to multiply 3 by 7, we can write: - -@c clear print-postscript-figures @c lambda example diagram #1 -@ifset print-postscript-figures @sp 1 @center @image{lambda-1} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group -(multiply-by-seven 3) - \_______________/ ^ - | | - function argument -@end group -@end smallexample -@end ifclear @noindent This expression returns 21. @@ -20731,44 +20568,18 @@ This expression returns 21. @need 1250 @noindent Similarly, we can write: - @c lambda example diagram #2 -@ifset print-postscript-figures @sp 1 @center @image{lambda-2} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group -((lambda (number) (* 7 number)) 3) - \____________________________/ ^ - | | - anonymous function argument -@end group -@end smallexample -@end ifclear @need 1250 @noindent If we want to divide 100 by 50, we can write: - @c lambda example diagram #3 -@ifset print-postscript-figures @sp 1 @center @image{lambda-3} @sp 1 -@end ifset -@ifclear print-postscript-figures -@smallexample -@group -((lambda (arg) (/ arg 50)) 100) - \______________________/ \_/ - | | - anonymous function argument -@end group -@end smallexample -@end ifclear @noindent This expression returns 2. The 100 is passed to the function, which diff --git a/doc/lispintro/lambda-1.png b/doc/lispintro/lambda-1.png new file mode 100644 index 00000000000..97d34b86330 Binary files /dev/null and b/doc/lispintro/lambda-1.png differ diff --git a/doc/lispintro/lambda-1.txt b/doc/lispintro/lambda-1.txt new file mode 100644 index 00000000000..a3701e3e7d8 --- /dev/null +++ b/doc/lispintro/lambda-1.txt @@ -0,0 +1,4 @@ + (multiply-by-seven 3) + \_______________/ ^ + | | + function argument diff --git a/doc/lispintro/lambda-2.png b/doc/lispintro/lambda-2.png new file mode 100644 index 00000000000..d288da4d587 Binary files /dev/null and b/doc/lispintro/lambda-2.png differ diff --git a/doc/lispintro/lambda-2.txt b/doc/lispintro/lambda-2.txt new file mode 100644 index 00000000000..40d0de448c4 --- /dev/null +++ b/doc/lispintro/lambda-2.txt @@ -0,0 +1,4 @@ + ((lambda (number) (* 7 number)) 3) + \____________________________/ ^ + | | + anonymous function argument diff --git a/doc/lispintro/lambda-3.png b/doc/lispintro/lambda-3.png new file mode 100644 index 00000000000..43027e11953 Binary files /dev/null and b/doc/lispintro/lambda-3.png differ diff --git a/doc/lispintro/lambda-3.txt b/doc/lispintro/lambda-3.txt new file mode 100644 index 00000000000..20e48dc2e56 --- /dev/null +++ b/doc/lispintro/lambda-3.txt @@ -0,0 +1,4 @@ + ((lambda (arg) (/ arg 50)) 100) + \______________________/ \_/ + | | + anonymous function argument