Ralf Hemmecke wrote:
>
> On 03/24/2014 03:10 AM, Waldek Hebisch wrote:
> > tf := '(TexFormat)
> > formatFn :=
> > getFunctionFromDomain("convert",tf,[$OutputForm,$Integer])
> > of := SPADCALL(expr,$IOindex,formatFn)
>
> Are you really sure, that you meant $IOindex as the second argument?
This is just an example. I wanted example with 2 arguments, so
choose this one.
If you ask if we want one argument or two argument convert, that
is tricky question. Currently second argument is equation number.
It make sense when formatter is used as alternative for text
interface. In other cases it depends on user preferences.
Also, equation number makes little sense in fortran output,
the best we could do is to put a comment with equation number.
So, I am not sure if we should require all formatters to support
equation numbers. Certainly formatter should support
version without numbers.
> I need to call outputTran from newfort.boot. Do you think that would be
> correct?
>
> outputTranF e ==
> dom := '(OutputDispatch)
> outputTranFn := getFunctionFromDomain("outputTran",dom,[$OutputForm])
> SPADCALL(e,outputTranFn)
Yes. Slightly better would be:
outputTranF e ==
dom := '(OutputDispatch)
outputTranFn := getFunctionFromDomain1("outputTran", dom,
$OutputForm, [$OutputForm])
SPADCALL(e,outputTranFn)
The difference is that for 'getFunctionFromDomain' the arguments
are name, domain, argument types, while 'getFunctionFromDomain1'
takes name, domain, target type, argument types. When the
domain contins only one function with given name and arguments,
then 'getFunctionFromDomain' is OK. But when overloading on
target type is needed 'getFunctionFromDomain' may choose wrong
function. For this reason we have 'getFunctionFromDomain1'.
--
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.
For more options, visit https://groups.google.com/d/optout.