Skip to content

Unexpected behaviour of options #4631

Closed
@zickgraf

Description

Consider the following piece of code:

myfunc1 := function( )
	Display( ValueOption( "myopt" ) );
	return 1;
end;

myfunc2 := function( )
	return IdFunc( myfunc1( ) : myopt := "myopt_value" );
end;

x := myfunc2( );
x := IdFunc( myfunc1( ) : myopt := "myopt_value" );

Observed behaviour

The output is:

myopt_value
fail

Expected behaviour

I would expect the output to be

fail
fail

(or at least the same output in both lines) because I do not see a reason why the option should propagate into the call of myfunc1 in the first case but not in the second.

Copy and paste GAP banner (to tell us about your setup)

 ┌───────┐   GAP 4.12dev-1020-g1fe30f7 built on 2021-08-19 10:21:04+0200
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-pc-linux-gnu-default64-kv8
 Configuration:  gmp 6.2.1, GASMAN, readline
 Loading the library and packages ...
 Packages:   Browse 1.8.9, GAPDoc 1.dev, IO 4.7.0dev, PrimGrp 3.4.0, SmallGrp 1.4.1, TransGrp 2.0.5
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'

Also happens with GAP 4.11.1.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions