curiousity: evaluation of block vs. method

"McCarrell, Jeff" <[email protected]>
Newsgroups gmane.comp.lang.io
Message-ID <CA228B81.31B3%[email protected]>
Hey everyone.  I have been getting to know Io; trying to work out the evaluation rules, especially t
he difference between a block and a method.
I understand the lexical vs. dynamic binding of variables aspect.
I have read that blocks and methods are mostly the same.
However, there is an aspect of the evaluation rules I am not following.
I would expect this code:

b := block(n,
  "in b" println)
b type println

m := method(n,
  "in m" println)
m type println

to produce
Block
Method
or perhaps:
Block
Block

Instead, it produces:
Io> doFile("curiousity.io")
Block
in m
Sequence

So it appears that in evaluating:
b type println
b (a block) is not evaluated.  This is what I expect.  However, for m, a method, it appears m is evaluated, as shown by the "in m" output, and the return type.
This puzzles me.
Asking the Lobby for the named slots back produces more expected results:
Io> Lobby getSlot("m") type
==> Block
Io> Lobby getSlot("b") type
==> Block

I thought maybe there were different rules implemented by the CLI for evalutation in its read-eval-print loop, but when I execute the code from within doFile(), I get the results above.

So why does evaluating m and b differ so much?
Thanks,

-- jeff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.