Re: vote on assignments as expressions

Lenard Lindstrom <[email protected]>
Newsgroups gmane.comp.lang.prothon.user
Message-ID <Mahogany-0.66.0-4294655545-20040629-103848.00@pop3.norton.antivirus>
On Fri, 25 Jun 2004 18:05:04 -0700 Mark Hahn <[email protected]> wrote:

> There have been two or three times that the topic of having assignments
> usable as expressions in Prothon has popped up in this list.  I want to vote
> on it.  We are getting near July and I'm trying to tie up loose ends and
> there are a million loose ends like this on the list.  (I'm also tying to
> break a record for starting the most threads in one day <grin>).
> 
> The proposal is to have an assignment syntax that can be used in an
> expression like "while item <- list.pop!(): process(item)".  We can't use
> the normal "a = b" because of the possible typo confusion in this situation:
> 
>     if a = b:
>             blah blah blah
> 
>     if a == b:
>             blah blah blah
> 
> So we need an alternative syntax like "a <- b", but I don't want to use that
> for all assignments because "a = b" is so common.  Once again familiarity
> beats logic.
> 
It depends on your background. I would be quite at home with := for assignment.

> Christian presented arguments against this in a thread starting here
> (amongst other topics):
>     http://www.prothon.org/pipermail/prothon-user/2004-June/002168.html
> 
> Paul proposed using "<-" but others are possible.  Let's vote on two things.
> First cast a vote on having the feature at all.  Then whether you want the
> feature or not, vote on which syntax you'd prefer.
> 
> # 1)  I WANT or DON'T WANT this feature in Prothon.
>
Only if the same operator is in all cases of assignment.
 
> #2) If I must have this feature, then I prefer the following syntax (look at
> these in your text editor):
> 
e)    a := b
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.