Am I doing something wrong or are macros only allowed with just one
parameter?

The wrapper domain is unimportant.

It compiles fine if I remove the yyy parameter from the argument list
and from the part after ==>.

Ralf

================================================

)co foo.spad
   Compiling FriCAS source code from file
      /home/hemmecke/backup/git/fricas/src/doc/foo.spad using old
      system compiler.
   FOO abbreviates domain Foo
------------------------------------------------------------------------
   initializing NRLIB FOO for Foo
   compiling into NRLIB FOO
   processing macro definition Rep ==> List Set S
   compiling local = : ($,$) -> Boolean
Time: 0.00 SEC.

   compiling exported coerce : $ -> OutputForm
   processing macro definition s z ==> ::(::(z,Symbol),OutputForm)
   processing macro definition o z ==> ::(z,OutputForm)
****** comp fails at level 7 with expression: ******
error in function coerce

(SEQ
 (MDEF (|s| |z|) (NIL NIL) (NIL NIL)
  (|::| (|::| |z| (|Symbol|)) (|OutputForm|)))
 (MDEF (|o| |z|) (NIL NIL) (NIL NIL) (|::| |z| (|OutputForm|)))
 (|print|
  (|brace|
   ((|Sel| (|List| (|OutputForm|)) |construct|) (|::| |xxx| (|OutputForm|))
    |yyy|)))
 (LET (|:| |oAnd| (|OutputForm|))
   (|s| " /\\ "))
 (LET (|:| |oOr| (|OutputForm|))
   (|s| " \\/ "))
 (|exit| 1
  (|infix| |oOr|
   (COLLECT (IN |a| (|pretend| (@ |x| $) (|List| (|Set| S))))
            (|infix| |oAnd| (COLLECT (IN |z| (|members| |a|)) (|o|
|z|)))))))
****** level 7  ******
$x:= xxx
$m:= (OutputForm)
$f:=
((((|last| #) (|rest| #) (|first| #) (|value| #) ...)
  ((= # #) (|/\\| #) (< #) (<= #) ...)))

   >> Apparent user error:
   no modemap for construct with 2 arguments

-- 
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.
For more options, visit https://groups.google.com/d/optout.
OF ==> OutputForm
-- dbgprintx(x: String, y: OF): Void ==
dbgprintx(xxx, yyy) ==> print(brace([xxx::OF, yyy]$List(OF)))


rep x ==> (x@%) pretend Rep
per x ==> (x@Rep) pretend %
)abbrev domain FOO Foo
Foo(S: SetCategory): CoercibleTo(OutputForm) with
    coerce: S -> %
    coerce: % -> Set Set S
  == add
    Rep ==> List Set S
    ((x: %) = (y: %)): Boolean == rep x = rep y
    coerce(x: %): OutputForm ==
        s(z) ==> z :: Symbol :: OutputForm
        o(z) ==> z :: OutputForm
        dbgprintx("Hello", "World"::OF)
        oAnd: OutputForm := s " /\ "
        oOr:  OutputForm := s " \/ "
        infix(oOr, [infix(oAnd, [o z for z in members a]) for a in rep x])
    coerce(s: S): % == per [set [s]]
    coerce(x: %): Set Set S == set rep x

Reply via email to