Johannes Grabmeier wrote:
>
> but then there should be one consequence: one should remove all
> destructive operations from lists, as they do not work. Then, this is
> the bug, to lead to believe that one performs a destructive change. Or
> at least: exclude the argument 1 for delete! and give an error.
>From ug01:
: An operation that can be destructive on one or more arguments
: usually has a name ending in a exclamation point (``!'').
: This actually means that it is {\it allowed} to update its
: arguments but it is not {\it required} to do so. For example,
: the underlying representation of a collection type may not allow
: the very last element to removed and so an empty object may be
: returned instead. Therefore, it is important that you use the
: object returned by the operation and not rely on a physical
: change having occurred within the object. Usually, destructive
: operations are provided for efficiency reasons.
Docstring for 'delete!':
delete!(u, i) destructively deletes the \spad{i}th element of u.
"Working" means that operation is doing what is promised.
AFAICS 'delete!' is keeping its promise: returned value
is OK. I do not know what more could we do to make
clear that 'delete!' is a version of 'delete' that may
be used when you do not care what happens to the
argument (for examples because you will forget the
argument and only use returned value).
Let me add that functions like 'delete!' (notably 'reverse!')
are used in the algebra and give considerable efficiency gains.
--
Waldek Hebisch
--
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 http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.