Re: Under the hood.
On 2009-06-04, at 7:31 AM, tobeythorn wrote:
> I've been trying to understand how Io works and what goes on under
> the hood. I'm becoming more and more impressed with it, but am a
> little confused about a a few things.
>
> What are the statements 123 and "this is a word" and TRUE, FALSE,
> and NIL? Are they messages, or objects, or messages routed to a
> special built in hidden object that constructs these objects?
Hi Tobey,
Everything compiles to a tree composed of messages. Literals such as
numbers and strings in the source become instances of number and
string objects attached to a Message object's "cachedResult", which
short circuits the message send and just returns the cachedResult when
that message is evaled.
true, false, and nil are just objects found in slots in the Lobby
Protos Core. IIRC, we don't put those in cachedResult, but it would
probably speed up the code (but slightly alter the semantics) if we did.
Cheers,
- Steve