[fa.info-cpm] Pascal & other programming languages

C70:info-cpm (06/03/82)

>From decvax!duke!uok!mwm@Ucb-C70 Thu Jun  3 12:59:26 1982
Via:  Mit-Mc; 3 Jun 82 6:30-EDT


First, in answer to the question of "how do you get the cursor to stay at the
end of the prompt", I know of only one way: you write a puts routine that
resorts to doing I/O outside of the standard Pascal I/O package, and does
NOT wait for a newline to get around to outputting characters. The problem
(once again) stems from the fact that Pascal was designed for a batch
environment, where such things are not a problem.  Due to this, ANY solution to
this problem will use some non-standard feature of Pascal (sigh).

As to the problem of checking for non-valid input, there is a fairly
straight-forward solution, like so:

	repeat
		puts(prompt) ;
		gets(input) ;
		until validp(input) ;

Unfortunately, you have to write the boolean function validp to parse the input
string and decide if it is reasonable.

Now, as to Pascal error messages & self-correction: last time I looked, the
behavior of a Pascal compiler when it ran into a syntactic error was NOT part
of the standard. Therefore, compilers that do nice things like you mentioned
would meet the standard, and would be NICE things to have. But this is 
immaterial, as I haven't seen a "standard" pascal compiler yet; they all have
extensions of some form or another.

@begin(soapbox)
As a matter of fact, some folks at CMU (I think) have a system wherein
it is impossible to type a syntactically incorrect program into the editor.
This is a step in the right direction, but not (YET!) available on micros.

On attacking languages, I never (well, hardly ever) use Pascal. I use C
(Leor's) since it is the best thing I have found. It is STILL an obnoxious
interface to the power of my (or anybody else's) machine.  If somebody out
there has a good suggestion, I'd appreciate hearing about it (Note: I am
thinking about LISP, & would like comments about CP/M LISP systems.)
The problem is that ALL popular languages look like fortran from any
distance of over 10 feet, and the few exceptions are nearly unusable.
See Backus's Turing Award Lecture for some thoughts on this.
@end(soapbox)

Now that I've made everybody sufficiently mad, I will sit back and prepare
to duck the shrapnel.

	mike