Undefine

Tony,

while(<binkd>)
{
    # date parsing code was here
     @diff=Delta_DHMS(@binkdate,@today) if /(\[\d+\])/;
     print $trimmed $_ if $diff[0] < $ARGV[1] && defined(@diff);
     next if defined(@diff);
     print $trimmed $_ if ! /(\[\d+\])/;
     undef(@diff);
}

    It looks like this could be simplified to:

while(<binkd>)
{
    # date parsing code was here
     if /(\[\d+\])/ then
         diff = Delta_DHMS(@binkdate,@today);
         print $trimmed $_ if diff[0] < $ARGV[1];
         next;
     else
         print $trimmed $_;
     end
}

    I guess I still don't see the need to define an instance variable
and then undefined it.

    BTW, why do all of your posts have a subject line of "undefine" on
the mailing list?

    - Warren Brown

   It looks like this could be simplified to:

that didn't look simplied to me...it was perl code that i posted...

   I guess I still don't see the need to define an instance variable
and then undefined it.

smaller code...

   BTW, why do all of your posts have a subject line of "undefine" on
the mailing list?

that's what i was asking about. i wanted to know if ruby had a way to
undefine a variable...

it's still the topic of the discussion, so i haven't changed it
here...

···

On Tue, 15 Jun 2004 07:58:23 +0900, you wrote:

yeah. much nicer. shorter also.

(number of actions / conditions)
perl: 2+3+2+3+1 == 11
ruby: 1+1+2+1+1 == 6

Alex

···

On Tue, Jun 15, 2004 at 07:58:23AM +0900, Warren Brown wrote:

> while(<binkd>)
> {
> # date parsing code was here
> @diff=Delta_DHMS(@binkdate,@today) if /(\[\d+\])/;
> print $trimmed $_ if $diff[0] < $ARGV[1] && defined(@diff);
> next if defined(@diff);
> print $trimmed $_ if ! /(\[\d+\])/;
> undef(@diff);
> }

while(<binkd>)
{
    # date parsing code was here
     if /(\[\d+\])/ then
         diff = Delta_DHMS(@binkdate,@today);
         print $trimmed $_ if diff[0] < $ARGV[1];
         next;
     else
         print $trimmed $_;
     end
}

tony summerfelt <snowzone5@hotmail.com> writes:

BTW, why do all of your posts have a subject line of
"undefine" on the mailing list?

that's what i was asking about. i wanted to know if ruby had a
way to undefine a variable...

it's still the topic of the discussion, so i haven't changed it
here...

He's probably wondering why your news reader keeps stripping
(and/or not adding) the "Re: " from the subject. It's quite
unhelpful.

···

--
Josh Huber

but it's 2 more lines :slight_smile:

at any rate, the code i posted probably wasn't the best example to
use for define/undef...

···

On Tue, 15 Jun 2004 17:29:20 +0900, you wrote:

yeah. much nicer. shorter also.

as an OT aside: i'm not using a newsreader, i'm on the mailing list,
so it would be my email client doing that (most can be set to strip
re:'s to avoid them piling up.

someone should correct me if i'm wrong, but don't all relatively
compliant newsreaders and and clients go by a message id for
threading and NOT the subject line?

subject kept intact for example of why i strip them.

···

On Tue, 15 Jun 2004 10:36:08 +0900, you wrote:

tony summerfelt <snowzone5@hotmail.com> writes:

He's probably wondering why your news reader keeps stripping
(and/or not adding) the "Re: " from the subject. It's quite
unhelpful.

tony summerfelt <snowzone5@hotmail.com> writes:

as an OT aside: i'm not using a newsreader, i'm on the mailing
list, so it would be my email client doing that (most can be
set to strip re:'s to avoid them piling up.

Okay, I don't know alot about Windows email clients -- I was
under the impression that Forte Agent was a news reader. I see
now that it also supports mail as well...

someone should correct me if i'm wrong, but don't all
relatively compliant newsreaders and and clients go by a
message id for threading and NOT the subject line?

Heh, well...assuming your client supports message threading
(which mine does, as does yours...). I suspect it just makes it
confusing for those who use clients which don't thread
messages. (i.e. Outlook, Outlook Express)

subject kept intact for example of why i strip them.

I guess I'm used to having a sane client which only adds the
"Re: " if it doesn't already exist.

···

--
Josh Huber

tony summerfelt <snowzone5@hotmail.com> writes:

He's probably wondering why your news reader keeps stripping
(and/or not adding) the "Re: " from the subject. It's quite
unhelpful.

as an OT aside: i'm not using a newsreader, i'm on the mailing list,
so it would be my email client doing that (most can be set to strip
re:'s to avoid them piling up.

someone should correct me if i'm wrong, but don't all relatively
compliant newsreaders and and clients go by a message id for
threading and NOT the subject line?

Yes, they do.

subject kept intact for example of why i strip them.

I only see one 'Re: ' in your subject line (or in any of the subject lines here), so I assume that by "piling up" you meant that all responding messages have "Re: "'s in them. This is actually the standard practice, only the original post is devoid of the "Re: " at the beginning.

It can be especially helpful when sometimes posts are not delivered in the order they are sent, since you can always easily find the starting point of a thread. I have been having to do this lately, since the gateway has had some hiccoughs that make sorting by either "date received" or "date sent" unreliable.

HTH,
Mark

···

On Jun 15, 2004, at 9:54 AM, tony summerfelt wrote:

On Tue, 15 Jun 2004 10:36:08 +0900, you wrote:

Josh Huber wrote:

[...] for those who use clients which don't thread
messages. (i.e. Outlook, Outlook Express)

Hope I haven't chopped out important context but ... Wha_???

Outlook Express maintains mail & news in databases with
dual index trees (flat & threaded).

<Alt>VVG is a [V]ery, [V]ery [G]ood way to switch views.
(View | Current View | Group Messages by Conversation)

Also, clicking the title bar sorts the messages which can
be useful to find all posts from one sender. For correct
threading, this is best left on "Sent" (date). Click
"Sent" bar again to toggle ascending/descending date.

    class OE < ThreadFest
    end

I don't know how much better than *correct* threading can be.

daz

Received: Wed, 16 Jun 2004 12:53:27 +0900
And lo, daz wrote:

Josh Huber wrote:
>
> [...] for those who use clients which don't thread
> messages. (i.e. Outlook, Outlook Express)
>

Hope I haven't chopped out important context but ... Wha_???

Outlook Express maintains mail & news in databases with
dual index trees (flat & threaded).

<snip>

What I believe Josh meant isn't threading as in real threads, but the subject line. It's kinda annoying when people's clients don't add the "Re: " header by default.

To note: The thread for this topic ('undefine') loooks like this

undefine (Original)
Re: undefine
Re: undefine
Re: undefine
undefine (Tony Summerfelt's reply)
undefine (ditto)
Re: undefine
Re: undefine
undefine (Summerfelt again)
Re: undefine

It makes one look twice when they're expecting a new topic (because of the lack of 'Re:') but it's actually a reply to an earlier post.

I don't know how much better than *correct* threading can be.

Most email clients are easily capable of doing "correct" threading. But this isn't what Josh meant. My own client (Sylpheed Claws) excels at this.

- Walker

Gregory Millam wrote:

And lo, daz wrote:

To note: The thread for this topic ('undefine') loooks like this

undefine (Original)
Re: undefine
Re: undefine
Re: undefine
undefine (Tony Summerfelt's reply)
undefine (ditto)
Re: undefine
Re: undefine
undefine (Summerfelt again)
Re: undefine

It has over 60 messages and looks like this:
http://www.d10.karoo.net/misc/threading.png

Most email clients are easily capable of doing "correct" threading.
But this isn't what Josh meant. My own client (Sylpheed Claws) excels at this.

- Walker

daz

Received: Wed, 16 Jun 2004 14:13:27 +0900
And lo, daz wrote:

> To note: The thread for this topic ('undefine') loooks like this

It has over 60 messages and looks like this:
http://www.d10.karoo.net/misc/threading.png

Ok, now I feel like a fool:

I went way back to read the post you were commenting on and now I get what you were complaining about.

You're saying Outlook does have threads.

I'm saying that threading shouldn't be relied upon and that clients should prepend "Re: " regardless of threads..

I blame the confusion on myself.

Whoops.

- Walker

"daz" <dooby@d10.karoo.co.uk> writes:

It has over 60 messages and looks like this:
http://www.d10.karoo.net/misc/threading.png

I see. I guess I'm used to Outlook (which appears to be a
pretty different piece of software ;).

Outlook doesn't seem to have decent threading abilities, while
OE does.

···

--
Josh Huber