First, I found that default constructor, "construct", always
copy its argument, that's inefficient if there are lots of
elements. I propose a destructive constructor "construct!",
that by potentially modify its argument, to achieve better
performance.
The second one is a minor issue, bracket already calls
commaSeparate, and Stack can use the default implementation.
diff --git a/src/algebra/aggcat.spad b/src/algebra/aggcat.spad
index 3447ba1..b591a65 100644
--- a/src/algebra/aggcat.spad
+++ b/src/algebra/aggcat.spad
@@ -154,8 +154,7 @@
true
if S has CoercibleTo(OutputForm) then
coerce(x : %) : OutputForm ==
- bracket commaSeparate
- [a::OutputForm for a in parts x]$List(OutputForm)
+ bracket [a::OutputForm for a in parts x]$List(OutputForm)
)abbrev category CLAGG Collection
@@ -2055,8 +2054,7 @@
if S has CoercibleTo(OutputForm) then
coerce(r : %) : OutputForm ==
- bracket commaSeparate(
- [qelt(r, k)::OutputForm for k in minIndex r .. maxIndex r])
+ bracket [qelt(r, k)::OutputForm for k in minIndex r ..
maxIndex r]
if S has SetCategory then
diff --git a/src/algebra/bags.spad b/src/algebra/bags.spad
index da135e8..cda2d62 100644
--- a/src/algebra/bags.spad
+++ b/src/algebra/bags.spad
@@ -25,7 +25,6 @@
map!(f : S -> S, s : %) ==
setref(s, map!(f, deref s)$List(S))
s
- coerce(d : %) : OutputForm == bracket [e::OutputForm for e in deref d]
copy s == ref copy deref s
# s == #deref s
pop! (s : %) : S ==
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.