No, it was just to be sure my string is good for Lisp.
Right now, the output with 'message':
(3) -> b
(3)
4×4 Matrix{BigFloat}:
0.371081 0.814431 0.0635363 0.0915533
0.545815
0.0246686 0.1221 0.182735
0.0559515 0.0243745 0.879007 0.17473
0.
232553 0.467648 0.922498 0.702181
Type: JuliaMatrix(JuliaFloat)
Time: 0 sec
=============================================
coerce(m : %) : OutputForm ==
if pprint then
ret : String := jl_string_eval_show(getind(m))$Lisp
message(ret)$OutputForm
else
l : List List OutputForm
l := [[qelt(m, j, i) :: OutputForm _
for i in 1 .. ncols(m)] _
for j in 1 .. nrows(m)]
matrix(l)
Don't look at the function name please.
Le lun. 6 mai 2024 à 17:55, Waldek Hebisch <[email protected]> a écrit :
>
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/fricas-devel/Zjj9aG-hZAR4ueLJ%40fricas.org.
--
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/CAHnU2dY4%3D04YjcgpH3B%3DJ2GAC%2BEe7%3D9uikePs82pk1Be0ZgAUw%40mail.gmail.com.