Yo !

>> You should test if "args in self" first. If your poset contains an
>> element named E=(x,y) and you want to compute join( E ) (which should
>> return E) then you raise an exception.
>
> I disagree.
>
> If you want to obtain the join of a single element E, you can use
> foo([E]), foo((E,)), or foo({E}), or any iterable that contains just E.
> This works even if such an iterable is an element of the poset.

To be honest I do not care much about the join(a,b,c) syntax. Jori asked
about that, and he also wanted the function to work with empty lists,
one-element lists, and arbitrarily long lists.

I believe that supporting empty sets and sets of cardinality 1 has its
value. If supporting both join([a,b,c]) and join(a,b,c) is going to start
another war, no problem for me --> let's only support join([a,b,c])

I would be glad to see the same kind of fighting spirit when we talk of
"Permutation":

sage: Permutation((1,2,3))(1)
2
sage: Permutation([1,2,3])(1)
1

That's way more dangerous than the slight inconsistency that could happen
(only when using join(a,b,c) *and not join([a,b,c])*) on some poset with
very specific elements.

> Without "args in self" things are just simpler. If you give one
> argument, you know that it will be interpreted as an iterable of
> elements. If you give some other number of arguments, you know that
> these arguments will be interpreted as elements.

Hmmm... There I really believe that the syntax with a set of size 1 should
be allowed. This is exactly what "gcd" does, and its role is precisely to
compute the join of elements in a specific poset:

sage: gcd([5])
5
sage: gcd([5,7])
1

It may be useful if some applications I guess. And join([]), too.

> Finally there is a bug when you add "args in self": Suppose that have
> added "args in self" and called the new function foo'. Suppose
> furthermore that you have a (facade) poset with elements x, y, and
> E=(x,y). Now foo'(x,y) has args==(x,y)==E and therefore returns E
> regardless of the order in the poset, which is not what is wanted from
> foo'(x,y).

Indeed, indeed, this is where the possible inconsistency is. If you think
that is a problem let's only keep join([....]).

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to