[33154] in Perl-Users-Digest
Perl-Users Digest, Issue: 4433 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun May 17 05:17:21 2015
Date: Sun, 17 May 2015 02:17:06 -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 Sun, 17 May 2015 Volume: 11 Number: 4433
Today's topics:
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Re: wordx....not_wordx...wordy pattern matching. <gamo@telecable.es>
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Re: wordx....not_wordx...wordy pattern matching. <gamo@telecable.es>
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Re: wordx....not_wordx...wordy pattern matching. <jurgenex@hotmail.com>
Re: wordx....not_wordx...wordy pattern matching. <gamo@telecable.es>
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Re: wordx....not_wordx...wordy pattern matching. <jurgenex@hotmail.com>
Re: wordx....not_wordx...wordy pattern matching. deangwilliam30@gmail.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 May 2015 00:24:51 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <8e9a9afc-5241-48a3-b0ca-d98b2395978a@googlegroups.com>
Have you considered deleting the stupid inline comments so that the
'function preceeding the first begin is not the second function on this
line and the first begin not the begin at the end of it?
Rainer
Thankyou for your gracious response.
Have you considered that I also said only function/procedure words that start a line in the pseudocode.
Here is my post so that things are self-contained
I'd be grateful
if someone could please show me how to extract ubstrings like...
function blob1 closest function line preceding first begin
var
some var
begin
procedure blob2 closest proc preceding first begin
var
somevar...
somevar...
begin
procedure blob3;
begin
from a Delphi unit i.e. the tighest procedure/function..begin pairings possible.
Here's the recipe I used...
read file
assert there's only one line containing the sole word "implementation"
ignore all words before the line containing only "implementation"
label1:
record the position of all instances of "procedure" or "function"..
that starts a line (save for space or tab)
until you see a line solely containing "begin" (save for space or tab)
when you do see that line...return all lines from the last "procedure"..
or "function" line upto and including the "begin" line.
goto label1
Hope this helps
Sorry...I thought solutions were derived from the sample data and not the other way around.
------------------------------
Date: Sat, 16 May 2015 12:10:36 +0200
From: gamo <gamo@telecable.es>
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <mj752s$g6g$1@speranza.aioe.org>
El 16/05/15 a las 09:24, deangwilliam30@gmail.com escribió:
> I'd be grateful
> if someone could please show me how to extract ubstrings like...
First you want to INSERT a comment or something like that.
Now you want to EXTRACT a substring.
Do you want to add more confusion to the topic?
--
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance
------------------------------
Date: Sat, 16 May 2015 03:58:04 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <c81de1c5-19b6-4bb7-9ead-c321f0831ffc@googlegroups.com>
from Gamo
El 16/05/15 a las 09:24, deangwi...@gmail.com escribi=F3:
> I'd be grateful
> if someone could please show me how to extract ubstrings like...
First you want to INSERT a comment or something like that.
Now you want to EXTRACT a substring.
Do you want to add more confusion to the topic?=20
Gamo=20
Thank you for your response.
Unless you can show me how to insert lines immediately after specified patt=
ern/substrings without first identifying the latter, the contradiction you =
infer seems unreasonable. If this is wrong please tell me how you'd insert =
a line after a particular substring without first identifying it.
I don't think you can.
------------------------------
Date: Sat, 16 May 2015 13:10:20 +0200
From: gamo <gamo@telecable.es>
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <mj78is$p7m$1@speranza.aioe.org>
El 16/05/15 a las 12:58, deangwilliam30@gmail.com escribió:
> from Gamo
> El 16/05/15 a las 09:24, deangwi...@gmail.com escribió:
>> I'd be grateful
>> if someone could please show me how to extract ubstrings like...
>
> First you want to INSERT a comment or something like that.
> Now you want to EXTRACT a substring.
> Do you want to add more confusion to the topic?
>
> Gamo
> Thank you for your response.
> Unless you can show me how to insert lines immediately after specified pattern/substrings without first identifying the latter,
the contradiction you infer seems unreasonable. If this is wrong
please tell me how you'd insert a line after a particular
substring without first identifying it.
> I don't think you can.
>
You must be wrong from the start thinking that could be a problem of
pattern matching. You have keywords, check the list of words of each
line with the keywords (you could use 'eq'), count them, and so on,
procceding in the next line or not.
HTH
--
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance
------------------------------
Date: Sat, 16 May 2015 04:10:45 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <614cf773-2e99-485f-ac74-7701033e0789@googlegroups.com>
from Gamo
El 16/05/15 a las 09:24, deangwi...@gmail.com escribi=F3:
> I'd be grateful
> if someone could please show me how to extract ubstrings like...
First you want to INSERT a comment or something like that.
Now you want to EXTRACT a substring.
Do you want to add more confusion to the topic?
Gamo
Thank you for your response.
Unless you can show me how to insert lines immediately=20
after specified pattern/substrings without first=20
identifying the latter, the contradiction you infer=20
seems quite unreasonable. If this is wrong please tell me=20
how you'd insert a line after a particular substring=20
without first identifying the substring.
------------------------------
Date: Sat, 16 May 2015 04:39:34 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <288b257f-1c29-4393-9d66-52974a668891@googlegroups.com>
gamo =09
12:10 PM (14 minutes ago)
El 16/05/15 a las 12:58, deangwi...@gmail.com escribi=F3:
- show quoted text -
You must be wrong from the start thinking that could be a problem of
pattern matching. You have keywords, check the list of words of each
line with the keywords (you could use 'eq'), count them, and so on,
procceding in the next line or not.
HTH
- show quoted text -
Really?
If I'm wrong then this Tcl regular expression
regexp {proc(?:(?!(?:proc|begin)).)*begin} $big_str x; ? $x
would not precisely return the substring I'm looking for re procedures but =
it does so can you clarify what you mean please.
------------------------------
Date: Sat, 16 May 2015 05:22:08 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <macela5h6dqs8u1v6rinalpd35dkps6ia1@4ax.com>
gamo <gamo@telecable.es> wrote:
>El 16/05/15 a las 09:24, deangwilliam30@gmail.com escribió:
>> I'd be grateful
>> if someone could please show me how to extract ubstrings like...
>
>First you want to INSERT a comment or something like that.
>Now you want to EXTRACT a substring.
>Do you want to add more confusion to the topic?
Well, he is doing a very good job at it:
- he never replies to a specific posting but only to his own original
post, thus making it impossible to follow a thread
- doesn't quote at all what he is responding to, thus making it
impossible to recognize what he is responding to
- or doesn't use any quote markers, making it impossible to recognize
quoting layers and who wrote what
- and thus making it impossible to understand what he is talking about
- or to reply in a meaningful manner
Even considering that Google Groups is only a very poor substitute for a
newsreader and that it has a lot of limitations and faults, I have never
seen anyone with such an atrocious posting style.
In my opinion he is a troll, because his style is so bad that it cannot
be explained by using Google alone but he would have to work quite hard
to deliberately make his postings this unreadable.
jue
------------------------------
Date: Sat, 16 May 2015 15:02:48 +0200
From: gamo <gamo@telecable.es>
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <mj7f5p$b7s$1@speranza.aioe.org>
El 16/05/15 a las 13:39, deangwilliam30@gmail.com escribió:
> gamo
> 12:10 PM (14 minutes ago)
> El 16/05/15 a las 12:58, deangwi...@gmail.com escribió:
> - show quoted text -
> You must be wrong from the start thinking that could be a problem of
> pattern matching. You have keywords, check the list of words of each
> line with the keywords (you could use 'eq'), count them, and so on,
> procceding in the next line or not.
> HTH
> - show quoted text -
>
> Really?
> If I'm wrong then this Tcl regular expression
> regexp {proc(?:(?!(?:proc|begin)).)*begin} $big_str x; ? $x
> would not precisely return the substring I'm looking for re procedures but it does so can you clarify what you mean please.
>
¡Ah! Vale, ahora resulta que es un problema de traducción de otro
lenguaje más. Pues entonces para qué nos vamos a molestar. :-)
--
http://www.telecable.es/personales/gamo/
The generation of random numbers is too important to be left to chance
------------------------------
Date: Sat, 16 May 2015 09:08:59 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <5b0f0c39-6008-4dd3-a7e2-d9501166ba25@googlegroups.com>
The 16/05/15 at 13:39, deangwi...@gmail.com wrote:
> Deer
> 24:10 (14 minutes ago)
> On 5/16/15 at 12:58, deangwi ... @ gmail.com wrote:
> - Show quoted text -
> You must be wrong from the start thinking That Could be a problem of
> Pattern matching. You have keywords, check the list of words of each
> With the keywords line (you could use 'eq'), count them, and so on,
> Procceding in the next line or not.
> HTH
> - Show quoted text -
>
> Really?
> If I'm wrong Then this Tcl regular expression
> Regexp {(?!.: ((?: Proc | begin))) * proc begin} $ big_str x; ? $ X
> Precisely would not return the substring I'm looking for re procedures=20
but it does so can you clarify what you mean please.=20
Ah! Okay, now it is a problem of translation of other
More language. Well then what are we going to bother. :-)=20
Gamo Not at all,=20
I'm just showing that this is solvable by pattern matching
so...I it's you that seems to be wrong isn't it?
Otherwise presumably you'd have come back with something sensible
rather than your blatant avoidance
Jue
I provided a fully self-contained post explaining that
my "stupid inline comments" weren't "stupid" at all=20
but were part of testing any solution like the working Tcl regex above
that searched only for procedure/function and begin at the beginning of lin=
es.
Here it is again...
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Rainer
Thankyou for your gracious response.
Have you considered that I also said only function/procedure words that sta=
rt a line in the pseudocode.
Here is my post so that things are self-contained
I'd be grateful
if someone could please show me how to extract ubstrings like...
function blob1 closest function line preceding first begin
var
some var
begin
procedure blob2 closest proc preceding first begin
var
somevar...
somevar...
begin
procedure blob3;
begin
from a Delphi unit i.e. the tighest procedure/function..begin pairings poss=
ible.
Here's the recipe I used...
- hide quoted text -
read file
assert there's only one line containing the sole word "implementation"
ignore all words before the line containing only "implementation"
label1:
record the position of all instances of "procedure" or "function"..
that starts a line (save for space or tab)
until you see a line solely containing "begin" (save for space or tab)
when you do see that line...return all lines from the last "procedure"..
or "function" line upto and including the "begin" line.
goto label1
Hope this helps
Sorry...I thought solutions were derived from the sample data and=20
not the other way around.=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Your response to this=20
i.e.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20
J=EF=BF=BDrgen Exner =09
1:22 PM (2 hours ago)
gamo <ga...@telecable.es> wrote:
>El 16/05/15 a las 09:24, deangwi...@gmail.com escribi=F3:
>> I'd be grateful
>> if someone could please show me how to extract ubstrings like...
>
>First you want to INSERT a comment or something like that.
>Now you want to EXTRACT a substring.
>Do you want to add more confusion to the topic?
Well, he is doing a very good job at it:
- he never replies to a specific posting but only to his own original
post, thus making it impossible to follow a thread
- doesn't quote at all what he is responding to, thus making it
impossible to recognize what he is responding to
- or doesn't use any quote markers, making it impossible to recognize
quoting layers and who wrote what
- and thus making it impossible to understand what he is talking about
- or to reply in a meaningful manner
Even considering that Google Groups is only a very poor substitute for a
newsreader and that it has a lot of limitations and faults, I have never
seen anyone with such an atrocious posting style.
In my opinion he is a troll, because his style is so bad that it cannot
be explained by using Google alone but he would have to work quite hard
to deliberately make his postings this unreadable.
jue
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
doesn't seem to address your own oversight=20
re my specification that only words at the start of lines should be
considered and your inference that I should change my question to
fit your less than sufficient solution seems bizarre to say the least.
Anyway...I'm not in the business of making people look stupid=20
or pointing out their inability to justify their own erroneous positions=20
when asked to so I won't labour the same.
Just before I go it is a fact that the Tcl guys provided the above=20
regexp after the same opening post you had so...
unless they are gifted with telepathy it looks like clarity was never
the problem...more the recipients and the lack of any hint of a
working solution after so many exchanges, sadly, only endorses that view.
I read recently that Perl is in decline.
I wonder why?
------------------------------
Date: Sat, 16 May 2015 09:33:49 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <64selalemoerifen3q1n06jqde41ao1bdc@4ax.com>
deangwilliam30@gmail.com wrote:
>The 16/05/15 at 13:39, deangwi...@gmail.com wrote:
>[lots of junk deleted]
>Well, he is doing a very good job at it:
>- he never replies to a specific posting but only to his own original
>post, thus making it impossible to follow a thread
>- doesn't quote at all what he is responding to, thus making it
>impossible to recognize what he is responding to
>- or doesn't use any quote markers, making it impossible to recognize
>quoting layers and who wrote what
>- and thus making it impossible to understand what he is talking about
>- or to reply in a meaningful manner
>
>Even considering that Google Groups is only a very poor substitute for a
>newsreader and that it has a lot of limitations and faults, I have never
>seen anyone with such an atrocious posting style.
>
>In my opinion he is a troll, because his style is so bad that it cannot
>be explained by using Google alone but he would have to work quite hard
>to deliberately make his postings this unreadable.
No, you _DID_NOT_ write those line above. You stole them from my
posting.
But thank you for proving my points yet again.
***PLONK***
>[lot's of junk deleted]
jue
------------------------------
Date: Sat, 16 May 2015 11:00:12 -0700 (PDT)
From: deangwilliam30@gmail.com
Subject: Re: wordx....not_wordx...wordy pattern matching.
Message-Id: <4af7419f-df3f-4214-8e3b-e4fb065efda7@googlegroups.com>
jue
In a nutshell you implied that my inline comments in
===========================================================
procedure blob0 a stray proc line
procedure blob1 closest proc preceding first begin
var
somevar...
begin
<insert trace line here
begin
end;
end;
function blob2 closest function line preceding first begin
var
some var
begin
<insert trace line here
begin
end;
end;
===========================================================
were "stupid" and that if I removed them your "solution" would work.
Further down the page I specifically stated that I was only interested in
"procedure","function" and "begin" words at the start of lines
i.e.
"
Here's the recipe I used...
read file
assert there's only one line containing the sole word "implementation"
ignore all words before the line containing only "implementation"
label1:
record the position of all instances of "procedure" or "function"..
that starts a line (save for space or tab)
until you see a line solely containing "begin"
(save for space or tab)
when you do see that line...return all lines from the last "procedure"..
or "function" line upto and including the "begin" line.
goto label1
Hope this helps
"
The "stupid" in-line comments were there to test that any solution
ignored "procedure", "function" and "begin" words not at the start of lines.
Unfortunately your solution failed to cope.
Rather than accept your failure you inferred that the test was "stupid".
Sad to say that's not how things work in the real world.
Same for Gamo i.e. to say regex's aren't relevant and then to refuse to discuss
his surprising position in light of the fact that the Tcl regex...
"Regexp {(?!.: ((?: Proc | begin))) * proc begin} $ big_str x; "
not only identifies the required substrings in my file
and copes my "stupid" inline comment tests
but does so with such elegance
strongly suggests an unsupportable position and this is endorsed by his similar
resort to personal insults rather than sensible discussion of the facts.
Dear me...I know nothing about Perl but do recognise people who've dug themselves
into a corner by their own gratuitous insults. If you have something to say about
my sample data re a solution please say it. Otherwise I'd call it a day because
you're really not doing yourselves any good at all credibility-wise.
Those people who pointed out that my initial messages were too long re line length
and not self-contained were obviously right i.e. I didn't know about that...but to try to
hide behind that now to avoid discussing your seemingly unsupportable positions
doesn't really wash.
My sample data is above as is my recipe.
If someone not given to personal insults could respond with a possible solution
I'd be very grateful.
------------------------------
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 4433
***************************************