Stored on: EDIT.COM This is the comment file for generating a listing of EDIT.VLI STORED ON: EDIT.VLI This file contains the VLISP editor and may be loaded by: (INPUT EDIT) VLISP.INI must be loaded for these routines to be used. When this file is loaded the following resources are used: Atoms = 332 Lists = 669 Numbers = 1 To enter the editor type: (EDIT Func-name) The edit commands are as follows: (where m,n are integers between 0 and 32767) "E" EXIT Exit from the editor and pretty print the edited function "0E" Exit from the editor "n " SELECT Select the nth list element as the new edit list " " the first list element as the new edit list "B" BACKUP Backup from the last select command "nB" Backup from the last n select commands "0B" Backup to the original edit list - i.e. (FVAL Func-name) "n,mS" SAVE Save the n'th thru m'th list elements in *0 "nS" Save the n'th list element in *0 "S" Save the first list element in *0 "n,mD" DELETE Save the n'th thru m'th elements in *0, then delete them from the list "nD" Save the n'th element in *0, then delete it from the list "D" Save the first element in *0, then delete it from the list "nU" UNSAVE expand the edit list by one element by using *0 as the new n'th element "U" expand the edit list by one element by using *0 as the new first element "0U" expand the edit list by one element by using *0 as the new last element "nV" expand the edit list by l [where l = (length *0)] by inserting *0 into the edit list before the n'th element "V" expand the edit list by l [where l = (length *0)] by inserting *0 into the edit list before the first element "0V" expand the edit list by l [where l = (length *0)] by appending *0 to the end of the edit list "nI" INSERT same as "nU" except instead of *0 use an expresssion input from the terminal "I" same as "U" except instead of *0 use an expresssion input from the terminal "0I" same as "0U" except instead of *0 use an expresssion input from the terminal "nJ" same as "nV" except instead of *0 use an expresssion input from the terminal "J" same as "V" except instead of *0 use an expresssion input from the terminal "0J" same as "0V" except instead of *0 use an expresssion input from the terminal "T" TYPE retype the entire edit list "n,mT" type elements n thru m of the edit list "nT" type elements n thru m of the edit list, where m = length of edit list ",nT" type the first n elements of the edit list "P" PUT *1 <-- *0 (Save the expression in *0 in *1) "nP" *n <-- *0 (Save the expression in *0 in *n) [use the put command after save or delete commands when the saved expression must not be lost by succeeding save or delete commands] "G" GET *0 <-- *1 (Retrieve the expression in *1) "nG" *0 <-- *n (Retrieve the expression in *n) [use the get command before U or V commands to retrieve saved expressions] "0R" RECALL Display the expression saved by the last S or D command (i.e. display *0) "R" Display the expression saved by the last P command (i.e. display *1) "nR" Display the expression saved by the last nP command (i.e. display *n) "X" EXCHANGE read two expressions form the terminal ("OLD","NEW"). Replace all occurances of "OLD" in the edit list with "NEW". note: Whenever the editor is displaying text on the terminal, you may cancel the rest of the printout by hitting the space bar (cancels all succeeding elements after completing current one). EDIT this is the VLISP editor, call with F as the function to be edited .SETQ ** is the edit list, **1 is the original edit list .SETQ initialize variables for PT (the pretty printer) .PEL print the edit list, using sequence numbers .UNTIL repeat this loop until the exit command has been executed .GETCMD get a command from the user .e exit command .IFN if ARG is nonzero, pretty print the function .SELECT select command .BACKUP backup command .INSRT insert commands .COPY unsave commands .IF watch command .SET put command .SETQ get command .EVAL recall command .PRIN1 exchange command .7 beep if illegal command PRIN1 output A, does not output a carriage return IMP* generates atom names to be used form expression storage via the PUT command SELECT select one of the list elements as the new edit list .IF dont allow an atom to be the new edit list .7 beep if bad select argument .NEWL add the selection to the backup list .SETQ select the new edit list BACKUP backup from one or more select commands .ZEROP 0B will cause edit list to reinitialize to **1 .SETQ 0B comes here - clear backup list .UNTIL nB comes here - remove n elements from backup list .BK reinitialize ** to original edit list (**1) .WHILE step through ** using backup list backwards SV*0 save one or more elements of the edit list in *0 .ARGOK check for valid arguments .7 beep if invalid .IFN are there 1 or 2 arguments? .SETQ 1 arg: save element number ARG of the edit list in *0 .SETQ 2 args: save elements ARG0 thru ARG in *0 DELET delete one or more elements from the edit list .ARGOK check for valid arguments .IF are there 1 or 2 arguments? .IF come here for 2 arguments .NTH come here if ARG0 = 1 .NTH come here if ARG0 > 1 .IF come here for 1 argument .CDR come here if ARG = 1 .NTH come here if ARG > 1 ARGOK check the arguments for validity .GT ARG must be greater than 0 .LE ARG cant be larger than the length of the edit list .OR if there are 2 arguments, the first arg (ARG0) must be greater than 0 and less than or equal to ARG GETCMD get a command sequence from the user .SETQ indicate that there is only one argument .PRIN prompt the user for a command .ARGCHR get the first argument and command character .IFN if command is "," get a second argument and a new command character .IF convert an upper case command character to lower case .TERPRI go to next line ARGCHR get a numeric argument and a command character from the user .SETQ use 1 as a default value if argument not present .SETQ get a character .IFN is it a digit? .SETQ yes, initialize ARG to 0 .WHILE keep going until the command character is found .SETQ convert from decimal ascii ISDIGIT return true if CHR is a "0" thru "9" PEL pretty print the edit list while numbering the list elements PEL1 print elements EL1 thru EL2 of the edit list .TYS cancel rest of output if spacebar is pressed .PRIN print the element number .PEL2 print the element starting in column 8 PEL2 pretty print the expression X INSRT insert INSR as the new Nth element of ** .1 come here if ARG = 1 .SUB1 come here if ARG is in range .INSR if out of range, put INSR at the end of the edit list JNSRT merge the list INSR into the edit list .ATOM make sure its a list .1 come here if ARG = 1 .SUB1 come here if ARG is in range .INSR if out of range, put INSR at the end of the edit list SVEDIT save all functions needed for the editor