On Wed, May 18, 2022 at 07:04:28AM +0200, Ralf Hemmecke wrote:
> >>>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?
> 
> Yes I do.
> 
> https://github.com/fricas/jfricas/blob/master/jfricas/webspad.lisp#L63
> 
> ===================
> (defun ws-fmt (marker)
>   (|sayMSG| (format nil "--FORMAT:~A:~D" marker boot::|$IOindex|)))
> 
> (setf |$ioHook|
>       (lambda (x &optional args)
>         (cond
> ;         ((eq x '|startAlgebraOutput|) (ws-fmt "BEG:Algebra"))
> ;         ((eq x '|endOfAlgebraOutput|) (ws-fmt "END:Algebra"))
>          ((eq x '|startPatternMsg|)    (ws-fmt "BEG:ERROR"))
>          ((eq x '|endPatternMsg|)      (ws-fmt "END:ERROR"))
> ....
> ===================
> 
> As long as nobody changes it inside a jfricas session, everything works
> fine. Do you see a problem with that?
> Any other option to read FriCAS' step number?

Well, the intent clearly was that "printing" produces a bundle                  
containing step number and value and that separationg step number               
and value should be easy.  ATM it seems that you prefer separate                
code path to transfer step number.  I wonder, maybe adding markers              
around step number would better.                                                
                                                                                
To say the truth it looks somewhat strange that you want to                     
suppres printing of step number but want its value.

-- 
                              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/20220519014253.GB29133%40fricas.math.uni.wroc.pl.

Reply via email to