On Sun, Dec 31, 2017 at 11:55 AM dc0d <kaveh.shahbaz...@gmail.com> wrote:

> Please read the first message in this thread. The first() function was
expected to be ignored as in common sense, yet it gets evaluated.
>
> I am not wrong (or right), only making a point (maybe the point seems
pointless) and I have read the specs. I am saying that this behavior was
unexpected.

You should probably point out what part of the specs make you expect that
behavior. AFAICT, it works exactly as specified[0]:

""""
For all the cases in the statement, the channel operands of receive
operations and the channel and right-hand-side expressions of send
statements are evaluated exactly once, in source order, upon entering the
"select" statement.
""""

'first()' is the right-hand-side of a send statement and the above quoted
part of the specs clearly says it _will_ be evaluated. Nowhere the specs
say otherwise.


[0]: https://golang.org/ref/spec#Select_statements

-- 

-j

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to