[Aldor-l] Compiling setup

Ralf Hemmecke ralf at hemmecke.de
Sat Aug 12 12:57:31 EDT 2006


> | However, you where trying to tell me, it is not an issue of the source  
> | code and thereby did not consider
> |    local a:String = "abc";
> |    a.3 := char "X";
> | bad style.
> 
> *If* the declaration of a above is valid and makes 'a' a modifiable
>  string, *then* the program is correct and *should function correctly*.

I consider it bad style! But probably for another reason. It contains a 
syntax error. Christian should have written

local a:String := "abc";

or

local a:String == "abc";

In the first case, modification should be allowed. In the second it 
would be quite questionable. But then

a.3 := char "X";

is the same as

set!(a, 3, char "X);

It's a BANG function and by convention destructive so one might expect 
strange behaviour even if a is a constant.

It becomes interesting to ask what the semantics of the following 
program should be.

---BEGIN aaavarconst.as
#include "aldor"
a: String := "a";   c: String == "c";
b: String := "a";   d: String == "c"
a.1 := char "X";    c.1 := char "Y";
---END aaavarconst.as

Clearly one expects b = "a". But would be d="Y" also be OK?

> There is no "bad style" excuse to invoke.  If the proram cannot work
> correctly, then either the language is defective or the compiler is
> buggy -- FWIW, I conisder the runtime system part of the compiler.

Hmm, until someone proves me wrong, I would claim that String is not 
part of the Aldor language. And it is also not a part of the runtime. It 
is defined in the Aldor library "libaldor". And I don't count libaldor 
as part of the compiler stuff.

Ralf



More information about the Aldor-l mailing list