[Oberon] IMPORT Modules: why does order matter?
Michael Schierl
schierlm at gmx.de
Sun Mar 3 13:37:24 CET 2019
Am 03.03.2019 um 10:00 schrieb Till Oliver Knoll:
> But I can tell you from my professional experience (which includes
> C/C++) that a simple = in an IF condition goes undetected far more in
> practise than you will do the = vs := mistake.
I can agree from JavaScript point of view. In Java it is usually an
error: if statements have to be a boolean expression and "x=y" is only a
boolean expression if the type of x is boolean itself; and you rarely
have to compare booleans with each other (comparing a boolean with
literal true or false is a warning so you tend not to write that), but
in JavaScript it happens too often for me too to miss one equals sign
and have weird errors (and no warning at all).
> Well, personally I've seen people doing forward declarations, but it was
> almost never the case where you could not simply move the
> implemementation up to the "correct place" and then do without a forward
> declaration.
Doing compilers/parsers with Recursive Descent often requires mutually
recursive functions. Also Sierpinski.Mod is an academic example that
could benefit from forward declarations.
Regards,
Michael
More information about the Oberon
mailing list