Items tagged with type-checking

Feed

Hello,

To check my arguments in a procedure I need something like

myproc := proc(M :: Matrix(square, rational)

                       , N :: Matrix(shape=triangular[lower, unit], datatype = rational
                       , O :: Matrix(shape = square, dimension = 5

               )

end proc;

How does that work in Maple? What is the correct Syntax? I tried many different things that doesn't fit.

I have two problems with type declarations in procedures. They seem to be related, so I'll ask both questions at once.

1. One problem is that I make this sort of declaration.

{[n,N]::positive:=1}

where n could be an integer or a float, but not negative nor complex. I'm not sure what's wrong with the code below: the type-checking fails, but I don't understand why. I followed the template laid out by Preben here:
http://www.mapleprimes.com/questions/134550...

Page 1 of 1