[33078] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4354 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 23 09:09:18 2015

Date: Fri, 23 Jan 2015 06:09:03 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 23 Jan 2015     Volume: 11 Number: 4354

Today's topics:
        I am trying to find the programmer that wrote the Perl  gnewton574@gmail.com
    Re: I am trying to find the programmer that wrote the P <gravitalsun@hotmail.foo>
    Re: I am trying to find the programmer that wrote the P gnewton574@gmail.com
    Re: I am trying to find the programmer that wrote the P <gravitalsun@hotmail.foo>
    Re: What is ++ operation <gravitalsun@hotmail.foo>
    Re: What is ++ operation <jblack@nospam.com>
    Re: What is ++ operation <rweikusat@mobileactivedefense.com>
    Re: What is ++ operation <news@todbe.com>
    Re: What is ++ operation (Tim McDaniel)
    Re: What is ++ operation <rweikusat@mobileactivedefense.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 22 Jan 2015 02:01:27 -0800 (PST)
From: gnewton574@gmail.com
Subject: I am trying to find the programmer that wrote the Perl scripts for QuizPlease in about 1997.
Message-Id: <e9de4ef2-a8a7-4974-889d-be4164d3b47b@googlegroups.com>

The client company was Moneytree Software.
Please contact me.


------------------------------

Date: Thu, 22 Jan 2015 14:06:30 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: I am trying to find the programmer that wrote the Perl scripts for QuizPlease in about 1997.
Message-Id: <m9qp37$1j04$1@news.ntua.gr>

On 22/1/2015 12:01, gnewton574@gmail.com wrote:
> Moneytree Software.


Usually people place their name at the top comment lines
After all it is Perl, how difficult could be to re-engineering them ?!


------------------------------

Date: Thu, 22 Jan 2015 13:28:28 -0800 (PST)
From: gnewton574@gmail.com
Subject: Re: I am trying to find the programmer that wrote the Perl scripts for QuizPlease in about 1997.
Message-Id: <43f43bcb-e966-401d-845d-a2cfb28dd59e@googlegroups.com>

On Thursday, January 22, 2015 at 3:06:06 AM UTC-9, George Mpouras wrote:
> On 22/1/2015 12:01, gnewton574@gmail.com wrote:
> > Moneytree Software.
> 
> 
> Usually people place their name at the top comment lines
> After all it is Perl, how difficult could be to re-engineering them ?!

No name on this one.  


------------------------------

Date: Fri, 23 Jan 2015 00:19:17 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: I am trying to find the programmer that wrote the Perl scripts for QuizPlease in about 1997.
Message-Id: <m9rt1j$ndc$1@mouse.otenet.gr>

On 22/1/2015 11:28 μμ, gnewton574@gmail.com wrote:
> On Thursday, January 22, 2015 at 3:06:06 AM UTC-9, George Mpouras wrote:
>> On 22/1/2015 12:01, gnewton574@gmail.com wrote:
>>> Moneytree Software.
>>
>>
>> Usually people place their name at the top comment lines
>> After all it is Perl, how difficult could be to re-engineering them ?!
>
> No name on this one.
>

so, the situation is clear


------------------------------

Date: Wed, 21 Jan 2015 23:55:11 +0200
From: George Mpouras <gravitalsun@hotmail.foo>
Subject: Re: What is ++ operation
Message-Id: <m9p78b$sei$1@mouse.otenet.gr>

On 16/1/2015 6:09 πμ, Paul Gekakis wrote:
> thanks
>

if you are still here, where did see the "++" ; at numerical operations 
or at string regular expressions ?


------------------------------

Date: Wed, 21 Jan 2015 16:25:40 -0600
From: John Black <jblack@nospam.com>
Subject: Re: What is ++ operation
Message-Id: <MPG.2f29e36382b3964098980f@news.eternal-september.org>

In article <87ppa7lvmx.fsf@doppelsaurus.mobileactivedefense.com>, 
rweikusat@mobileactivedefense.com says...
> > But if the value is discarded, as it is in this example, pre-increment
> > and post-increment are effectively identical.
> 
> Surely, but if the result is discarded, anyway, what's the point in
> using an operator preserving the old value?

The point is that $l++ looks better (IMO of course) because you don't have two plus signs 
butted up against a dollar sign.  So if you are not using the value, then you might as well 
go with the one that you prefer since they do exactly the same thing.

John Black


------------------------------

Date: Wed, 21 Jan 2015 22:43:54 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: What is ++ operation
Message-Id: <87lhkvlpp1.fsf@doppelsaurus.mobileactivedefense.com>

John Black <jblack@nospam.com> writes:
> In article <87ppa7lvmx.fsf@doppelsaurus.mobileactivedefense.com>, 
> rweikusat@mobileactivedefense.com says...
>> > But if the value is discarded, as it is in this example, pre-increment
>> > and post-increment are effectively identical.
>> 
>> Surely, but if the result is discarded, anyway, what's the point in
>> using an operator preserving the old value?
>
> The point is that $l++ looks better (IMO of course) because you don't have two plus signs 
> butted up against a dollar sign.

I'm totally aware that "it looks better" because "that's how it has
always been done since nineteen-seventy-something[*]" and I am actually
arguing in favor of changing this habit: All other arithmetic
expressions return the value computed by them, only postdecrement and
-increment-expressions don't. Hence, unless this property is exploited
for something, don't use them, since they're "weird and special".

[*] Some years ago, I read one of the many "your writing style has to
match my intellectual laziness, otherwise, you suck" (and I'll hit you
since I'm The Big Guy and you're The Insignificant Insect) which
demanded that the return value of ++ must not be used because "if I need
to understand the difference between ++a and a++ to understand your
code, it's too complicated". And I strongly suspect this to be the 'the
real postincrement motiviation' in many practical cases ...


------------------------------

Date: Wed, 21 Jan 2015 16:33:59 -0800
From: "$Bill" <news@todbe.com>
Subject: Re: What is ++ operation
Message-Id: <m9pggr$koh$1@dont-email.me>

On 1/21/2015 14:43, Rainer Weikusat wrote:
> John Black <jblack@nospam.com> writes:
>>
>> The point is that $l++ looks better (IMO of course) because you don't have two plus signs
>> butted up against a dollar sign.
>
> I'm totally aware that "it looks better" because "that's how it has
> always been done since nineteen-seventy-something[*]" and I am actually
> arguing in favor of changing this habit: All other arithmetic
> expressions return the value computed by them, only postdecrement and
> -increment-expressions don't. Hence, unless this property is exploited
> for something, don't use them, since they're "weird and special".
>
> [*] Some years ago, I read one of the many "your writing style has to
> match my intellectual laziness, otherwise, you suck" (and I'll hit you
> since I'm The Big Guy and you're The Insignificant Insect) which
> demanded that the return value of ++ must not be used because "if I need
> to understand the difference between ++a and a++ to understand your
> code, it's too complicated". And I strongly suspect this to be the 'the
> real postincrement motiviation' in many practical cases ...

I used to always use $x++, but since realizing ++$xx is more efficient, I started
using it that way.  $x++ has to do the extra hassle of saving the orig value and
doing the increment whereas ++$x can just inc and return the new value making
it more efficient (I assume. since I haven't looked at the actual source code).


------------------------------

Date: Thu, 22 Jan 2015 05:19:02 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: What is ++ operation
Message-Id: <m9q186$mu4$1@reader1.panix.com>

In article <MPG.2f29e36382b3964098980f@news.eternal-september.org>,
John Black  <jblack@nospam.com> wrote:
>The point is that $l++ looks better (IMO of course) because you don't
>have two plus signs butted up against a dollar sign.

I prefer    ++$l    because it make the increment operator more visible,
even considering that it's against a $.  In languages with ++ or --
and no sigils (/^C/), I like    ++i   even more.

-- 
Tim McDaniel, tmcd@panix.com


------------------------------

Date: Thu, 22 Jan 2015 14:57:06 +0000
From: Rainer Weikusat <rweikusat@mobileactivedefense.com>
Subject: Re: What is ++ operation
Message-Id: <87lhku983h.fsf@doppelsaurus.mobileactivedefense.com>

"$Bill" <news@todbe.com> writes:
> On 1/21/2015 14:43, Rainer Weikusat wrote:
>> John Black <jblack@nospam.com> writes:

[++$i vs $i++]

>> All other arithmetic expressions return the value computed by them,
>> only postdecrement and -increment-expressions don't. Hence, unless
>> this property is exploited for something, don't use them, since
>> they're "weird and special".

[...]

> I used to always use $x++, but since realizing ++$xx is more efficient, I started
> using it that way.  $x++ has to do the extra hassle of saving the orig value and
> doing the increment

In theory, this is correct and the difference is actually measurable
provided the return value is not discarded. But "it's slower" is
considered to be a much better argument than "logically, it doesn't make
any sense" since it affects the machine and not
$random_guy_whose_problems_are_not_mine, hence

--------
my $a;

sub pre
{
    ++$a;
    1;
}

sub post
{
    $a++;
    1;
}
--------

which is translated to (5.14.2)

[rw@doppelsaurus]/tmp#perl -MO=Concise,pre a.pl
main::pre:
6  <1> leavesub[1 ref] K/REFC,1 ->(end)
-     <@> lineseq KP ->6
1        <;> nextstate(main 2 a.pl:5) v ->2
3        <1> preinc vK/1 ->4
2           <0> padsv[$a:FAKE:] sRM ->3
4        <;> nextstate(main 2 a.pl:6) v ->5
5        <$> const[IV 1] s ->6

and

[rw@doppelsaurus]/tmp#perl -MO=Concise,post a.pl
main::post:
6  <1> leavesub[1 ref] K/REFC,1 ->(end)
-     <@> lineseq KP ->6
1        <;> nextstate(main 3 a.pl:11) v ->2
3        <1> preinc[t2] vK/1 ->4
2           <0> padsv[$a:FAKE:] sRM ->3
4        <;> nextstate(main 3 a.pl:12) v ->5
5        <$> const[IV 1] s ->6

This is what people usually mean when referring to 'compiler
optimization' :->.


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 4354
***************************************


home help back first fref pref prev next nref lref last post