Forums before death by AOL, social media and spammers... "We can't have nice things"
|    sci.math.symbolic    |    Symbolic algebra discussion    |    10,432 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 9,715 of 10,432    |
|    oldk1331@gmail.com to asetof...@gmail.com    |
|    Re: [Axiom] function for compare 2 strin    |
|    25 Nov 17 01:00:14    |
   
   On Saturday, November 25, 2017 at 4:18:06 PM UTC+8, asetof...@gmail.com wrote:   
   > Yes that not generated warning...   
   >   
   > If we have   
   >   
   > f(a)==(#a<4=>[a];[[a.1,a.2],[a.2,a.3]])   
   >   
   > a:=f("string")   
   >   
   > f is compiled as String -> Any   
   > (and not String -> List List Character)   
   > even if the "a" above it seems to be "List List Character"   
      
   Because String is not List Character. (String is more like a Vector)   
   Type of '#a<4=>[a]' is List String,   
   Type of '[[a.1,a.2],[a.2,a.3]]' is List List Character,   
   those 2 types are not the same, so the whole function type is Any.   
      
   > But this is the *only case* it is compiled as type->Any   
   > (but I say some part of system recognized"a" as type Any)   
   >   
   > For example if I write   
   >   
   > f([1,2,3,4]) it is compiled as   
   > List Positive Integer-> List List positive integer   
   >   
   > f([x,2,3,4]) it is compiled as   
   > List Polynomial Integer -> List List Polynomial Integer   
   >   
   > Etc   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca