Re: How do I print a structure?

2025-04-12 Thread ToddAndMargo via perl6-users
On 4/12/25 10:14 AM, Tirifto wrote: Hello! Both `print` and `say` convert their argument to a string, but they do so by calling different methods on the argument. `print` calls the method `.Str`, while `say` calls the method `.gist`. On custom classes (like your PartitionClass), calling `.Str

Re: How do I all an interactive command?

2022-11-08 Thread ToddAndMargo via perl6-users
On 11/8/22 15:04, ToddAndMargo via perl6-users wrote: On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's con

Re: How do I all an interactive command?

2022-11-08 Thread ToddAndMargo via perl6-users
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility:     hptraidconf     query array

Re: How do I all an interactive command?

2022-11-07 Thread ToddAndMargo via perl6-users
On 11/7/22 17:50, ToddAndMargo via perl6-users wrote: Hi All, I am scratching my head trying to figure out how to gather information fro a RAID controller from Raku for Windows. I need to issue the following commands to the controller's configuration utility:     hptraidconf     query array

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 10/29/22 14:28, ToddAndMargo via perl6-users wrote: On 10/29/22 13:07, Elizabeth Mattijsen wrote: > $ echo "a/b/c/d" | raku -ne 'say .subst("/", Q/\\\/, :g)' > Hi Elizabeth, Thank you for the subst workaround! I created a keep of the subst. Got to love Raku. 101 ways of doing everything

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 10/29/22 13:02, ToddAndMargo via perl6-users wrote: Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d But this does not: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 29 Oct 2022, at 23:28, ToddAndMargo via perl6-users wrote: On 29 Oct 2022, at 22:02, ToddAndMargo via perl6-users wrote: Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread Elizabeth Mattijsen
/ 'literal string in target' / > On 29 Oct 2022, at 23:28, ToddAndMargo via perl6-users > wrote: > > >>> On 29 Oct 2022, at 22:02, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> I am trying to change >>> >>> / >>> >>> into >>> >>> \\\ >>> >>> This works: >>> >

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread ToddAndMargo via perl6-users
On 29 Oct 2022, at 22:02, ToddAndMargo via perl6-users wrote: Hi All, I am trying to change / into \\\ This works: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~ "\n"' a\\\b\\\c\\\d But this does not: $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s

Re: how do I do a literal string in the target of a regex?

2022-10-29 Thread Elizabeth Mattijsen
$ echo "a/b/c/d" | raku -ne 'say .subst("/", Q/\\\/, :g)' > On 29 Oct 2022, at 22:02, ToddAndMargo via perl6-users > wrote: > > Hi All, > > I am trying to change > > / > > into > > \\\ > > This works: > > > $ echo "a/b/c/d" | raku -ne 'my $x=$_; $x~~s:g|$(Q[/])|\\|;print $x ~

Re: How do I print the last three lines in a file?

2022-10-23 Thread ToddAndMargo via perl6-users
On 10/22/22 23:26, ToddAndMargo via perl6-users wrote: On 10/22/22 22:33, Bruce Gray wrote: dir . /s /A:-D /d /a  | raku -e "say lines[*-2].words[2]" It is pretty !  I like it.  Thank you! I just verified it works on Windows 7, 10, and 11 You have to be careful to double check. Sometimes th

Re: How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
On 10/22/22 22:33, Bruce Gray wrote: dir . /s /A:-D /d /a | raku -e "say lines[*-2].words[2]" It is pretty ! I like it. Thank you!

Re: How do I print the last three lines in a file?

2022-10-22 Thread Bruce Gray
> On Oct 22, 2022, at 11:46 PM, ToddAndMargo via perl6-users > wrote: > > On 10/22/22 21:11, Bruce Gray wrote: >>> On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users >>> wrote: >>> >>> Hi All, >>> >>> Is there a way to print only the last three lines >>> in a long file (full on \n

Re: How do I print the last three lines in a file?

2022-10-22 Thread ToddAndMargo via perl6-users
On 10/22/22 21:11, Bruce Gray wrote: On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users wrote: Hi All, Is there a way to print only the last three lines in a long file (full on \n's). In Windows, I am trying to such the last the lines is dir /s /A:-D /d /a ... Total File

Re: How do I print the last three lines in a file?

2022-10-22 Thread Bruce Gray
> On Oct 22, 2022, at 10:28 PM, ToddAndMargo via perl6-users > wrote: > > Hi All, > > Is there a way to print only the last three lines > in a long file (full on \n's). > > > In Windows, I am trying to such the last the lines is > > > dir /s /A:-D /d /a > ... > Total Files Listed: >

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread William Michels via perl6-users
Maybe my favorite example of the differential applications of `comb` vs `split`. Below, sometimes you want to precisely tease-apart text, and `comb` works towards that end. Other times you want to destructively blast-away at text--eliminating the destractions--so you use `split`, until you see the

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread ToddAndMargo via perl6-users
On 11/1/21 19:07, Patrick R. Michaud wrote: If you want only the first 10 digits, then: How about if I want 64 or more digits?

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread Patrick R. Michaud
This is a place where .comb() is likely much better than .split() -- .comb() allows you to specify what you're wanting instead of what you're wanting to avoid: $ raku -e "say sqrt(2).comb(/\d/).join(', ');" 1, 4, 1, 4, 2, 1, 3, 5, 6, 2, 3, 7, 3, 0, 9, 5, 1 If you want only the first 10 di

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread William Michels via perl6-users
You did great for not knowing Raku! ~$ raku -e "say sqrt(2).split(/\.|''/);" ( 1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1 ) ~$ raku -e "say sqrt(2).split(/\.|''/).raku;" ("", "1", "", "4", "1", "4", "2", "1", "3", "5", "6", "2", "3", "7", "3", "0", "9", "5", "1", "").Seq ~$ raku -e "say sqrt(2).split(/\.|

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread Sean McAfee
On Mon, Nov 1, 2021 at 1:53 AM sisyphus wrote: > Note that what you have there is a 200-decimal-digit (around 658-bit) > precision representation of the square root of 2 - which is quite different > to the (53-bit precision) Real sqrt(2). > Always gotta be careful with reals. I also attempted

Re: how do I turn a real into and array of Integers?

2021-11-01 Thread sisyphus
On Mon, Nov 1, 2021 at 2:35 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 10/31/21 19:39, Sean McAfee wrote: > > > (2.FatRat, { $_ / 2 + 1 / $_ } ... (* - *).abs < 1e-100).tail > > 1.414213562373095048801688724209698078569671875376948073176679737990732478462107038850387534

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 19:39, Sean McAfee wrote: On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> How do I get more digits out of sqrt? On 10/31/21 17:50, Kevin Pye wrote:  > You don't.  >  > sqrt is a function which acts on 64-b

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Sean McAfee
On Sun, Oct 31, 2021 at 6:51 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > >> How do I get more digits out of sqrt? > > On 10/31/21 17:50, Kevin Pye wrote: > > You don't. > > > > sqrt is a function which acts on 64-bit floating point numbers, and > there's no more meaningful

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
How do I get more digits out of sqrt? On 10/31/21 17:50, Kevin Pye wrote: > You don't. > > sqrt is a function which acts on 64-bit floating point numbers, and there's no more meaningful digits available. If you need more precision you're on your own. Dang! I was hoping ther was some th

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Kevin Pye
You don't. sqrt is a function which acts on 64-bit floating point numbers, and there's no more meaningful digits available. If you need more precision you're on your own. On Mon, 1 Nov 2021, at 11:20, ToddAndMargo via perl6-users wrote: > On 10/31/21 16:42, ToddAndMargo via perl6-users wrote: >>

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 16:42, ToddAndMargo via perl6-users wrote: On 10/31/21 11:20, Sean McAfee wrote: On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users mailto:perl6-us...@perl.org>> wrote:     put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits comb takes an argument that can save you

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 11:20, Sean McAfee wrote: On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users mailto:perl6-us...@perl.org>> wrote:     put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits comb takes an argument that can save you a method call:     2.sqrt.comb.grep(*.Int)   ==>    

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Sean McAfee
On Sun, Oct 31, 2021 at 9:08 AM Andinus via perl6-users < perl6-us...@perl.org> wrote: > put 2.sqrt.comb.grep(*.Int)>>.Int[^10].raku # 10 digits > comb takes an argument that can save you a method call: 2.sqrt.comb.grep(*.Int) ==> 2.sqrt.comb(/\d/)

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Andinus via perl6-users
ToddAndMargo via perl6-users @ 2021-10-30 23:57 -07: > Without going into why (it is a secret), how do I turn > >> my $x = sqrt 2 > 1.4142135623730951 > > into an array of integers? > @y[0] = 1 > @y[1] = 4 > @y[2] = 1 > @y[3] = 4 > @y[4] = 2 > @y[5] = 1 put 2.sqrt.comb.grep(*.Int)>>.Int[^10]

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Bruce Gray
> On Oct 31, 2021, at 6:10 AM, ToddAndMargo via perl6-users > wrote: > > On 10/31/21 01:43, Shlomi Fish wrote: > >>> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) >> (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) > > Cool! > > my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) > [1 4 1 4 2 1 3 5

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread sisyphus
On Sun, Oct 31, 2021 at 10:10 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 10/31/21 01:43, Shlomi Fish wrote: > > > > >> ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) > > (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) > > Cool! > > my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread ToddAndMargo via perl6-users
On 10/31/21 01:43, Shlomi Fish wrote: ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) (1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1) Cool! my Int @x = ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) [1 4 1 4 2 1 3 5 6 2 3 7 3 0 9 5 1] Is there a way to set how many digits I get?

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Shlomi Fish
Hi all! On Sun, 31 Oct 2021 15:14:07 +0800 Alice wrote: > Hello > > Try this one: > > use strict; > > use Data::Dumper; > > > my $x = sqrt 2; > > my @li= grep{/\d+/} split//,$x; > > > print Dumper \@li; > Or in raku: > ("" ~ sqrt(2)).comb().grep(* ne ".").map(+*) (1 4 1 4 2 1 3 5 6 2

Re: how do I turn a real into and array of Integers?

2021-10-31 Thread Alice
Hello Try this one: use strict; use Data::Dumper; my $x = sqrt 2; my @li= grep{/\d+/} split//,$x; print Dumper \@li; $ perl t1.pl $VAR1 = [ '1', '4', '1', '4', '2', '1', '3', '5', '6',

Re: How do I address individual elements inside an object

2020-12-19 Thread ToddAndMargo via perl6-users
On 12/19/20 4:49 PM, Brad Gilbert wrote: You can interpolate a method call in a string, but you need the parens.     say "$FruitStand.location() has $FruitStand.apples() apples in stock"; Cool! Now four ways of doing it: print $FruitStand.location ~ "has " ~ $FruitStand.apples ~" app

Re: How do I address individual elements inside an object

2020-12-19 Thread Brad Gilbert
You can interpolate a method call in a string, but you need the parens. say "$FruitStand.location() has $FruitStand.apples() apples in stock"; On Sat, Dec 19, 2020 at 4:28 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Yeah, right. $FruitStand.apples is not a direct ac

Re: How do I address individual elements inside an object

2020-12-19 Thread ToddAndMargo via perl6-users
apples."; Is the "." at the end of the apples literal or syntax?

Re: How do I address individual elements inside an object

2020-12-19 Thread William Michels via perl6-users
Great, Laurent! Works fine (and Todd's as well). Thank you for the explanation. --B. On Sat, Dec 19, 2020 at 2:27 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Yeah, right. $FruitStand.apples is not a direct access to the attribute, > but a method invocation (a call to a

Re: How do I address individual elements inside an object

2020-12-19 Thread Laurent Rosenfeld via perl6-users
Yeah, right. $FruitStand.apples is not a direct access to the attribute, but a method invocation (a call to a method implicitly created by Raku), so it doesn't get interpolated within the string. So it should be outside the string or used with a code interpolation block. For example: say "Fruitst

Re: How do I address individual elements inside an object

2020-12-18 Thread ToddAndMargo via perl6-users
On 12/18/20 9:42 AM, William Michels via perl6-users wrote: Hi Laurent, I get: Fruitstand in Fruit<140431957910656>.location has  Fruit<140431957910656>.apples apples. [Rakudo v2020.10] Best, Bill. Hi Bill, From my notes in progress: -T *** addressing values inside and object ***

Re: How do I address individual elements inside an object

2020-12-18 Thread William Michels via perl6-users
Hi Laurent, I get: Fruitstand in Fruit<140431957910656>.location has Fruit<140431957910656>.apples apples. [Rakudo v2020.10] Best, Bill. On Fri, Dec 18, 2020 at 5:29 AM Laurent Rosenfeld via perl6-users < perl6-us...@perl.org> wrote: > Hi Todd, > > 1. Yes, a class is a blueprint for manufact

Re: How do I address individual elements inside an object

2020-12-18 Thread Parrot Raiser
Although it's a standard term, "class" has a misleading connotation of "set". Using the "fruit" example, the class Fruit should indicate a set of relevant properties for a fruit, such as name, colour, taste, size, possibly cost/kilo. Individual variables can be defined as Fruit-type objects. Then $

Re: How do I address individual elements inside an object

2020-12-18 Thread Laurent Rosenfeld via perl6-users
Hi Todd, 1. Yes, a class is a blueprint for manufacturing objects, you can construct as many object as you want. 2. As an example, you can try: say " Fruitstand in $FruitStand.location has $FruitStand.apples apples."; 2. As you declared your class the object attributes will not be mutable. But

Re: How do I handle Getopt::Long stray entries?

2020-05-14 Thread Peter Pentchev
On Fri, May 15, 2020 at 07:57:47AM +0300, Peter Pentchev wrote: > On Thu, May 14, 2020 at 06:46:17PM -0700, ToddAndMargo via perl6-users wrote: > > On 2020-05-11 21:19, Peter Pentchev wrote: > > > #!/usr/bin/env raku > > > > > > use v6.d; > > > > > > use Getopt::Long; > > > > > > sub cmd_install

Re: How do I handle Getopt::Long stray entries?

2020-05-14 Thread Peter Pentchev
On Thu, May 14, 2020 at 06:46:17PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-11 21:19, Peter Pentchev wrote: > > #!/usr/bin/env raku > > > > use v6.d; > > > > use Getopt::Long; > > > > sub cmd_install($cmd, Array[Str] :$enablerepo = [], Bool :$y = False, > > *@rest --> int) > > {

Re: How do I handle Getopt::Long stray entries?

2020-05-14 Thread ToddAndMargo via perl6-users
On 2020-05-11 21:19, Peter Pentchev wrote: #!/usr/bin/env raku use v6.d; use Getopt::Long; sub cmd_install($cmd, Array[Str] :$enablerepo = [], Bool :$y = False, *@rest --> int) { say 'install'; dd $cmd; dd @rest; dd $enablerepo; dd $y; return 0;

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread Peter Pentchev
On Mon, May 11, 2020 at 04:09:32PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-11 11:48, Peter Pentchev wrote: > > On Mon, May 11, 2020 at 12:40:05AM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-10 23:47, Peter Pentchev wrote: > > > > On Sun, May 10, 2020 at 06:20:02

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread ToddAndMargo via perl6-users
On 2020-05-11 11:48, Peter Pentchev wrote: On Mon, May 11, 2020 at 12:40:05AM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-10 23:47, Peter Pentchev wrote: On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: Hi All, https://modules.raku.org/dist/Getopt::Long:

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread Peter Pentchev
On Mon, May 11, 2020 at 12:40:05AM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-10 23:47, Peter Pentchev wrote: > > On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users > > wrote: > > > Hi All, > > > > > > https://modules.raku.org/dist/Getopt::Long:cpan:LEONT > > > >

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread ToddAndMargo via perl6-users
On 2020-05-10 23:47, Peter Pentchev wrote: On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: Hi All, https://modules.raku.org/dist/Getopt::Long:cpan:LEONT How do I handle stray entries (unknown options) without crashing? Is there some grab bag I can stick all those

Re: How do I handle Getopt::Long stray entries?

2020-05-11 Thread ToddAndMargo via perl6-users
On 2020-05-10 23:47, Peter Pentchev wrote: On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: Hi All, https://modules.raku.org/dist/Getopt::Long:cpan:LEONT How do I handle stray entries (unknown options) without crashing? Is there some grab bag I can stick all those

Re: How do I handle Getopt::Long stray entries?

2020-05-10 Thread Peter Pentchev
On Sun, May 10, 2020 at 06:20:02PM -0700, ToddAndMargo via perl6-users wrote: > Hi All, > > https://modules.raku.org/dist/Getopt::Long:cpan:LEONT > > How do I handle stray entries (unknown options) without > crashing? Is there some grab bag I can stick all > those into? When something signals a

Re: How do I open Raku in the background?

2020-03-31 Thread ToddAndMargo via perl6-users
On 2020-03-31 01:12, ToddAndMargo via perl6-users wrote: On 2020-03-30 21:06, ToddAndMargo via perl6-users wrote: On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailt

Re: How do I open Raku in the background?

2020-03-31 Thread ToddAndMargo via perl6-users
On 2020-03-30 21:06, ToddAndMargo via perl6-users wrote: On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org>    

Re: How do I open Raku in the background?

2020-03-31 Thread ToddAndMargo via perl6-users
On 2020-03-30 21:06, ToddAndMargo via perl6-users wrote: On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org>    

Re: How do I open Raku in the background?

2020-03-30 Thread ToddAndMargo via perl6-users
On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: >> On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users >> mailto:perl6-us...@perl.org> >> wrote: >> >>

Re: How do I open Raku in the background?

2020-03-30 Thread Brad Gilbert
There is a bit in the executable that tells windows to open a terminal. If you copy the executable to say rakudo_no_terminal.exe and change that bit in the copy, then Windows won't show you a terminal. On Mon, Mar 30, 2020 at 8:14 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: >

Re: How do I open Raku in the background?

2020-03-30 Thread ToddAndMargo via perl6-users
On Sun, Mar 29, 2020 at 8:44 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Windows 10-1909 Pro raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am opening Raku from the registry with [

Re: How do I open Raku in the background?

2020-03-30 Thread yary
This is a Windows explorer/shell issue. Search the web; this is one approach - use cmd with some switches to start with the window minimized https://stackoverflow.com/questions/4277963/how-to-call-cmd-without-opening-a-window I'm a fan of Emacs on all my platforms; their solution in Windows is a t

Re: How do I contact the moderator?

2020-02-11 Thread ToddAndMargo via perl6-users
On 2020-02-11 01:03, ToddAndMargo via perl6-users wrote: On 2020-02-11 00:44, Shlomi Fish wrote: Hi Todd, On Mon, 10 Feb 2020 19:25:50 -0800 ToddAndMargo via perl6-users wrote: Hi All, I have been getting a strange eMail on this group. How do I contact the moderator to check and see if it i

Re: How do I contact the moderator?

2020-02-11 Thread Shlomi Fish
Hi Todd, On Mon, 10 Feb 2020 19:25:50 -0800 ToddAndMargo via perl6-users wrote: > Hi All, > > I have been getting a strange eMail on this group. > How do I contact the moderator to check and see > if it is a scam? > I think you should send an email to perl6-users-ow...@perl.org . > Many than

Re: How do I contact the moderator?

2020-02-11 Thread ToddAndMargo via perl6-users
On 2020-02-11 00:44, Shlomi Fish wrote: Hi Todd, On Mon, 10 Feb 2020 19:25:50 -0800 ToddAndMargo via perl6-users wrote: Hi All, I have been getting a strange eMail on this group. How do I contact the moderator to check and see if it is a scam? I think you should send an email to perl6-use

Re: How do I convert integer to cardinal on the fly?

2020-01-08 Thread ToddAndMargo via perl6-users
On 2020-01-07 08:20, ToddAndMargo via perl6-users wrote: On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here?  > my int16 $x = 0xABCD; -21555  > say $x.base(16); -5433  > my uint16 $y = $x.uint16; No such method 'uint16' for invocant of type 'Int'    i

Re: How do I convert integer to cardinal on the fly?

2020-01-07 Thread Todd Chester via perl6-users
On Tue, Jan 7, 2020 at 10:20 AM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote: > Hi All, > > What am I doing wrong here? > > > my int16 $x = 0xABCD; > -21555 > > > say $x.bas

Re: How do I convert integer to cardinal on the fly?

2020-01-07 Thread Brad Gilbert
my int16 $x = 0xABCD; my uint16 $y = $x; say $x.base(16); say $y.base(16) -5433 ABCD If you just want to coerce to uint16 (my uint16 $ = $x) say (my uint16 $ = $x).base(16) On Tue, Jan 7, 2020 at 10:20 AM ToddAndMargo via perl6-users < perl6-us...@p

Re: How do I convert integer to cardinal on the fly?

2020-01-07 Thread ToddAndMargo via perl6-users
On 2020-01-06 22:54, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here? > my int16 $x = 0xABCD; -21555 > say $x.base(16); -5433 > my uint16 $y = $x.uint16; No such method 'uint16' for invocant of type 'Int'   in block at line 1 Many thanks, -T Came up with a wor

Re: How do I assign values to CArray[WCHAR]?

2020-01-06 Thread ToddAndMargo via perl6-users
On 2020-01-06 22:02, ToddAndMargo via perl6-users wrote: Hi All, What am I doing wrong here?  How do I assign values to CArray[WCHAR]? I want $lpData[0] to be 0xABCD and $lpData[1] to be 0xEF12. > use NativeCall; Nil > constant WCHAR    := uint16; (uint16) This was the booboo. I forgot t

Re: how do I read registry key?

2019-12-27 Thread ToddAndMargo via perl6-users
My Latest with Wolf's recommendations. Now I can open and close the key, but still am getting an invalid parameter trying to read the key K:\Windows\NtUtil>perl6 -I. -e "use WinMount :GetLUA; say GetLUA();" RegOpenKeyExW RegOpenKeyExW RtnCode 0 RegQueryValueExW 1 2

Re: how do I read registry key?

2019-12-27 Thread ToddAndMargo via perl6-users
On 2019-12-27 00:45, WFB wrote: Hi Todd, According to this: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- Return code 161 means: ERROR_BAD_PATHNAME. Changing your code fixed that:  my Str   $SubKey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\S

Re: how do I read registry key?

2019-12-27 Thread WFB
Hi Todd, According to this: https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- Return code 161 means: ERROR_BAD_PATHNAME. Changing your code fixed that: my Str $SubKey = 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Policies\\System'; my $lpValueName = wstr(

Re: how do I read registry key?

2019-12-26 Thread WFB
I would love to look into that, however, my son needs all my free time and I do have very little knowledge about NativeCall. I hope I will find time in the next days to learn more of this stuff, but I will not much help :-( On Fri, 27 Dec 2019 at 07:31, ToddAndMargo via perl6-users < perl6-us...@

Re: how do I read registry key?

2019-12-26 Thread ToddAndMargo via perl6-users
This is how far I have gotten: Note that is I use a "0" in $RtnCode = RegQueryValueExW( HKEY_LOCAL_MACHINE, $lpValueName, 1, REG_DWORD, $lpData, $lpcbData ); The program dies with no return code. -T K:\Windows\NtUtil>perl6 -I. -e "use WinMount :GetLUA; say GetLUA();" Reg

Re: how do I read registry key?

2019-12-25 Thread ToddAndMargo via perl6-users
On 2019-12-25 21:48, WFB wrote: BTW, hat would be also a great module for pushing to https://modules.raku.org/. Not sure my code is good enough for that. :'(

Re: how do I read registry key?

2019-12-25 Thread ToddAndMargo via perl6-users
On 2019-12-25 21:48, WFB wrote: On Wed, 25 Dec 2019 at 23:10, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Windows https://docs.microsoft.com/en-us/windows/win32/sysinfo/retrieving-data-from-the-registry How do I use this to read retrieve a va

Re: how do I read registry key?

2019-12-25 Thread WFB
On Wed, 25 Dec 2019 at 23:10, ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Windows > > > https://docs.microsoft.com/en-us/windows/win32/sysinfo/retrieving-data-from-the-registry > > How do I use this to read retrieve a value of a registry key? > > Many thanks, > -T >

Re: How do I do literal quotes in a regex?

2019-12-10 Thread ToddAndMargo via perl6-users
On 2019-12-09 00:46, Fernando Santagata wrote: On Mon, Dec 9, 2019 at 9:38 AM Fernando Santagata mailto:nando.santag...@gmail.com>> wrote: It can be used this way: $ raku -e'say „Hello!“' Hello! But it must be used with that closing quote '“' (U+201C); it cannot be used pai

Re: How do I do literal quotes in a regex?

2019-12-09 Thread Trey Harris
On Mon, Dec 9, 2019 at 03:54 Fernando Santagata wrote: > On Mon, Dec 9, 2019 at 9:38 AM Fernando Santagata < > nando.santag...@gmail.com> wrote: > >> It can be used this way: >> >> $ raku -e'say „Hello!“' >> Hello! >> But it must be used with that closing quote '“' (U+201C); it cannot be >> used

Re: How do I do literal quotes in a regex?

2019-12-09 Thread Fernando Santagata
On Mon, Dec 9, 2019 at 9:38 AM Fernando Santagata wrote: > It can be used this way: > > $ raku -e'say „Hello!“' > Hello! > But it must be used with that closing quote '“' (U+201C); it cannot be > used paired with itself: > There's another quotation mark that can be used with '„', it's '”' (U+201

Re: How do I do literal quotes in a regex?

2019-12-09 Thread Fernando Santagata
On Mon, Dec 9, 2019 at 1:27 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > What is the unicode for the subscript double quote „ ? > That's U+201E and can it be used together with the regular > quote the same as 「」 ? > It can be used this way: $ raku -e'say „Hello!“' Hello! Bu

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 19:34, Brad Gilbert wrote: I like to use them, but I am not you. Hi Brad, I am going to create a keeper and give it a shot! It is not like I don't have four or five of them open when I am programming :-) -T

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Brad Gilbert
I like to use them, but I am not you. On Sun, Dec 8, 2019 at 8:19 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2019-12-08 18:04, Brad Gilbert wrote: > > I do not quite understand the question. > > > > I told you how to directly enter unicode by remembering the codepoint. >

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 18:04, Brad Gilbert wrote: I do not quite understand the question. I told you how to directly enter unicode by remembering the codepoint. It's still the same characters. I would definitely recommend setting up, and getting used to Compose keys. I use them all the time for things

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Brad Gilbert
I do not quite understand the question. I told you how to directly enter unicode by remembering the codepoint. It's still the same characters. I would definitely recommend setting up, and getting used to Compose keys. I use them all the time for things like « » ‘ ’ “ ” ¹²³⁴⁵⁶⁷⁸⁹⁰¯⁺≠ On Sun, De

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 06:22, Brad Gilbert wrote: Personally though I just use 「Ctrl+Shift+u f f 6 2 Space」 and 「Ctrl+Shift+u f f 6 3 Space」 Hi Brad, Your technical opinion: is it better for maintainability to stick with escape sequences or to use the unicodes? I ask as I will never remember them.

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 08:46, Fernando Santagata wrote: You won't believe it :-) but Raku's wonderful documentation has a page on how to enter Unicode characters: https://docs.raku.org/language/unicode_entry Hi Fernando, Oh they sure do go to town on that one! That page is nicely done. What is the

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
On 2019-12-08 06:22, Brad Gilbert wrote: Personally though I just use 「Ctrl+Shift+u f f 6 2 Space」 and 「Ctrl+Shift+u f f 6 3 Space」 So basically I just remember how to directly type in Unicode codepoints, and those the two codepoints. Taught me something new. Thank you!

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Fernando Santagata
You won't believe it :-) but Raku's wonderful documentation has a page on how to enter Unicode characters: https://docs.raku.org/language/unicode_entry That page also links to a GitHub project which offers a .XCompose ready to use. I started from that and added some faster and easier (for me) to

Re: How do I do literal quotes in a regex?

2019-12-08 Thread Brad Gilbert
I would recommend setting up a compose key. But that is not enough because I don't think it has a binding for those two characters. So you would also have to modify the config to include them. I think that 「Compose [ [ 」 and 「Compose ] ] 」 might be what I would set them as. Note that 「‘」 is 「Co

Re: How do I do literal quotes in a regex?

2019-12-08 Thread ToddAndMargo via perl6-users
> On Sat, Dec 7, 2019 at 12:51 AM ToddAndMargo via perl6-users > mailto:perl6-us...@perl.org>> wrote: > > Hi All, > > Is there a `Q[]` that can be used in a regex? > > I am looking for how to get around > > my $x = Q[\:\\::]; ( my $y = $x ) ~~ s/ '' /x/; say $y > \:x:: > >

Re: How do I do literal quotes in a regex?

2019-12-07 Thread Brad Gilbert
The shortcut spelling of Q[…] is to use 「 and 」 (U+FF62 and U+FF63) my $x = 「\:\\::」; ( my $y = $x ) ~~ s/ 「\\」 /x/; say $y \:\\:: The case could be made that \Q[\\] should work as well. (It would need to be added). (Along with \q[…] and \qq[…]) Note that \Q[…] doesn't work in string li

Re: How do I use ~ with Regex syntax?

2019-08-30 Thread ToddAndMargo via perl6-users
On Fri, Aug 30, 2019 at 8:26 PM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, Yes, I know to just put the variable inside the quote, but I'd still like to know how to do it outside the quote; $NewPage ) ~~ s/ .*? "Full Change Log for Version " ~ $Ye

Re: How do I use ~ with Regex syntax?

2019-08-30 Thread Paul Procacci
Drop the '~'. $b ~~ s/ .*? "In the year " $a//; ~Paul On Fri, Aug 30, 2019 at 8:26 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Yes, I know to just put the variable inside the quote, but > I'd still like to know how to do it outside the quote; > > > $NewPage ) ~

Re: How do I fix this zef error?

2019-04-28 Thread ToddAndMargo via perl6-users
On 4/28/19 12:45 AM, ToddAndMargo via perl6-users wrote: $ perl6 --stagestats GetUpdates.pl6 Stage start  :   0.000 Stage parse  : ===SORRY!=== Could not find Net::SMTP at line 18 in: $ zef install  Net::SMTP ===SORRY!=== Failed to open file /usr/lib64/perl6/site/dist/863D6AAB4F5E7259BA

Re: How do I use chr inside a regex?

2019-02-02 Thread ToddAndMargo via perl6-users
On 2/1/19 11:32 PM, JJ Merelo wrote: Hi, El sáb., 2 feb. 2019 a las 7:48, ToddAndMargo via perl6-users (mailto:perl6-us...@perl.org>>) escribió: Hi All, How do I use chr inside a regex.  In the below, how do I get rid of $y? $ p6 'my Str $x=chr(0x66)~chr(0x77); my Str $y=chr

Re: How do I use chr inside a regex?

2019-02-01 Thread JJ Merelo
Hi, El sáb., 2 feb. 2019 a las 7:48, ToddAndMargo via perl6-users (< perl6-us...@perl.org>) escribió: > Hi All, > > How do I use chr inside a regex. In the below, how > do I get rid of $y? > > $ p6 'my Str $x=chr(0x66)~chr(0x77); my Str $y=chr(0x66)~chr(0x77); > $x~~s/ $y /xy/; say $x;' > > If w

Re: How do I trap a crash?

2019-01-11 Thread ToddAndMargo via perl6-users
>> Hi All, >> >> I would like to do a Send Notify when a program of mine >> crashes. >> >> How do I trap a crash? >> >> Is there a way to see some of the local variables in the >> sub that crashes with the trap? >> >> >> Many thanks, >> -T On 1/11/19 10:56 AM, Elizabeth Mattijsen wrote: Perhaps

Re: How do I trap a crash?

2019-01-11 Thread Elizabeth Mattijsen
Perhaps https://docs.perl6.org/language/exceptions#Catching_exceptions could be enlightening? > On 11 Jan 2019, at 18:54, ToddAndMargo via perl6-users > wrote: > > Hi All, > > I would like to do a Send Notify when a program of mine > crashes. > > How do I trap a crash? > > Is there a way to

Re: How do I Stringy a Buf?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 4:36 PM, ToddAndMargo via perl6-users wrote: $ p6 'my $fh=open "/home/linuxutil/WhoIsMySub.pl6", :r;  my Buf $f = $fh.read(100); $fh.close; say "<" ~ $f.decode("utf-8") ~ ">";' I changed `$f.decode("utf-8")` to `$f.decode("utf8-c8")` as you never know what a web page will have on it

Re: How do I Stringy a Buf?

2018-10-09 Thread ToddAndMargo via perl6-users
On 10/9/18 6:26 AM, Curt Tilmes wrote: On Tue, Oct 9, 2018 at 9:21 AM ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Yes, I know there are other ways to read a file.  I have a specific reason for using `read`. How do I properly turn a Buf into a Str (all the

Re: How do I Stringy a Buf?

2018-10-09 Thread Curt Tilmes
On Tue, Oct 9, 2018 at 9:21 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > > Yes, I know there are other ways to read a file. I > have a specific reason for using `read`. > > How do I properly turn a Buf into a Str (all the bytes will > have been tested to make sure they are pri

  1   2   3   >