Hi
I’m a new arrival of golang. Recently when I write something, I meet a weird problem that, the code written like
> // scanFunc is a closure
for pos := scanFunc(list[beg:end]) ; middle != pos ; pos = scanFunc(list[beg:end]) { fmt.Printf("Scan %v, %v, result %v\n",beg,end,pos) if middle < pos { end = pos + 1 }else{ beg = pos } middle = ( beg + end ) / 2
}
causes an extremely long time to compile before running, and the debug info are not printed.
I suppose that my because golang expand the function call during compile time, then the value of beg and end are fixed but not computed real-time, but I’m not sure about that.
Does anybody have some idea about that?