Go's garbage collector is very nice, and solves many problems that come up
in C programs.
However, one thing I've been wondering about is explicitly freeing memory.
I know it can't be done
now, and that the GC takes care of everything.
But I was thinking about multi-pass programs like compilers
In a compiler, say during the lexing and parsing phases, memory might be
allocated
that won't be needed after those phases are complete. The memory is still
referenced,
so the GC won't free it, but conceptually it actually could be freed. In
other words,
the fact that memory is referenced isn't
I'm learning Go (using 1.9.2 on Centos 7). Consider the following
trivial program, which works fine:
package main
import "fmt"
type symbol struct {
name string
fn func(int)
options int
}
func main() {
symbols := [] symbol {
{"jon",x, 4},
}
symbols[0].fn(13)
Thanks for the quick reply! I should have seen that. Sorry for the noise.
Jon
--
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...@googlegrou
On Monday, December 18, 2017 at 12:12:22 PM UTC-8, Dave Cheney wrote:
>
> It's true it is an exception, it's one of the few cases where the language
> adds a pinch of syntactic sugar to make the experience more pleasurable.
>
I'd describe this more as removing a pinch of syntactic sugar.
I ca