The user calls non-existent method foo.Bar() or accesses non-existent field foo.Bar. If they don't exist, I want to:
a) In case of a method call: forward that call to foo.Baz()
b) In case of field access: set the foo.Bar at runtime with some value
--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/4417bc0c-d521-4a3b-a8af-78c399238e80%40googlegroups.com.
this is not my first statically typed language, I know a little bit of C and Java. I was under the impression that Go is capable of some dynamic behavior. Maybe things like Go's type inference, duck typing, empty interface{} led me to believe that. All these type-related bindings can be resolved at compile-time. So I was thinking, if the compiler can do some extra work for resolving the types, maybe it could add a few more steps to keep track of which function to call when an undefined method is accessed.