On 06/27/2016 06:09 PM, Waldek Hebisch wrote:
> Ralf Hemmecke wrote:
>>
>> The specification in says:
>>
>> http://fricas.github.io/api/UnaryRecursiveAggregate.html#l-unary-recursive-aggregate-concat
>>
>> concat!: (%, %) -> % if % has shallowlyMutable
>>     concat!(u, v) destructively concatenates v to the end of u. Note:
>> concat!(u, v) = setlast!(u, v).
>>
>> That makes only sense for me if u is nonempty. I think, it should be
>> explicitly written in the specification that "not empty? u" is required.
>> Otherwise the specification is wrong, no?
> 
> AFAICS the note should be deleted.  Or changed to
> 
>    Note: For nonempty u we have concat!(u, v) = setlast!(u, v).
> 
> But for me without the note documentation looks clearer.

Well, the note "concat!(u, v) = setlast!(u, v)" looks more like how the
function is implemented and should not be part of the specification, but
in view of "destructive" means "may change argument" I would rather like
something

https://github.com/pippijn/aldor/blob/master/aldor/lib/aldor/src/arith/sal_lincomb.as#L49


Thus I propose:

  concat!(u, v) concatenates v to the end of u.
  The storage used by u is allowed to be destroyed or reused,
  so u is lost after this call.

I don't like "destructively", because it sounds like "for sure there
will be some destruction". However, the exclamation mark at the end of a
name only means that the function "may change some arguments", but not
"it has to change an argument".

Just my 2 cents.

Ralf

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