perm filename HOMWRK.1[206,LMM] blob sn#095293 filedate 1974-04-01 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00004 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	Handout #4				CS206
C00005 00003	(6) Send a message to your TA's. You call the program called
C00008 00004	(c) Then call the editor and play with as follows:
C00010 ENDMK
CāŠ—;
Handout #4				CS206
Homework #1				April 2, 1974

DUE: April 9, 1974. You are urged to try this assignment before April
4 and ask questions.

WHAT TO DO:
     Go to a terminal and do the following things. When you
are through, tear off the paper on the terminal and put your
name on it. This is what you will turn in.

(1) LOGIN to IMSSS. See page 2 of "Intro to TENEX" handout.
    You will type ctrl-C, wait for the "HELLO ..." message, and
    type:
	LOG nnLISP Lnn 206<cr>
    where the "nn" is the two digit number assigned to you
    (i.e. you are assigned to one of the USERnames 10LISP,
    11LISP, ... 20LISP). The "<cr>" stands for "carriage return"
    which is a key on the terminal-- on the teletype it is
    labeled "return".

(2) LOGOUT. (Use the "K" command to TENEX).

(3) LOGIN again. This time try typing LOGG as if you made a mistake
    and use ctrl-A to "erase" the second G. (TENEX will type \G after
    you type ctrl-A to show you that the G has been deleted).

(4) Try some TENEX commands. These things must be typed to the TENEX
	EXEC prompt, an at-sign (@).
	(a)	DIR<cr>		   lists all of your files

	(b)	DIR,<cr>	   lists all of your "deleted files"
		 DEL<cr>	   The system will prompt with two
		 <cr>		   at-signs "@@" after the "DIR,".

	(c) Start typing out a file, and then abort it with two
	ctrl-C's. I.e. type:
		TYPE <206LIB>CS206.DOC<cr>
	and then before it gets too far, type two ctrl-C's.

(5) Read your mail. Your mail is contained in a file called
	MESSAGE.TXT. Thus you use the exec command:
		TYPE MESSAGE.TXT
	There may be mail for different individuals using the
	same directory-name. If all of the mail is for you
	(ignoring junk-mail) you may delete MESSAGE.TXT using
	the command
		DELETE MESSAGE.TXT
(6) Send a message to your TA's. You call the program called
	SNDMSG, by typing SNDMSG<cr> to the at-sign. This
	will appear at your terminal magically as

	@SNDMSG.SAV
	...enter list of users:

	Send the message to 206LIB by answering 206LIB<cr> to
	the question. Then enter your message. Be sure to
	say who you are and whether this is a question, a bug
	report, or what. E.g.

	Dear Tom and Larry:
	    This is Joe Schmoe. I have a question. How do I
	 get out of SNDMSG?

		Joe.

	If you make a mistake, use ctrl-A to erase a character,
	ctrl-Q to erase a whole line.  (note that different
	programs have different "erase" characters). It happens
	that EXEC, SNDMSG, and LISP all use ctrl-A. SNDMSG
	and LISP both also use ctrl-Q. When you are through,
	type ctrl-Z. This will get you out of SNDMSG and
	actually send the message.

(7) Call the lisp system by typing ILISP<cr>. You should get the
   percent-sign (%) prompt.

(a) Try the following exercises. Before typing in each one, predict what
    will be returned as the value (or printed) in each case. Do not hand
    it in, but develop a theory that explains the difference between what
    you predicted and what really happens.

CAR((A B C))		CADR((A (B) C))
CDR((A B C))		CAADR((A (B) C))
CADR((A B C))		CDADR((A (B) C))
CONS(A NIL)		CONS(A B)
CONS(A (B C))		CONS((A) (B C))
CONS((A) B)		CDR((A . B))
CONS((A) NIL)		CAAR(((A . B) . C))
PLUS(2 2)		TIMES(2 3 4)
PLUS(1 2 3 4)		DIFFERENCE(2 3)

    Sometime in the middle of this, try typing ctrl-T (to see what
    is going on -- it should either say RUNNING AT ... or IOWAIT AT ...)

    Also try ctrl-C, look at your DIRECTORY, and then CONTINUE.

(b) Execute the following command:

	SET(X (A (B C (D E)) F G))

(c) Then call the editor and play with as follows:
    (in the following, the # and %'s are prompt characters; you 
    do not type them. It is understood that you "return" at the
    end of each line).

	%EDITV(X)
	#P
	#PP
	#?
	#2
	#P
	#PP
	#3 P
	#ā†‘ P
	#2 3 P
	#0 P
	#(3 H)
	#PP
	#(3)
	#P
	#(-2 I)
	#P
	#OK

(9) You should be back in the "top-level" of lisp. Just in case,
     type ctrl-Z. You should get the % prompt (again).

(10) Execute the following commands (again, the % is prompt character
     which you do not type):

	%PRINT(X)
	%SET(X 2)
	%EVAL(X)

(11) Problems or questions?  Type ctrl-C to get out of ILISP and
	back to the TENEX exec. Then type 
	SNDMSG
	206LIB
	Dear Larry and Tom:
		This is Joe Schmoe. I have a problem. I typed
	PP and lisp answered NO.
	<ctrl-Z>