This is really about you, your taste in design, and your sensibilities for
information hiding.
If you have a global symbol, be it a function name or data item, then
that's what it is, a global. Globals, r/w data especially, invite subtle
sharing complications, can cause complexity in attempts at m
On Thursday, April 11, 2019 at 6:20:33 AM UTC-4, Dumitru Ungureanu wrote:
>
> It helps a lot! Thanks.
>
> I now have two things to moan about.
>
> If I was to pass c around, I would added it to the params list. If I had
> more others, I'd built a struct. But now, if somehow I lose track of who's
It helps a lot! Thanks.
I now have two things to moan about.
If I was to pass c around, I would added it to the params list. If I had
more others, I'd built a struct. But now, if somehow I lose track of who's
passing what and where, hard times debugging ahead. Having them declared at
package l
On Thu, Apr 11, 2019 at 11:56 AM Dumitru Ungureanu wrote:
>
> Secondly, as far as my knowledge goes:
>
> your example is declaring the function in place, it doesn't pass the
> variable around to another function
The `w` variable is visible in the closure. Closure is a function +
closed over var
First off, thank you for the time Jan.
Secondly, as far as my knowledge goes:
- your example is declaring the function in place, it doesn't pass the
variable around to another function, i.e. goConect
- my code evolved , so now, if I use a init func then it's off to init
passing the
On Wed, Apr 10, 2019 at 7:23 PM Dumitru Ungureanu wrote:
>
> In this particular case, w.DefineFunction Api does not acomodate such a
> passing.
Please explain why and/or what do you mean by that as I don't see
where/what the problem is.
> Reason I asked in the first place. Dependency injection
In this particular case, w.DefineFunction Api does not acomodate such a
passing. Reason I asked in the first place. Dependency injection of what sort
can be used here...
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this g
On Wed, Apr 10, 2019 at 2:42 PM Dumitru Ungureanu wrote:
The alternative is to pass `w` around as a function argument. For that
it will be necessary to create/initialize `w` in main or in a function
call made from main.
PS: Go has no global scope. The closest is universe scope, but
programs cann
I have this.
Enter code here...
package main
import (
"fmt"
"log"
"github.com/sciter-sdk/go-sciter"
"github.com/sciter-sdk/go-sciter/window"
)
var w *window.Window
func init() {
var err error
w, err = window.New(sciter.DefaultWindowCreateFlag, sciter.DefaultRect)
i