The semantics of "has" is complicated, is there a possibility that we make
it clear and precise?


The first problem, in my mind, is the lack of distinguishability of
categories and attributes, so that
> Integer has Rint
will return false without any warning, for "Rint" is not a known Category in
Axiom, and therefore is treated
as attribute automatically. Currently all Category names begin with
uppercase letters, while attributes begin
with lowercase letters (with some exceptions, e.g.
NullSquare,JacobiIdentity). Can we make this as the
rule( and rename that uppercase attributes)?


Related to first problem, the name of attributes are not checked. There is a
Category AttributeRegistry in
src/algebra, which seems to work as the registry of all attributes, but it's
not used.


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?



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 :=
    isLocalVar(type) =>
      $genValue => ["evaluateType", ["unabbrev", type]]
      -- At this point, type will have already been reduced to
      -- its object representation.
      ["devaluate", type]
    MKQ unabbrev type
  catCode :=
    -- FIXME: when we come to support category valued variable
    --        this code needs to be adapted.
    prop := unabbrev prop
    evaluateType0 prop => ["evaluateType", MKQ prop]
    MKQ prop
  code:=["newHasTest",type, catCode]
  if $genValue then code := wrap timedEVALFUN code
  putValue(op,objNew(code,$Boolean))
  putModeSet(op,[$Boolean])

So that:
(1) -> f==()+->Integer
                                                                   Type:
Void
(2) -> f() has Ring
   (2)  true
                                                                Type:
Boolean
-------------------------------------------------------------------------
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

Reply via email to