[29064] in Perl-Users-Digest
Perl-Users Digest, Issue: 308 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 5 11:14:16 2007
Date: Thu, 5 Apr 2007 08:14:08 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 5 Apr 2007 Volume: 11 Number: 308
Today's topics:
Re: perl OOP <bik.mido@tiscalinet.it>
Re: perl OOP <rs@474.at>
Re: perl OOP <bik.mido@tiscalinet.it>
Re: perl OOP <bik.mido@tiscalinet.it>
Re: perl OOP <bik.mido@tiscalinet.it>
Re: perl OOP <cwilbur@chromatico.net>
Re: Testing against a list of values ? <bik.mido@tiscalinet.it>
Re: Testing against a list of values ? <uri@stemsystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 05 Apr 2007 15:33:42 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl OOP
Message-Id: <hfu913pu671dtl6g6k3kp0kvm6jjrjh15h@4ax.com>
On Wed, 04 Apr 2007 20:12:35 -0700, Xiong Changnian
<please@nospam.net> wrote:
>More to the point, perhaps, do you think the distinction benefits OP?
In the long run, yes. The rationale being that passing *incorrect* is
of no benefit. It will be harder to correct later and in the meanwhile
it may have leaked elsewhere.
>Here is a fellow whose grasp of the English language is so poor that
>some replies were outright rude -- in essence, "come back when you learn
>English". I seriously doubt my post was of much help -- not because at
Not quite so IMHO. Any evidence?
>Is Perl truly the Swiss Army Chainsaw? Or is it the sacred katana in its
>rack on the shelf that none dare touch without the proper ritual -- it
>will cut anything but the taboos are so thick that in actuality, it cuts
>nothing?
Perl is the Swiss Army Sacred Katana!
>I started by thinking it was common courtesy to respond when someone
>criticized one of my posts. Now, I think it is only heaping fuel on the
>fire. Perhaps it's time for a Standard Disclaimer. {sigh}
You're free to do so, and we're all polite and all. So we may well
acknowledge we were wrong, if we actually were. Indeed, it's *also*
heaping fuel on fire. Necessarily!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 05 Apr 2007 16:00:51 +0200
From: Robert 'phaylon' Sedlacek <rs@474.at>
Subject: Re: perl OOP
Message-Id: <4615012d$0$23134$9b4e6d93@newsspool1.arcor-online.net>
Xiong Changnian wrote:
> You know *exactly* what the relationships are among the concepts "new",
> "object constructor", "used to make a new object", and "class method". I
> don't doubt it in the least. Do you truly think I don't have a good
> handle on this as well? Or do you just feel that you would not have
> phrased the matter as I did? Do you think I left a loophole that, with
> sufficient pushing, could be enlarged into a screwup?
Yes, everybody who knows how Perl OO works knows what you mean. But
that's a pretty small percentage of the world population. Also, this is
a group where many people who try to learn things read. Don't just think
about the OP, your making a public statement here. And to state that
"new" is defined as constructor is just wrong. You could say it is the
common best practice, that in 99.9% when you see "new," it's the
constructor, but that doesn't define it as such.
My problem is that these are the situations were in one year I'm going
to hear from someone that I have to use "new()" to construct a Perl object.
People believe what you say. People who aren't native speakers do that
even more. I'm a native-german speaker and have come to clearly see an
advantage to keep one's technical language straight, or at least to try to.
> More to the point, perhaps, do you think the distinction benefits OP?
> Here is a fellow whose grasp of the English language is so poor that
> some replies were outright rude -- in essence, "come back when you learn
> English". I seriously doubt my post was of much help -- not because at
> some later date, OP will insist that all object constructors must be
> named "new"; not even because the entire explanation may whiz over his
> head; but because OP probably read the first few replies and ran away,
> never to return.
That's a different issue. I personally think nothing of the above,
including the tale of the new(), will help him. Except he goes off to
learn english, which is always good, if not essential, for developers.
> Is Perl truly the Swiss Army Chainsaw? Or is it the sacred katana in its
> rack on the shelf that none dare touch without the proper ritual -- it
> will cut anything but the taboos are so thick that in actuality, it cuts
> nothing?
Why do people always start beating the cabal bush? And why do they
always start with it when someone said "You're wrong"? I guess in
today's world it's always easier to attack Perl and its community itself
rather than following an argument.
> I started by thinking it was common courtesy to respond when someone
> criticized one of my posts. Now, I think it is only heaping fuel on the
> fire. Perhaps it's time for a Standard Disclaimer. {sigh}
Responding doesn't matter, reacting does.
.phaylon
------------------------------
Date: Thu, 05 Apr 2007 16:18:50 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl OOP
Message-Id: <rv0a1358vl8pkej0fq41fivl1c0oqeins5@4ax.com>
On Thu, 05 Apr 2007 04:19:40 -0700, Xiong Changnian
<please@nospam.net> wrote:
>> My correction was for the benefit
>> of everyone who had read your post...
>
>Was it really? Because I'm starting to get the distinct impression that
Yes it was!
>a majority of posts to this group are made to trash the egos of other
>posters, without regard for topic or eventual clarity. Newcomers are
If you feel happier to think so, then please do.
>scathingly attacked for failure to read docs and others' posts are
>searched for the least deviation from convention, there to be pilloried
Really? Honestly saying that in connection with a post from Abigail,
sounds... err... well... humourous! Were it in answer to -say- me, it
may have made more sense, as a remark.
>and beaten to a pulp. This obsessive deconstruction serves nobody who
>seeks information.
Do not misunderstand the onthological category of those who seek
information with that of those who want to be spoonfed. Or do not even
have a clue.
>Now I remember why I departed the world of engineering, eventually to
>arrive in education. My students do not expect me to be 100% accurate
[snip]
>I still get the occasional engineering client. I have found that
>technical proficiency is not prized one-half so highly as clarity,
>courtesy, and fulfillment of the client's actual needs. I have never yet
>met a client who cares whether I am right about anything.
engineers...
: The trouble with engineers is that given the problem of knocking down
: a stack of 100 bricks, they will start at the top, and work all
: day removing them one at a time, while the mathematician will, after
: a momemt's thought, remove the bottom brick and be done with it.
: The "trouble" part, is having to brook the noise of the engineer
: boasting about how much harder he worked while one is trying to
: think about the next problem.
: - Bart Goddard in sci.math
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 05 Apr 2007 16:33:26 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl OOP
Message-Id: <kc1a1351trrkiqrshtrhl29b5rt0jleo9t@4ax.com>
On Thu, 05 Apr 2007 04:06:13 -0700, Xiong Changnian
<please@nospam.net> wrote:
>> It's not a matter of belief. "By definition" has a meaning.
>
>Okay. Direct me to the page of the Camel Book where this phrase ("by
>definition") is defined. If you can do this, I will bow to your
>superiority.
You're joking now, aren't you? To have a meaning doesn't mean "to be a
Perl keyword". Nor "a Perl concept". Not even "a Perl idiomatic
expression".
>Otherwise, I maintain that I'm entitled to use it in the sense of "by my
>current definition", "defined in this case", or "as hereby defined" and
No, you're getting on my nerves now: for one thing is to be "by
definition", and another one to be "by one's own definition". You may
well be Marilyn Monroe by your own definition. But you can't expect to
claim to be her "by definition" and being taken seriously.
>if you don't like that, you're quibbling with my English, not my Perl,
>and you need to go to another newsgroup to beat me up. Tell me when you
>take this thread there, because I will gladly stand my ground -- there.
Yes, we're quibbling about your English. Because maybe you didn't
realize that, but you're writing in English. It is the common exchange
language here. Natural languages can be ambiguous, granted. That's why
we encourage people to write as much as possible in Perl, for the
technical part of their posts. But no one generally writes Perl code
with no English introduction, except, say, on a jokingly basis or when
wanting to stay extremely concise. That natural languages can be
ambiguous is not an excuse not to try to be as unambiguous as possible
when expressing in one.
PS: if you prefer to think we're all evil minded boasters with an
overwhelming ego that feel like o a sort of perverted pleasure bashing
people, then you're welcome: just be prepared to be plonked by the
most resourceful, skilled and helpful regulars, because "this kinda
things" happen quite often. I only claim, wholeheartedly, that it's
not out of the reasons you think. Even uninformed newbies realise
that, when they're not the arrogant stupid type. They ask better when
requested to do so, for example. And they always thank for the
fantastic support. Of course that's not the same with the other type.
Needless to say, I don't give a fuck.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 05 Apr 2007 16:36:20 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perl OOP
Message-Id: <da2a131lbnvfi4hoj5uqougfheq6qbhgcl@4ax.com>
On Thu, 05 Apr 2007 16:00:51 +0200, Robert 'phaylon' Sedlacek
<rs@474.at> wrote:
>"new" is defined as constructor is just wrong. You could say it is the
>common best practice, that in 99.9% when you see "new," it's the
>constructor, but that doesn't define it as such.
>
>My problem is that these are the situations were in one year I'm going
>to hear from someone that I have to use "new()" to construct a Perl object.
Perhaps he's in 6's realms already...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 05 Apr 2007 10:50:58 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: perl OOP
Message-Id: <87ircaan8t.fsf@mithril.chromatico.net>
>>>>> "XC" == Xiong Changnian <please@nospam.net> writes:
XC> I still get the occasional engineering client. I have found
XC> that technical proficiency is not prized one-half so highly as
XC> clarity, courtesy, and fulfillment of the client's actual
XC> needs. I have never yet met a client who cares whether I am
XC> right about anything.
You have never yet met a client who cares whether you're right or wrong?
What are they paying you for, then?
(And are they paying you by the word?)
Charlton
--
Charlton Wilbur
cwilbur@chromatico.net
------------------------------
Date: Thu, 05 Apr 2007 15:54:43 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Testing against a list of values ?
Message-Id: <9cv913huvmgb8lokvjrng4umcv0kkv8mc5@4ax.com>
On Thu, 05 Apr 2007 01:58:15 +0200, Gunnar Hjalmarsson
<noreply@gunnar.cc> wrote:
>if ( grep( $temp eq $_, @values ) == 0 ) { ... }
unless ( grep $temp eq $_, @values) { ... }
But seriously, in this case hash look up is probably better...
(too bad there's not a syntactically sweet enough way to make an array
or a list into a hash(ref) with, say, undef values. In this case I can
think of
unless ( { map { $_ => 1 } @values}->{$temp} ) { ... } # )
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Thu, 05 Apr 2007 10:54:28 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Testing against a list of values ?
Message-Id: <x7ejmyc1nf.fsf@mail.sysarch.com>
>>>>> "MD" == Michele Dondi <bik.mido@tiscalinet.it> writes:
MD> On Thu, 05 Apr 2007 01:58:15 +0200, Gunnar Hjalmarsson
MD> <noreply@gunnar.cc> wrote:
>> if ( grep( $temp eq $_, @values ) == 0 ) { ... }
MD> unless ( grep $temp eq $_, @values) { ... }
MD> But seriously, in this case hash look up is probably better...
MD> (too bad there's not a syntactically sweet enough way to make an array
MD> or a list into a hash(ref) with, say, undef values. In this case I can
MD> think of
MD> unless ( { map { $_ => 1 } @values}->{$temp} ) { ... } # )
and that rebuilds the anon hash each time which is not nice if it is
called more than once. maybe in a cgi or single shot script it would be
ok.
a simple way to make a hash of keys with undef values is:
my %isa_foo ;
@isa_foo{ @values } = () ;
i think i have seen tricks (randal?) on how to merge those line and i
bet abigail or damian could do it with an anon hash. but that is getting
to wacky for my taste. whenever i have a list of things to test against,
i usually need the list as an array too so making an array of foo and a
hash of isa_foo is best IMO (michele: see, i shifted there!)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
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:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#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 308
**************************************