<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid:47DBADBE.5030709@student.matnat.uio.no"
type="cite">
<pre wrap="">
Also, it kinds of breaks IoC:
<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Inversion_of_Control">http://en.wikipedia.org/wiki/Inversion_of_Control</a>
</pre>
</blockquote>
Actually, reading that article it gives the wrong impression, that is
not what I meant.<br>
<br>
It's strange that it is called IoC - it might be the inverse of 1980-s
style programming, but it certainly is the norm now. The important
thing anyway is about encapsulation and the so-called <a
href="http://en.wikipedia.org/wiki/Hollywood_Principle"
title="Hollywood Principle">Hollywood Principle</a> -- "don't call us,
we will call you" (to cite the article).<br>
<br>
Basically, write encapsulated, stand-alone code that can be unit-tested
easily, and don't assume that the compiler works this or that way (ie,
the transform shouldn't have knowledge about various phase<br>
<br>
What it does need knowledge about is what kind of contract/state the
tree is in: "I expect there to be type information there"), which is
something different from "I know there will be type information there
because we are in state B or C or D but not A". The former is a
contract, the latter makes the transform assume something about the
compiler operation.<br>
<br>
The assert I inserted contradicts this and was a quick mistake BTW :-)<br>
<br>
<pre class="moz-signature" cols="72">--
Dag Sverre
</pre>
</body>
</html>