On 05/15/2008 05:00 AM, Gabriel Dos Reis wrote: > Martin Rubey <[EMAIL PROTECTED]> writes: > > | Ralf Hemmecke <[EMAIL PROTECTED]> writes: > | > | > So, if you must, make a variable implicitly local to branches of "if" if > | > it is not used outside the "if". Also that would make the above code > | > legal. And I think that would be a better way to express the conceptual > | > level. Of course, that can only work in SPAD. The interpreter has no way > | > to know whether or not a variable is used later so it should not be > | > local and have the same type in both branches. > | > | oops, that's an excellent reason, much better than what Stephen Watt said. > > Why is it better? > > As far as I can see, with that proposal the variable would be local > depending on whether it is used after, not because it was intended > (and expressed so) before its definition.
Oh, Gaby, I am not a compiler guy, so don't count on me. But if a variable is not used afterwards it does not matter much whether it is local or not, just that one would be allowed to use different types in the branches of the "if". But, hey, I am not really proposing that, since it would introduce a difference for the compiler and interpreter language. Honestly, I don't want that difference so much. It has disturbed me from the beginning that the interpreter accepts a different language than the compiler. Ralf ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel