----- "Dale" <[email protected]> wrote: | Teleplacer wrote: | > | > On 5/6/2010 9:55 AM, Dale wrote: | > <snip> | >> #includes is used quite extensively for Seaside30 where an | expression | >> like | >> the following is used: | >> | >> spec for: #common do: [ | >> spec | >> package: 'Javascript-Core' | >> with: [ spec requires: #('Seaside-Core' 'Seaside-Canvas' ). ]; | >> package: 'JQuery-Core' | >> with: [ spec requires: #('Javascript-Core' ). ]]. | >> spec for: #squeakCommon do: [ | >> spec | >> package: 'Javascript-Core' | >> with: [ spec includes: #('Javascript-Pharo-Core' ) ]]. | >> | > | > <snip> | > | >> Whereas if we only had the #requires: mechanism, we'd need to | duplicate | >> every 'Javascript-Core' #requires: with a #requires: for | >> 'Javascript-Pharo-Core' | > | > How so? It seems to me, that the following should be equivalent, | no? | > | > spec for: #squeakCommon do:[ | > "Javascript-Core-Top is a pseudo target" | > spec package: 'Javascript-Core-Top' | > with: [spec requires: #(JavaScript-Pharo-Core)] | > "And be explicit about load order" | > spec package: 'Javascript-Pharo-Core' | > with: [spec requires: #(JavaScript-Core)] | > ]. | > | > spec for: #common do:[ | > "Pseudo-top always depends on actual Javascript-Core" | > spec package: 'Javascript-Core-Top | > with: [spec requires: #(JavaScript-Core)] | > | > "standard Javascript-Core dependencies" | > spec | > package: 'Javascript-Core' | > with: [ spec requires: #('Seaside-Core' 'Seaside-Canvas' ). ]. | > | > "Now make JQuery-Core depending on the pseudo package" | > spec package: 'JQuery-Core' | > with:[spec requires: #('Javascript-Core-Top')]. | > ]. | > | > Is there any difference? | > | > | | Andreas, | | The difference is that you introduced the package | 'Javascript-Core-Top' and | that package doesn't exist:) So the #includes: directive means that | you | don't have to introduce "artificial" targets that perform no other | function | than act as a dependency target. | | Keep in mind that over time a project may evolve to the point where | you need | to add a "new dependency target" and if you have to add a new target, | other | projects that depend upon this project and may reference the "old | dependency | target" and will not function correctly moving forward. | | The #includes: directive allows you to "add packages to the original | dependency target" without changing the structure of your project... | | Dale | -- | View this message in context: | http://forum.world.st/Metacello-questions-tp2132073p2133346.html | Sent from the Squeak - Dev mailing list archive at Nabble.com.
_______________________________________________ Pharo-project mailing list [email protected] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
