Dear Waldek, 

Gabriel Dos Reis <[EMAIL PROTECTED]> writes:

> OpenAxiom now uses proclamation at the generated Lisp level to try to catch
> problems, and also for optimization purposes (in particular for SBCL-based
> builds).  This means that `pretend's like above (which really violate data
> representation description) are caught at runtime.

as far as I can tell, this optimization is orthogonal to the optimization I
pushed through.  Maybe we could integrate it?

For your convenience, here is what I believe to be the main routine (from
c-util.boot).

Martin

++ Proclaim the type of the capsule function `op' with signature `sig'.
++ Note that all capsule functions take an additional argument 
++ standing for the domain of computation object.
proclaimCapsuleFunction(op,sig) ==
  LAM_,EVALANDFILEACTQ
    ["DECLAIM",["FTYPE",
       ["FUNCTION",[:[argType first d for d in tails rest sig],"%Shell"], 
          retType first sig],op]] where
      argType d ==
        getVMType normalize d
      retType d ==
        d := normalize d
        atom d => getVMType d
        args := rest d
        #args = 0 => getVMType d
        or/[atom a for a in args] => "%Thing"
        -- not theoretically correct, but practically OK.
        getVMType d
      normalize d ==
        d = "$" => 
          -- If the representation is explicitly stated, use it.  That way
          -- we optimize abstractions just as well as builtins.
          rep := get("Rep","value",$e) => rep
          -- Cope with old-style constructor definition
          atom $functorForm => [$functorForm] 
          $functorForm
        atom d => d
        [first d, :[normalize first args for args in tails rest d]]


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to