multiline strings

10 views
Skip to first unread message

Ralf Hemmecke

unread,
May 4, 2025, 4:22:55 AMMay 4
to fricas-devel
Probably the answer is no, but does FriCAS allow to enter multiline
strings similar to python's

"""foo bla
hello world
baz"""

so that the newlline is included.

Ralf

Hill Strong

unread,
May 4, 2025, 4:35:59 AMMay 4
to fricas...@googlegroups.com

Wouldn't the _ at the end of the line do this?


--
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...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/edbf5ed1-f52f-4509-8bb6-e27f86e937ed%40hemmecke.org.

Ralf Hemmecke

unread,
May 4, 2025, 8:56:02 AMMay 4
to fricas...@googlegroups.com
On 5/4/25 10:35, Hill Strong wrote:
> Wouldn't the _ at the end of the line do this?

No. It escapes the following newline, but doesn't include it.

Ralf

Waldek Hebisch

unread,
May 4, 2025, 9:00:01 AMMay 4
to 'Ralf Hemmecke' via FriCAS - computer algebra system
FriCAS used to allow newlines in strings, but it was implemented
differently in interpreter and Spad compiler so in now removed.

You can put newlines in the string like:

nl ==> new(1, newline())$String
fmy_str() ==
"foo bla" nl "hello world" nl "baz"

print fmy_str()


--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages