Re: vote on assignments as expressions

Laurent Dube <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Organization DEI
Message-ID <[email protected]>
Mark Hahn wrote:

> This is actually an argument to
> use choice e ( ":=" ), since it looks the most like a normal assignment and
> will cause the least readability problem if they do this.

Paul Prescod wrote:

> I almost think I would purposely use it everywhere, for two reasons:
>
>   1) consistency between different contexts
>
>   2) because it has always irritated me that programming languages use
> "==" to mean what mathematicians call "=" and "=" to mean something that
> mathematicians rarely do.

I would be tempted to make the jump and use it as an alternative
assignment op too, depending on context.

Here is also a nice side effect at the console:

>>> b=2
>>> a=b        # assign
>>> a          # show
2
>>> c:=b       # assign and show
2

For these 2 reasons, I support "a:=b" as expression assignment, with 2 votes.

  Laurent Dube
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.