Re: [Templates] Array of hashes or hash refs

[prev] [thread] [next] [Date index for 2004/09/24]

From: Harald Joerg
Subject: Re: [Templates] Array of hashes or hash refs
Date: 21:59 on 24 Sep 2004
Randal L. Schwartz admonishes:

 >>>>>>"Harald" == Harald Joerg <haj@xxxx.x.xxxxx.xx> writes:
 >
 > Harald>     $sut->process($filename
 > Harald>                  ,{'CSI'       => \%CSI
 > Harald>                   ,'array'     => \@array
 > Harald>                   }
 > Harald>                  );
 >
 > Aside - I do not understand the "put the joining punctuation at
 > the *beginning* of the next line" phenomenon.  It looks extremely
 > ugly and unmaintainable to me.

My apologies.  I seem to have adopted it without thinking from some
old C sources I'm currently working with.

In Cperl mode, Emacs' automatic indentation reminds me not to start
lines with a comma, but I often forget to activate Cperl mode when
writing mail ;-)

 > [...]
 >         ->process($filename,
 >                 $this => $that,
 >                 $one => $other,
 >                 $two => $three,
 >                 );
 >
 > I don't want to have to parse through some punctuation to get to
 > what each line needs.  It looks like a lot of extra work if you want
 > to swap lines as well.

Hm.  I can't see a lot of work with swapping lines either way.  The
first line of each structural level needs special attention, all other
lines can be swapped as they are, regardless of where the comma is.

 > Larry told Perl to permit optional trailing punctuation for precisely
 > this reason.  Use it!

Ah - I see.  If trailing punctuation isn't permitted for the last
element of a list, then swapping lines needs special attention for the
*last* element as well.  This might be a reason why some C programmer
thought that leading punctuation is a good idea.

So it is all Larry's fault: If Larry would have taken care to permit
optional trailing punctuation in C as well, then perhaps noone would
ever have started to use leading punctuation, and I would not have
adopted it without thinking....

Maybe I'm getting into less trouble on this list if I praise Larry
instead, for creating the only programming language which permits
trailing punctuation, so that lines can be swapped easily without
resorting to ugly syntax?
        -- 
        Prosit,
haj


_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates

[Templates] Array of hashes or hash refs
Roderick A. Anderson 23:39 on 23 Sep 2004

Re: [Templates] Array of hashes or hash refs
Axel Gerstmair 09:25 on 24 Sep 2004

Re: [Templates] Array of hashes or hash refs
Harald Joerg 09:54 on 24 Sep 2004

Re: [Templates] Array of hashes or hash refs
merlyn (Randal L. Schwartz) 12:09 on 24 Sep 2004

Re: [Templates] Array of hashes or hash refs
Harald Joerg 21:59 on 24 Sep 2004

Re: [Templates] Array of hashes or hash refs
Roderick A. Anderson 19:43 on 24 Sep 2004

Generated at 08:56 on 15 Mar 2005 by mariachi v0.52