On 11/09/2011 06:24 AM, siqi zhou wrote:
         function1(s:R):SC ==
             [s for i in 1..]::SC

I don't know a solution yet, but I doubt that "::SC" is really what you want. In fact, I believe you should rather have something like "$SC". I wouldn't know why there should be a "coerce" in this function. I even don't know which would be the input type of the ::SC coercion.

However,

)abb domain ORESUS UniS

UniS(R:Type) : Exports == Implementation where
    Exports == with
      fun: R -> Stream R
    Implementation == add
      import Stream(R)
      import Integer
      fun(s:R):Stream(R) == [s for i in 1..]$Stream(R)

does not compile.

I don't yet dare to say that's a bug. But it smells very much like one.

(1) -> )co test.spad
   Compiling FriCAS source code from file
      /home/hemmecke/scratch/test.spad using old system compiler.
   ORESUS abbreviates domain UniS
------------------------------------------------------------------------
   initializing NRLIB ORESUS for UniS
   compiling into NRLIB ORESUS
   importing Stream R
   importing Integer
   compiling exported fun : R -> Stream R
****** comp fails at level 4 with expression: ******
error in function fun

((|elt| (|Stream| R) COLLECT) (STEP |i| 1 1) |s|)
****** level 4  ******
$x:= (COLLECT (STEP i (One) 1) s)
$m:= (Stream R)
$f:=
((((|s| # #) (* #) (+ #) (- #) ...)))

   >> Apparent user error:
   Invalid collect bodytype

The following compiles fine with Aldor

#include "aldor"
UniS(R:Type) : with {
    fun: R -> Stream R
} == add {
    import from Integer;
    fun(s:R):Stream(R) == [s for i in 1..]
}

Ralf

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