On Wednesday, 18 January 2017 16:39:03 UTC-5, rog wrote:
>
> On 18 January 2017 at 18:45, Bryan Chan <brya...@gmail.com <javascript:>> 
> wrote: 
> > But I couldn't find a way to bind a receiver to a method expression, 
> such 
> > that the resulting method value can be invoked at a later time. Would 
> this 
> > be a useful addition to the language? Or did I miss something? 
>
> If a is an object with the method foo, a.foo will give you a function that 
> will invoke the method at a later time. 
>
> See https://golang.org/ref/spec#Method_values 
>
 
I understand what method values are. My original email already contained an 
example. What I want to do is to store away a method expression, and then 
over time, bind that expression with different receivers to form different 
method values, so that those method values can be passed to other parts of 
the program and invoked later.

--
Bryan

-- 
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to