Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for package extensions #5490

Merged
merged 10 commits into from
Aug 25, 2023
17 changes: 17 additions & 0 deletions doc/ref/gappkg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,23 @@ each being a record with the following components.
</Item>
</List>

<P/>

As an example the following as part of the <F>PackageInfo.g</F> load the file <F>fileForB.gd</F> as soon as package <C>B</C> is loaded and <F>fileForC.gi</F> once package <C>C</> is loaded.
schnellecom marked this conversation as resolved.
Show resolved Hide resolved

<Log><![CDATA[
Extensions := [
rec(
needed := [ ["B", "0.6"] ],
filename := "./gap/fileForB.gd",
schnellecom marked this conversation as resolved.
Show resolved Hide resolved
),
rec(
needed := [ ["C", "0.6"] ],
schnellecom marked this conversation as resolved.
Show resolved Hide resolved
filename := "./gap/fileForC.gi",
schnellecom marked this conversation as resolved.
Show resolved Hide resolved
)
],
]]></Log>

Whenever <Ref Func="LoadPackage"/> is called,
&GAP; checks for package extensions whose conditions now are satisfied,
and loads them.
Expand Down