Brent 'Dax' Royal-Gordon skribis 2004-04-16  0:25 (-0700):
> Number of keystrokes isn't our only concern here.  This is Perl, not 
> APL--we care about the size of the language and its intuitiveness too. 
> (Perhaps not much, but we do.)

Not the only concern, but to me, it is as important as readability.

> I don't like %hash{'foo'} because it's ugly.  I don't like %hash<<foo>> 
> because it's ugly and adds syntax.  I don't like %hash`foo because it's 
> ugly, adds syntax, and looks nothing like an indexing operator.  (I'll 
> revisit this third point soon.)  I think it will be easier to fix 
> %hash{'foo'} or %hash<<foo>> than %hash`foo.

I have no doubt that between fixing existing things to make them nice
enough to use very, very often and just implementing %hash`foo, the
latter is by far the easiest to do.

> It's also worth noting that, except for Javascript, every language I can 
> think of uses paired characters for indexing.  Perl 5 uses {} and []; 
> the C-like languages I know use []; Visual Basic (ugh) uses ().

Template toolkit uses a . for methods, indexes and keys. It's great for
indexes. It's not so great for keys when there is a key that has the
same name as one of the virtual methods.

Also, other languages are irrelevant, except for inspiration.

Perl 6 mustn't be a copy of existing languages. It must be BETTER.

I thought that to make Perl a better language than all the other
languages, we were supposed to be open minded about new ideas. But
instead, many of the perl6-language subscribers keep referring to
existing non-Perl-6 languages.

> >I dislike XML and HTML because they're a lot of typing (not only because
> >of the redundancy in the closing tags).
> I'd be inclined to agree with you.  But we're talking about *one* 
> *extra* *character* here.  That's two keys.  It's hardly the end of the 
> world.

One extra character, two keys. EACH time. Still indeed not really a very
big problem. However, bracketing operators are very heavy, visually.
Unconsciously, you're matching them, counting them, seeing them.

But do note: I think %foo{EXPR} and %foo<<WORDS>> are perlfect and can stay
if %foo`key is implemented. I am not suggesting removing or changing {}
and <<>>. (Although I wouldn't mind seeing <<>> go.)

> "If the inside of a hash indexer consists entirely of \w characters, it 
> will be interpreted as the name of a hash key.  If you want it to call a 
> subroutine instead, add a ~ stringifying operator to the beginning of 
> the call, or a pair of parentheses to the end of it."  Simple, clear, 
> and doesn't shift around based on subroutine definitions.  (It's not 
> what Perl 5 does, but that's Perl 5's fault.)

That looks to me like exactly what Perl 5 does, except you use ~ instead
of +.

> It looks better to me and doesn't add any syntax.

It adds one hell of an ugly special case for the :pair syntax.

> To make my position clear:  WE DO NOT NEED THREE WAYS TO INDEX A HASH. 

We don't even NEED two!

We don't need convenient aliasses in regexes.

We don't need threads.

We don't need lexical variables.

We don't need junctions.

We don't need any dwimmery.

But please, let's write Perl 6 instead of another Java-wannabe.

We don't NEED anything except zeroes and ones.

But all these nice features are damn nice to have!

> I don't really think we need two.  All we really need is one way with a 
> good enough syntax to meet all of our needs.

Or three syntaxes of which you can choose, depending on what you mean
and like to write.

I thought Perl minded people were used to TIMTOWTDI, but I'm proven
wrong once again.


Juerd

Reply via email to