develooper Front page | perl.perl6.language | Postings from September 2000

Re: RFC 179 (v1) More functions from set theory to manipulate arrays

Thread Previous | Thread Next
From:
Gael Pegliasco
Date:
September 1, 2000 06:40
Subject:
Re: RFC 179 (v1) More functions from set theory to manipulate arrays
Message ID:
39AFB1BC.859E77DA@telecorporate.com
> 
>     Arrays are ordered.
>     Hashes are not.
>     Neither are sets.
> 
>     Arrays can have repetitions.
>     Hashes can not.
>     Neither can sets.
> 
> etc.
> 
> --tom


Yes, this is true, but the natural syntax, for me, to manipulate sets,
is the one of arrays.

It is not natural to write :

%my_fruit_set = ( 1 => 'orange', 2 => 'lemon' );

but it is natural to write :

@my_fruit_set = ( 'orange', 'lemon' );

I don't want to have to deal with keys of hashes because my set elements
don't care about them !

so, I want new functions to manipulate arrays.

then, when manipulating arrays, without speaking about sets, you often
need in/union/intersection functions, even if arrays have duplicated
elements or if they are ordered.

Well, in fact I don't understand why you don't think that
union/intersection/difference are not usefull functions for arrays ?

Gael,

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About