> Another question: what happens here? Is this a bug?
> 
> (37) -> l := [4,2,2,2,3,3,1]
> 
>    (37)  [4,2,2,2,3,3,1]
>                                                   Type: List(PositiveInteger)
> (38) -> sort! l             
> 
>    (38)  [1,2,2,2,3,3,4]
>                                                   Type: List(PositiveInteger)
> (39) -> sort! l
> 
>    (39)  [4]
>                                                   Type: List(PositiveInteger)
> 
> Why can I not call it twice?

I haven't looked at the documentation of sort!, but the general rule is,
if you call a function that has an exclamation mark at the end, it does
something destructive to (at least one) of its arguments.

In this case, after the first call, you shouldn't use l anymore after
the first call. The right way to call would be

l := sort! l

That, of course, you can repeat as often as you like.

Ralf


-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to