> > > BTW: Do we have a cumulative sum function in Fricas?
> > > The cumSum([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) should
> > > give me [0,  1,  3,  6, 10, 15, 21, 28, 36, 45].
> > 
> > scan(+, [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], 0)

It works as expected in the interpreter:

(3) -> al := [1,2,3,4,5]

   (3)  [1,2,3,4,5]
                                                  Type: List(PositiveInteger)
(4) -> scan('+, al, 1)  

   (4)  [2,4,7,11,16]
                                                  Type: List(PositiveInteger)

Compiling the same (really?) code with some more
explicit type declarations:

      al : LPI := [1,2,3,4,5]
      l : LPI := scan("+", al, 1::PI)

gives me back:

****** comp fails at level 6 with expression: ******
error in function horizSplit 

(SEQ
 (LET #1=#:G7159
   (~= (|reduce| "+" |lc|) (|ncols| A)))
 (|exit| 1
  (IF #1#
      (|error| "split does not result in proper partition")
      (SEQ
       (LET (|:| |al| (|List| (|PositiveInteger|)))
         (|construct| 1 2 3 4 5))
       (LET (|:| |l| (|List| (|PositiveInteger|)))
         | << |
         (|scan| "+" |al| (|::| 1 (|PositiveInteger|)))
         | >> |)
       (LET |al|
         (|construct| 1 2 3 4 5))
       (|scan| "+" |al| 1) (|exit| 1 (|construct| A))))))
****** level 6  ******
$x:= (scan + al (:: (One) (PositiveInteger)))
$m:= $EmptyMode
$f:=
((((|l| #) (|al| # #) (#:G7159 #) (|value| # #) ...)))
 
   >> Apparent user error:
   NoValueMode
    is an unknown mode

I do not understand why I get this message or what *exactly*
the compiler tries to tell me.

Any hint please?

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