4

I don't understand the following excerpt. More precisely, it's not clear what the #includes: directive is since it looks exactly like the opposite of #requires:.

spec for: #'pharo3.x' do: [
    spec 
        package: 'Grease-Core' with: [
            spec includes: #('Grease-Pharo30-Core' ). ];
        package: 'Grease-Tests-Core' with: [
            spec includes: #('Grease-Tests-Pharo20-Core' ). ];
        package: 'Grease-Pharo30-Core' with: [
            spec requires: #('Grease-Core' ). ];
        package: 'Grease-Tests-Pharo20-Core' with: [
            spec requires: #('Grease-Tests-Core' ) ] ].
Damien Cassou
  • 2,555
  • 1
  • 16
  • 21

1 Answers1

7

It is an opposite to the requires but it does more. If A requires: B and B includes: A, then loading B effects, that A is also loaded (because of #includes:) after B is loaded (because of #requires).

I had a discussion with Dale about this behavior. In the end, it is a naming issue. In the debian World, you would use something like #provides: (which is not existing), and you could write

A provides: B

However, the fact that still A requires: B would not be reflected there.

TL;DR

When A includes: B, then loading A also loads B.

Tobias
  • 3,026
  • 20
  • 34
  • 2
    From your explanation I get what `includes:` does but not what distinguishes it from `requires:`. – camillobruni Sep 24 '13 at 12:45
  • 3
    So, `A requires: B` says: “If you load `A`, you _previously_ have to load `B`.” But `A includes: B` says “If you want to load `A`, you _also_ have to load `B`” – Tobias Sep 24 '13 at 13:30