<br><br><div class="gmail_quote">On Sun, Feb 10, 2013 at 8:42 AM, Frank Shearar <span dir="ltr"><<a href="mailto:frank.shearar@gmail.com" target="_blank">frank.shearar@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 10 February 2013 16:25, Camillo Bruni <<a href="mailto:camillobruni@gmail.com">camillobruni@gmail.com</a>> wrote:<br>
> Why does SystemNavigation >> #allSelect: return strings of the form 'Array at:' instead of the real methods?<br>
<br>
</div>Probably because the things that use SystemNavigation - Browsers,<br>
MessageSets and the like - want to render lists of things to the user.<br>
<br>
There is one advantage to dumb strings, which is that it's easy to<br>
make a SystemNavigation that works against a remote image. But that's<br>
not much to go on. Changing these kinds of methods to return<br>
MethodReferences might be a useful middle ground (and permit easy<br>
extension to remote tools).<br></blockquote><div><br></div><div>No, dumb strings are dumb. A className, selector pair (which is what MethodReference is) is the right thing (and what systemNavigation methods return). The dumb strings are a pain in the ass to parse (endlessly looking for ' class' to spot meta classes etc). Whereas the class,selector p[air approach is extensible, e.g. to include a pointer to a specific external entity (be it Monticello package or remote image). MethodReference is what the system has provided for a decade and they're convenient. There are multiple versions of these and I could care less about whether one uses MethodReference or RBMethodDefinition. But that they have a consistent API is really important. Programmatic uses of these things for code editing is something I've depended upon in the VMMaker, and I'm anxious that Pharo and Squeak don't diverge hopelssly on this level of the system.</div>
<div><br></div><div>In my own work I've ended up with three kinds of code reference object</div><div><br></div><div>a) MethodReference that points to a class,selector pair</div><div>b) ClassReference that points to a class</div>
<div>c) TextReference that holds onto a text</div><div><br></div><div>So if one wants to check out a refactoring/edit before applying it one compares a sequence of MethodReference objects and a matching sequence of TextReference objects that hold onto the edited source to a comparison engine.</div>
<div><br></div><div>If one wants to have a look at all uses of a SharedPool one can supply a list of ClassReference objects to a list browser.</div><div><br></div><div>If one wanted to build a "compare two images" or "compare arbitrary package versions: facility one can extend the reference objects with pointers to specific packages or remote images.</div>
<div><br></div><div>etc.</div><div><br></div><div>Lots of stuff in the system depends on these kinds of pointer; message list browsers, Monticello's loader, etc.</div><div><br></div><div>What's insane is a) not having a standard set of facilities common between Pharo and Squeak with a well-defined API (e.g. isCodeReference, isMethodReference, isClassReference), b) having some of the API in extension methods in e.g. Monticello.</div>
<div><br></div><div>This is core reflection protocol and it needs to be well-defined and in what ever package contains base reflection protocol.</div><div><br></div><div><br></div><div>excuse my ranting.</div><div><br></div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I mention remote tools because I hacked up a proof of concept a while<br>
back that turned a Browser into one that could access a suitably<br>
prepared image through an HTTP API. Development stalled because the<br>
reflection machinery's API is a bit... involved, and it was dog slow,<br>
but I could browse anything I liked. I should really wrap up the work<br>
a bit so I can spread the love.<br>
<span class="HOEnZb"><font color="#888888"><br>
frank<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>