someone wrote:
> 
> One small addition. If I try to import:
> 
>     import ListFunctions2(M, List M)
> 
> and then write:
> 
>     blockSplit(A:M, nr:PI, nc:PI) : List List M ==
>       map( (X:M):(List M) +-> horizSplit(X, nc), vertSplit(A, nr) 
> )$ListFunctions2(M, List M)
> 
> this fails with:
> 
> -------------------------------------------------------------------
> ****** comp fails at level 1 with expression: ******
> error in function blockSplit 
> 
> (((|elt| (|ListFunctions2| M (|List| M)) |map|)
>   (|:| (|:| X M) (+-> (|List| M) (|horizSplit| X |nc|))) (|vertSplit| A 
> |nr|)))
> ****** level 1  ******
> $x:= ((elt (ListFunctions2 M (List M)) map) (: (: X M) (+-> (List M) 
> (horizSplit X nc))) (vertSplit A nr))
> $m := List List M
>  
>    >> Apparent user error:
>     +-> is not a known type
> -------------------------------------------------------------------
> 
> This error is really not apparent to me and the message does not help.
> How can "+->" ever be a Type?

In FriCAS '+->' is a name almost like other names.  The compiler
has no objections to treating a name a type name.  Of course
since '+->' has builtion meaning using it as a type name would
be confusing but not much different than other case of name
clashes (in FriCAS overloading typically allows you to reuse
name but overloading is _not_ applicable to type names).

Of course you ask why compiler thinks that '+->' should be
a type name?  It is a parsing problem.  The error message
says you how compiler interpreted your input.  It thinks
that you are calling 'map' (from ListFunctions2 ...) with
two arguments.  The first with extra parentheses indicating
parse is

  (X:M):((List M) +-> horizSplit(X, nc))

that is expression '(X:M)' declared to be of type 
'(List M) +-> horizSplit(X, nc)'.  Now the compiler
realised that '(List M) +-> horizSplit(X, nc)' is
not a valid type because the '+->' operator does not
produce types.  Note: the compiler parses

(List M) +-> horizSplit(X, nc)

like

(List M) -> horizSplit(X, nc)

which (with type producing 'horizSplit(X, nc)' could be
a valid type.  The only difference is that the '->'
operator produces types, while '+->' not.

Since you gave only a small snippet I can not say why compiler
parsed your input that way -- when I tried to make complete
package from your snippent using FriCAS from end of September
I got correct parse.  Probably you use older FriCAS (version
from January 2009 gives wrong parse -- without checking
I can not say when this has changed).

-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to