[Pharo-users] Java "this" against our "thisContext"

Sergi Reyner sergi.reyner at gmail.com
Tue Mar 25 08:16:34 EDT 2014


2014-03-25 10:50 GMT+00:00 Panu Suominen <panu.suominen at iki.fi>:

> What do you mean operates at higher level?
>

It´s probably a slightly poor choice of words :)

What I mean by operating at a higher level is that, whereas:

thisContext instVarNamed: #receiver put: 42


is a single message send to an object, this:

Field a = sun.misc.VM.class.getDeclaredField("directMemory");
a.setAccessible(true);
a.get(null);


somehow makes me think about accessing internals that I shouldn´t care
about. I´m not sure of what the Java code does, as far as I can tell the
intention was to show me how you can access 'this' in Java. It doesn´t look
very object-oriented to me, but I can´t produce a "formal" explanation of
why.

Most things are much harder to do in Java than in Smalltalk but I don't
> know if the level differs so much. For example method substitution is not
> so standard VM feature in Java.
>

Maybe it wasn´t the right choice of words. I accept suggestions of
alternatives :)


Cheers,
Sergi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20140325/911dbdca/attachment.html>


More information about the Pharo-users mailing list