mirror of
https://github.com/PDP-10/its.git
synced 2026-04-17 08:51:08 +00:00
227 lines
9.1 KiB
Plaintext
Executable File
227 lines
9.1 KiB
Plaintext
Executable File
.comment -*- Mode:TEXT; -*-
|
|
.comment this lesson tells all sorts of stuff about the mechanics of
|
|
.comment moving about in this program. it needs stuff about SHOW-LIST
|
|
.comment and EXAMINE-LIST. also about how to get a menu of lessons.
|
|
.document INFO - General information about the Teach-Lisp program.
|
|
.tag INFO
|
|
Lesson INFO, version 4 by Kent Pitman
|
|
and Victoria Pigman 9/3/82
|
|
|
|
Hi! Welcome to Teach-Lisp ... We will be running through a large number
|
|
of lessons -- showing you things and then asking you to try them on your
|
|
own. Before we get into the meat of the matter, however, let's talk for
|
|
a second about things you'll have to know in order to get through these
|
|
lessons.
|
|
|
|
Going from lesson to lesson
|
|
---------------------------
|
|
|
|
IMPORTANT: You are going to see a lot of lessons that will stop to let
|
|
you try something and then continue. To continue, you will have to know
|
|
to type Control-N. This signals to Teach-Lisp that you are done fooling
|
|
around on your own and want to continue with the lesson. We'll pause for
|
|
a second here so you can get a feel for that.
|
|
.pause
|
|
Good. Welcome back. We can now continue with our lesson...
|
|
|
|
|
|
Moving about in a lesson
|
|
------ ----- -- - ------
|
|
|
|
Control-P goes to the previous section of your current lesson, so typing it
|
|
N times in succession will take you back N lesson sections, if there were
|
|
that many. A lesson section is taken to mean the stuff between two pauses
|
|
to let you fool around.
|
|
|
|
Control-O repeats the lesson section just covered.
|
|
|
|
Aborting a lesson
|
|
-------- - ------
|
|
|
|
If you want to give up on a particular lesson without letting it run its
|
|
full course, type Control-A. This will abort the lesson and leave Maclisp
|
|
sitting around waiting for you to try another lesson or just fool around.
|
|
.pause
|
|
Aborting What's Going On
|
|
------------------------
|
|
|
|
If you get stuck and don't know what's going on, type Control-G. That is
|
|
the magic quit character. It will stop everything that is happening and
|
|
bring you back to Lisp's main reader. From there you can invoke the
|
|
lesson function again. So if you are expecting a response and don't get
|
|
one for a long time, you might type Control-G and then retry typing
|
|
what you were trying before it.
|
|
|
|
|
|
Control-B is similar except that it doesn't kill what is happening, just
|
|
makes it stop so you can find out what is going on. (This is not recommended
|
|
for use until you have a good idea of what is going on.
|
|
|
|
$P (<esc>P) continues from one of these "breakpoints".
|
|
|
|
Refreshing the screen or your input
|
|
---------- --- ------ -- ---- -----
|
|
|
|
Now for a couple of convenient features... Type the following,
|
|
where ^L means <ctl>L and ^K means <ctl>K:
|
|
|
|
'(this is a test^K
|
|
)
|
|
|
|
'(this is another test^L
|
|
)
|
|
And see how it redisplays!
|
|
IMPORTANT: Remember to type the ")"'s to finish the input and then return to
|
|
this lesson.
|
|
.try
|
|
What happens is that when you type an ^K, Maclisp redisplays the expression
|
|
you are currently typing in, without clearing the rest of the screen for you.
|
|
This is useful for seeing exactly what Maclisp thinks you've typed thus far
|
|
without destroying your context. When it sees ^L, on the other hand, Maclisp
|
|
clears the screen of everything except the current expression. This is
|
|
redisplayed at the top of your screen.
|
|
|
|
Flushing what you have typed
|
|
----------------------------
|
|
|
|
For now you will probably find that when you have made a typo way back,
|
|
it is easiest just to type Control-G and start typing again rather than
|
|
deleting back to it. As you become more sophisticated, you will find it
|
|
is really not the right thing to use, but it will be ok to use for now.
|
|
|
|
Control-D and Control-U which are used by other programs and other
|
|
operating systems to flush typeahead on the current line do *NOT* work
|
|
in Lisp to do this. Control-D has a very special use and Control-U
|
|
is initially undefined.
|
|
|
|
Getting Help
|
|
------------
|
|
|
|
If you get stuck, this Lisp has a special feature built into it for
|
|
teaching purposes. If you type the expression (HELP), it will request an
|
|
online helper (if one is logged in) to help you out. (Actually, this feature
|
|
has not yet been implemented.)
|
|
|
|
Exiting
|
|
--------
|
|
|
|
When you are done, you can type the expression (QUIT) and this Lisp will
|
|
go away.
|
|
.pause
|
|
Parentheses!
|
|
------------
|
|
|
|
Lisp stands for LISt Processing language. Its main distinguishable feature,
|
|
even if you're just glancing at it, is surely the number of parentheses.
|
|
It is VERY important that you balance all your parentheses. If you type
|
|
a "(", Lisp is not going to do ANYTHING until it sees the ")" that matches
|
|
it. It is not a line-oriented machine. Every time you reach a point where
|
|
all pending open parentheses have been matched with close parentheses, it
|
|
will go and try to execute it without waiting for a space or a carriage
|
|
return. Hence, typing
|
|
|
|
(COMMENT (THIS IS) (A TEST) TO SEE
|
|
(IF (IT IS GOING TO (DO SOMETHING))))
|
|
|
|
will not do anything until you type the last ")" and then Lisp will go and
|
|
try to execute the form as a program. (Don't worry about what it does right
|
|
yet -- we'll get to that -- this happens to be a form that does nothing but
|
|
return the word COMMENT so that you can put notes in the middle of programs.)
|
|
|
|
[A general note about carriage returns and spaces. Lisp ignores carriage
|
|
returns entirely. Thus you can type one in the middle of a word. A space or
|
|
parenthesis MUST be used to end a word.]
|
|
|
|
Errors you may encounter
|
|
------ --- --- ---------
|
|
|
|
While learning to use Maclisp you are bound to make mistakes. It is possible
|
|
to generate lots of different kinds of errors in Maclisp. Usually Maclisp
|
|
detects the errors and gives you an error message of some sort. The particular
|
|
error message may seem totally obscure. For the duration of your stay in
|
|
Teach-Lisp, several of the most common types of errors are being handled in a
|
|
friendlier way by the program. In some cases, Teach-Lisp will make a guess
|
|
at what it thinks you meant and will fix the mistake for you according to what
|
|
it thinks is right.
|
|
|
|
The specific types of errors which are handled by Teach-Lisp are
|
|
|
|
1. Unbound variables
|
|
2. Undefined functions
|
|
3. Wrong number of args supplied to a function
|
|
4. Wrong type of args supplied to a function
|
|
5. IO errors
|
|
6. Occurence of a go tag in an illegal place (If you don't know
|
|
about go tags, don't worry about this.)
|
|
7. Random lossage-- this is a catch-all for errors that aren't
|
|
specifically understood anywhere else.
|
|
|
|
If you want to see what is known about a particular error, type
|
|
(DESCRIBE-ERROR)
|
|
and Teach-Lisp will give you a menu and prompt you for which error to
|
|
explain about.
|
|
.pause
|
|
.if (status feature its)
|
|
Getting a normal Lisp
|
|
------- - ------ ----
|
|
|
|
To get a Lisp, one normally types LISP^K or just L^K (or one of several
|
|
variations on this.....) However, for the purposes of this course there
|
|
has been created a special version of Lisp (one of the neatest things
|
|
about Lisp is that it makes such things surprisingly easy.). To run it,
|
|
just say :RWK;LISP
|
|
.if (status feature tops-20)
|
|
Getting a normal Lisp
|
|
------- - ------ ----
|
|
|
|
To get a Lisp, one normally types LISP<cr> or just L<cr> (or one of several
|
|
variations on this.....) However, for the purposes of this course there
|
|
has been created a special version of Lisp (one of the neatest things
|
|
about Lisp is that it makes such things surprisingly easy.). To run it,
|
|
just say XTEACH.
|
|
.end-if
|
|
|
|
Session Record
|
|
------- ------
|
|
|
|
A file will be kept of everything which happens when you use this program,
|
|
so when you have difficulties and request help from one of the special people,
|
|
it will not be necessary for you to tell that person all about it; just tell
|
|
him you are having problems and he can look and see. Since it is very
|
|
important from the implementors' standpoint to find out just what kind of
|
|
problems you might encounter, don't worry about looking dumb-- feel absolutely
|
|
free to try things to see what happens.
|
|
|
|
|
|
Script File
|
|
------ ----
|
|
|
|
If you would like to keep a script file of your session with Teach-Lisp (That
|
|
is, a file similar to the session record that contains everything in it that
|
|
you type and everything that is typed back at you.), you can do so by using
|
|
the function SCRIPT. If you type
|
|
(SCRIPT)
|
|
just like that, with no arguments, Teach-Lisp will create (or add to if it
|
|
already exists as a script file) a file called
|
|
.if (status feature its)
|
|
SCRIPT >
|
|
.if (status feature tops-20)
|
|
TEACH-LISP.SCRIPT.#
|
|
.end-if
|
|
on your home directory. If you prefer, you can give SCRIPT an argument of
|
|
the name of the file to use. In that case, that file will be created or
|
|
added to, as appropriate. If you give SCRIPT an argument, you must put
|
|
doubled quotes (") around the file name, or Lisp will be confused.
|
|
|
|
As soon as SCRIPT is invoked, Teach-Lisp will commence to write everything
|
|
that happens to the appropriate file. There is no way for it to write the
|
|
things that have happened before you invoke it, so if you want a record of
|
|
the entire session, (SCRIPT) must be the first thing you type upon entering.
|
|
It will also not record the script of any lessons you invoke, so you don't
|
|
have to worry about genereating a monstrously large file this way. You can
|
|
stop scripting any time you like by typing
|
|
(STOP-SCRIPT)
|
|
without any arguments.
|
|
|
|
.next INTRO
|