Skip to content

Commit

Permalink
Add example for package extensions (#5490)
Browse files Browse the repository at this point in the history
  • Loading branch information
schnellecom authored Aug 25, 2023
1 parent beac8a0 commit 24c720d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions doc/ref/gappkg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1299,6 +1299,26 @@ each being a record with the following components.
</Item>
</List>

<P/>

As an example suppose the following is part of the <F>PackageInfo.g</F>.
Then &GAP; will load the file <F>fileForB.gd</F> as soon as package
<C>B</C> is loaded in version 0.6 or newer, and <F>fileForCD.gi</F> once
package <C>C</C> and <C>D</C> are loaded in version 1.2 and 0.1 or newer respectively.

<Log><![CDATA[
Extensions := [
rec(
needed := [ ["B", "0.6"] ],
filename := "gap/fileForB.gd",
),
rec(
needed := [ ["C", "1.2"] , ["D", "0.1"] ],
filename := "gap/fileForCD.gi",
)
],
]]></Log>

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

0 comments on commit 24c720d

Please sign in to comment.