> I must admit that currently I plan to have parameterless
> system domains.  In such case search for right function
> can be done at compile time.  Also, for parameterless
> domains variables can be stored outside domain vector,
> so that the survive ')lib' without any extra effort.

OK, that would be sufficient as FormattetOutut comes without parameters.
I guess, it would still be a problem, since the variable here contains
pointers to other domains that might change their address, right?

Ralf

FormattedOutput: Exports == Implementation where
  OFC ==> OutputFormatterCategory
  Exports ==> OFC with
    setFormats!: List OFC -> Void
      ++ \spad{setFormats!(l)} takes a list \spad{l} of formatters and
      ++ sets this for future output in a session.
  Implementation ==> add
    Rep ==> Record(out: OutputForm, step: Integer)
    import from Rep
    rep x ==> (x@%) pretend Rep
    per x ==> (x@Rep) pretend %

    formatters: Reference List OFC := ref empty()

    setFormats!(l: List OFC): Void == setelt!(formatters, l)

    convert(e: OutputForm, n: Integer): % == per [e, n]

    display(x: %): Void ==
        for F in deref formatters repeat
            display(convert(rep(x).out, rep(x).step)$F)$F

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/2ce02f6a-a46b-3c63-5441-223e7400227d%40hemmecke.org.

Reply via email to