Search Postgresql Archives

Re: Strange behavior of "=" as assignment operator

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 






On Sat, Jun 1, 2013 at 2:52 AM, David Johnston <polobo@xxxxxxxxx> wrote:
Chris Travers-5 wrote
> However = as assignment is particularly odd to me for two reasons.  First
> it is not ambiguous but it leads to difficult to read constructs, like
> this:
>
>    out_var = in_left = in_right;

Agreed but the genie is already out of the bottle and I am OK with something
at the "lint/check_function" level trying to enforce good coding habits as
opposed to changing the language to prohibit what has now been allowed for
many years.

My  preference would be that at some point we start adding warnings when = is used as an assignment.  Such warnings could be turned off.  Then at some later point we can decide whether to change the behavior.  A decision to changing the language would be different if such behavior had given warnings for several years prior.

Best Wishes,
Chris Travers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux