Re: -c question

2024-02-06 Thread ToddAndMargo via perl6-users
On 2/6/24 09:03, Bruce Gray wrote: On Feb 6, 2024, at 10:52, ToddAndMargo via perl6-users wrote: On 6 Feb 2024, at 00:39, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to syntax a module? Sort of like the "-c" option on main programs? Many thanks, -T On 2/6/24 01:34,

Re: -c question

2024-02-06 Thread ToddAndMargo via perl6-users
On 6 Feb 2024, at 17:52, ToddAndMargo via perl6-users wrote: On 6 Feb 2024, at 00:39, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to syntax a module? Sort of like the "-c" option on main programs? Many thanks, -T On 2/6/24 01:34, Elizabeth Mattijsen wrote: $ raku -c

Re: -c question

2024-02-06 Thread Bruce Gray
> On Feb 6, 2024, at 10:52, ToddAndMargo via perl6-users > wrote: > >>> On 6 Feb 2024, at 00:39, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> Is there a way to syntax a module? Sort of like the "-c" >>> option on main programs? >>> >>> Many thanks, >>> -T > > On

Re: -c question

2024-02-06 Thread Elizabeth Mattijsen
Do you have some "use lib 'foo'" setting in your program? If so, use that on the command-line, e.g.: $ raku -Ifoo -c bar.rakumod > On 6 Feb 2024, at 17:52, ToddAndMargo via perl6-users > wrote: > >>> On 6 Feb 2024, at 00:39, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>>

Re: -c question

2024-02-06 Thread ToddAndMargo via perl6-users
On 6 Feb 2024, at 00:39, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to syntax a module? Sort of like the "-c" option on main programs? Many thanks, -T On 2/6/24 01:34, Elizabeth Mattijsen wrote: > $ raku -c foo.rakumod > Syntax OK > $ raku -c WinMessageBox.pm6

Re: -c question

2024-02-06 Thread Elizabeth Mattijsen
$ raku -c foo.rakumod Syntax OK > On 6 Feb 2024, at 00:39, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Is there a way to syntax a module? Sort of like the "-c" > option on main programs? > > Many thanks, > -T > > > > -- > ~~ > Computers are

-c question

2024-02-05 Thread ToddAndMargo via perl6-users
Hi All, Is there a way to syntax a module? Sort of like the "-c" option on main programs? Many thanks, -T -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: .contains question

2023-12-11 Thread ToddAndMargo via perl6-users
On 12/11/23 14:47, Andy Bach wrote:  I have found that when using `say` for debugging, it has been known to print out the previous value of a variable and not the current value.  `print` does not do this. That would certainly be a surprise to me. I'd think I was misunderstanding my program,

Re: .contains question

2023-12-11 Thread Andy Bach
a bug in say. From: ToddAndMargo via perl6-users Sent: Monday, December 11, 2023 3:24 PM To: perl6-users@perl.org Subject: Re: .contains question CAUTION - EXTERNAL: > "so" will collapse the junction into a Bool. > "say" will append a \n for

Re: .contains question

2023-12-11 Thread ToddAndMargo via perl6-users
"so" will collapse the junction into a Bool. "say" will append a \n for you, so you don't have to. On 11 Dec 2023, at 01:52, ToddAndMargo via perl6-users wrote: On 10 Dec 2023, at 21:36, ToddAndMargo via perl6-users wrote: Hi All, my Str $x="abc3defg"; if $x.contains( "a" || "b" ||

Re: .contains question

2023-12-11 Thread Elizabeth Mattijsen
my $x="abc45def"; my @y=; say so $x.contains(any @y); "so" will collapse the junction into a Bool. "say" will append a \n for you, so you don't have to. > On 11 Dec 2023, at 01:52, ToddAndMargo via perl6-users > wrote: > >>> On 10 Dec 2023, at 21:36, ToddAndMargo via perl6-users >>> wrote:

Re: .contains question

2023-12-10 Thread ToddAndMargo via perl6-users
On 10 Dec 2023, at 21:36, ToddAndMargo via perl6-users wrote: Hi All, my Str $x="abc3defg"; if $x.contains( "a" || "b" || "3" ) { print "True\n"; } else { print "False\n" }; True Is there a way to tell .contains that you want to know if any of a sequence characters is in a string other

Re: .contains question

2023-12-10 Thread Elizabeth Mattijsen
my @letters = ; if $x.contains(any @letters) { ... > On 10 Dec 2023, at 21:36, ToddAndMargo via perl6-users > wrote: > > Hi All, > > my Str $x="abc3defg"; if $x.contains( "a" || "b" || "3" ) { print "True\n"; > } else { print "False\n" }; > True > > Is there a way to tell .contains that

.contains question

2023-12-10 Thread ToddAndMargo via perl6-users
Hi All, my Str $x="abc3defg"; if $x.contains( "a" || "b" || "3" ) { print "True\n"; } else { print "False\n" }; True Is there a way to tell .contains that you want to know if any of a sequence characters is in a string other that repeating || over and over. Any [a..z] or [0..9] option?

Re: A question on AND

2023-07-01 Thread ToddAndMargo via perl6-users
> On 30/06/2023 06:06, ToddAndMargo via perl6-users wrote: >> if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {...} On 6/30/23 02:40, Richard Hainsworth wrote: I tried this and it worked without any problem. And today is is working for me as well without a problem. I must have had

Re: A question on AND

2023-06-30 Thread Andy Bach
a list operator without the need >> for >> parentheses: >> >> unlink "alpha", "beta", "gamma" >> or gripe(), next LINE; >> >> With the C-style operators that would have been wri

Re: A question on AND

2023-06-30 Thread yary
es: > > unlink "alpha", "beta", "gamma" > or gripe(), next LINE; > > With the C-style operators that would have been written like this: > > unlink("alpha", "beta", "gamma") >

Re: A question on AND

2023-06-30 Thread Andy Bach
pha", "beta", "gamma")) { gripe(); next LINE; } Using "or" for assignment is unlikely to do what you want; see below. From: yary Sent: Friday, June 30, 2023 8:45 AM To: Richard Hainsworth Cc: perl

Re: A question on AND

2023-06-30 Thread Vadim Belman
And then nobody mentions that `and` has low priority. Try `say 42 & 13` and `say 42 and 13`. Best regards, Vadim Belman > On Jun 30, 2023, at 9:45 AM, yary wrote: > > Most of Richard's parting suggestions I understand & agree with, but not > this: " why are you using '&&' and not 'and' " >

Re: A question on AND

2023-06-30 Thread yary
Most of Richard's parting suggestions I understand & agree with, but not this: " why are you using '&&' and not 'and' " My habit (from Perl 5 days) is to use && || for expressions, and reserve "and" "or" for "do this if assignment/function call without parens succeeds/fails" – is there a

Re: A question on AND

2023-06-30 Thread Richard Hainsworth
I tried this and it worked without any problem. Here's the whole program: use v6.d; say @*ARGS.raku; if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" { say 'got' } and at the terminal: $ raku todd-test.raku debug --debug=50 ["debug", "--debug=50"] got FWIW why are you quoting ARGS? The

A question on AND

2023-06-29 Thread ToddAndMargo via perl6-users
Hi All, This gets the finger wagged at me for a "Nil" when @*ARGS.elems equals zero: if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {...} I have to do this instead: if @*ARGS.elems > 0 { if "@*ARGS[0]".lc eq "debug" {...} } Do I misunderstand something? In an AND, is not the

Re: "returns" question

2022-12-07 Thread ToddAndMargo via perl6-users
On 12/7/22 02:02, ToddAndMargo via perl6-users wrote: On my sub declarations, I like to use "export" I had been doing a lot of module coding. I should have said "returns", not "export[s]" -- ~~ Computers are like air conditioners. They malfunction when

Re: "returns" question

2022-12-07 Thread ToddAndMargo via perl6-users
On 12/7/22 02:02, ToddAndMargo via perl6-users wrote: use "export" "exports", I forgot the "s" -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

"returns" question

2022-12-07 Thread ToddAndMargo via perl6-users
Hi All, On my sub declarations, I like to use "export" sub abc() returns Str {...} becasue it makes eh sub easier to figure out at a glance when I go to maintain it. Two exports I have not figured out are 1) an array, 2) an object created from a custom class. returns @ gets

Re: NativeCall and pointers question

2022-11-30 Thread ToddAndMargo via perl6-users
On 11/30/22 12:53, ToddAndMargo via perl6-users wrote: Let me ask this question a little simpler: To answer my own questions, which I figured out the hard way. 1) how to I tell NativeCall I only want the C pointer back, not what it points to? By declaring it as a pointer and creating

Re: NativeCall and pointers question

2022-11-30 Thread ToddAndMargo via perl6-users
Let me ask this question a little simpler: 1) how to I tell NativeCall I only want the C pointer back, not what it points to? 2) how do I tell NativeCall I am sending it a C pointer? Many thanks, -T

NativeCall and pointers question

2022-11-30 Thread ToddAndMargo via perl6-users
t;) returns DWORD { * }; NativeCall is resolving the pointers automatically for me. It is taking $pServerName, which is a Long Pointer to String (LPSTR) and creating the pointer for me. This is appreciated. It also returns and resolves the value of “HANDLE” which is a C Pointer DWORD.. Questi

Re: Pointer to bug question

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/27/22 19:13, Clifton Wood wrote: ToddAndMargo: Why are you referencing NativeHelpers::Blob when I've linked to the code you need. The bug was in the code snippet I've sent. NONE of my stuff is available via zef because CURI (and hence zef) have problems with large scale code that I am

Re: Pointer to bug question

2022-11-28 Thread ToddAndMargo via perl6-users
On 11/27/22 19:13, Clifton Wood wrote: ToddAndMargo: Why are you referencing NativeHelpers::Blob when I've linked to the code you need. The bug was in the code snippet I've sent. NONE of my stuff is available via zef because CURI (and hence zef) have problems with large scale code that I am

Re: Pointer to bug question

2022-11-27 Thread Clifton Wood
ToddAndMargo: Why are you referencing NativeHelpers::Blob when I've linked to the code you need. The bug was in the code snippet I've sent. NONE of my stuff is available via zef because CURI (and hence zef) have problems with large scale code that I am still trying to resolve. You should be able

Re: NativeCall pointer question?

2022-11-24 Thread ToddAndMargo via perl6-users
On Sun, Nov 20, 2022 at 3:48 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, In one of my native call, I get returned a pointer to a DWORD (uint32). How do I turn that into the actual value in the DWORD? Many thanks, -T On 11/20/22

Re: Pointer to bug question

2022-11-24 Thread ToddAndMargo via perl6-users
On 11/23/22 20:01, Clifton Wood wrote: Long story short: my $a = GLib::Roles::TypedBuffer[.new($ppSessionInf); $a.setSize($pCount, :forced); my @sessions = $a.Array; That should return you an array of objects. raku PopUpTest2.pl6 ===SORRY!=== Error while compiling

Re: Pointer to bug question

2022-11-23 Thread Clifton Wood
t 9:46 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > >>> Hi All, > >>> > >>> This is driving me nuts! > >>> > >>> Native Call question. I have a Pointer ($ppSessionInf). > >>> &

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I load what $ppSessionInf points to into $Sessions # something gets assigned to it from an API call

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
On 11/23/22 18:21, Clifton Wood wrote: What type is BYTE, pray tell? constant BYTE := uint8; -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
On 11/23/22 18:07, ToddAndMargo via perl6-users wrote: removing my typos: Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I load what $ppSessionInf points to into $Sessions    # something gets

Re: Pointer to bug question

2022-11-23 Thread Clifton Wood
gt; removing my typos: >> >> >> Hi All, >> >> This is driving me nuts! >> >> Native Call question. I have a Pointer ($ppSessionInf). >> >> It points to a structure of $pCount bytes. >> >> How do I load what $ppSessionInf

Re: Pointer to bug question

2022-11-23 Thread Clifton Wood
2022 at 9:08 PM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > removing my typos: > > > Hi All, > > This is driving me nuts! > > Native Call question. I have a Pointer ($ppSessionInf). > > It points to a structure of $pCount bytes. > > How d

Re: Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
removing my typos: Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I load what $ppSessionInf points to into $Sessions # something gets assigned to it from an API call my Pointer $ppSessionInf

Pointer to bug question

2022-11-23 Thread ToddAndMargo via perl6-users
Hi All, This is driving me nuts! Native Call question. I have a Pointer ($ppSessionInf). It points to a structure of $pCount bytes. How do I read that into a Buf of $ my DWORD $pCount = 0; bytes? my Pointer $ppSessionInf = Pointer.new(); my DWORD $pCount = 32 times

Re: NativeCall C++ structure question

2022-11-21 Thread ToddAndMargo via perl6-users
Scheduler Oh and I almost forgot:  A H ! Another question: Is there a way to use the returned pointer and the pCount to to read the data into a Raku Buf or similar?

NativeCall C++ structure question

2022-11-21 Thread ToddAndMargo via perl6-users
Hi All, Windows ChromeBook Edition (W11-22H2). I have been doing a lot of head scratching here. I have a project were I need to use BOOL WTSEnumerateSessionsA( [in] HANDLE hServer, # WTS_CURRENT_SERVER_HANDLE to use the RD Session Host server that hosts your

Re: NativeCall pointer question?

2022-11-20 Thread ToddAndMargo via perl6-users
On Sun, Nov 20, 2022 at 3:48 AM ToddAndMargo via perl6-users mailto:perl6-users@perl.org>> wrote: Hi All, In one of my native call, I get returned a pointer to a DWORD (uint32). How do I turn that into the actual value in the DWORD? Many thanks, -T On 11/20/22

Re: NativeCall pointer question?

2022-11-20 Thread Clifton Wood
@ToddAndMargo, Two ways: - Use "my CArray[uint32] $p", use $p as your parameter, and access the value as "$p[0]" or - Use "my Pointer[uint32] $p" and use "$p.deref" My personal preference is the former, as it is the best way to access AND set the actual former value. The latter can only

NativeCall pointer question?

2022-11-20 Thread ToddAndMargo via perl6-users
Hi All, In one of my native call, I get returned a pointer to a DWORD (uint32). How do I turn that into the actual value in the DWORD? Many thanks, -T

Re: BEGIN {} question

2022-09-10 Thread rir
s one module, which then may > use other modules, all of them in the same directory, under the lib/ > subdirectory. The distribution can then also contain simple tests under t/ > and development tests under xt/ > > Regards, > > Richard > > On 30/08/2022 2:38 am, ToddAndM

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: sprintf and print question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/1/22 23:50, ToddAndMargo via perl6-users wrote: On 9/1/22 19:37, ToddAndMargo via perl6-users wrote: Hi All, Is there a cleaner way to do this? $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' ande I want to print the first four letter s to STDOUT. -T $ raku -e

Re: sprintf and print question

2022-09-02 Thread ToddAndMargo via perl6-users
On 9/1/22 19:37, ToddAndMargo via perl6-users wrote: Hi All, Is there a cleaner way to do this?     $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)'     ande I want to print the first four letter s to STDOUT. -T $ raku -e 'printf "%.4s\n", "andefghi";' ande Thank you all!

Re: BEGIN {} question

2022-09-02 Thread ToddAndMargo via perl6-users
in question. Am I missing something?

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: sprintf and print question

2022-09-01 Thread William Michels via perl6-users
Hi Todd, ~$ raku -e '(sprintf "%.4s", "andefghi" ).put;' ande ~$ raku -e 'put (sprintf "%.4s", "andefghi" );' ande If sprintf isn't a requirement, then: ~$ raku -e 'put substr("andefghi", 0..3);' ande HTH, Bill. On Thu, Sep 1, 2022 at 7:37 PM ToddAndMargo via perl6-users <

Re: sprintf and print question

2022-09-01 Thread Andinus via perl6-users
ToddAndMargo via perl6-users @ 2022-09-01 19:37 -07: > Is there a cleaner way to do this? > > $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' > ande > > I want to print the first four letter s to STDOUT. You can use substr, | put "andefghi".substr(0, 4) ande

Re: sprintf and print question

2022-09-01 Thread Norman Gaywood
On Fri, 2 Sept 2022 at 12:37, ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > Is there a cleaner way to do this? > > $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' > ande > > I want to print the first four letter s to STDOUT. > $ raku -e 'printf

sprintf and print question

2022-09-01 Thread ToddAndMargo via perl6-users
Hi All, Is there a cleaner way to do this? $ raku -e 'print( (sprintf "%.4s", "andefghi" ) ~ "\n";)' ande I want to print the first four letter s to STDOUT. -T

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
Margo 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 variable values or declare

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
ne program. ... Hi Tom, The .precomp workaround was never in question! But there are tines when it is impractical. ... So lots and lots of compiling that .precomp does not help me with. ... More information that you wanted. Sorry. No reason to apologize, Todd. I had forgotten how much you wer

Re: BEGIN {} question

2022-08-29 Thread Tom Browder
> Hi Tom, > The .precomp workaround was never in question! > But there are tines when it is impractical. ... > So lots and lots of compiling that .precomp does not > help me with. ... > More information that you wanted. Sorry. No reason to apologize, Todd. I had forgotten how much

Re: BEGIN {} question

2022-08-29 Thread ToddAndMargo via perl6-users
speedup you may get by using the precompiled-module "trick" for most of your 11,000-line program. -Tom Hi Tom, The .precomp workaround was never in question! But there are tines when it is impractical. Most of the programs I have written for customers run in the background (r

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

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 BEG

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

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

Re: Hex string to buf question

2022-06-19 Thread ToddAndMargo via perl6-users
On 6/19/22 03:06, ToddAndMargo via perl6-users wrote: On 6/19/22 00:33, ToddAndMargo via perl6-users wrote: Hi All, I have a string:  > my Str $x = "1BB67AE85A"; 1BB67AE85A which has the hexadecimal values I want to add to a buffer:  > my buf8 $y = buf8.new($x.base(16)); No such method

Re: Hex string to buf question

2022-06-19 Thread ToddAndMargo via perl6-users
On 6/19/22 00:33, ToddAndMargo via perl6-users wrote: Hi All, I have a string: > my Str $x = "1BB67AE85A"; 1BB67AE85A which has the hexadecimal values I want to add to a buffer: > my buf8 $y = buf8.new($x.base(16)); No such method 'base' for invocant of type 'Str'.  Did you mean any of

Re: Hex string to buf question

2022-06-19 Thread ToddAndMargo via perl6-users
On 6/19/22 00:33, ToddAndMargo via perl6-users wrote: Hi All, I have a string: > my Str $x = "1BB67AE85A"; 1BB67AE85A which has the hexadecimal values I want to add to a buffer: > my buf8 $y = buf8.new($x.base(16)); No such method 'base' for invocant of type 'Str'.  Did you mean any of

Hex string to buf question

2022-06-19 Thread ToddAndMargo via perl6-users
Hi All, I have a string: > my Str $x = "1BB67AE85A"; 1BB67AE85A which has the hexadecimal values I want to add to a buffer: > my buf8 $y = buf8.new($x.base(16)); No such method 'base' for invocant of type 'Str'. Did you mean any of these: 'Bag', 'Date', 'Hash', 'are', 'asec', 'hash', 'take'?

Re: append to Bug question

2022-06-19 Thread ToddAndMargo via perl6-users
Typo. Should have been: append to Buf question And in my Keeper, I keep typing "bugger" instead of "buffer". Can't win.

Re: append to Bug question

2022-06-19 Thread ToddAndMargo via perl6-users
On 6/18/22 22:58, Bruce Gray wrote: If all you want is to append 0xBB to $y, either of these will work: $y ~= Buf.new(0xBB); $y.append(0xBB); Did not realize I could use buf new like that. Thank you! Append numbers to a buffer: > $x Buf:0x<41 42 43 44> > $x.append( 0xDD );

Re: append to Bug question

2022-06-19 Thread ToddAndMargo via perl6-users
On 6/18/22 22:58, Bruce Gray wrote: From just looking at your code, I am not clear on what you are trying to do. I am updating my Keeper on buffers. I have four of them that are a mess and I an going to consolidate them into a single .ODT (open document text) file with an index.

Re: append to Bug question

2022-06-18 Thread Bruce Gray
> On Jun 18, 2022, at 11:13 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > What am I doing wrong here: From just looking at your code, I am not clear on what you are trying to do. > > my Buf $y = Buf.new( 0xFA xx 10); > Buf:0x > > > $y ~= 0xBB.encode.Buf; > Buf:0x > > I got

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 21:13, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here: > my Buf $y = Buf.new( 0xFA xx 10); Buf:0x > $y ~= 0xBB.encode.Buf; Buf:0x I got three entries (31 38 37) instead of one (0xBB) Some more goofing around: > $y ~= 0xBB; Stringification of a Buf is

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
On 6/18/22 22:12, ToddAndMargo via perl6-users wrote: What am I doing wrong here too? my $d = buf8.new( 0xDE..0xDB ); Buf[uint8]:0x<> Not sure why the above did not work, but this does: Presalt with swept entries: > my buf8 $e = buf8.new(0x5..0x8); Buf[uint8]:0x<05 06 07 08> > my

Re: append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
What am I doing wrong here too? my $d = buf8.new( 0xDE..0xDB ); Buf[uint8]:0x<> -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

append to Bug question

2022-06-18 Thread ToddAndMargo via perl6-users
Hi All, What am I doing wrong here: > my Buf $y = Buf.new( 0xFA xx 10); Buf:0x > $y ~= 0xBB.encode.Buf; Buf:0x I got three entries (31 38 37) instead of one (0xBB) Some more goofing around: > $y ~= 0xBB; Stringification of a Buf is not done with 'Str'. The 'decode' method should be used

Re: Dual Buf and Str question

2022-06-11 Thread ToddAndMargo via perl6-users
On 6/11/22 02:28, ToddAndMargo via perl6-users wrote: On 6/9/22 22:54, ToddAndMargo via perl6-users wrote: Hi All, I can easily  get away with this in Modula2, but how can I do this with Raku? I wish to create a single variable that can be manipulated in two ways: 1) as a fixed length string

Re: BigRoot precision question

2022-06-11 Thread Bruce Gray
> On Jun 11, 2022, at 4:41 AM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > In the following paper on Big Root: > > https://newbedev.com/how-can-i-set-the-level-of-precision-for-raku-s-sqrt > > > > use BigRoot; > > BigRoot.precision = 7; > > say (BigRoot.newton's-sqrt:

BigRoot precision question

2022-06-11 Thread ToddAndMargo via perl6-users
Hi All, In the following paper on Big Root: https://newbedev.com/how-can-i-set-the-level-of-precision-for-raku-s-sqrt > use BigRoot; > BigRoot.precision = 7; > say (BigRoot.newton's-sqrt: 2;).base(10) 1.4142136 > say (BigRoot.newton's-sqrt: 2;).base(16) 1.6A09E7 That is a base(10) precision.

Re: Dual Buf and Str question

2022-06-11 Thread ToddAndMargo via perl6-users
On 6/9/22 22:54, ToddAndMargo via perl6-users wrote: Hi All, I can easily  get away with this in Modula2, but how can I do this with Raku? I wish to create a single variable that can be manipulated in two ways: 1) as a fixed length string (Str) 2) as a fixed length buffer (Buf) I can think

Re: Dual Buf and Str question

2022-06-10 Thread ToddAndMargo via perl6-users
On 6/10/22 02:36, Elizabeth Mattijsen wrote: On 10 Jun 2022, at 11:20, ToddAndMargo via perl6-users wrote: On 10 Jun 2022, at 07:54, ToddAndMargo via perl6-users wrote: Hi All, I can easily get away with this in Modula2, but how can I do this with Raku? I wish to create a single

Re: Dual Buf and Str question

2022-06-10 Thread Elizabeth Mattijsen
> On 10 Jun 2022, at 11:20, ToddAndMargo via perl6-users > wrote: > >>> On 10 Jun 2022, at 07:54, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> I can easily get away with this in Modula2, but >>> how can I do this with Raku? >>> >>> I wish to create a single variable

Re: Dual Buf and Str question

2022-06-10 Thread ToddAndMargo via perl6-users
On 10 Jun 2022, at 07:54, ToddAndMargo via perl6-users wrote: Hi All, I can easily get away with this in Modula2, but how can I do this with Raku? I wish to create a single variable that can be manipulated in two ways: 1) as a fixed length string (Str) 2) as a fixed length buffer (Buf) I

Re: Dual Buf and Str question

2022-06-10 Thread Elizabeth Mattijsen
Perhaps https://raku.land/zef:raku-community-modules/Pythonic::Str is what you're after? > On 10 Jun 2022, at 07:54, ToddAndMargo via perl6-users > wrote: > > Hi All, > > I can easily get away with this in Modula2, but > how can I do this with Raku? > > I wish to create a single variable

Dual Buf and Str question

2022-06-09 Thread ToddAndMargo via perl6-users
Hi All, I can easily get away with this in Modula2, but how can I do this with Raku? I wish to create a single variable that can be manipulated in two ways: 1) as a fixed length string (Str) 2) as a fixed length buffer (Buf) I can think of ways to do this, but it would require separate

  1   2   3   4   5   6   7   >