> From: Paul Otto <[EMAIL PROTECTED]>
>> And finally, it makes sense to have separate syntax for arrays
>> and general functions, because different behavior is expected
>> for the two.
> That argument would suggest that you should use a different
> syntax for each different implementation of an abstract data
> type. (Since their performance tradeoffs are usually different.)
> Do you advocate that?
Ideally, no. Practically yes. If compilers were smart enough to
determine which would be the most efficient implementation for the
most abstract version of a function, who would ever want to worry
about such details? In fact, many algorithms are efficient by
expoiting various features of imperative arrays. If I want to
encode such an algorithm, I want my performance to be guaranteed
to be no worse than those imperative arrays. If you deny the
programmer control over efficiency, why use the language? Oh,
maybe as a specification language, but it certainly won't be used
in industrial strength programming. Further, in a typical program
I will mix functions that compute values by rules and arrays --
if the compiler has no ability to determine which should be implemented
as which, I certainly should be able to make that specification.
Ken