Ralf Hemmecke wrote:
>
> Hi,
>
> I'm used to parametrized macros. Are they available in SPAD?
>
> The following program seems to suggest NO, but it also seems to contain
> a bug, since it compiles with X which is nowhere defined.
>
> ---rhxBEGIN tst.spad
> EXX ==> Expression X
> EX Y ==> Expression Y
> fooz z ==> 2*z+3^z
>
> )abbrev category CATX CatX
> CatX(R: Ring): Category == with
> foo: EXX -> Integer
>
> )abbrev category CATY CatY
> CatY(R: Ring): Category == with
> foo2: EX R -> Integer
>
> )abbrev domain MINT MyInteger
> MyInteger: IntegerNumberSystem with
> baz: Integer -> Integer
> == Integer add
> -- fooz z ==> 2*z+3^z
> baz(x: Integer): Integer == fooz x
> ---rhxEND tst.spad
>
I have now commited support for parametrized macros. Your
program missed coercion to NonNegativeInteger, so I changed
definition of fooz to:
fooz z ==> 2*z+3^(z::NonNegativeInteger)
Now it compiles with FriCAS trunk. Also the second version
works (with the same correction).
--
Waldek Hebisch
[email protected]
--
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.