Re: Difference between method and block - with examples
"Shashank" <[email protected]>
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
Hi Oscar, --- In [email protected], Oscar Martinez <wasi.network@...> wrote: > > > > Hi Shashank, > > blk call(2) > Perfect! Thanks!! Now, am I to assume that the way blocks differ from methods is this: n := 10 mthd := method(i, i + n) mthd(2) # No need to "call" I must have mis-understood then. I thought "method" was a dynamic closure and was expecting this to work too: foo := method(n := 20,mthd(2)) foo # should return 22 but returns 12 No? - Shashank