<div dir="ltr">So, your definition of #packageInfo is to bring up the package where the class itself is defined, right?<div><br></div><div>I would often think of the package more nebulously- where the class is defined and where any methods in the class are defined.  Currently we only support one package where a class is defined (except for the odd string/pseudo packages you talk about below), unless I&#39;m missed something.*  We do, however, support lots of overrides/extension for the class in other packages, and I would assume that is fairly common.  It is certainly encouraged by rants about how #isKindOf: or #class = MyClass being bad patterns - at which point I often fall back onto #isMyClass defined in Object, for instance.</div>
<div><br></div><div>Is this secondary question of interest to you and the tools you&#39;re working on?</div><div><br></div><div>(* Of course, I&#39;d love to be able to add variables to a class in a separate, non-base package for a class.  Not a completely redefinition, but the ability to add them just for the contents of that extensions package.  Maybe I&#39;ll fiddle around with the Traits definition next time I need this to figure out how to do it from that direction.  Except I probably can&#39;t just add a trait to a class in an extension package, either, can I?  bummer...)</div>
<div><br></div><div>-Chris</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 9, 2013 at 12:12 PM, Chris Muller <span dir="ltr">&lt;<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You know, there is one little part of me that is with you -- It&#39;s when<br>
I think about a Class definition having its category delimited by<br>
dashes -- where does the Package name end and the Category begin?  I&#39;m<br>
torn between wanting to lock down a rule for that and leaving it<br>
open-ended.<br>
<br>
OTOH, by tying elements of Smalltalk (PackageInfo, Class and<br>
MethodReference) to corresponding elements of the SCM tool (MCPackage,<br>
MCClassDefinition, MCMethodDefinition), additional tools can be easily<br>
built on the seam formed between these two.<br>
<br>
So to answer your question -- by being able to ask the selected<br>
Message its Package/MCPackage, I can also know its WorkingCopy, which<br>
means I can know the Repositories it was loaded from.<br>
<br>
If we have to support Classes and Methods being &quot;defined in more than<br>
one&quot; Package, that means they have more than one WorkingCopy, which<br>
means they&#39;re in more than one RepositoryGroup, which means means more<br>
than one McModel.  So since the complexity explodes quickly, I just<br>
want to have a good reason for it.<br>
<br>
One suggestion would be simply to have both for now -- since 99% of<br>
the time it&#39;s 1:1, #packageInfo could simply be implemented as  ^self<br>
packageInfos ifNotEmpty: [ : infos | infos anyOne ].  The 99% case for<br>
tools would work and whatever 1% cases would too..??<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On Mon, Sep 9, 2013 at 1:07 PM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>
&gt; Well, what use case do you have for these proposed new methods?<br>
&gt;<br>
&gt; - Bert -<br>
&gt;<br>
&gt;<br>
&gt; On 2013-09-09, at 18:31, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; First, let me answer your question to say, &quot;yes&quot; we could do that.<br>
&gt;&gt; But before we do, let&#39;s revive this same debate we had earlier this<br>
&gt;&gt; year.  I&#39;m starving for a compelling argument on this.  Back then I<br>
&gt;&gt; had shown we don&#39;t have any meaningful examples in the image,<br>
&gt;&gt;<br>
&gt;&gt;     <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-April/170234.html" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-April/170234.html</a><br>
&gt;&gt;<br>
&gt;&gt; and, to this day, I guess we still don&#39;t..<br>
&gt;&gt;<br>
&gt;&gt; Back then, I had said:  &quot;My goal w.r.t. this issue is to have a<br>
&gt;&gt; simple, practical model useful for connecting Monticello elements with<br>
&gt;&gt; their in-image counterparts.  What&#39;s yours?&quot;  You mentioned Balloon3D<br>
&gt;&gt; to belong to Balloon making it &quot;easier for users&quot;.<br>
&gt;&gt;<br>
&gt;&gt; But using name-hierarchies is just _totally insufficient_ to represent<br>
&gt;&gt; package-hierarchies.  As we make our packages more modular,<br>
&gt;&gt; name-hierarchies become less effective.  e.g., what if Balloon3D<br>
&gt;&gt; requires, say, &quot;OpenGL?&quot;  We are much better off defining package<br>
&gt;&gt; hierarchies via something else like the nascent Installer extensions<br>
&gt;&gt; (&quot;package-definitions&quot; category), or perhaps even Metacello.<br>
&gt;&gt;<br>
&gt;&gt; Back then, Dave&#39;s use-case example was a one-off where he simply<br>
&gt;&gt; needed to rename his packages back to OSProcess.  The benefit in<br>
&gt;&gt; Colin&#39;s case didn&#39;t make sense to me -- so I had asked for<br>
&gt;&gt; clarification but I guess the discussion simply died out.<br>
&gt;&gt;<br>
&gt;&gt;     <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-April/170261.html" target="_blank">http://lists.squeakfoundation.org/pipermail/squeak-dev/2013-April/170261.html</a><br>
&gt;&gt;<br>
&gt;&gt; As I said, I&#39;ll surrender on this if I have to, but I really don&#39;t<br>
&gt;&gt; like this idea of employing loosey-goosey String front-matching on<br>
&gt;&gt; names of MC Versions and now Packages in order to form hierarchies for<br>
&gt;&gt; the purpose of trying to coax the SCM tool into being something it<br>
&gt;&gt; isn&#39;t.  I think it makes the code more complex while at the same<br>
&gt;&gt; weakening its potential.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Sep 9, 2013 at 7:26 AM, Bert Freudenberg &lt;<a href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</a>&gt; wrote:<br>
&gt;&gt;&gt; A class can be in multiple packages at the same time. These new #packageInfo methods only answer a random one.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Wouldn&#39;t it be better if they returned a (possibly empty) collection of package infos, and the senders would deal with them?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; - Bert -<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On 2013-09-07, at 16:29, <a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a> wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; A new version of Monticello was added to project The Inbox:<br>
&gt;&gt;&gt;&gt; <a href="http://source.squeak.org/inbox/Monticello-cmm.568.mcz" target="_blank">http://source.squeak.org/inbox/Monticello-cmm.568.mcz</a><br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; ==================== Summary ====================<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Name: Monticello-cmm.568<br>
&gt;&gt;&gt;&gt; Author: cmm<br>
&gt;&gt;&gt;&gt; Time: 7 September 2013, 11:23:41.529 am<br>
&gt;&gt;&gt;&gt; UUID: 575ad6a3-2df6-4ae5-99a8-24c15f032558<br>
&gt;&gt;&gt;&gt; Ancestors: Monticello-cmm.567<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; - Adopt two more methods needed for browsing MC history.<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; =============== Diff against Monticello-cmm.567 ===============<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Item was added:<br>
&gt;&gt;&gt;&gt; + ----- Method: Class&gt;&gt;packageInfo (in category &#39;*monticello&#39;) -----<br>
&gt;&gt;&gt;&gt; + packageInfo<br>
&gt;&gt;&gt;&gt; +     ^ PackageInfo allPackages<br>
&gt;&gt;&gt;&gt; +             detect: [ : each | each includesClass: self ]<br>
&gt;&gt;&gt;&gt; +             ifNone: [ nil ]!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Item was changed:<br>
&gt;&gt;&gt;&gt; ----- Method: MCHttpRepository&gt;&gt;httpGet:for: (in category &#39;private&#39;) -----<br>
&gt;&gt;&gt;&gt; httpGet: actionString for: aMCDefinition<br>
&gt;&gt;&gt;&gt; - self halt.<br>
&gt;&gt;&gt;&gt;      ^ HTTPSocket<br>
&gt;&gt;&gt;&gt;              httpGet: self locationWithTrailingSlash<br>
&gt;&gt;&gt;&gt;              args:<br>
&gt;&gt;&gt;&gt;                      { &#39;action&#39;-&gt;{actionString}.<br>
&gt;&gt;&gt;&gt;                      &#39;mc-definition&#39;-&gt; {self serializeForRequest: aMCDefinition}}<br>
&gt;&gt;&gt;&gt;              user: self user<br>
&gt;&gt;&gt;&gt;              passwd: self password!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt; Item was added:<br>
&gt;&gt;&gt;&gt; + ----- Method: MethodReference&gt;&gt;packageInfo (in category &#39;*monticello&#39;) -----<br>
&gt;&gt;&gt;&gt; + packageInfo<br>
&gt;&gt;&gt;&gt; +     &quot;Answer the PackageInfo containing this method.&quot;<br>
&gt;&gt;&gt;&gt; +     | methodCategory classCategory |<br>
&gt;&gt;&gt;&gt; +     methodCategory := self category.<br>
&gt;&gt;&gt;&gt; +     classCategory := methodCategory first = $* ifFalse: [ self actualClass theNonMetaClass category ].<br>
&gt;&gt;&gt;&gt; +     ^ PackageInfo allPackages<br>
&gt;&gt;&gt;&gt; +             detect:<br>
&gt;&gt;&gt;&gt; +                     [ : each |<br>
&gt;&gt;&gt;&gt; +                     &quot;detect: [ : each | each methods includes: self ]&quot; &quot;&lt;-- too slow&quot;<br>
&gt;&gt;&gt;&gt; +                     (each isYourClassExtension: methodCategory) or:<br>
&gt;&gt;&gt;&gt; +                             [ classCategory notNil and: [ each systemCategories includes: classCategory ] ] ]<br>
&gt;&gt;&gt;&gt; +             ifFound: [ : foundPackage | PackageInfo named: foundPackage packageName ]<br>
&gt;&gt;&gt;&gt; +             ifNone: [ nil ]!<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;<br>
&gt;<br>
</div></div><br><br>
<br></blockquote></div><br></div>