From: Wolfgang J. <wj...@so...> - 2007-08-03 15:04:27
|
Eric Bezault wrote: > Wolfgang Jansen wrote: >> Hi, >> >> when experimenting with classes of the GEC it happens >> that compilation fails because of a catcall. >> To be precise, let `f' be a ET_DYNAMIC_FEATURE >> then adding the line >> >> if f.static_feature.name.name.is_equal("abc") then ... end >> >> leads to compiler message >> >> [CATCALL] class ET_C_GENERATOR (17182,4): type 'STRING_8' of actual >> argument #1 does not conform to type 'UC_UTF8_STRING' of formal >> argument in feature `is_equal' in class 'UC_UTF8_STRING' > > Yes, the signature of `is_equal' is a real problem when > we want to be CAT-call free. The workaround is to inherit > from KL_IMPORTED_STRING_ROUTINES and write: > > if STRING_.same_string (f.static_feature.name.name, "abc") then > > Another solution: > > if f.static_feature.name.same_feature_name (create > {ET_IDENTIFIER}.make ("abc")) then > > >> A similar catcall occurs if a DS_HASH_TABLE[INTEGER,STRING] >> object is created (a call at the object is not needed). > > For hash-tables, you need to create them that way in order > to be CAT-call free: > > create ht.make_map (...) > ht.set_key_equality_tester (string_equality_tester) > > or: > > create ht.make_with_equality_testers (..., Void, > string_equality_tester) > > where `string_equality_tester' is inherited from > KL_SHARED_STRING_EQUALITY_TESTER. > > Thanks, it works (though it is hard to understand). -- Wolfgang Jansen University of Potsdam, Germany mailto: wj...@so... |