Re: [fricas-devel] Struggling with OutputForm

2024-05-09 Thread Grégory Vanuxem
Hello,

I looked more carefully at your suggestion, and, yes, 'pile' is very
interesting for my purpose, but only in Format2D from what I have seen.
Moreover it's not as simple as I like to switch to it, I didn't even
know how. In algebra output "mode", look at this if I use the '=' operator.
Apparently in algebra mode 'pile' piles everythings:

(1) -> a:=qnew(4,4)$JF64MAT;a=a

   (1)   0.0  0.0  0.0  0.0 =  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.00.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.00.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.00.0  0.0  0.0  0.0

(2) -> juliaMPrint(false)$JF64MAT

   (2)  true

(3) -> a=a

 +0.0  0.0  0.0  0.0+  +0.0  0.0  0.0  0.0+
  |0.0  0.0  0.0  0.0|   =   |0.0  0.0  0.0  0.0|
   (3)   |0.0  0.0  0.0  0.0|0.0  0.0  0.0  0.0|
  +0.0  0.0  0.0  0.0+  +0.0  0.0  0.0  0.0+

(4) -> )lib JF64MAT
   JuliaFloat64Matrix is now explicitly exposed in frame frame1
   JuliaFloat64Matrix will be automatically loaded when needed from
  /home/greg/Git/jlfricas/JF64MAT.NRLIB/JF64MAT
(4) -> a=a

   (4)
  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.0
   =
  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.0
  0.0  0.0  0.0  0.0

%%(1) is with 'vconcat' and algebra mode, %%(2) the FriCAS mode, i.e. using
matrix$OutputForm, %%(3), an equation, %%(4) the same with 'pile'.

But for matrices with bigger line length 'vconcat' quickly abandons. And a
VCONCAT ``structure" is rendered to the console. If anyone knows how to
circumvent this I would be happy. 'box'  behaves also like 'vconcat' with
large output i.e. here with length of line bigger than )boot $LINELENGTH.

(1) -> a:=nrand(3,5)$JF64MAT

   (1)   -1.13447   0.638686   0.335689  -0.59345  -0.094803
  -1.49625   0.193793   0.596652   0.30491   0.937385
  -0.230353  0.196435  -0.9298 0.40040.409875
 Type:
JuliaFloat64Matrix
   Time: 0.19 (EV) + 3.00 (OT) = 3.20
sec
(2) -> a:=nrand(3,7)$JF64MAT

   (2)
   VCONCAT
   0.394442   0.0713554   1.255761.38318   -0.360066  -0.0659153
0.79
 6545
  ,
  -0.187801  -0.130892   -0.0295291  1.40156   -0.785709   2.06677
0.65
 2902
  ,
   2.62115   -0.355164   -1.359010.780112  -1.7862-0.454005
-0.08
 9139
 Type:
JuliaFloat64Matrix

- Greg

Le mar. 7 mai 2024 à 11:16, Ralf Hemmecke  a écrit :

> > is present in a string. Next, it's outputString in i-output.boot that
> > needs a little tweaking for me. In fact, I've bypassed the part of the
> > code that breaks lines.
>
> Well, you could set the output length to the maximum.
>
> )set output length 245
>
> There is also another option use Format2D.
>
> )set output algebra off
> )set output formatted on
> LOFC ==> List(OutputFormatterCategory)
> setFormats!([Formatter Format2D] pretend LOFC)$FormattedOutput
> pile(["long string", "another long string"])$OutputForm
>
> If you do not want to see quotes, then convert to Symbol.
>
> pile(["long string"::Symbol, "another long string"::Symbol])$OutputForm
>
> Format2D should work reasonably well maybe sometimes even better than
> i-output.boot, but it never breaks lines.
> You can consider that a weakness. And it is.
>
> To switch it off again, say
>
> )set output formatted off
> )set output algebra on
>
> Ralf
>
> --
> 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/b88868ac-c8f2-4709-9a3e-ab078ad5a3b2%40hemmecke.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 fricas-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/CAHnU2dbJ3-muwqJEo12uUiawcdiSffmGB73S%3Dvv%3Dhk23CJTmgQ%40mail.gmail.com.


Re: [fricas-devel] Struggling with OutputForm

2024-05-07 Thread Grégory Vanuxem
Le mar. 7 mai 2024 à 13:41, Ralf Hemmecke  a écrit :

> On 5/7/24 13:22, Grégory Vanuxem wrote:
> >> )set output algebra off
> >> )set output formatted on
> >> LOFC ==> List(OutputFormatterCategory)
> >> setFormats!([Formatter Format2D] pretend LOFC)$FormattedOutput
> >> pile(["long string", "another long string"])$OutputForm
>
> > It requires switching off algebra though,
>
> Why would that be a problem?
>

No problem at all. In fact I did not know how to use the mode as explained
in your mail.


> > and frankly I really like the work done by the Julia community
> > for outputting their objects.
>
> But hey, that was exactly, why I gave you the "pile" function above.
> Assuming that you get the julia output as a list of lines/string, you
> just have to convert them to a list li of type List(Symbol) and form the
> OutputForm for that result by saying pile(li). And then let Format2D do
> the rest (which basically just prints that OutputForm without any
> modification as in Julia). Other FriCAS stuff is still printed very
> similar to the original algebra output of FriCAS. Try it out.
>

Of course, I did, and will  test it more for sure. But the code is almost
done, it was the first time I used AI generated code. By inadvertence
Copilot  gave me a piece of AI generated Julia code, even better than what
I was finding about redirecting IO etc.
I also asked if it can code in FriCAS Spad, and after a topo on FriCAS and
Spad, it responded yes, I just had to fix it, FriCAS from my voice is
interpreted as fricassée ;). Not as good as Julia but that's a beginning. I
asked it to code a factorial function, it gave me a FACTORIAL domain with
factorial in it. The future is already here. Highly based on your github.io
work from what I have seen ;)

To come back to this discussion, I really need a string representation to
conform to FriCAS "conventions, and I do not like using Julia to print
something on the terminal, I was doing that. Moreover I have added some
times ago some code to use the PCRE library so  I can catch a regular
expression, do some replacements, etc. So having a string is very important
to me to output it. I even plan unless it is available in FriCAS to add a
'split" function, this is always handy.


However, I am not sure whether a normal user would actually want
> "julia-tagged" values look different from equivalent FriCAS values. On
> the other hand, the type decides how its elements are printed. So, why not.
>

I dislike that a lot, but, "julia-tagged" wording is good to me. I am in
the process of removing it as a collateral task. With more improvement in
this direction.

- Greg

PS: I forgot to send this email...

-- 
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/CAHnU2dZ9f9RYKyc9eXYqFaPC_zWPwKuZagOnZtBatEZgUUe1qg%40mail.gmail.com.


Re: [fricas-devel] Struggling with OutputForm

2024-05-07 Thread Ralf Hemmecke

On 5/7/24 13:22, Grégory Vanuxem wrote:

)set output algebra off
)set output formatted on
LOFC ==> List(OutputFormatterCategory)
setFormats!([Formatter Format2D] pretend LOFC)$FormattedOutput
pile(["long string", "another long string"])$OutputForm



It requires switching off algebra though,


Why would that be a problem?


and frankly I really like the work done by the Julia community
for outputting their objects.


But hey, that was exactly, why I gave you the "pile" function above.

Assuming that you get the julia output as a list of lines/string, you 
just have to convert them to a list li of type List(Symbol) and form the 
OutputForm for that result by saying pile(li). And then let Format2D do 
the rest (which basically just prints that OutputForm without any 
modification as in Julia). Other FriCAS stuff is still printed very 
similar to the original algebra output of FriCAS. Try it out.


However, I am not sure whether a normal user would actually want 
"julia-tagged" values look different from equivalent FriCAS values. On 
the other hand, the type decides how its elements are printed. So, why not.


Ralf

--
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/84b0bfcd-4b78-4712-a3b0-059b7fd8d529%40hemmecke.org.


Re: [fricas-devel] Struggling with OutputForm

2024-05-07 Thread Grégory Vanuxem
Hello,

Le mar. 7 mai 2024 à 11:16, Ralf Hemmecke  a écrit :
>
> > is present in a string. Next, it's outputString in i-output.boot that
> > needs a little tweaking for me. In fact, I've bypassed the part of the
> > code that breaks lines.
>
> Well, you could set the output length to the maximum.
>
> )set output length 245
>
> There is also another option use Format2D.
>
> )set output algebra off
> )set output formatted on
> LOFC ==> List(OutputFormatterCategory)
> setFormats!([Formatter Format2D] pretend LOFC)$FormattedOutput
> pile(["long string", "another long string"])$OutputForm

It could be of use to me, yes. I am recording it it!

It requires switching off algebra though, and frankly I really like the
work done by the Julia community for outputting their objects.

No plain text mail, sorry.

>
> If you do not want to see quotes, then convert to Symbol.
>
> pile(["long string"::Symbol, "another long string"::Symbol])$OutputForm
>
> Format2D should work reasonably well maybe sometimes even better than
> i-output.boot, but it never breaks lines.

Personally, omitting the place of displayed type, time, memory usage and so
on, I prefer "data'' line cutted by the console. I am even asking myself
now if the underlying CL system does not have a way to interact with the
console for its parameters. More to look at. But, I "struggled" too much
with this, understanding the functions flows in outputting FriCAS objects,
I even loved the function 'name concatTrouble'. I'm not a big fan of coding
aesthetic things like this. Readability is also important of course and the
first time I tried Axiom, I was astonished by its 2D printing, do not take
my critics wrong.

I did not know your way of printing, I tried yesterday the formatted output
but had no output, I better understand now. The output is still buggy since
the output is no longer saved by the system command )spool, it's a pity.
There are rooms of work to do. One is using at Spad level I think #\newline
instead of letting the interpreter do all the job line by line (cutting it
etc.).

An example below with algebraic numbers à la Nemo (partially printed in
real/complex form). I really prefer your and my ways.
As one can see matrices are often very badly printed on screen, even if for
small sized matrices with small outputted elements that is a beautiful
work. Some options are available I think to better handle default mechanism
for matrices thought.

(14) -> pile([b])$OutputForm

4×4 Matrix{QQBarFieldElem}:
 Root 0.472954 of 18x^2 - 36x + 13  Root 16. of x - 16 Root -1.72973
of 37x + 64Root -1.51136 of 88x + 133
 Root 0 of xRoot 0.50 of 2x - 1Root -3.31662
of x^2 - 11Root 2.0 of x - 2
 Root 104.000 of x - 104Root -3.72727 of 11x + 41  Root -
0.723577 of 123x + 89  Root 4.23810 of 21x - 89
 Root -1.21157 of 12x^2 - 16x - 37  Root -1.44737 of 38x + 55  Root 2.25316
of 79x - 178Root -2.8 of 5x + 14

 Type:
OutputForm
  Time: 0
sec
(15) -> b

4×4 Matrix{QQBarFieldElem}:
 Root 0.472954 of 18x^2 - 36x + 13  Root 16. of x - 16 Root -1.72973
of 37x + 64Root -1.51136 of 88x + 133
 Root 0 of xRoot 0.50 of 2x - 1Root -3.31662
of x^2 - 11Root 2.0 of x - 2
 Root 104.000 of x - 104Root -3.72727 of 11x + 41  Root -
0.723577 of 123x + 89  Root 4.23810 of 21x - 89
 Root -1.21157 of 12x^2 - 16x - 37  Root -1.44737 of 38x + 55  Root 2.25316
of 79x - 178Root -2.8 of 5x + 14

   Type: JuliaMatrix
(NemoAlgebraicNumber)
  Time: 0
sec

(16) -> juliaMPrint(false)$JMATRIX(NAN)

true

Type:
Boolean
  Time: 0
sec
(17) -> b

[[Root 0.472954 of 18x^2 - 36x + 13][Root 16. of x - 16][Root -
1.72973 of 37x + 64]   [Root -1.51136 of 88x + 133]]
[
  ]
[   [Root 0 of x]  [Root 0.50 of 2x - 1][Root -
3.31662 of x^2 - 11]  [Root 2.0 of x - 2]  ]
[
  ]
[ [Root 104.000 of x - 104]   [Root -3.72727 of 11x + 41]  [Root -
0.723577 of 123x + 89]   [Root 4.23810 of 21x - 89] ]
[
  ]
[[Root -1.21157 of 12x^2 - 16x - 37]  [Root -1.44737 of 38x + 55]   [Root
2.25316 of 79x - 178][Root -2.8 of 5x + 14] ]

   Type: JuliaMatrix
(NemoAlgebraicNumber)
   Time: 0.01 (OT) = 0.01
sec
(18) -> )set out alg on
(18) -> )set out form off
(18) -> b

   (18)
   [
 [[Root 0.472954 of 18x^2 - 36x + 13], [Root 16. of x - 16],
  [Root -1.72973 of 37x + 64], [Root -1.51136 of 88x + 133]]
 ,

 [[Root 0 of x], [Root 0.50 of 2x - 1], [Root -3.31662 of x^2 - 11],
 

Re: [fricas-devel] Struggling with OutputForm

2024-05-07 Thread Ralf Hemmecke

is present in a string. Next, it's outputString in i-output.boot that
needs a little tweaking for me. In fact, I've bypassed the part of the
code that breaks lines.


Well, you could set the output length to the maximum.

)set output length 245

There is also another option use Format2D.

)set output algebra off
)set output formatted on
LOFC ==> List(OutputFormatterCategory)
setFormats!([Formatter Format2D] pretend LOFC)$FormattedOutput
pile(["long string", "another long string"])$OutputForm

If you do not want to see quotes, then convert to Symbol.

pile(["long string"::Symbol, "another long string"::Symbol])$OutputForm

Format2D should work reasonably well maybe sometimes even better than 
i-output.boot, but it never breaks lines.

You can consider that a weakness. And it is.

To switch it off again, say

)set output formatted off
)set output algebra on

Ralf

--
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/b88868ac-c8f2-4709-9a3e-ab078ad5a3b2%40hemmecke.org.


Re: [fricas-devel] Struggling with OutputForm

2024-05-07 Thread Grégory Vanuxem
Hi Waldek,

Le lun. 6 mai 2024 à 18:17, Waldek Hebisch  a écrit :
>
> On Mon, May 06, 2024 at 06:04:12PM +0200, Grégory Vanuxem wrote:
> > No, it was just to be sure my string is good for Lisp.
>
> There is something fishy in your string, so you need to look at
> it.  PRINC is not good for this, as it hides special characters.
> PRIN1 or maybe our PRETTYPRINT is better.  If that shows nothing
> you can try 'script' and examine output using 'od' to show you
> character codes.

Yes, it contains newline characters, the string is already formatted.
I need to study the implications of UTF-8 better in my settings, but
in the meantime I've finally coded a simple CL predicate if #\newline
is present in a string. Next, it's outputString in i-output.boot that
needs a little tweaking for me. In fact, I've bypassed the part of the
code that breaks lines. This could be interesting for FriCAS when, and
if, the output code in the interpreter is modified to be "ported" at
the Spad level. In fact, I think the interpereter overdoes in this
area.

Thanks,

- Greg

-- 
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/CAHnU2dbb8RC7fYxoOATujNuYB4fvuYPRwA7JrTG-jf4UMTepuQ%40mail.gmail.com.


Re: [fricas-devel] Struggling with OutputForm

2024-05-06 Thread Waldek Hebisch
On Mon, May 06, 2024 at 06:04:12PM +0200, Grégory Vanuxem wrote:
> No, it was just to be sure my string is good for Lisp.

There is something fishy in your string, so you need to look at
it.  PRINC is not good for this, as it hides special characters.
PRIN1 or maybe our PRETTYPRINT is better.  If that shows nothing
you can try 'script' and examine output using 'od' to show you
character codes.

-- 
  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/ZjkCf9wv3GP0Hlxs%40fricas.org.


Re: [fricas-devel] Struggling with OutputForm

2024-05-06 Thread Grégory Vanuxem
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  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 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.

-- 
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/CAHnU2dY4%3D04YjcgpH3B%3DJ2GAC%2BEe7%3D9uikePs82pk1Be0ZgAUw%40mail.gmail.com.


Re: [fricas-devel] Struggling with OutputForm

2024-05-06 Thread Waldek Hebisch
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.


[fricas-devel] Struggling with OutputForm

2024-05-06 Thread Grégory Vanuxem
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

- Greg

-- 
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/CAHnU2dZbsp%3DU6uMHfLrDmMDqh16W3%2BesDP7UW4_%3DbxY_d0VWKQ%40mail.gmail.com.