> > Compiling the same (really?) code with some more
> > explicit type declarations:
> > 
> >       al : LPI := [1,2,3,4,5]
> >       l : LPI := scan("+", al, 1::PI)
> 
> Does this give you the same error?
> 
>         l : LPI := scan(_+, al, 1$PI)

Just for completeness here the full code:

    horizSplit(A:M, lc:LPI) : List M ==

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

      [A]

If I compile with the line "l : ..." commented out then
everything works fine. Otherwise I get:

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

(SEQ
 (LET (|:| |al| (|List| (|PositiveInteger|)))
   (|construct| 1 2 3 4 5))
 (LET (|:| |l| (|List| (|PositiveInteger|)))
   (|scan| | << + >> | |al| (|elt| (|PositiveInteger|) 1)))
 (|exit| 1 (|construct| A)))
****** level 4  ******
$x:= +
$m:= $EmptyMode
$f:=
((((|l| #) (|al| # #) (|value| # #) (|lc| # #) ...)))
 
   >> Apparent user error:
   NoValueMode
    is an unknown mode

I tried this is a fresh Fricas. It's not the same error
(different level, whatever that means) but is does not
work either.

> Note that "+" is a string while _+ is the identifier for plus.
> One has to escape it in this position.

Yes, but I thought this is done by quotation with ".
I learn that escaping of operators has to be done by
a single leading _.

> Also '+ would be wrong, because that would be something of type Symbol.

Ah. 

> But you want a function (PI,PI)->PI in this position.

Yes, exactly.

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