Commit 7a32b85a authored by HUANG Wei Chih's avatar HUANG Wei Chih
Browse files

fix: the same symbol can be added more than once by new_symbol predicate

parent a281ef21
......@@ -534,10 +534,17 @@ new_symbol( Symbol, dual ) :-
new_symbol( Symbol, InitAttributeList ) :-
list( InitAttributeList ),
!,
get_symbol_name( Symbol ),
default_symbol_attr( Symbol, DefaultAttributeList ),
replace_attr( DefaultAttributeList, InitAttributeList, AttributeList ),
add_symbol( Symbol, AttributeList ).
(
name( Symbol ),
symbol( Symbol, _ )
->
change_symbol_attr( Symbol, InitAttributeList )
;
get_symbol_name( Symbol ),
default_symbol_attr( Symbol, DefaultAttributeList ),
replace_attr( DefaultAttributeList, InitAttributeList, AttributeList ),
add_symbol( Symbol, AttributeList )
).
new_symbol( Symbol, dual, Init ) :-
number( Init ),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment