An update from the bug: Seems the behavior is WAI because the execution
order of dereference and function calls are not defined. deference of
`foo.bar` may happen before or after (which is this case) the function call
of `compute_value()`
Spec states following about order of evaluation:
> whe
A nice thing about Go is that it is easy on the eye. Names are short, and
easy to read. When you look at Go code, you are not faced with a
wall of black text. The signal to noise ratio is high. Variable and
function names general convey what they do, what they mean, rather than
the types of thei
I don't see a good argument for the lack of a suffix "naturally" implying
returning a slice. I don't think `ValuesSlice` would be less natural than
`ValuesSeq`.
At the end of the day, it's purely a question of what you think would be
more frequently used. That should get the better name. `Values`
Thanks for the confirmation, I
created https://github.com/golang/go/issues/71054 for this.
On Saturday, December 28, 2024 at 6:11:52 PM UTC-8 Ian Lance Taylor wrote:
> On Sat, Dec 28, 2024 at 5:38 PM Kaiming Yang wrote:
> >
> > I'm trying to understand execution order of assignment statement, a
> On Dec 28, 2024, at 2:41 PM, Amnon wrote:
>
> There are big advantages in maps.Keys and maps.Values returning iterators.
> It allows us to iterate very big maps without having to allocate vast amounts
> of memory.
I definitely agree there is a big advantage to have functions in the standard
On Sat, Dec 28, 2024 at 5:38 PM Kaiming Yang wrote:
>
> I'm trying to understand execution order of assignment statement, as spec
> mentioned:
>
> > The assignment proceeds in two phases. First, the operands of index
> > expressions and pointer indirections (including implicit pointer
> > indir
Hi everyone,
I'm trying to understand execution order of assignment statement, as spec
mentioned:
> The assignment proceeds in two phases. First, the operands of index
expressions and pointer indirections (including implicit pointer
indirections in selectors) on the left and the expressions on
There are big advantages in maps.Keys and maps.Values returning iterators.
It allows us to iterate very big maps without having to allocate vast
amounts of memory.
When maps was moved from x/exp to the standard library, the Keys and
Values methods were not added
until 1.23.0 when iterators beca
Background#1: working on Linux system diagnosis tools, I often end up
scraping the process and system filesystems quite extensively using
os.ReadDir. On busy systems this might be a place to optimize things a
little bit, or at least see if it does reap any benefits.
Background#2: "*You can copy