RE: Small feature request for future EU versions

new topic     » goto parent     » topic index » view thread      » older message » newer message

Ricardo M. Forno wrote:
> 
> I think Euphoria, in this respect, is exactly as it should be.
> To maintain laguage coherence / orthogonality, if {5,1,4}+{4,0,2} is {9,1,6}
> as it is now, and similarly regarding subtraction, multiplication and
> division, then {3,2,1}={4,2,1} should be {0,1,1}, and {5,7}>{8,6} should be
> {0,1} and so on.
> Comparing sequences is entirely another matter, and so I think the equal()
> and compare() functions are all right.
> If an improvement is needed, then equal() and compare() could be replaced by
> other special characters or sets of same. remainder(a, b) is also a good
> canditate to be replaced by a % b.
> Moreover, please remember (or consider) that one of the most common pitfalls
> in the C language is to use = instead of ==, and in Pascal and other ones,
> to use = instead of :=.
> This is my (perhaps not so) humble opinion.

Another alternative is to use function calls for sequence operations and 
leave operators just for comparisions. To have the same syntax element do
multiple jobs, depending on context, can be a source of problems.

I agree with the C and Pascal comments you make, but the difference there
is that they are only dealing with assignment and comparisions, not 
sequence operations as well. In Euphoria, '=' is used for three distinct
actions, depending on its context. I would propose that it, and the other
comparison operators, should be deprecated for sequence operations and
those (rarely used) activities be replaced with built-in functions.

-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu