[Aldor-l] Compiling setup
Christian Aistleitner
tmgisi at gmx.at
Mon Aug 14 02:21:02 EDT 2006
Hello,
On Sun, 13 Aug 2006 13:32:56 +0200, Ralf Hemmecke <ralf at hemmecke.de> wrote:
>>> | Just being curious... is there a legal C program that defines a
>>> | constant array, and a pointer (or whatever) to on element of that
>>> | array and then modifies that entry in-place?
>>>
>>> If I understand the question correctly, the answer is "no".
>>
>> For those being not familiar with C or C++:
>> These languages also provide a modifier const (just doing what its name
>> suggests), which Aldor (currently) lacks.
>
> Ooops. What is then
>
> str: String == anotherString;
>
> supposed to mean?
Sorry, I did not make myself clear enough.
Gaby already elaborated on the "const" modifier. However, I meant it more
in the direction of passing parameters. For example type "man strcat" at
your command line and you'll probably get a description of the C function
strcat. Already from its signature
char *strcat(char *dest, const char *src);
you can read off, that src is not meant to be changed, while dest probably
will be modified (indeed the string it points to is modified). That's the
concept Aldor lacks. We just have the "!"-convention. But that's not a
hard requirement but simply a convention. The compiler cannot use it to
perform checks. Furthermore, the "!" does not specify, which parameters
act constant and which may be modified.
--
Kind regards,
Christian
More information about the Aldor-l
mailing list