On Tue, May 17, 2022 at 11:08:59PM +0200, Ralf Hemmecke wrote:
> On 04.05.22 03:23, Waldek Hebisch wrote:
> >On Tue, May 03, 2022 at 11:28:58PM +0200, Ralf Hemmecke wrote:
> >>I am currently working on the jfricas interface.
> >>Unfortunately, there are some rather unsafe elements in it,
> >>I must patch the functions |mathprintWithNumber| and OBEY
> >>
> >>https://github.com/hemmecke/jfricas/blob/master/jfricas/webspad.lisp#L84
> >>
> >>;;; Override a FriCAS function in order to remove the equation number.
> >>(DEFUN |mathprintWithNumber| (|x|)
> >> (PROG ()
> >> (RETURN
> >> (PROGN
> >> ;(|ioHook| '|startAlgebraOutput|)
> >> (|saySpadMsg| '|--FORMAT:BEG:Algebra|)
> >> (|maprin| (|outputTran2| |x|))
> >> (|saySpadMsg| '|--FORMAT:END:Algebra|)
> >> ;(|ioHook| '|endOfAlgebraOutput|)
> >> ))))
> >
> >I do not see why you are doing this. If you want to call
> >'saySpadMsg' appropriate io hook should be enough. For
> >skipping line numbers setting '$IOindex' to NIL should
> >be enough.
>
> Well, not so easy. ;-) I could probably do this with the ioHook, but
> the Jupyter interface also has numbers for input/output. I use $IOindex to
> syncronize FriCAS step numbers with Jupyter numbers. Setting $IOindex to nil
> is thus counterproductive.
You mean you read $IOindex?
> Maybe I could change the |mathprintWithNumber| in FriCAS to depend on a flag
> that if not set prevents outputting the equation number.
Using flag is quite reasonable.
> Sounds a bit strang, given the name ...withNumber.
>
> mathprintWithNumber x ==
> ioHook("startAlgebraOutput")
> x:= outputTran2 x
> maprin
> $IOindex => ['EQUATNUM,$IOindex,x]
> x
> ioHook("endOfAlgebraOutput")
Well, as you see _not_ printing number is already part of behaviour.
More accurate name probaby would be 'mathprintMaybeWithNumber', but
in several other places we also do some actions conditionally,
without spelling out disclaimers inside name.
--
Waldek Hebisch
--
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/20220517231444.GA2420%40fricas.math.uni.wroc.pl.