Thread View: net.lang.mod2
3 messages
3 total messages
Started by haynes
Tue, 14 Oct 1986 23:28
Re: Single Pass Modula-2 Compiler
Author: haynes
Date: Tue, 14 Oct 1986 23:28
Date: Tue, 14 Oct 1986 23:28
27 lines
1853 bytes
1853 bytes
Re: Declaration after use is an abomination, and should not bear consideration. Yeah? And so's your mother! (Proof by assertion refuted by childish ad hominem attack. Now that I've satisified net protocol...) What's wrong with declaration "after use"? Especially for procedures and the destinations of pointer types, declaration after "first mention" is often a natural programming style. It does make single pass compilation more difficult, sometimes impossible, and has performance implications for any compiler that has to translate the language that allows it. However declaration after use is not the obvious abomination you would try to hand wave us into believing. If claim that declaration before use results in more correct, easier to maintain programs, I will reply that the easiest to maintain large programs I ever worked on had all procedures declared in strict alphabetical order. That sure made a given procedure easy to find. One pass compilers are a boon to compiler writers and people who have to run on small machines. For them a one pass compiler is often the only possibility. For others who have large machines, and want an easy to use language, but don't want to sacrifice correctness or efficient object code, a multi-pass compiler is often the right thing. -- Charles
Re: Single Pass Modula-2 Compiler
Author: Randy Bush
Date: Thu, 16 Oct 1986 23:20
Date: Thu, 16 Oct 1986 23:20
17 lines
1127 bytes
1127 bytes
And your mother wears combat boots!
Certainly I agree that forward reference is needed to resolve pointer
declarations. And I agree that PIM-2.[1..3] would allow forward
reference to procedure declarations, although discussion here has not
revealed a method for one-pass compilation of such - forward declaration
being the only technique discussed so far.
What I refer to is that PIM-2[1..3] would seem to allow
PROCEDURE A ();
BEGIN
x := 42
END A;
VAR x : CARDINAL;
randy
Re: Single Pass Modula-2 Compiler
Author: Felton.pa
Date: Fri, 17 Oct 1986 21:07
Date: Fri, 17 Oct 1986 21:07
13 lines
1009 bytes
1009 bytes
Re: Declaration after use is an abomination, and should not bear consideration. If you think about it, requiring that procedures be declared before they are called is contrary to the ideals of top down programming. John p.s. I know. You don't have to write the program in the same order that it appears in the listing. But, in practice this is often the way that it is done.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads