Re: make == as = ?

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: make == as = ?
Дата
Msg-id 4485.24.211.141.25.1081595110.squirrel@www.dunslane.net
обсуждение исходный текст
Ответ на Re: make == as = ?  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: make == as = ?  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
Fabien COELHO said:
>
>
> So on the point that the standard must be supported, I perfectly agree.
>
> On the point that anything else should be dropped out: let's do it!
> I'll send a patch to remove all those non portable features in
> postgresql that make users write non portable code... But I'm not sure
> it will be accepted;-)
>
> Moreover, having == as a synonym for = is not necessarily in
> contradiction with a stable, reliable and predictable server.


Nobody is suggesting that we should not support legacy features that are
non-standard, nor even that we should not occasionally, and for very good
reasons, introduce new non-standard features (e.g. dollar quoting).

But making == a synonym for = is just syntactic sugar, of no obvious
practical benefit that I can see. I think its alleged utility in teaching
C/Java/perl programmers is overstated - if they think of == as equality
will they also think of = as assignment? And the fact that C (stupidly)
uses = for assignment is the whole reason for the existence of == in the
first place, and many languages (e.g. see the algol family) do not suffer
from this defect.

The last reason I advance against this is that operator space is scarce,
and if we do use == somewhere it should be to some better purpose than
this.

cheers

andrew






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Fabien COELHO
Дата:
Сообщение: Re: make == as = ?
Следующее
От: "zhengjinyuan"
Дата:
Сообщение: postgresql 7.4.2 on macosx 10.3