Sorry, I was a busy with other things.

What about the string join addition?

Are you satisfied with this? See attachment or here

https://github.com/fricas/fricas/pull/196/commits/e7bf0ff005cf0c25fdcdede8dd5e8de9ec04fdf0

I have modified according to your comments.

Does anyone have suggestions for improvements of the content of
the src/doc/sphinx/source/*.rst files. I will adapt to the recent change of Makefile concerning the docbuild. Anything else?

* Are there more things to be added to
  https://fricas.github.io/citation.html ?

* Does anyone have new suggestions for examples of how to use
  FriCAS. New tutorials?

* Are there people who develop add-ons that we can point to from
  fricas.github.io? I think, the development of jlfricas
  (by Gregory Vanuxem) would be a good example.
  I currently also develop QEta that I would like to point to from the
  FriCAS homepage. More suggestions?

Ralf

On 5/17/25 13:28, Waldek Hebisch wrote:
I plan a new release around end of May.  We have a long list of
old unfixed bugs.  Also, a few new developements are not quite
finished yet.  But there is long time from previous release
and we have accumulated several fixes, so it is better to do
a release.  I will try to include whatever gets finished on
time.


--
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 visit 
https://groups.google.com/d/msgid/fricas-devel/1b177e8d-f4ab-4bfc-82d5-218fc58309be%40hemmecke.org.
From e7bf0ff005cf0c25fdcdede8dd5e8de9ec04fdf0 Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <r...@hemmecke.org>
Date: Sun, 13 Apr 2025 21:30:26 +0200
Subject: introduce string join with separator

join(["a","b","cd"], " + ") returns "a + b + cd"
---
 src/algebra/aggcat.spad |  4 ++++
 src/algebra/string.spad | 10 ++++++++++
 2 files changed, 14 insertions(+)

diff --git a/src/algebra/aggcat.spad b/src/algebra/aggcat.spad
index 02c5d55e..2c40cf8e 100644
--- a/src/algebra/aggcat.spad
+++ b/src/algebra/aggcat.spad
@@ -2597,6 +2597,10 @@ StringAggregate : Category == OneDimensionalArrayAggregate Character with
       ++ elt(s, t) returns the concatenation of s and t. It is provided to
       ++ allow juxtaposition of strings to work as concatenation.
       ++ For example, \spad{"smoo" "shed"} returns \spad{"smooshed"}.
+    join: (%, List %) -> %
+      ++ join(sep,ls) returns an element that is the concatenation
+      ++ of all strings in ls but separated by sep, for example,
+      ++ concat("/",["a","b","c"]) returns "a/b/c".
  add
    trim(s : %, cc : CharacterClass) == leftTrim(rightTrim(s, cc), cc)
 
diff --git a/src/algebra/string.spad b/src/algebra/string.spad
index 92a16e76..16d5dfda 100644
--- a/src/algebra/string.spad
+++ b/src/algebra/string.spad
@@ -374,6 +374,16 @@ IndexedString(mn : Integer) : Export == Implementation where
         RPLACSTR(y, s, m, x, 0, m)$Lisp
         y
 
+    join(sep: %, l: List %): % ==
+        empty? l => empty()
+        lensep := #sep
+        t := new(+/[#s for s in l] + #rest(l)*lensep, space$C)
+        t := copyInto!(t, first l, 1); i := 1 + #first(l)
+        for s in rest l repeat
+            t := copyInto!(t, sep, i); i := i + lensep
+            t := copyInto!(t, s,   i); i := i + #s
+        t
+
     qelt(s : %, i : I) == Qelt(s, i - mn)
 
     elt(s : %, i : I) ==
-- 
2.43.0

Reply via email to