glycerine/zygomys

General Question: Calling methods on a Go struct

andrewrowe-wk opened this issue · 2 comments

Hello! Wonderful library! The Go bindings are very easy to use, and I've had a great deal of fun tinkering around with possible use-cases for zygomys.

Without declaring/registering a new function, is there a way to call methods on a struct? I see a few things in the docs that seem to reference it, but I have not been able to find a concrete example.

Thanks for all your work on this library!

Hmm... I don't recall. I think so, but I'm not sure just offhand. It's been a long time since I wrote this. But here are some places to look and read the code. I recommend the _test.go cases especially (the last two).

https://github.com/glycerine/zygomys/wiki/Go-API#defining-your-own-types

https://github.com/glycerine/zygomys/blob/master/zygo/demo_go_structs.go

https://github.com/glycerine/zygomys/blob/19c0bdf4c230eb298cfbeda7289c222783400e4b/tests/methodcall.zy

invok, err := env.EvalString(`

func Test008CallByReflectionWorksWithoutNesting(t *testing.T) {

Thank you!