Re: AW: AW: AW: AW: nag Exegesis 2

2003-01-08 Thread Damian Conway
Murat Ünalan wrote:


Then i could pray to the god of the camel herdsman, that

  my DNA human size(4) ($alpha, $beta,  $gamma, $delta) 
 = ('atgc', 'ctga', 'aatt', 'ccaa');

may be activated through perl6 custom parser options 8-)

*Any* consistent syntax may be activated through perl6 custom parser options.
Whether it *should* be is, of course, another matter entirely. ;-)



I have a german background.


BTW, I wasn't criticizing your English. Someone who's German is as poor as mine
doesn't have the right. ;-)



But my litte english-vs-perl6 example sounds
not so odd to me (what doesn't mean to much):

  my aged uncles ( john, james, jim, tony ) are 
 ( 102,  99,88,  79   ) 

That's perfect English. But not necessarily good programming language design.
		


Thanks for your patience with me,


It's not a matter of patience. You raise important issues (which I very much
appreciate), and it's my job -- and my desire -- to address them.

Damian





Re: AW: nag Exegesis 2

2003-01-04 Thread Luke Palmer
 From: =?iso-8859-1?Q?Murat_=DCnalan?= [EMAIL PROTECTED]
 Date: Sat, 4 Jan 2003 14:50:22 +0100
 
my int ($pre, $in, $post) is constant = (0..2);
   
   Two things type and property that belong so together
  
  Do they? Surely the type and constancy of a variable are 
  entirely orthogonal to each other.
 
 Oh yes. Psycho-affectivly it is disturbing seeing the group of variables
 ($pre, $in, $post) teared apart from the initilizing (0..2). This is my
 second step in the brain when analysing it. And this is prone to
 problems like in:
 
  my int ($one, $two, $three, $four, $five, $six, $seven ) is Prop(
 'camel', 'perl', 'camel', 'perl' ) = (0..6);
 
 where the distance grows with property-syntax-complexity.

In Perl 5,

  my int ($one = 0, $two = 1, $three = 2);

is a fatal error.  I could argue for this to change, as to support
better readability (and it would).  It's obvious WIM, so why doesn't
it DWIM  (disclaimer: cannot be used as an argument for arbitrary
features. Is not a slogan.  I repeat, is not a slogan.  :)  ?

If you say that:

  my int ($one = 0, $two = 1, $three = 2) is constant;

is seperating related parts, I disagree.  I don't think Cconstant
has anything to do with Cint.  Like Damian said, they're orthogonal
concepts.

 Suggestion: it could be pieced to
 
  my constant int ($pre, $in, $post ) = (0..2);

 which i guess is far superior (of course i hadn't done any field testing
 and making statistics over it). 

It's not far superior.  It's pretending like Cconstant is part of
the type, which it isn't.

 Btw: it is self-explanatory for many cross-language-programmers.

Yes, but

  my int $foo is constant;

Is self-explanatory for many language-speakers.  If I recall, the set
of cross-language-programmers is a proper subset of the set of
language-speakers.  It is clear which is clearer :).

 Excerpt: Ony of my fears orginate from the idea that someone new to
 perl6 could be put off by such hard nuts during the very basics of
 variable decleration.

What hard nuts?  p6d is working on a fine nutcracker, in any case.

Luke



Re: AW: nag Exegesis 2

2003-01-04 Thread Joseph F. Ryan
Luke Palmer wrote:

 In Perl 5,
 
   my int ($one = 0, $two = 1, $three = 2);
 
 is a fatal error.  I could argue for this to change, as to support
 better readability (and it would).  It's obvious WIM, so why doesn't
 it DWIM  (disclaimer: cannot be used as an argument for arbitrary
 features. Is not a slogan.  I repeat, is not a slogan.  :)  ?


The problem is that this couldn't work given the current semantics of
the assignment operator.  The return-value of an assignment is the
lhs of the assignment, so

  my int ($one = 0, $two = 1, $three = 2);

ends up becoming:

  my int (0,1,2);
  
Which, of course, is a fatal error (partly because it doesn't make any
sense).  This is why stuff like:

  if (defined ($child = fork)) {
  
  }
  
Works as expected.

The point that I am trying to get at is: just because it is obvious
WIM to a human reader doesn't mean that it will be easy for a compiler
to figure out, especially when the rest of the language works a
different way.  List assignment is much easier to read anyways.


Joseph F. Ryan
[EMAIL PROTECTED]

This message was sent using the Webmail System hosted by OARDC Computing Services  -- 
http://webmail.oardc.ohio-state.edu:8080



Re: AW: nag Exegesis 2

2003-01-04 Thread Damian Conway
Murat Ünalan wrote:


Oh yes. Psycho-affectivly it is disturbing seeing the group of variables
($pre, $in, $post) teared apart from the initilizing (0..2). This is my
second step in the brain when analysing it. And this is prone to
problems like in:

 my int ($one, $two, $three, $four, $five, $six, $seven ) is Prop(
'camel', 'perl', 'camel', 'perl' ) = (0..6);

where the distance grows with property-syntax-complexity.


Oh, *that's* what you're concerned about?
Then you're just not thinking in enough simultaneous dimensions:


	my int ($pre, $in, $post) is constant
 = (0,1,   2);

or even:

	my int ($one,$two,   $three,  $four,  $five,  $six,  $seven )
is Prop('camel', 'perl', 'camel', 'perl')
 = (0,   1,  2,   3,  4,  5, 6  );


However, I have to say that I consider it a questionable practice to
declare multiple constants in a single statement. Which makes much of
this discussion moot from my point of view.

Damian





AW: AW: nag Exegesis 2

2003-01-04 Thread Murat Ünalan
  where the distance grows with property-syntax-complexity.
 
 Oh, *that's* what you're concerned about?
 Then you're just not thinking in enough simultaneous dimensions:
 
 
   my int ($pre, $in, $post) is constant
   = (0,1,   2);

This could been written faster in a single line, without decorating with
extra newline+tab+tab+tab+tab:

 my constant int ($pre, $in, $post) = ( 0, 1, 2 );

 
 or even:
 
   my int ($one,$two,   $three,  $four,  $five,  $six, 
  $seven )
  is Prop('camel', 'perl', 'camel', 'perl' 
)
   = (0,   1,  2,   3,  4,  5, 
 6  );

dito.

 However, I have to say that I consider it a questionable 
 practice to declare multiple constants in a single statement. 
 Which makes much of this discussion moot from my point of view.

I intended to address property syntax in general (where constant is just
an example). So please don't proof me wrong with just taking a very
primitive example. My believe is to clear something fogged by syntax.
Back to natural reading:

 my wise uncles ( john, james, jim and tony ) are ( 42, 77, 32, 34
).

is a template for 

 my property type ($john, $james, $jim, $tony ) = ( 42, 77, 32, 34
);

could be in real world application for making statistics about average
age of webshop users:

 my Customer('WebShop') AGE ( $john, $james, $jim, $tony ) = ( 42, 77,
32, 34 );

Murat




AW: AW: nag Exegesis 2

2003-01-04 Thread Murat Ünalan
 Yes, but
 
   my int $foo is constant;
 
 Is self-explanatory for many language-speakers.  If I recall, 
 the set of cross-language-programmers is a proper subset of 
 the set of language-speakers.  It is clear which is clearer :).

You do proof by best case scenario. In my previous posting i showed
how this can become complicated to read when the list grows.

To language-speakers: Why isn't my example language-speaker conform:

 my wise uncles ( john, james, jim and tony ) are ( 42, 77, 32, 34
).

is a template for 

 my property type ($john, $james, $jim, $tony ) = ( 42, 77, 32, 34
);

could be in real world:

 my Application('Bricolage') USER ( $john, $james, $jim, $tony ) = (
'john camel', 'james content', 'jim parrot', 'tony perl' ;

Excerpt: why don't catch two mosquitos with one snatch... easy c++/java
and language-speaker migration.

Murat




Re: AW: AW: nag Exegesis 2

2003-01-04 Thread Damian Conway
Murat Ünalan wrote:


Then you're just not thinking in enough simultaneous dimensions:


	my int ($pre, $in, $post) is constant
  = (0,1,   2);

This could been written faster in a single line, without decorating with
extra newline+tab+tab+tab+tab:


It's source code. Four extra keystrokes is a negligible price to pay for the
clarity gained.




could be in real world application for making statistics about average
age of webshop users:

 my Customer('WebShop') AGE ( $john, $james, $jim, $tony ) = ( 42, 77,
32, 34 );


And that shows precisely why Perl 6 does it the other way. Prepending extended
properties like that makes the declaration almost unreadable. Because it
separates the properties from the variables they qualify. Expecially compared
with:

 my AGE ( $john, $james, $jim, $tony ) is Customer('WebShop')
  = ( 42,77, 32,   34);


Besides which, multiple variables like this are almost always exactly the
wrong solution. Especially for statistical applications.

You really want:

  my AGE %customers = ( John=42, James=77, Jum=32, Tony=34 );


Damian




AW: AW: AW: nag Exegesis 2

2003-01-04 Thread Murat Ünalan
 And that shows precisely why Perl 6 does it the other way. 
 Prepending extended properties like that makes the 
 declaration almost unreadable. Because it separates the 

I shoot in my own foot. My example was extremly bad. Give me a better
try:

(1)

 my size(4), human DNA ($alpha, $beta, $gamma, $delta ) = ( 'atgc',
'ctga', 'aatt', 'ccaa' );

is so perfect, vs

(2) 

 my DNA ($alpha, $beta, $gamma, $delta) is human, size(4) = ( 'atgc',
'ctga', 'aatt', 'ccaa' );

which is so prone to overlook the eucaryotic property during i.e.
debugging hassle. Why do code beautify (2) when (1) so crystal clear
without it. And (1) is so close to natural language. BTW: are multiple
properties separated with ',' ?

This was my last try, promise!

Murat






Re: AW: AW: AW: nag Exegesis 2

2003-01-04 Thread Damian Conway
Murat Ünalan wrote:


And that shows precisely why Perl 6 does it the other way. 
Prepending extended properties like that makes the 
declaration almost unreadable. Because it separates the 


I shoot in my own foot. My example was extremly bad. Give me a better
try:

(1)

 my size(4), human DNA ($alpha, $beta, $gamma, $delta ) = ( 'atgc',
'ctga', 'aatt', 'ccaa' );

is so perfect, vs

(2) 

 my DNA ($alpha, $beta, $gamma, $delta) is human, size(4) = ( 'atgc',
'ctga', 'aatt', 'ccaa' );

which is so prone to overlook the eucaryotic property during i.e.
debugging hassle. Why do code beautify (2) when (1) so crystal clear
without it. 

Because (1) *isn't* crystal clear. At least, not to me. And certainly
not as readable as:

  my DNA ($alpha, $beta,  $gamma, $delta) is human size(4)
   = ('atgc', 'ctga', 'aatt', 'ccaa');

or as useful as:

  my DNA %sequence is human size(4) =
  (alpha = 'atgc', beta = 'ctga', gamma = 'aatt', delta = 'ccaa'_;


And (1) is so close to natural language.

Perhaps to *your* natural language, but not to mine. :-)

And that's what it may come down to. Perhaps we just have to agree
to disagree on this question. You're not convincing me at all, and
I'm obviously not convincing you either.



BTW: are multiple properties separated with ',' ?


No. Whitespace or an Cis.

Damian





Re: AW: AW: AW: nag Exegesis 2

2003-01-04 Thread attriel
 (1)

  my size(4), human DNA ($alpha, $beta, $gamma, $delta ) = ( 'atgc',
 'ctga', 'aatt', 'ccaa' );

 is so perfect, vs

 (2)

  my DNA ($alpha, $beta, $gamma, $delta) is human, size(4) = ( 'atgc',
 'ctga', 'aatt', 'ccaa' );

If I were concerned about this, I would either do it the way Damian
suggests

my DNA ($alpha,  $beta,  $gamma, $delta) is human size(4)
=  ('atgc',  'ctga', 'aatt', 'ccaa');

Or I would just make it two lines:

my DNA ($alpha, $beta, $gamma, $delta) is human size(4);
($alpha, $beta, $gamma, $delta) = ('atgc', 'ctga', 'aatt', 'ccaa');

And then expect the compiler to do precisely the same thing.  The
benefit I find in the second case is that I can now move it somewhere
else and have separate declarations and initializations.


the example in (1) looks like it's beind declared as a size(4) , with
human and DNA being somehow modifiers on size(4) (admittedly, if
it were the stated style, people would be expected to understand it, but
it would still be counterintuitive, IMO)

--attriel