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

allow repeated use of same DeclareSynonym call #835

Merged
merged 1 commit into from
Jun 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib/coll.gd
Original file line number Diff line number Diff line change
Expand Up @@ -337,18 +337,24 @@ end );
## <#/GAPDoc>
##
BIND_GLOBAL( "DeclareSynonym", function( name, value )
BIND_GLOBAL( name, value );
if ISBOUND_GLOBAL(name) and IS_IDENTICAL_OBJ(VALUE_GLOBAL(name), value) then
if not REREADING then
INFO_DEBUG( 1, "multiple declarations for synonym `", name, "'\n" );
fi;
else
BIND_GLOBAL( name, value );
fi;
end );

BIND_GLOBAL( "DeclareSynonymAttr", function( name, value )
local nname;
BIND_GLOBAL( name, value );
DeclareSynonym( name, value );
nname:= "Set";
APPEND_LIST_INTR( nname, name );
BIND_GLOBAL( nname, Setter( value ) );
DeclareSynonym( nname, Setter( value ) );
nname:= "Has";
APPEND_LIST_INTR( nname, name );
BIND_GLOBAL( nname, Tester( value ) );
DeclareSynonym( nname, Tester( value ) );
end );


Expand Down