Re: [MC] Re: An Overview of Metacello ... loads: vs requires: in a project reference

1 view
Skip to first unread message

Dale Henrichs

unread,
Aug 26, 2009, 6:57:49 PM8/26/09
to montice...@googlegroups.com

----- "stephane ducasse" <stephane...@gmail.com> wrote:

| I do not understand what is loads:
| in add: 'Anncounement' project: 'misc' version '0.233' load
| { 'Gemestone-Release}
|
| Is it require?

You've transcribed the example incorrectly, so here is the actual line:

add: 'Announcements'
project: 'Misc Project'
version: '0.233'
loads: { 'Announcements'. };

As you know, I have sometimes struggled with names, so this is obviously another case.

The project reference statment should be interpreted as the following:

"The name 'Announcements' is an alias for loading the package named
'Announcements' from version '0.233' of the required project named
'Misc Project'."

The required project 'Misc Project' is specified as follows:

^self projectSpec
name: 'Misc Project';
className: 'GsMiscMetacelloProject';
operator: #>=;
projectPackage:
(self packageSpec
name: 'GsMisc-MetacelloProject';
repositoryName: 'http://seaside.gemstone.com/ss/GLASSproject';
yourself);
yourself

and you find that the Metacello project class is GsMiscMetacelloProject. So the above project reference is equivalent to executing the following expression:

(GsMiscMetacelloProject version: '0.233') load: { 'Announcements'. }

So I used #loads: in the selector. The project reference is more of a load declaration than a requires: declaration. The name arguments in #requires: are looked up in the context of the current project, whereas the name arguments in a #loads: are looked up in the context of the referenced project. In fact a project reference can have a #requires: component:

add: 'Announcements'
project: 'Misc Project'
version: '0.233'
loads: { 'Announcements'. }
requires: { 'Core'. };


Dale

stephane ducasse

unread,
Aug 27, 2009, 2:26:13 AM8/27/09
to montice...@googlegroups.com

On Aug 27, 2009, at 12:57 AM, Dale Henrichs wrote:

>
>
> ----- "stephane ducasse" <stephane...@gmail.com> wrote:
>
> | I do not understand what is loads:
> | in add: 'Anncounement' project: 'misc' version '0.233' load
> | { 'Gemestone-Release}
> |
> | Is it require?
>
> You've transcribed the example incorrectly, so here is the actual
> line:
>
> add: 'Announcements'
> project: 'Misc Project'
> version: '0.233'
> loads: { 'Announcements'. };
>
> As you know, I have sometimes struggled with names, so this is
> obviously another case.
>
> The project reference statment should be interpreted as the following:
>
> "The name 'Announcements' is an alias for loading the package named
> 'Announcements' from version '0.233' of the required project named
> 'Misc Project'."

this is really of the required project?
so in that case yes the api is really confusing :)
Reply all
Reply to author
Forward
0 new messages