On Mon, May 06, 2024 at 05:22:06PM +0200, Grégory Vanuxem wrote:
> Hello,
> 
> I am struggling with OutputForm and frankly I do not want to be angry
> today. Maybe you have used it, even not a lot? My question is very
> simple, how do I prevent OutputForm processing, or how to bypass
> interpreter rules, just in case the interpreter has its own rules
> also, from memory I think it has some "knowledge" about OutputForm.
> 
> That's simple, my output string is already formatted and I just want
> to let FriCAS display it. Of course there is line length but I do not
> understand very well what happens. Below is the output from PRINC
> (without double quotes, essentially)  and after from FriCAS. Why is
> the second row cut???
> 
> (1) -> b:=map(i+->urand01()$JFLOAT, identity(4)$JMATRIX(JFLOAT))
> 
>  4×4 Matrix{BigFloat}:
>  0.165528  0.830355  0.630221  0.0903032
>  0.615811  0.532272  0.765433  0.0450628
>  0.439631  0.582113  0.309186  0.178607
>  0.974177  0.350188  0.319465  0.981603
> 
>    (1)
>    4×4 Matrix{BigFloat}:
>  0.165528  0.830355  0.630221  0.0903032
>  0.615811  0.
>   532272  0.765433  0.0450628
>  0.439631  0.582113  0.309186  0.178607
>  0.974177
>     0.350188  0.319465  0.981603
> 
> 
> The code:
> 
> if pprint then
>     --newLine()$DisplayPackage
>     ret : String := jl_string_eval_show(getind(m))$Lisp
>     ret := concat(" ", ret)
>     PRINC(ret)$Lisp
>     TERPRI()$Lisp
>     newLine()$DisplayPackage
>     TERPRI()$Lisp
>     ret pretend OutputForm
>     --concat("\n", ret) pretend OF
>     --PRINT(ret)$Lisp

What do you pass to PRINC?  Normal FriCAS way to print a literal
string is to use 'message', like:

(13) -> message(" 0.165528  0.830355  0.630221  0.0903032")$OutputForm        

   (13)   0.165528  0.830355  0.630221  0.0903032
                                                             Type: OutputForm

As you can see with correct literal string you get the expected output.

-- 
                              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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/Zjj9aG-hZAR4ueLJ%40fricas.org.

Reply via email to