[go-nuts] Current Thinking on Explicit Memory Freeing?

2019-04-16 Thread jlforrest
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

Re: [go-nuts] Current Thinking on Explicit Memory Freeing?

2019-04-16 Thread jlforrest
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

[go-nuts] Beginner Question About Structure Initialization

2017-11-22 Thread jlforrest
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)

[go-nuts] Re: Beginner Question About Structure Initialization

2017-11-22 Thread jlforrest
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

Re: [go-nuts] Surprise About How Method Receivers Work

2017-12-18 Thread jlforrest
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