Lecture 15 - October 16, 2007
Snobol Quiz
There will be an in-class exam next week…
Graded Review #1 returned – 3 points will be added to score if your name was on the submission
Graded book homework problems returned and gone over
Some of the remaining graded FirstPascal programs were returned
The bonus points were on firstPascal - look under assignment FirstPascal - IF YOU HAVE EARNED THE BONUS, SEND ME AN E-MAIL
There were no bonus points on SecondPascal – no one has it back yet.
NOTE: If your language choice for a project was accepted, you should have received an e-mail message from me with the language name in the subject line and no message. If you didn’t get one, you need to choose a language from the list linked into Lecture14 notes.
Started talking about Snobo4 program to be assigned. Looked at the grade sheet for it which may be changed slightly so keep an eye on it. Snobol Gradesheet.
Talked about what is wanted for language comments
Since program requires subprograms,
we need to discuss them
Since program requires an array, we need to discuss that
Program description:
· Introduce your program to the user
· Input a line of text
· Print each word as it is obtained(extracted) from the line
o Do not change the case of elements in the word
· Put them in an array
· Print the unsorted array
· Sort the array
· Output the sorted array
· Output a statement saying the program has ended normally
20 point bonus if it’s submitted by 11:59 on Friday night
10 point bonus if it’s submitted by 11:59 on Saturday night
No bonus if it’s submitted by `11:59 on Sunday night
Deductions start after 11:59 on Sunday night
Slide your printouts under my door as soon as possible – not later than class on Tuesday.
Your program will need Subprograms and an array
Snobol Notes:
&TRIM = 1
* Gets rid of all trailing blanks on any
input to a program
* The DEFINE statement defines a subprogram
* The parameters are in nested parentheses following the
subprogram name
* The subprogram name along with its parameter list is
delimited by single quotes and the quoted expression is delimited by
parentheses
* example: DEFINE ('AREPLACE(ATEXT,ORIG_CH,NEW_CH)')
*
template: DEFINE (‘functionName (arg1, arg2, … argN)
local1, local2… localN’)
…….
* any
one time initialization for fname
: (Fname_end)
Fname
function body
…
Fname_end
* Snobol code is NOT case sensitive but SNOBOL strings are!
* the dot operator is the conditional assignment operator. If the pattern match left of the dot operator succeeds, what is found is stored in the variable to the right of the dot operator.
Snobol4 doesn’t have reserved words, uses context for special words like END. The code below runs.
end = 16
output = end
end