> Actually, I would have expected [5,2,3,4]
But do you expect this:
(1) -> x:=arrayStack[1,2,3,4]
(1) [1,2,3,4]
Type:
ArrayStack(PositiveInteger)
(2) -> y := parts x
(2) [1,2,3,4]
Type:
List(PositiveInteger)
(3) -> y.1 := 5
(3) 5
Type:
PositiveInteger
(4) -> x
(4) [1,2,3,4]
Type:
ArrayStack(PositiveInteger)
> I would even have expected that I cannot use the value of x
> anymore, because the internal datastructure might have been modified so
> badly that it becomes invalid as an element of the respective domain.
Right, that's why I think the doc should mention parts don't do structure
sharing and current implementation needs fixing. So that the problem
you mention will never happen.
> But otherwise, it is exactly as I said before, using "destructive"
> operations is dangerous, since it's usually unknown if arguments (hier
> in the creation with the "stack" constructor) are copied or not.
We'll try to make sure the arguments are copied.
> in general be too much copying
You are against destructive operations and concerns too much
copying, it seems that Haskell really suits you :-)
--
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.