Problem defining factorial operator in .rakumod file

2022-10-13 Thread Joseph Polanik
I am trying to define '!' as the factorial operator. The following works in a .raku script file:   sub postfix: ($n) is export {     when $n == 0 {return 1}     default {$n * ($n - 1)!}   } However when I tried to move this sub to a .rakumod file, it produces an error: Negation metaoperator

Re: JPEG meta-data timestamps

2022-10-09 Thread JJ Merelo
Chapter 2 of my Raku Recipes, published by APress, includes that as one of the recipes. Here's the code for that recipe: https://github.com/JJ/perl6-recipes-apress/blob/09a3465726ce96549946401970ae282baa4ba60d/Chapter-2/get-image-size.rk El dom, 9 oct 2022 a las 8:28, Fernando Santagata (<

Re: JPEG meta-data timestamps

2022-10-09 Thread Fernando Santagata
Actually there's a Raku module: https://raku.land/cpan:FRITH/Image::Libexif It's a thin-layer interface to the libexif, but it works. On Sat, Oct 8, 2022 at 10:21 PM rir wrote: > Are there any Raku modules for extracting meta-data from > JPEG files? I have looked but not found. > > At this

Re: JPEG meta-data timestamps

2022-10-08 Thread William Michels via perl6-users
I looked at this issue recently and found the Perl5 executable "ExifTool": https://unix.stackexchange.com/a/676180/227738 https://exiftool.org/forum/index.php?topic=9224.msg47655#msg47655 https://exiftool.org/forum/index.php?topic=6330.msg31354#msg31354 https://exiftool.org/exiftool_pod.html

Re: JPEG meta-data timestamps

2022-10-08 Thread Henrik Park
the last you can even use Inline::C. Elizabeth Mattijsen wrote: Are there any in Perl? If so, maybe you can use them with Inline::Perl5 ? -- Simple Mail https://simplemail.co.in/

Re: JPEG meta-data timestamps

2022-10-08 Thread Elizabeth Mattijsen
Are there any in Perl? If so, maybe you can use them with Inline::Perl5 ? > On 8 Oct 2022, at 22:20, rir wrote: > > Are there any Raku modules for extracting meta-data from > JPEG files? I have looked but not found. > > At this point, I just want to extract dates to re-timestamp > the files.

JPEG meta-data timestamps

2022-10-08 Thread rir
Are there any Raku modules for extracting meta-data from JPEG files? I have looked but not found. At this point, I just want to extract dates to re-timestamp the files. Later, I might use the fix in the pictures to map to personally defined places. Rob

The SF Perl Raku Study Group, 10/09 at 1pm PDT

2022-10-07 Thread Joseph Brenner
Now I tell you a secret Don't hammer on the keys For a little pianissimo is always bound to please. -- Marlene Dietrich & Hollander Victor, "Naughty Lola" (1930) The Raku Study Group October 9, 2022 1pm in California, 9pm in the UK Zoom meeting link:

The SF Perl Raku Study Group, 09/25 at 1pm PDT

2022-09-22 Thread Joseph Brenner
"Excursions in Number Theory" by Ogilvy and Anderson (1966): "Until recent years the binary system was looked upon as something of a mathematical curio of only theoretical importance. Suddenly it has become indispensable, and would have had to be developed in a hurry had it not

Re: Regex surprises

2022-09-15 Thread Daniel Sockwell
Sean, To follow up on what Brian said, you can also do the same thing on a single line with named captures https://docs.raku.org/language/regexes#Named_captures (This often isn't as good as Brian's method, since breaking things up as Brian showed often helps readability. But it can be a good

Regex surprises

2022-09-14 Thread Clifton Wood
Hi Brian, I would think this would become pretty easy. Consider: sub MAIN ( $replacement, :$x, :$y ) { my regex x {<{ $x }> } my regex y { <{$y}> } S:g! ! <{ $replacemement }> ! if $x; S:g! ! <{ $replacement }> ! if $y } Is this what you are looking for or did I miss something?

How can I check the content of a pre-compiled file ?

2022-09-14 Thread Dominique Dumont
Hi I'm facing a problem [1] while packaging Raku modules for Debian. In summary, raku-json-marshal and raku-json-unmarshal packages both containt the same precompiled file. I'm trying to figure out what went wrong. How can I check what's inside this file ? (Strings is a bit unwieldy in this

Re: Regex surprises

2022-09-13 Thread Brian Duggan
> > > ... > > > "y" ~~ /(x)|(y)/ I would probably take advantage of the composability of Raku regexes, and do something like my regex x { x } my regex y { y } and then use / | / and check for $ or $ > > S:g[(x)|(y)] = $0 ?? x-replacement !! y-replacement e.g. this becomes S:g[|] =

Re: Regex surprises

2022-09-12 Thread Brad Gilbert
Raku removed all of the regex cruft that has accumulated over the years. (Much of that cruft was added by Perl.) I'm not going to respond to the first part of your email, as I think it is an implementation artifact. On Mon, Sep 12, 2022 at 3:06 PM Sean McAfee wrote: > Hello-- > > I stumbled

Regex surprises

2022-09-12 Thread Sean McAfee
Hello-- I stumbled across a couple of bits of surprising regex behavior today. First, consider: S:g[ x { say 1 } ] = say 2 given "xx" I expected this to print 1, 2, 1, 2, but it prints 1, 1, 2, 2. So it looks like, in a global substitution like this, Raku doesn't look for successive matches

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: Using Inline::Python

2022-09-09 Thread Elizabeth Mattijsen
Sorry to hear that. I'm afraid then you'd need to invest more time to go along this avenue. I know that Inline::Python hasn't nearly gotten the TLC that Inline::Perl5 has had by Stefan Seifert. And that Inline::Python basically needs an additional maintainer. > On 9 Sep 2022, at 21:08, Sean

Re: Using Inline::Python

2022-09-09 Thread Sean McAfee
Good enough reason to try! I got the 2022.07 release from brew. Then zef install -v Inline::Python --exclude=python3 (the same incantation I used before) failed with: ===> Searching for: Inline::Python ===> Found: Inline::Python:ver<0.5>:auth [via Zef::Repository::LocalCache] ===> Building:

Re: Using Inline::Python

2022-09-09 Thread Elizabeth Mattijsen
Well, if you would like people to look into possible core issues, then it would help using the latest released version (aka 2022.07). Especially since 2021.04 is from before the new-disp work being merged, so it is not completely unlikely it functions better now. > On 9 Sep 2022, at 20:44,

Re: Using Inline::Python

2022-09-09 Thread Sean McAfee
I still see the same behavior. That is, if I do say spark.sql('select 1+1'); twice, the first time prints an empty array, and the second produces the "instance has no attribute 'sql'" error message. I forgot to mention, this is on a somewhat old version of Raku, 2021.04. But then, Inline::Python

Re: Using Inline::Python

2022-09-09 Thread Elizabeth Mattijsen
To rule out any REPL artefacts, do you see the same thing if you put the code in a script and run the script? > On 9 Sep 2022, at 20:17, Sean McAfee wrote: > > Hello-- > > I recently started playing around with PySpark. It soon occurred to me that > it would be a lot more fun to work in

Using Inline::Python

2022-09-09 Thread Sean McAfee
Hello-- I recently started playing around with PySpark. It soon occurred to me that it would be a lot more fun to work in Raku instead of Python, and I recalled that it's supposed to be possible to get handles to Python objects from Raku and call methods on them seamlessly, so I tried to make it

The SF Perl Raku Study Group, 09/11 at 1pm PDT

2022-09-08 Thread Joseph Brenner
"Ventnor's father had been destroyed for gadgeteering and it was apparent that this tendency had been carried forward to the next generation. Worse, although latent, the characteristic was predominent and increasing." Philip E. High, "These Savage Futurians" (1967) The Raku Study

Re: How can I get Raku documentation on one page?

2022-09-08 Thread Steve Dondley via perl6-users
OK, got it figured it out by reading the REAMDE flle at https://github.com/Raku/doc Basically, you do `make bigpage` and then start the app with `./app-start` and then you can view it at http://localhost:3000/raku.html > On Sep

How can I get Raku documentation on one page?

2022-09-08 Thread Steve Dondley via perl6-users
At one point, someone generated all the documentation for Raku onto one page: https://docs.raku.org/perl6.html However, this Raku documentation is badly out of date (the language is still called Perl6). I’d like to generate or find an up-to-date version of raku’s docs and have it all on one

Re: steps of a path

2022-09-07 Thread William Michels via perl6-users
Apologies: the first code example in my previous email won't check for a given directory, and will print out bogus paths: ~$ echo "/Users/none/bogus_dir/" | raku -e 'for lines.IO -> $a is copy {$a.Str.say; repeat {$a.=parent andthen $a.Str.say;} until $a eq $*SPEC.rootdir};'

Re: steps of a path

2022-09-07 Thread The Sidhekin
On Wed, Sep 7, 2022 at 6:27 PM Parrot Raiser <1parr...@gmail.com> wrote: > > > > That said, right now gmail is claiming whipupitude is misspelled... > > > An alternative is "whipitupitude" (the difference being the first "it". > > Given the examples I've seen over the years, there's a need for an

Re: steps of a path

2022-09-07 Thread Parrot Raiser
> > That said, right now gmail is claiming whipupitude is misspelled... > An alternative is "whipitupitude" (the difference being the first "it". Given the examples I've seen over the years, there's a need for an opposite to "idiomatic", for programming that arrives at a solution by a Rube

Re: steps of a path

2022-09-07 Thread William Michels via perl6-users
Hi Marc, Does this do what you want? I've omitted the call to `run` and used mostly IO::Path calls instead: ~$ echo "/Users/admin/logs" | raku -e 'for lines.IO -> $a is copy {$a.Str.say; repeat {$a.=parent andthen $a.Str.say;} until $a eq $*SPEC.rootdir;};' #returns: /Users/admin/logs

Re: steps of a path

2022-09-07 Thread Ralph Mellor
On Wed, Sep 7, 2022 at 1:20 AM Marc Chantreux wrote: > > Actually what I really like the most from all your answers was the fact > that I learned a lot not only about the langage but also some idoms. That sounds cool. :) I know what *I* think of when I write "idiom" in the context of

Re: steps of a path

2022-09-06 Thread Marc Chantreux
Hi Ralph, > Given that the broader picture is file/path related operations, it makes > sense to me you're mostly exploring use of `.parent` and `map`s etc. Actually what I really like the most from all your answers was the fact that I learned a lot not only about the langage but also some idoms.

Re: steps of a path

2022-09-06 Thread Ralph Mellor
On Mon, Sep 5, 2022 at 8:07 AM Marc Chantreux wrote: > > I just played again with your solution and got the beauty of it. > > Actually: this is by far the simplest solution. Thanks. Thanks for the follow up. So I'm not going mad! :) Given that the broader picture is file/path related

Re: steps of a path

2022-09-05 Thread Marc Chantreux
I love this one. I used uniq and run so the whole script can be run from raku (except the xargs ls avoid the ARG_MAX error) <<. raku -e 'run < ls -lUd >, unique map {(.IO, *.parent …^ "/")>>.Str.Slip}, lines' /var/log/messages /var/log/auth.log regards -- Marc Chantreux Pôle de Calcul et

Re: steps of a path

2022-09-05 Thread Bruce Gray
> On Sep 5, 2022, at 1:54 AM, Marc Chantreux wrote: --snip of Bill's pointer to Mathew's email-- > I tried this line but got an immutability problem. I tried > multiple work around with no success for the moment. > <<. raku -e 'lines.IO.map: {repeat {.put} while not .=parent ~~ "/" }' >

Re: steps of a path

2022-09-05 Thread Fernando Santagata
Hello, you can get around the immutability problem: raku -e '"/var/log/messages".IO.map: -> $_ is copy {repeat {.put} while ! ($_ .= parent ~~ "/") }' On Mon, Sep 5, 2022 at 8:55 AM Marc Chantreux wrote: > hello William, > > On Sat, Sep 03, 2022 at 04:27:04PM -0700, William Michels wrote: >

Re: steps of a path

2022-09-05 Thread Marc Chantreux
Hi Ralph, > The `.Str.say` can be just `.put`. oh! got it. thanks :) > If not, can you see why I'm surprised -- why `m:g{ "/" <-[/]>+ }` > seems simpler to me than `m:ex{^ [:r "/" <-[/]>+]+? }`? I just played again with your solution and got the beauty of it. why made me realize I should take

Re: steps of a path

2022-09-05 Thread Marc Chantreux
hello William, On Sat, Sep 03, 2022 at 04:27:04PM -0700, William Michels wrote: > Hi Marc, There's also this conversation from March 2021 on the mailing list: > https://www.nntp.perl.org/group/perl.perl6.users/2021/03/msg9857.html > [Matthew's answer looks very interesting]. Interesting as it

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: steps of a path

2022-09-03 Thread Ralph Mellor
Marc Chantreux wrote: > > I got ([^1,^2,^3]) and tried to generalize it with something > more generic (using * to get the number of elements). Yeah, I was disappointed that that didn't work, and that what did was relatively ugly, which is why I didn't bother to share it. <<. raku -ne '.Str.say

Re: steps of a path

2022-09-03 Thread William Michels via perl6-users
Hi Marc, There's also this conversation from March 2021 on the mailing list: https://www.nntp.perl.org/group/perl.perl6.users/2021/03/msg9857.html [Matthew's answer looks very interesting]. Anyway, HTH. --Bill. On Sat, Sep 3, 2022 at 2:51 PM Marc Chantreux wrote: > On Sat, Sep 03, 2022 at

Re: steps of a path

2022-09-03 Thread Marc Chantreux
On Sat, Sep 03, 2022 at 09:50:08PM +0100, Ralph Mellor wrote: > > ( A B C ) to ((A) (A B) (A B C)) ? > [^1,^2,^3] I got that one and tried to generalize it with something more generic (using * to get the number of elements). thanks for helping -- Marc Chantreux Pôle de Calcul et Services

Re: steps of a path

2022-09-03 Thread Marc Chantreux
Hi Bruce and William, Ineed: I was looking for [\,] but your code removes the anoying empty string because of the leading / (which is awesome) so I mixed from both answers (<-[/]> is more robust than .alpha ) and added .Str to .say. finally I got: <<. raku -ne '.Str.say for m:ex /^ ["/"

Re: steps of a path

2022-09-03 Thread Ralph Mellor
On Sat, Sep 3, 2022 at 9:50 PM Ralph Mellor wrote: > > .put for [\~] '/A/B/C' ~~ m:g { '/'? <-[/]>+ } That won't match just a slash (`/`). Maybe: .put for [\~] '/A/B/C' ~~ m:g { ('/'? <-[/]>*) } And it'll treat `/a/b` and `/a/b/` as distinct if the input string is `/a/b/`. -- raiph

Re: steps of a path

2022-09-03 Thread Ralph Mellor
On Sat, Sep 3, 2022 at 9:50 PM Ralph Mellor wrote: > > it makes more sense to do something like Bruce or Michel's solutions. s/Michel/William/ -- raiph

Re: steps of a path

2022-09-03 Thread Ralph Mellor
On Sat, Sep 3, 2022 at 6:17 PM Marc Chantreux wrote: > > ( A B C ) to ((A) (A B) (A B C)) ? [^1,^2,^3] I could share a generalization but it's pretty ugly and I also think it makes more sense to do something like Bruce or Michel's solutions. Here's my variation: .put for [\~] '/A/B/C'

Re: steps of a path

2022-09-03 Thread William Michels via perl6-users
Hi Marc (and Bruce)! Okay, I use our old friend `:exhaustive` adverb below: ~$ echo "/var/log/messages" | raku -ne '.say for m:ex/ ^ ["/" <.alpha>+:]**?{1..*} /;' 「/var」 「/var/log」 「/var/log/messages」 If you remove the `?` frugal quant-modifier, the output is the same--except in the reverse

Re: steps of a path

2022-09-03 Thread Bruce Gray
> On Sep 3, 2022, at 12:17 PM, Marc Chantreux wrote: --snip-- > I thought the raku one could be shorter It will be hard to beat the brevity of a language with single-character instructions. --snip-- > I'm pretty sure I saw a very concise and elegant way to transform > ( A B C ) to ((A) (A

steps of a path

2022-09-03 Thread Marc Chantreux
hello people, I have this steps() function implemented this way in shell: steps() sed -r ':b p; s,/[^/]+$,,; t b' # demo: <<. steps | xargs ls -lUd /var/log/messages which shows -rw-r- 1 root adm 464304 Sep 3 19:03 /var/log/messages drwxr-xr-x 22 root root 4096 Sep 3 00:00 /var/log

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
> On 2 Sep 2022, at 22: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

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
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: 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

Help: will you be a friend and advocate. Did I put myself under hypnosis? Scripts.

2022-08-30 Thread Maneesh D. Sud
Will larry wall himself respond: help. I read parts of Programming Perl. Respect for artificial languages and the mathematicians that implement. I need friends that are smart, understand computer engineering and the dangers of playing Dungeons' and Dragons. I am intelligent and defiantly

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: Ping Larry Wall: excessive compile times

2022-08-30 Thread ToddAndMargo via perl6-users
On 8/30/22 07:45, Parrot Raiser wrote: Surely Jonathan Worthington (or one of the other people who've worked on the compiler) would be in a better position to answer this sort of question. Assuming that you write in a normal "interpreted-language" style, (i.e. gradually adding features,

Re: Ping Larry Wall: excessive compile times

2022-08-30 Thread Parrot Raiser
Surely Jonathan Worthington (or one of the other people who've worked on the compiler) would be in a better position to answer this sort of question. Assuming that you write in a normal "interpreted-language" style, (i.e. gradually adding features, testing, and moving on to the next one, do you

Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 19:58, ToddAndMargo via perl6-users wrote: On 8/29/22 19:26, Brad Gilbert wrote: The Raku compiler is written in Raku (to an extent) so no it can't be toned down. I've been out of the loop for a while, but there has been work to make the compiler use a better design which should be

Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 19:26, Brad Gilbert wrote: The Raku compiler is written in Raku (to an extent) so no it can't be toned down. I've been out of the loop for a while, but there has been work to make the compiler use a better design which should be more optimizable. Awesome.

Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread Brad Gilbert
The Raku compiler is written in Raku (to an extent) so no it can't be toned down. I've been out of the loop for a while, but there has been work to make the compiler use a better design which should be more optimizable. On Mon, Aug 29, 2022, 2:01 PM ToddAndMargo via perl6-users <

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: detach?

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 17:59, ToddAndMargo via perl6-users wrote: Hi All, How do I trigger and detach and external program from inside Raku?  I want the program to go off on its own and I do not want any results back from it. Many thanks, -T Figured it out with `shell` but not `run` (I want both for my

detach?

2022-08-29 Thread ToddAndMargo via perl6-users
Hi All, How do I trigger and detach and external program from inside Raku? I want the program to go off on its own and I do not want any results back from it. Many thanks, -T

Reno 911 || AIDS not HIV. TV/TB. Please help I need a healer.

2022-08-29 Thread Maneesh D. Sud
Well, my habit of asking "url?" had not changed a bit; descriptions of objects cannot be resolved into real ideas without a pointer, and URL is a very good and precise way to motivate people putting their ideas into resolvable entities. I may not have internet access when I need a lifesaver. I

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: exe?

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/28/22 09:21, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to convert a Windows Raku program to to an executable (.exe) file? Many thanks, -T My target is to create a diaglog box with GLADE that allow for certain Windows registry settings to be set by the users with a

Re: Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users
On 8/29/22 11:50, Brad Gilbert wrote: Actually Raku is faster to compile than Perl5. If you consider all of the features it comes with. For example, in Raku everything is an object with meta features. If you add Moose or similar to Perl5 then the compile times will often take longer than the

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: Ping Larry Wall: excessive compile times

2022-08-29 Thread Brad Gilbert
Actually Raku is faster to compile than Perl5. If you consider all of the features it comes with. For example, in Raku everything is an object with meta features. If you add Moose or similar to Perl5 then the compile times will often take longer than the equivalent Raku times. That's not the

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: Ping Larry Wall: excessive compile times

2022-08-29 Thread Elizabeth Mattijsen
> Since you wrote both Perl 5 and Perl 6, is there some > reason beyond my limited understanding of how these > things work as to why your Perl 5 is so much faster to > compile that your Perl 6? You clearly understand the situation! What can I say? Ah, I know. *PLONK* Liz

Ping Larry Wall: excessive compile times

2022-08-29 Thread ToddAndMargo via perl6-users
Dear Larry Wall, Sorry for writing you directly, but I know you sometimes answer questions on this mailing list. And those answers are uniquely easy for a beginner to understand. The compile times of Perl5 and Perl6 are dramatically different. Perl 5 is literally 100 times or more faster than

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 --

Re: rotor in comb?

2022-08-28 Thread Marc Chantreux
hello everyone and thanks Bruce and William for help, On Sat, Aug 27, 2022 at 01:25:32PM -0700, William Michels wrote: > ~$ raku -e '++(my %digraphs){$_} for slurp.lc.match(:global, :exhaustive, > /<[a..z]>**2/); .say for %digraphs.sort(-*.value);' richard3.txt I don't see a huge difference with

exe?

2022-08-28 Thread ToddAndMargo via perl6-users
Hi All, Is there a way to convert a Windows Raku program to to an executable (.exe) file? Many thanks, -T -- ~~ Computers are like air conditioners. They malfunction when you open windows ~~

Re: Inconsistencies with "with" chained to "for"

2022-08-28 Thread Fernando Santagata
Hi Vadim, Thank you! I opened issue #5049. On Sun, Aug 28, 2022 at 12:56 AM Vadim Belman wrote: > > Looks like it worth a bug report. I was probably stumbling upon this too > for a couple of times. > > Best regards, > Vadim Belman > > > On Aug 27, 2022, at 2:24 AM, Fernando Santagata < >

Re: Inconsistencies with "with" chained to "for"

2022-08-27 Thread Vadim Belman
Looks like it worth a bug report. I was probably stumbling upon this too for a couple of times. Best regards, Vadim Belman > On Aug 27, 2022, at 2:24 AM, Fernando Santagata > wrote: > > Hello, > I noticed this behavior: > > [0] > my @a = > [a b c d e] > [1] > .say with $_ for @a > () >

Re: rotor in comb?

2022-08-27 Thread William Michels via perl6-users
Heads-up: code was correct in my last post, but the output is as follows (Rakudo v2021.06): ~$ raku -e '++(my %digraphs){$_} for slurp.lc.match(:global, :exhaustive, /<[a..z]>**2/); .say for %digraphs.sort(-*.value);' richard3.txt or => 4 rs => 3 ho => 3 se => 3 gd => 1 in => 1 fo => 1 om => 1 do

Re: rotor in comb?

2022-08-27 Thread William Michels via perl6-users
Hi Marc (and Bruce)! I'm adapting a "word frequency" answer posted by Sean McAfee on this list. The key seems to be adding the `:exhaustive` adverb to the `match` call. AFAIK comb will not accept this adverb, so `match will have to do for now: Sample Input (including quotes): “A horse, a horse,

Re: rotor in comb?

2022-08-27 Thread Bruce Gray
> On Aug 27, 2022, at 10:56 AM, Marc Chantreux wrote: --snip-- > but I think it is possible to move the cursor backward in the comb regex. --snip-- I do *not* think you can ("move the cursor backward in the comb regex"); See https://docs.raku.org/routine/comb : ... "returns a Seq

<    1   2   3   4   5   6   7   8   9   10   >