Re: BEGIN {} question

2022-09-10 Thread rir
Richard, That is a nice summary of some differences among various Callables. Rob On Tue, Aug 30, 2022 at 09:34:01PM +0100, Richard Hainsworth wrote: > Hi Todd, > > Long time no see. > > Re your 'keeper'. There is a reason why things are called the way they are > in Raku (aka Perl6). BEGIN is

Re: BEGIN {} question

2022-09-04 Thread ToddAndMargo via perl6-users
On 9/4/22 04:23, Ralph Mellor wrote: On Sun, Sep 4, 2022 at 5:07 AM ToddAndMargo via perl6-users wrote: For the fun of it, I placed a "booboo;" Interesting! You might like to think of `BEGIN` as a signal to the "compiler": "Please do more than just "compile" this code. Please also run it,

Re: BEGIN {} question

2022-09-04 Thread Ralph Mellor
On Sun, Sep 4, 2022 at 5:07 AM ToddAndMargo via perl6-users wrote: > > For the fun of it, I placed a "booboo;" > > Interesting! You might like to think of `BEGIN` as a signal to the "compiler": "Please do more than just "compile" this code. Please also run it, right now, before "compiling" any

Re: BEGIN {} question

2022-09-03 Thread ToddAndMargo via perl6-users
On 9/2/22 18:14, ToddAndMargo via perl6-users wrote: On 9/2/22 13:52, ToddAndMargo via perl6-users wrote: On 9/2/22 00:13, ToddAndMargo via perl6-users wrote: Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it. The guys on the

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/2/22 13:52, ToddAndMargo via perl6-users wrote: On 9/2/22 00:13, ToddAndMargo via perl6-users wrote: Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it. The guys on the chat line said this is normal as `BEGIN` runs a

Re: BEGIN {} question

2022-09-02 Thread Elizabeth Mattijsen
ck it. > > The guys on the chat line said this is normal > as `BEGIN` runs a compile time How short *is* your memory? > From: Elizabeth Mattijsen > Subject: Re: BEGIN {} question > Date: 29 August 2022 at 09:44:30 CEST > To: ToddAndMargo via perl6-users > >> Question, wo

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/2/22 00:13, ToddAndMargo via perl6-users wrote: Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it. The guys on the chat line said this is normal as `BEGIN` runs a compile time -- ~~

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
Found something interesting $ raku -c GetUpdates.pl6 Syntax OK Will execute the BEGIN {}, not just syntax check it.

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/1/22 20:16, Andinus via perl6-users wrote: ToddAndMargo via perl6-users @ 2022-09-01 10:30 -07: On 9/1/22 00:45, Richard Hainsworth wrote: Treat the regexes as data for a program. Compile the program once. Run the regexes as often as you need. Please elucidate. That could save me

Re: BEGIN {} question

2022-09-01 Thread Andinus via perl6-users
ToddAndMargo via perl6-users @ 2022-09-01 10:30 -07: > On 9/1/22 00:45, Richard Hainsworth wrote: >> Treat the regexes as data for a program. Compile the program once. >> Run the regexes as often as you need. > > Please elucidate. That could save me boat loads > of time. You could take the

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 00:45, Richard Hainsworth wrote: Raku and Perl are two different languages in the same family. They evolved with different targets, perl to react quickly to internet requests, Raku to be a better programming language. This may not be the take the actual developers have, but it's what

Re: BEGIN {} question

2022-09-01 Thread ToddAndMargo via perl6-users
On 9/1/22 00:45, Richard Hainsworth wrote: Work with Raku rather than expect it to be the same as Perl. Oh I intent too! I program in Top Down. Perl 5's subroutines are a nightmare. I ADORE Perl 6's subroutines. By saying above / below, this indicates a linear view of code at the same

Re: BEGIN {} question

2022-09-01 Thread Richard Hainsworth
On Wed, 31 Aug 2022, 00:59 ToddAndMargo via perl6-users, < perl6-users@perl.org> wrote: > On 8/30/22 13:34, Richard Hainsworth wrote: > > Hi Todd, > > > > > Since you continue for ever to complain about 'compile' time issues, > > "Stage parce" is specifically what I am whining about > > > rather

Re: BEGIN {} question

2022-08-30 Thread ToddAndMargo via perl6-users
On 8/30/22 13:34, Richard Hainsworth wrote: Hi Todd, Long time no see. Re your 'keeper'. There is a reason why things are called the way they are in Raku (aka Perl6). BEGIN is NOT a special subroutine. BEGIN is a phaser. And it introduces a block. Blocks are not subroutines (subs). Even

Re: BEGIN {} question

2022-08-30 Thread Richard Hainsworth
Hi Todd, Long time no see. Re your 'keeper'. There is a reason why things are called the way they are in Raku (aka Perl6). BEGIN is NOT a special subroutine. BEGIN is a phaser. And it introduces a block. Blocks are not subroutines (subs). Even though blocks and subs (and methods and

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/28/22 15:58, ToddAndMargo via perl6-users wrote: Hi All, I am thinking of using    BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code?   If I set variable values or declare variables, are they wiped out,

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 13:03, ToddAndMargo via perl6-users wrote: On 8/28/22 15:58, ToddAndMargo via perl6-users wrote: Hi All, I am thinking of using     BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code?   If I set

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/28/22 15:58, ToddAndMargo via perl6-users wrote: Hi All, I am thinking of using    BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code?   If I set variable values or declare variables, are they wiped out,

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 10:45, Tom Browder wrote: On Mon, Aug 29, 2022 at 12:31 PM ToddAndMargo via perl6-users wrote: On 8/29/22 08:41, Tom Browder wrote: ... And I think you may be surprised how much speedup you may get by using the precompiled-module "trick" for most of your 11,000-line program. ...

Re: BEGIN {} question

2022-08-29 Thread Tom Browder
On Mon, Aug 29, 2022 at 12:31 PM ToddAndMargo via perl6-users wrote: > On 8/29/22 08:41, Tom Browder wrote: ... > > And I think you may be surprised how much speedup you may get by using > > the precompiled-module "trick" for most of your 11,000-line program. ... > Hi Tom, > The .precomp

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 08:41, Tom Browder wrote: On Mon, Aug 29, 2022 at 10:29 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: ... > Does the compiler make a full pass through > the code before firing off the BEGIN routine NO. And I think you may be surprised how much speedup you

Re: BEGIN {} question

2022-08-29 Thread Tom Browder
On Mon, Aug 29, 2022 at 10:29 AM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: ... > Does the compiler make a full pass through > the code before firing off the BEGIN routine NO. And I think you may be surprised how much speedup you may get by using the precompiled-module "trick"

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 00:44, Elizabeth Mattijsen wrote: Question, would BEGIN go at the top or the bottom of my code? Seems the compiler would hit it first at the top, but I do not know if it makes a full pass of everything before firing off the BEGIN. BEGIN runs at *compile* time. This means that

Re: BEGIN {} question

2022-08-29 Thread Elizabeth Mattijsen
> Question, would BEGIN go at the top or the bottom > of my code? Seems the compiler would hit it first > at the top, but I do not know if it makes a full > pass of everything before firing off the BEGIN. BEGIN runs at *compile* time. This means that anything before the BEGIN statement in the

Re: BEGIN {} question

2022-08-28 Thread ToddAndMargo via perl6-users
On 8/28/22 19:11, Bruce Gray wrote: On Aug 28, 2022, at 5:58 PM, ToddAndMargo via perl6-users wrote: Hi All, I am thinking of using BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code? If I set variable

Re: BEGIN {} question

2022-08-28 Thread Bruce Gray
> On Aug 28, 2022, at 5:58 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > I am thinking of using > > BEGIN {} > > to fire up a splash screen (libnotify). > > Question: is what happens between the brackets > isolated from the rest of the code? If I set > variable values or

BEGIN {} question

2022-08-28 Thread ToddAndMargo via perl6-users
Hi All, I am thinking of using BEGIN {} to fire up a splash screen (libnotify). Question: is what happens between the brackets isolated from the rest of the code? If I set variable values or declare variables, are they wiped out, etc.? Many thanks, -T --