On Thu, 4 Jan 2007 [email protected] wrote:
make sense?
It seems a bit drastic to flip things around into that less OO style. I’m
not too worried if something like BlankSlate has to jump through a hoop or
two.
i wouldn’t say it’s less OO. according to wikipedia
in fact, it’s quite OO: Pervasives (Introspector or whatever we might
call it)
is the object that sees through to the pristine unalterable state of any
other
object. it interacts with these other objects by sending messages.
this is
quite inline with any OO i’ve ever heard of, for instance
we might as well say something like
Guru.send student, message, :compassion
Object (computer science) - Wikipedia seems to
agree
somewhat
“In the programming paradigm, object-oriented programming, an object
is an
individual unit of run-time data storage that is used as the basic
building
block of programs. These objects act on each other, as opposed to a
traditional view in which a program may be seen as a collection of
functions, or simply as a list of instructions to the computer. Each
object
is capable of receiving messages, processing data, and sending
messages to
other objects. Each object can be viewed as an independent little
machine
or actor with a distinct role or responsibility.”
i understand the sentiment. still, what we after is a methodology which
ensures that some aspects of objects can always be reached. it’s quite
OO to
delegate the responsibility of locating and preserving that aspect to
another
object. syntactically one might prefer
reveal{ object }.send msg
but the impl would obviously be the same since, here, we’ve just popped
up to
(Kernel|Object).reveal
remember that much of ruby works this way: puts, fork, exit, raise, etc
are
all hung off of Kernel|Object.
In practice, has the name conflict issue with send actually been much of a
problem?
yes. and the related object_id, instance_eval, instance_variable_get,
etc.
the fact that some, but not all, methods of an object are required for
it to
function at a reasonble level, and that those same methods are not
protected
or separated from ‘normal’ methods in any way has frequently been an
issue for
the few metaprogramming libs i’ve written such as traits, attributes,
xx, etc.
regards.
-a