[Cuis-dev] Do classes know what package they come from ?

Juan Vuletich juan at jvuletich.org
Mon Aug 9 06:00:48 PDT 2021


On 09/08/2021 09:33 a.m., Nicola Mingotti via Cuis-dev wrote:
> Hi again,
>
> Problem. I have made my own package, classes, methods.
> Ok, all is ready to start the real work. But I need to do
> some cleaning and put data files in a reasonably safe directory
> Example: some JSON data file needed by my methods.
>
> The ideal for me would be to put the data files in the same directory
> containing the FooBar.pck.st file, or a sub-directory of it.
>
> Now, it would be all easy if i could say
> ----
> FooBar getMyPackageDirectory.
> ----
>
> Up to now i found that
> -----------------
> ou1 _ CodePackageList new.   "# here I can find the loaded package list."
>
> Then I could iterate over CodePackage list in 'CodePackageList new 
> packages' and check
> the first one containing class 'FooBar'.
>
> What I ask you is this. Can I go in the inverse way? Does
> a Class know who is its ClassCatergory ? Does a ClassCategory
> know who is its package ?
>
>
> bye
> Nicola
>

Just ask `aClass package`.


Cheers,

-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20210809/27d3fc67/attachment.htm>


More information about the Cuis-dev mailing list