Re: OOPs!! When is a class not a class? (Re: Number/Specificality/Archetypes in Language)
From: | Pablo Flores <pablodavidflores@...> |
Date: | Monday, September 27, 2004, 12:21 |
On Sat, 25 Sep 2004 17:28:06 +0200, Philippe Caquant
<herodote92@...> wrote:
> In Pick Basic: concatenation = ":", addition = "+". So
> the program performs concatenating or adding,
> depending of what *you* told it (by using an operator
> meaning what *you* mean, and not what *it* fancies
> (because he finds that 1st or 2nd operand happens to
> be a number or a string).
From what you wrote, it seems to me that Pick Basic
forces you to learn two operators where just one
(overloaded) would be enough. I use Python, where
'+' stands for concatenation and also for addition,
and I've never ever had a problem with it, because
Python, once it guesses the type of a variable,
demands that you do a explicit type conversion
when you want to use it as some other type (the
only implicit type conversions are the promotions
of int -> long -> float and string -> unicode string,
IIRC).
If you do "a + b" and you don't know what type of
value you put into those variables, that's a problem
with your program, not with the operator. :)
I agree that a good programming language should
not be as paternalistic as to assume that, when you
wrote '2' + '2', you actually meant 2 + 2...
--Pablo Flores
Reply