Re: [RFC] Perl6 Operator List, Take 5

2002-11-02 Thread Philippe 'BooK' Bruhat
On Thu, 31 Oct 2002, Damian Conway wrote:

 Larry mused:

  Of course, Real Mathematicians will want [1..10) and (1..10] instead.
 

 Forgive me but is this syntax really necessary.
 Does it buy us enough over +1 and -1?

And for what it's worth, Real Mathematicians do not use open intervals for
integers!

(Sorry for the late post, but p6l is always 200 messages ahead of me)

-- 
 Philippe BooK Bruhat

 One lesson learned is never enough.
   (Moral from Groo The Wanderer #104 (Epic))





Re: vectorization (union and intersection operators)

2002-11-02 Thread Philippe 'BooK' Bruhat
On Fri, 1 Nov 2002, Ed Peschko wrote:

 I'm probably opening up a whole new can of worms here, but if we said
 that the following were both vector operators:

   ^ == intersection operator
   v == union operator

 then these could have potentially useful meanings on their *own* as set
 operators, as well as modifying other operators. For example:

 a = (1,2,3);
 b = (4,1,3);

 a = a ^ b; # a = (1,3);
 a = a v b; # a = (1,2,3,4);

Or is a = (1,2,3,4,1,3) ?

So what happens with:

 a = (1, 2, 3, 3);
 b = (4, 3, 1, 3);

 a = a ^ b; # a = (1,3) ? a = (1, 3, 3) ? element order?
 a = a v b, # a = (1, 2, 3, 4) ? a = (1, 2, 3, 4, 4, 4, 1, 3) ?

Does the operand order change something?

The element order is significant in arrays, but not in hashes. And with
hashes, each key is unique. For a hash, these operators should be simpler.

 %a = ( 1 = 'a', 2 = 'b', 3 = 'c' );
 %b = ( 4 = 'A', 1 = 'B', 3 = 'C' );

And the operand order could be used to apply a keep the values from the
left-hand side hash rule:

 %a = %a ^ %b; # %a = (1 = 'a', 3 = 'c')
 %a = %b ^ %a; # %a = (1 = 'B', 3 = 'C')
 %a = %a v %b; # %a = (1 = 'a', 2 = 'b', 3 = 'c', 4 = 'A')
 %a = %b v %a; # %a = (1 = 'B', 2 = 'b', 3 = 'C', 4 = 'A')


(And notice how I avoided answering my own questions about arrays by
swiftly speaking of hashes... ;-)

-- 
 Philippe BooK Bruhat

 Few things in life are so dependable as the incompetence of those who know
 precisely what they are doing.   (Moral from Groo The Wanderer #5 (Pacific))




Re: Learning curve (was Re: Perl6 Operator List)

2002-10-26 Thread Philippe 'BooK' Bruhat
On Sat, 26 Oct 2002, Michael Lazzaro wrote:

 So lets have _lots_ of operators, and _lots_ of two-to-four-letter
 barewords, so long as they each do something Big, or something
 Universal.  And let's locale-ize them, so that non-english-speakers can
 use 'umu' to mean 'bool', etc.  Hey, why the heck not?

Why not? Here is my opinion about localized programming languages.

As a non-native English speaker, I like it very much that I *don't* have
the possibility to write:

   afficher pour tableau;# note I used functions that map
   mon uaelbat = retourner tableau; # to single words in French ;-)

And I suspect my non-native French speaker readers like it very much too.

I suppose it's very doable to have a FrenchPerl6 editor/parser/whatever
that makes most of this transparent, but the thing I like the most about
programming languages it that their are foreign languages.

And since most of them are based on English, they are just twice as
foreign to me. So when I program, I can concentrate on what the syntax of
the programming langage accepts, rather than on the sentences I could
write if I were using a subset of French.

And imagine the pain for all those programmer that do not speak very well
their own mother tongue... Should I use effacer, efacer, éfasser
when I want to remove a file? With programming languages as there are
today, I just have to learn a new word (unlink), and this won't mess my
already messy understanding of my own language (pity the one who will read
the comments and documentation, though).

I admit that knowing a little English can be helpful to guess a function
name here and there, though. ;-)

Also, remember Microsoft moved back specifically on that topic with the
Excel and Word macro-language some years ago.

Naturally, this has nothing to do with naming your variables as you like
(even Unicode and stuff); variables are another matter entirely.

Don't misunderstand me, I love the fact that Perl works like a natural
language. It's just that I also understand the fact that it's its own
natural (English-looking) language, and not a subset of English.

-- BooK


PS: I have troubles explaining this view in French as well; please forgive
me if I didn't make much sense in English either.

-- 
 Philippe BooK Bruhat

 When you run from your problem, you make it that much harder for good
 fortune to catch you, as well. (Moral from Groo The Wanderer #14 (Epic))