> Again unclear. Would you count a list domain that does export setelt!,
> but not setrest! a (mutable) list of ImmutableList?

I would say like Haskell, setelt (without !) will return a copy in the
ImmutableList case.

> because there were not yet any big issues with the current
> List (probably because the programmers know how to behave nicely). But
> otherwise all I want is a clear specification of what the functions in
> the domain do and that application of functions does not lead out of the
> domain. setrest! is a destructive function, so a user should expect that
> the result is not in the domain anymore. In that sense I accept lists
> with a cycle in List. But they are NOT the "official" inhabitants of
> List, at least not for me.

Spad List is basicly Common Lisp list.
A cyclic list is a perfectly good list in LISP, so you can't avoid cycle.
But Spad doesn't have to behave like LISP.  I hope Spad can support
immutable data structure through categories nicely.

# calls LENGTH$List, it hangs in lisp.

> BTW, note that we also have http://fricas.github.io/api/Finite.html. You
> obviously see a difference between Finite and finiteAggregate.

See comments about HOAGG in aggcat.spad:

-- It would probably make sense to make [[HOAGG S]] export [[Finite]],
-- when this is the case.  The following modifications would be necessary:
--
-- 1) we need another attribute, say, [[constantSizeAggregate]], that
--    says that each aggregate has the same number of members.
-- 2) we need a way to construct an aggregate given a list of its parts,
--    i.e., construct : List R -> %
--
-- Then, the exports of [[Finite]] could be implemented similar to
-- [[RectangularMatrixCategory]].

-- 
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.

Reply via email to