HaloO,
Larry Wall wrote:
Then [X]() also is ()? How about (0,1) X ([]) === (0,1)?
No, that's (0,[]), (1,[1]). [] *doesn't* flatten in list context.
I guess you meant (0,[]), (1,[]). And you didn't answer what
[X]() returns. Following your arguments this would be undef.
I am genuinely cur
Doug McNutt douglist-at-macnauchtan.com |Perl 6| wrote:
At 09:58 -0700 4/14/08, Larry Wall wrote:
By the way, you don't need to put parens around the arguments to X. It takes a
list on either side. We made it tall so that it would stand out visually
anyway:
$a,$b,$c X $x,$y,$z
H
On Mon, Apr 14, 2008 at 11:47:04AM -0600, Doug McNutt wrote:
: At 09:58 -0700 4/14/08, Larry Wall wrote:
: >By the way, you don't need to put parens around the arguments to X. It takes
a list on either side. We made it tall so that it would stand out visually
anyway:
: >
: >$a,$b,$c X $x,$y,
At 09:58 -0700 4/14/08, Larry Wall wrote:
>By the way, you don't need to put parens around the arguments to X. It takes a
>list on either side. We made it tall so that it would stand out visually
>anyway:
>
>$a,$b,$c X $x,$y,$z
How long before some engineer or 3D graphic artist gets really
On Mon, Apr 14, 2008 at 06:28:06PM +0200, TSa wrote:
> The original question was sort of about how to write a list
> that has .elems == 1 but "no" content.
Wouldn't that just be [[]] ?
Mark J. Reed <[EMAIL PROTECTED]>
On Mon, Apr 14, 2008 at 06:28:06PM +0200, TSa wrote:
> HaloO,
>
> Larry Wall wrote:
>> No, the inner () is also in list context, and () in list context
>> always just disappears.
>>
>> And 0,1 X () is going to be (). Perl 6's infix: is defined over
>> lists, not sets. If you want to overload X fo
HaloO,
I wrote:
Then [X]() also is ()? How about (0,1) X ([]) === (0,1)?
The original question was sort of about how to write a list
that has .elems == 1 but "no" content.
Other ideas are: [[]] and @@() with the latter not very likely
because it implies any multidimensional array somehow havin
HaloO,
Larry Wall wrote:
No, the inner () is also in list context, and () in list context
always just disappears.
And 0,1 X () is going to be (). Perl 6's infix: is defined over
lists, not sets. If you want to overload X for set types, you may.
Then [X]() also is ()? How about (0,1) X ([])
On Mon, Apr 14, 2008 at 12:05:15PM +0200, TSa wrote:
> But X is cooperating with , in Perl 6:
>
> (0,1) X (()) === ((0,()),(1,())) === (0,1)
>
> That is, X strips the outer list and comma concatenates the
> inner empty list away.
No, the inner () is also in list context, and () in list context
a
On Apr 14, 2008, at 12:05 , TSa wrote:
HaloO,
Xavier Noria wrote:
{0, 1} X {{}} = {(0, {}), (1, {})}
which, you see, is different from {0, 1}. They have different
elements. The fact that there's a clear mapping that sort of
identifies them has nothing to do with set equality.
But X is
HaloO,
Xavier Noria wrote:
{0, 1} X {{}} = {(0, {}), (1, {})}
which, you see, is different from {0, 1}. They have different elements.
The fact that there's a clear mapping that sort of identifies them has
nothing to do with set equality.
But X is cooperating with , in Perl 6:
(0,1) X
>-Original Message-
>From: Mark A. Biggar [mailto:[EMAIL PROTECTED]
>Sent: Sunday, April 13, 2008 11:22 PM
>To: Miller, Hugh
>Cc: Moritz Lenz; p6l
>Subject: Re: cross operator and empty list
>
>Miller, Hugh wrote:
>>> From: Moritz Lenz [mailto:[EMAI
On Apr 12, 2008, at 17:37 , Moritz Lenz wrote:
[EMAIL PROTECTED] wrote:
Technically the Cartesian cross operator doesn't have an identity
value.
It has.
The set which contains only the emty set, or in perl terms ([]);
If (a, b) denotes an ordered pair you get
{0, 1} X {{}} = {(0, {}),
Miller, Hugh wrote:
From: Moritz Lenz [mailto:[EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
Technically the Cartesian cross operator doesn't have an
identity value.
It has.
The set which contains only the emty set, or in perl terms ([]);
Or am I missing something?
Should be a (any) 1 point set fo
>-Original Message-
>From: Moritz Lenz [mailto:[EMAIL PROTECTED]
>Sent: Saturday, April 12, 2008 10:37 AM
>To: [EMAIL PROTECTED]
>Cc: p6l
>Subject: Re: cross operator and empty list
>
>[EMAIL PROTECTED] wrote:
>> Technically the Cartesian cross operator do
[EMAIL PROTECTED] wrote:
> Technically the Cartesian cross operator doesn't have an identity value.
It has.
The set which contains only the emty set, or in perl terms ([]);
Or am I missing something?
Cheers,
Moritz
--
Moritz Lenz
http://moritz.faui2k3.org/ | http://perl-6.de/
signature.asc
[EMAIL PROTECTED] wrote:
Technically the Cartesian cross operator doesn't have an identity value. There is no set X such that
A x X = A. Now any singleton set gives a result that is naturally isomorphic to the original set, I.e, there is a obvious bijection between the two sets, but they are no
Technically the Cartesian cross operator doesn't have an identity value. There
is no set X such that
A x X = A. Now any singleton set gives a result that is naturally isomorphic
to the original set, I.e, there is a obvious bijection between the two sets,
but they are not equal sets.
--
Mark
Adriano, I think perhaps what Tsa is trying to get at is the identity value
for the X operator, and I believe I know what it is.
In the relational model of data, both the version of the model where tuples
have unordered named attributes/elements (which I prefer), and the version
where tuples h
On Mon, Apr 7, 2008 at 4:50 AM, TSa <[EMAIL PROTECTED]> wrote:
> HaloO,
>
>
> Larry Wall wrote:
>
> >(@a X @b X @c).elems == @a.elems * @b.elems * @c.elems
> >
>
> Sorry, I was aiming at defining a neutral element of the X
> operator.
A neutral element for the cross operator seems weird if
HaloO,
Larry Wall wrote:
(@a X @b X @c).elems == @a.elems * @b.elems * @c.elems
Sorry, I was aiming at defining a neutral element of the X
operator. In cartesian products of sets this is achieved
by having a set that contains as sole member the empty tuple.
So how would that be written? ((
Cartesian product of anything with the empty set is empty. Which is
why SQL has outer joins.
On 4/4/08, TSa <[EMAIL PROTECTED]> wrote:
> HaloO,
>
> why is (1,2,3) X () defined to be the empty list
> and not (1,2,3) as is the case with the cartesian
> product of sets which X basically is with pre
On Fri, Apr 04, 2008 at 06:51:20PM +0200, TSa wrote:
> HaloO,
>
> why is (1,2,3) X () defined to be the empty list
> and not (1,2,3) as is the case with the cartesian
> product of sets which X basically is with preserved
> order.
(@a X @b X @c).elems == @a.elems * @b.elems * @c.elems
Larry
Cartesain product with the empty set is empty. A x B is the set of all pairs
(a,b) where a is in A and b is in B. If either is empty then there are no such
pairs and the result is also empty.
--
Mark Biggar
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]
-- Original message
24 matches
Mail list logo