Benito van der Zander wrote:
array1[array2[i]] := min(array1[array2[i]], 42);
Now, you need to repeat all the array indices.
Which is very ugly.
So there should be an alternative syntax, similar to += :
I.e.:
   array1[array2[i]] min= 42;

Now *that* is ugly. It would take me quite a while to find out what happens 
here.
What is assigned to what and when?
Why making Pascal look like C instead of using C?
In the example case I would prefer the original or write

if array1[array2[i]]>42 then
    array1[array2[i]] := 42;

or if performance is realy an issue you I would use an intermediate pointer to 
the array type:

var p : ^arrayelementtype;

p := @array1[array2[i]];
p^ := min(p^,42);
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to