Re: how to call blocks?

"shifeng_h" <[email protected]> Thu, 09 Aug 2012 05:30:18 -0000
Newsgroups gmane.comp.lang.io
Message-ID <[email protected]>
Thank you very much

--- In [email protected], Jeremy Tregunna <jeremy.tregunna@...> wrote:
>
> Blocks aren't activatable by default, therefore you need to pass a "call" message to them. I.e., in your example, call v like this:
> 
> v call
> 
> If you make blocks activatable, by sending the setIsActivatable(true) message to them such like this:
> 
> v b := block("block println") setIsActivatable(true)
> 
> Or at any point in their life, from that point on they can be called just like methods; by name.  
> 
> Regards,
> 
> Jeremy Tregunna
> 
> 
> On Wednesday, 8 August, 2012 at 12:15 PM, shifeng_h wrote:
> 
> >    
> > hi, I am a new guy for Io language. and I have a problem need help.
> >  
> > after I create a block with method block(), how to invoke it? the code below didn't work.
> >  
> > thanks for help
> >  
> > Io 20110905
> > Io> v := Object clone
> > ==> Object_0x15f8b60:
> >  
> > Io> v b := block("block" println)
> > ==> method(
> > "block" println
> > )
> > Io> v b
> > ==> method(
> > "block" println
> > )
> > Io>
> >  
> >
>