On Fri, Jul 25, 2008 at 2:54 AM, Yixin Cao wrote: > > Another undocumented usage of "has" is even check the equality of > domains, > try: > )abbrev package TEST Test > Test(T:Type):with > if T has Integer then Ring > which is intrinsic and too ad-hoc. Why does this exist? >
If we consider 'Integer' in this *context* as standing for the category to which Integer belongs, i.e. the enter category-value to the right of : in the domain definition Integer(): ... then this test is not ad-hoc. It makes since to treat the category part of the definition of a domain to be an unnamed category. Yixin, if this use of 'has' is valid, isn't it equivalent to the the patch for 'is' that you sent earlier? > > Type can be returned as a value from a function, but this value cannot > be used directly to "has", but I enabled this feature by adding only one > line of code: > > --in i-spec2.boot > uphas t == > t isnt [op,type,prop] => nil > -- handler for category and attribute queries > + type := objVal interpret(type) > type := > ... > So that: > (1) -> f==()+->Integer > Type: Void > (2) -> f() has Ring > (2) true > Type: Boolean > Looks good to me! I really like being able to use domain-valued functions is the interpreter. Regards, Bill Page. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel