Options Stack
<#Include Label="[1]{options}">

Functions Dealing with the Options Stack
<#Include Label="PushOptions"> <#Include Label="PopOptions"> <#Include Label="ResetOptionsStack"> <#Include Label="OnQuit"> <#Include Label="ValueOption"> <#Include Label="DisplayOptionsStack"> <#Include Label="InfoOptions">

Options Stack – an Example

The example below shows simple manipulation of the Options Stack, first using and and then using the special function calling syntax.

gap> foo := function() > Print("myopt1 = ", ValueOption("myopt1"), > " myopt2 = ",ValueOption("myopt2"),"\n"); > end; function( ) ... end gap> foo(); myopt1 = fail myopt2 = fail gap> PushOptions(rec(myopt1 := 17)); gap> foo(); myopt1 = 17 myopt2 = fail gap> DisplayOptionsStack(); [ rec( myopt1 := 17 ) ] gap> PopOptions(); gap> foo(); myopt1 = fail myopt2 = fail gap> foo( : myopt1, myopt2 := [Z(3),"aardvark"]); myopt1 = true myopt2 = [ Z(3), "aardvark" ] gap> DisplayOptionsStack(); [ ] gap>