Martin Rubey wrote:
> 
> Waldek Hebisch <[EMAIL PROTECTED]> writes:
> 
> > > (1) -> Float has signature random: Float -> Float
> > >  
> > >    >> System error:
> > >    newHasTest expects category from
> > 
> > Sorry for noise, I misremebered 'signature'.  I see now: the test is
> > broken in interpreter.  The first form (without signature) works
> > in the compiler.  The form with 'signature' is accepted, but
> > generates bogus code.
> 
> 
> Although this is not pressing for me (the coerce trouble is much more
> important), I would very much prefer if has works as in the compiler.
> 

You may try the following patch.  It gives me:

(4) -> Float has exp: Float -> Float

   (4)  true
                                                                Type: Boolean
(5) -> Float has random: Float -> Float

   (5)  false
                                                                Type: Boolean

(more testing welcome).

--- fricas.bb/src/interp/nrunfast.boot  2008-11-17 18:38:39.000000000 -0500
+++ fricas/src/interp/nrunfast.boot     2008-11-18 23:58:51.000000000 -0500
@@ -481,6 +481,10 @@
 -- we will refuse to say yes for 'Cat has Cat'
 --GETDATABASE(opOf domform,'CONSTRUCTORKIND) = 'category => 
throwKeyedMsg("S2IS0025",NIL)
 -- on second thoughts we won't!
+  catOrAtt is [":", fun, ["Mapping", :sig1]] =>
+      evaluateType ["Mapping", :sig1] is ["Mapping", :sig2]  =>
+         not(null(HasSignature(domform, [fun, sig2])))
+      systemError '"strange Mapping type in newHasTest"
   GETDATABASE(opOf domform,'CONSTRUCTORKIND) = 'category =>
       domform = catOrAtt => 'T
       for [aCat,:cond] in [:ancestorsOf(domform,NIL),:SUBLISLIS (rest 
domform,$FormalMapVariableList,GETDATABASE(opOf domform,'ATTRIBUTES))] |  aCat 
= catOrAtt  repeat

-- 
                              Waldek Hebisch
[EMAIL PROTECTED] 

--~--~---------~--~----~------------~-------~--~----~
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