Re: ones and twos compliment

2025-06-07 Thread Paul Procacci
my $number = 42; my $ones-complement = +^$number; my $twos-complement = +^$number + 1; ~Paul On Sat, Jun 7, 2025 at 11:26 AM Will Coleda wrote: > > (You may have to manually paste that URL, gmail cut off the trailing ^ here > when I clicked on my own link) > > On Sat, Jun 7,

Re: IO::Socket::INET timeout?

2024-01-21 Thread Paul Procacci
On Sat, Jan 20, 2024 at 5:02 PM William Michels wrote: > Hi Paul, > > Did you get any resolution on this? I've only found these links: > > https://docs.raku.org/type/IO/Socket/INET > > > https://stackoverflow.com/questions/72639883/how-to-deal-with-exceptions-in

IO::Socket::INET timeout?

2024-01-08 Thread Paul Procacci
mple of connecting a socket, and reading/writing to that socket with timeouts? Thanks, Paul Procacci -- __ :(){ :|:& };:

Re: Your idea on how to detect random directory names

2023-12-08 Thread Paul Procacci
encing a file or not: my @to_skip = dir(".", test => { .IO.d && / ^ <[a..z]> ** 32 $ / } ) ; If that possibility doesn't exist, then I personally would use: my @to_skip = dir(".", test => { / ^ <[a..z]> ** 32 $ / } ) ; As always, there's more than one way to skin a cat. ~Paul -- __ :(){ :|:& };:

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Paul Procacci
On Sat, Jan 15, 2022 at 5:03 AM Jon Smart wrote: > > Thanks Paul. I am surprised that mmap has that huge IO advantages > comparing to the classic way. So ruby take more benefit from this mmap > calling. Just get learned from your case. > > Regards > > It's not always

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Paul Procacci
Sorry, it's 5:00am here and needless to say it's wy past my bedtime and I'm making mistakes. The comparison should have been between both ruby versions ugh. I'll let you play though. Have a great night. On Sat, Jan 15, 2022 at 4:57 AM Paul Procacci wrote: >

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Paul Procacci
ke(20).each do |s| puts "#{s[0]} -> #{s[1]}" end On Sat, Jan 15, 2022 at 3:48 AM Paul Procacci wrote: > Hey John, > > On Sat, Jan 15, 2022 at 3:04 AM Jon Smart wrote: > >> >> Hello Paul >> >> Do you mean by undef $/ and with <$fh> we can

Re: Benchmark for Scala, Ruby and Perl

2022-01-15 Thread Paul Procacci
Hey John, On Sat, Jan 15, 2022 at 3:04 AM Jon Smart wrote: > > Hello Paul > > Do you mean by undef $/ and with <$fh> we can read the file into memory > at one time? > In most cases the short answer is yes. I have problems with your wording however given the 'g

Re: Benchmark for Scala, Ruby and Perl

2022-01-14 Thread Paul Procacci
Hey Jon, The most glaringly obvious thing I could recommend is that at least in your perl routine (and probably the other languages) most of your time is context switching reading from the disk. Now, my perl version is indeed faster, but one has to ask themselves, was .015193256 seconds really wor

Re: Grammar Help

2021-12-29 Thread Paul Procacci
some to say the least. Thanks for pointing it out. Thanks, Paul On Sun, Dec 26, 2021 at 5:37 PM Ralph Mellor wrote: > On Sun, Dec 26, 2021 at 6:01 AM Paul Procacci wrote: > > > > Hope everyone had a Merry Christmas and takes likings to corny opening > statements. ;) > >

Re: Grammar Help

2021-12-26 Thread Paul Procacci
at to me seems perfect: % raku ./test2.raku < test.data {objectKey => {a => 1234, anotherObjectKey => {b => "45934"}, b => 5345, newobjectKey => {a => 1534, b => "asdf"}}} Thanks all for taking the time to respond. ~Paul data

Re: Grammar Help

2021-12-26 Thread Paul Procacci
paste from JSON::Tiny w/ just enough changes to account for the differences would be enough, but they are in fact different enough that this was an oversight. At least I learned a bit in the process. Thanks, Paul On Sun, Dec 26, 2021 at 5:37 PM Ralph Mellor wrote: > On Sun, Dec 26, 2021 at 6:

Grammar Help

2021-12-25 Thread Paul Procacci
Hey all, Twas the night of Christmas, when all through the house, not a creature was stirring except Paul w/ his mouse. Hope everyone had a Merry Christmas and takes likings to corny opening statements. ;) I was writing a little something tonight using Grammars and ran into something that I

Re: why not raku ?

2021-11-19 Thread Paul Procacci
Raku is pretty amazing. I too would use it pretty regularly except it doesn't run on Freebsd properly. Many a times I started a project that would have been a great contribution yet always ran into problems and had to change back to Perl. It's definitely a good language. It's just not suited for

Re: Buf to Str

2021-06-09 Thread Paul Procacci
>> That C null is an int pointer, longer than a single byte. Yep, no arguments there. ;) On Wed, Jun 9, 2021 at 11:06 AM yary wrote: > That C null is an int pointer, longer than a single byte. > > On Wed, Jun 9, 2021 at 11:04 AM Paul Procacci wrote: > >> Not

Re: Buf to Str

2021-06-09 Thread Paul Procacci
fer that is MAX_PATH length, and the strings stored there are <= MAX_PATH in length. The only way to get them is to look for that NULL. On Wed, Jun 9, 2021 at 10:46 AM Daniel Sockwell wrote: > Hi Paul, > > If you _do_ want/need to work with C-style null-terminated strings, you > can

Re: Buf to Str

2021-06-09 Thread Paul Procacci
ue using 0 over NULL rightly or otherwise; though tend to use either/or when describing something ... as Elizabeth pointed out. Potato vs Potatoe I guess. ~Paul On Wed, Jun 9, 2021 at 10:20 AM yary wrote: > From my early 1980s days learning programming, ASCII CHR 0 is not null, it > is NUL

Re: Buf to Str

2021-06-09 Thread Paul Procacci
>> But yeah, the Str class in Raku is much more than a C-string. Got it. Thanks Elizabeth. On Wed, Jun 9, 2021 at 6:45 AM Elizabeth Mattijsen wrote: > > On 9 Jun 2021, at 06:34, Paul Procacci wrote: > > > > Hopefully a pretty quick question > > > > GI

Buf to Str

2021-06-08 Thread Paul Procacci
anly. Another question might be, should decode() follow null terminating semantics instead of number of elements in a given Buf. Thanks, Paul -- __ :(){ :|:& };:

Re: Find Packages with prefix ...

2021-03-07 Thread Paul Procacci
t; the candidate modules that match 'Top::*', along the whole of the linked > list. > > Once I have the list of candidates, I can use '^can' to check it has a > 'on-starting' method, and then call that method. > > If someone could provide a bit of boiler

Find Packages with prefix ...

2021-03-06 Thread Paul Procacci
Hey Gents, I was toying with an idea of writing a program (shocker!) and in the design of said program I wanted to give the ability to other module writers to extend functionality of the base program. The main program would live in bin/ as per normal and claim a namespace of its own. Call it: Su

Re: Extracting 4 wchar_t's from int64

2021-01-14 Thread Paul Procacci
es this, if any? I'm ok with no function existing in which case I'll need to roll my own, but this is the premise for this email. On Thu, Jan 14, 2021 at 11:00 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 1/14/21 7:38 PM, Paul Procacci wrote: > > I

Re: Extracting 4 wchar_t's from int64

2021-01-14 Thread Paul Procacci
allee, yet I'm looking for a method to reconstruct this back into 260 wchar_t's (which has a width of 16) w/ a simple method that doesn't include me walking the int64 and masking the chars out myself. Does this exist. Thanks, ~Paul On Thu, Jan 14, 2021 at 9:58 PM ToddAndMargo via

Re: Extracting 4 wchar_t's from int64

2021-01-14 Thread Paul Procacci
https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-createtoolhelp32snapshot On Thu, Jan 14, 2021 at 7:30 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 1/14/21 3:42 PM, Paul Procacci wrote: > > Let me preface this by saying if I were usin

Extracting 4 wchar_t's from int64

2021-01-14 Thread Paul Procacci
long the lines of: buf16.new( $.a1, ... $.a64); ... but that doesn't quite work like I would expect. Thanks, ~Paul -- __ :(){ :|:& };:

Re: Nativecall - Callee filled static character array - CArray [repost]

2021-01-03 Thread Paul Procacci
Thanks for that. I did see that but neglected to add my 2 cents. I just have though. ~Paul On Sun, Jan 3, 2021 at 8:40 PM Paul Procacci wrote: > This is a repost from an improperly worded email. > That previous email thread divulged into things it shouldn't have to which > I&

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-03 Thread Paul Procacci
Todd, I know what 'is rw' is for. This isn't at all related to the problem I'm having. On Sun, Jan 3, 2021 at 9:43 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 1/3/21 10:40 AM, Paul Procacci wrote: > > Furthermore you c

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-03 Thread Paul Procacci
No, it doesn't work. The inline statically defined array in Raku never gets filled with any data from the win32 function call. On Sun, Jan 3, 2021 at 9:37 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 1/3/21 12:00 PM, Paul Procacci wrote: > > Todd,

Nativecall - Callee filled static character array - CArray [repost]

2021-01-03 Thread Paul Procacci
); > printf("%c\n%d\n", t.a[0], t.b); > _exit(0); > } > So the questions are: 1) How does one define an *inline* array of whatever size in Raku (size doesn't matter) 2) How does one retrieve the values stored in that defined array after the callee populates it. Thanks, ~Paul [1] - test.so is the shared object that I created for testing. -- __ :(){ :|:& };:

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-03 Thread Paul Procacci
Todd, I've made a mistake. Raku does ensure a pointer gets passed to the function transparently when referencing a structure and doesn't require one to be explicit. I stand corrected. ~Paul On Sun, Jan 3, 2021 at 1:40 PM Paul Procacci wrote: > Todd, > > Nothing you

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-03 Thread Paul Procacci
a[0]; say $t.b; - Running this yields: # ./test.raku 0 1 What's expected is: # ./test.raku T 1 On Sun, Jan 3, 2021 at 1:29 AM Paul Procacci wrote: > A follow-up to my initial message. > > I think the following is relevant: > > https://github.com/rakudo/r

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-03 Thread Paul Procacci
you'd get it to work properly, show me what version of raku you are using and supply it as it could be a bug in the version I'm running. ~Paul On Sun, Jan 3, 2021 at 5:37 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 1/2/21 11:38 PM, Paul Procacci wr

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-03 Thread Paul Procacci
Hi Fernando, I appreciate your response. The windows api requires that the dwSize member of the structure gets set to the size of the structure. This is the reason why the object is being constructed as I've provided. ~Paul On Sun, Jan 3, 2021 at 4:58 AM Fernando Santagata wrote: >

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread Paul Procacci
$ptr, nativecast(Pointer, $entry)); -- The output of the above is: 48 48 This is clearly wrong. This is either a) my misunderstanding of these api calls b) raku bug or c) a usage error on my part. ~Paul On Sun, Jan 3, 2021 at 2:12 AM ToddAndMargo via

Re: Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread Paul Procacci
(tm) v2020.12. Implementing the Raku(tm) programming language v6.d. Built on MoarVM version 2020.12. ~Paul On Sat, Jan 2, 2021 at 11:13 PM Paul Procacci wrote: > Hey gents (again), > > I'm having on awful time with decoding UTF16LE character sequences that > are placed into a Nativecall

Nativecall - Help with converting wchar_t CArray to something printable

2021-01-02 Thread Paul Procacci
e sequences terminated by 0". What's the cleanest way of doing this in raku? I've tried variations of "join" and "encode", simple printf's, say's, etc., and even tried manipulating this data with Buf's, but I can't seem to get it quite right. Any help is appreciated. ~Paul -- __ :(){ :|:& };:

Re: NativeCall -- size of data structure

2021-01-02 Thread Paul Procacci
nativesizeof is what I was looking for. Thanks, ~Paul On Sat, Jan 2, 2021 at 8:39 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 1/2/21 4:58 PM, Paul Procacci wrote: > > Hey Gents, > > > > Hopefully a simple question that I could not find the a

Re: NativeCall -- size of data structure

2021-01-02 Thread Paul Procacci
Apologies. I just came across it. nativesizeof is the subroutine you're looking for. Again, sorry for the noise. ~Paul On Sat, Jan 2, 2021 at 7:58 PM Paul Procacci wrote: > Hey Gents, > > Hopefully a simple question that I could not find the answer to. > > Given the

NativeCall -- size of data structure

2021-01-02 Thread Paul Procacci
would use sizeof() to provide the size. In raku I could not find the documentation that would provide this information. Thanks, Paul Procacci -- __ :(){ :|:& };:

Re: Sending a string to a subprocess

2020-11-11 Thread Paul Procacci
So sorry... hit enter way too early. https://docs.raku.org/type/Proc my $p = run "ssh", "myhost", "cat - > outfile", :in, :out; $p.in.say: "Hello,\nworld!"; I haven't tested it, but you can obtain a proc object and write to the processes' std

Re: Sending a string to a subprocess

2020-11-11 Thread Paul Procacci
https://docs.raku.org/type/Proc my $p = run "cat", "cat - > outfile", :in, :out; $p.in.say: "Hello,\nworld!"; On Wed, Nov 11, 2020 at 7:15 PM Sean McAfee wrote: > I posted this question on Stack Overflow a few days ago: > https://stackoverflow.com/questions/64757138/raku-sending-a-string-to-a-

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Paul Procacci
Thank you Bruce, This does indeed help. Like I mentioned to Joseph I have yet to test it but because it's coming out of the SF Study group I imagine it works. ;) I'll certainly make noise if it doesn't. Appreciate the time given to a follow-up. ~Paul On Sun, Nov 8, 2020 a

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-08 Thread Paul Procacci
Thank you Joseph, Your response along with Bruce's response (which I'll respond to separately) I presume works. My hopes of fitting this into a one liner are crushed! lol Nah, just playing. Thank you for taking the time to respond. This certainly helps with my project. ~Paul On

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Paul Procacci
Hi Bill, Yes, that is exactly what I'm saying. https://github.com/rakudo/rakudo/issues/2624 " FWIW, the :P5 supports a Perl 5 like syntax from X versions ago (probably about 5.8, I would say)." The features I need are in perl 5.10 which the :P5 adverb doesn't provide.

Re: Subset w/ Inline::Perl5 RE as constraint

2020-11-06 Thread Paul Procacci
elieve are PCRE, It was my hopes to lean on perl to do the evaluation. Raku's perl regex engine is too old to interpret it properly, hence the shenanigans with Inline::Perl5. Thanks, Paul On Fri, Nov 6, 2020 at 9:51 AM Parrot Raiser <1parr...@gmail.com> wrote: > Can you provide

Subset w/ Inline::Perl5 RE as constraint

2020-11-05 Thread Paul Procacci
ind a method of constraining Str's w/ >perl5.8 RE's in subset's without it getting too crazy. The RE's that come w/ raku proper are are much older version of RE and cannot accomplish what I need. Thanks in Advance, ~Paul -- __ :(){ :|:& };:

Re: Metamodel parent and return values ...

2020-10-30 Thread Paul Procacci
Well I feel dumb. I haven't tried it yet, but that makes sense. It's what I get for working on this in the w hours of the morning. Thanks, Paul On Fri, Oct 30, 2020 at 7:48 AM Timo Paulssen wrote: > On 30/10/2020 07:58, Paul Procacci wrote: > > Here is what

Metamodel parent and return values ...

2020-10-30 Thread Paul Procacci
e that question. I know it's not doing what I expect it to do, but is this the right method? ... if it is, returning a class which is a child of another class should satisfy the return value requirements and I would expect this to work. Any pointers in the right direction are much appreciated. Thanks in advance, Paul Procacci -- __ :(){ :|:& };:

Re: lines :$nl-in question

2020-08-28 Thread Paul Procacci
:nl-in is a named parameter that defines what the method lines would consider as line endings. It defines "\x0A", "\r\n" as the default. Example: % echo "Hi, Frank." > test.txt ; echo "What's up?" >> test.txt ; echo '"test.txt".IO.lines(:nl-in).say' > test.pl6 ; perl6 ./test.pl6 (Hi, Fr nk. Wh t

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
rt there on wikipedia or something. On Mon, May 18, 2020 at 1:03 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 21:48, Paul Procacci wrote: > > You can check this yourself by looking at the QAST nodes after the > > static analyzer has had its

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 21:19, ToddAndMargo via perl6-users wrote: > > On 2020-05-17 20:28, Paul Procacci wrote: > >> So tack a .Bool at the end. > >> You are coercing a bool to a bool by doing so and hopefully the > >>

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) On Sun, May 17, 2020 at 6:10 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 14:43, ToddAndMargo via perl6-

Re: I need help with the copy command

2020-05-01 Thread Paul Procacci
$createonly fails to do a copy when the destination file already exists. An example of shell commands to emulate this is: # echo a > test1 # echo b > test2 # cp -n test2 test1 # cat test1 a As for recursion...you probably need to write a recursive function somewhere (didn't look that hard). On F

Re: sleep 3600 vs task scheduler

2020-04-07 Thread Paul Procacci
What happens when you try it? What impact do you observe? My guess is the impact is exactly the time it takes for your cpu to perform the initial context switch for the syscall, and then another when waking up. On Tue, Apr 7, 2020 at 10:28 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> w

Re: Can a sub be released?

2020-04-07 Thread Paul Procacci
https://docs.perl6.org/language/5to6-perlfunc#fork https://docs.perl6.org/type/Thread I haven't tried myself but it's conceivable that you can start a new thread that exec's some external program. On Tue, Apr 7, 2020 at 7:21 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All

Re: qqx with quotes

2020-02-25 Thread Paul Procacci
to be in quotes as it can have > >> spaces in it. > >> > >> > >> The following did not work: > >> > >> \"$FileName\" > >> "$FileName\ > >> $FileName > >> > >> What am I do

Re: qqx with quotes

2020-02-25 Thread Paul Procacci
The following works on FreeBSD: my $fn = "file name"; say qqx { ls -l "$fn" }; Not sure why this would be any different on Windows. On Mon, Feb 24, 2020 at 4:01 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Windows 7 > > In the following > > @Result = qqx { C:/Win

Re: irrational nubmer?

2020-02-20 Thread Paul Procacci
returns True to maybe_irrational ... until it isn't. ;) On Thu, Feb 20, 2020 at 2:21 AM Shlomi Fish wrote: > Hi Paul, > > On Thu, 20 Feb 2020 00:22:34 -0500 > Paul Procacci wrote: > > > If you wouldn't mind, please stop referring things as being "magical". >

Re: irrational nubmer?

2020-02-19 Thread Paul Procacci
a complete trivia question. > >> > >> Is there a test to see if a number is irrational, > >> such as the square root of two? > >> > >> And how does Int handle a irrational number? Is > >> there a limit to magic Larry powder? > >>

Re: irrational nubmer?

2020-02-19 Thread Paul Procacci
>> Is there a test to see if a number is irrational There is no such thing as an irrational number in computing. Surely there are "close approximations", but that's the best any computer language can currently do. On Wed, Feb 19, 2020 at 9:58 PM ToddAndMargo via perl6-users < perl6-us...@perl.or

Re: PCRE -> Perl 6 RE

2020-02-18 Thread Paul Procacci
(I lean on the Perl5 adverb) ... and was hoping someone get frustrated enough w/ Raku's perl5 regex implementation that rolled their own. ;( Thanks Brad, Paul On Tue, Feb 18, 2020 at 11:56 PM Brad Gilbert wrote: > The \p{L} syntax is done by using :L inside of <> instead > &

PCRE -> Perl 6 RE

2020-02-18 Thread Paul Procacci
caped p's. Is there anything smart enough to translate these tokens into either: a) perl5 syntax for use with the Perl5 adverb or b) perl6 syntax for use with built-in perl6 re's. c) A module that anyone's familiar with that isn't publish or d) I'm simply SOL? Thanks, Paul -- __ :(){ :|:& };:

Re: Substr behaviour with CRLF

2020-02-10 Thread Paul Procacci
Unicode conformance requires "\r\n" to be interpreted as \n alone. With that said; no, I don't not know how to turn this off. I personally think I'd consider this a bug. If not a bug, greater documentation efforts that explain this. The display routines (say / print) don't modify the string on ou

Re: printf question

2020-02-10 Thread Paul Procacci
Thanks Timo, I was, in part, aware of this, but didn't have the full knowledge/details as you've explained it. Thanks! On Mon, Feb 10, 2020 at 6:18 AM Timo Paulssen wrote: > Hi Paul and Todd, > > just a little extra info: the limitation for nameds to come after > p

Re: printf question

2020-02-09 Thread Paul Procacci
t;named_a"), :c("named_c")); On Sun, Feb 9, 2020 at 6:24 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-02-09 14:53, Paul Procacci wrote: > > subchdir(IO() $path, :$d=True, :$r, :$w, :$x-->IO::Path:D) > > Hi Paul, > > What I

Re: printf question

2020-02-09 Thread Paul Procacci
llowing: my $d = False; I could instead have written the above examples like the following (in the order the above was written): chdir('/tmp'); chdir('/tmp', :$d); chdir('/tmp', :$d, :x); chdir('/tmp', :x, :$d); If you desire another example, please let me

Re: printf question

2020-02-08 Thread Paul Procacci
-us...@perl.org> wrote: > >> On Thu, Feb 6, 2020 at 11:43 AM ToddAndMargo via perl6-users > >> mailto:perl6-us...@perl.org>> wrote: > >> > >> On 2020-02-05 20:12, Paul Procacci wrote: > >> > I wasn't going to follow up but deci

Re: printf question

2020-02-06 Thread Paul Procacci
AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-02-05 20:12, Paul Procacci wrote: > > I wasn't going to follow up but decided to do so since there is a small > > but subtle bug in my original post. > > I wouldn't want to mislead you Todd.

Re: printf question

2020-02-05 Thread Paul Procacci
I wasn't going to follow up but decided to do so since there is a small but subtle bug in my original post. I wouldn't want to mislead you Todd. The \d has been changed to [0..9] as the expected input would only ever be in that range. (\d includes Unicode Characters) I've also included an alignme

Re: printf question

2020-02-04 Thread Paul Procacci
; wrote: > >> > >> On 2020-02-03 13:51, ToddAndMargo via perl6-users wrote: > >> > p6 'my uint8 $u = 84; printf "\$u = <%08s>\n", $u;' > >> > >> Oops, that should have been > >> > >> $ p6 &#

Re: printf question

2020-02-03 Thread Paul Procacci
Here's one way my uint8 $u = 0x4F; say '$u = <0b' ~ '%08b'.sprintf($u).comb(/\d ** 4/).join('_') ~ '>;'; There's probably others as well. On Mon, Feb 3, 2020 at 8:17 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-02-03 13:51, ToddAndMargo via perl6-users wrote: >

Re: Hash Constraints w/in subset's

2020-02-01 Thread Paul Procacci
Thanks for all the answers. This will get me going. I was unaware of the ' Hash[Int, Str]' type of declarative syntax. I knew Hash[Str] was a thing but was unaware of the '[Int,Str]' type of syntax. Thanks for the insight! On Sat, Feb 1, 2020 at 11:16 AM Elizabeth Mattijsen wrote: > subset

Hash Constraints w/in subset's

2020-02-01 Thread Paul Procacci
Hey ladies/gents, How would one go about defining a subset of a Hash who's key's and values are both constrained by something I've read https://docs.perl6.org/type/Hash and it does make mention of constraining keys and values, but not within the context of a subset. Before I go ripping my ha

Re: endian

2020-01-23 Thread Paul Procacci
endianess is dictate by the cpu. If I store the value 4 into some memory address, the storage of and retrieval thereof is controlled by the cpu. On Thu, Jan 23, 2020 at 11:51 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > This is just a trivia question. > > Does anyo

Re: Ping JJ: string literals

2020-01-18 Thread Paul Procacci
Sorry. Not a WINAPI expert, nor do I want to be. ;) The $nSize variable looks fishy. Can it ever contain a value that's <= 2? If so, you're in for a surprise one day. ;) Bedtime. ~Paul On Sun, Jan 19, 2020 at 12:28 AM ToddAndMargo via perl6-users < perl6-us...@perl.org>

Re: Ping JJ: string literals

2020-01-18 Thread Paul Procacci
; perl6-us...@perl.org> wrote: > >> On 2020-01-18 20:05, Paul Procacci wrote: >> > >> I also found out the >> > >> hard wasy the UTF16 strings need to be terminated with >> > >> a double nul (0x). >> > >> > Not to d

Re: Ping JJ: string literals

2020-01-18 Thread Paul Procacci
>> I also found out the >> hard wasy the UTF16 strings need to be terminated with >> a double nul (0x). Not to doubt you (I don't do anything in UTF-16), but can you show an example of this? I would have thought a single NULL character is enough. The 1st byte of a Unicode character determines

Re: Ping JJ: string literals

2020-01-18 Thread Paul Procacci
Thank you Tobias. This is what I was trying to get at, but wasn't sure _how_ to reach that conclusion. You've done so elegantly. ~Paul On Sat, Jan 18, 2020 at 7:55 AM Tobias Boege wrote: > On Sat, 18 Jan 2020, JJ Merelo wrote: > > The example works perfectly, and it does be

Re: problems with xor

2020-01-17 Thread Paul Procacci
Apocalypse 3: "*operators are just funny* looking *function* calls" On Sat, Jan 18, 2020 at 12:31 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-01-17 20:49, Kevin Pye wrote: > > In Raku, all operators are just functions with a funny syntax > > I like the way you wrote

Re: problems with xor

2020-01-17 Thread Paul Procacci
multi sub infix:<+^>($a, $b --> Int:D) _infix_ here is the keyword for you. my uint8 $z = $x +^ $y; On Fri, Jan 17, 2020 at 11:03 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > https://docs.raku.org/routine/+$CIRCUMFLEX_ACCENT > > (Operators) infix +^§ > > multi s

Re: Ping JJ: string literals

2020-01-17 Thread Paul Procacci
< perl6-us...@perl.org> wrote: > For anyone following along that is not familiar with > C, a BYTE in C is called a Char in C. (Causes > some interesting conversations when UTF16 gets involved.) > > > On 2020-01-17 17:03, Paul Procacci wrote: > > >> Take

Re: Ping JJ: string literals

2020-01-17 Thread Paul Procacci
#x27;s my bread and butter. Quite frankly, I don't need the copy/pastes from outside sources as I know for sure that everything I've stated here is 100% accurate. >> C can not figure out where the end of the string I don't see a string. I only see a Character Array. On Fri

Re: Ping JJ: string literals

2020-01-17 Thread Paul Procacci
ired. The example is not only perfectly valid raku, it's also perfectly valid C. Perhaps something could be added to remove whatever ambiguity you perceive, but you argument stems from something that isn't necessarily true in this example and that's the function set_foo($array) exp

Re: bitwise NOT

2020-01-14 Thread Paul Procacci
se(16);' > >> 5A > >> > >> But this does not: > >> > >> $ p6 'my uint8 $c = 0xA5; say (+^$c).base(16);' > >> -A6 > >> > >> 1) who turned it into an negative integer? > >&g

Re: bitwise NOT

2020-01-13 Thread Paul Procacci
If you read the signature for +^, you'll notice it returns an Int. In your first working example, you're taking a uint8 with binary value 10100101, zero extending it to 64 bits via +^, applying a two's compliment, and then assigning bits [0:7] to another uint8 which at that point contains the bin

Re: Bug to report: cardinal called an integer

2020-01-13 Thread Paul Procacci
t; >> >> And, no one is telling me percisely what the difference >> >> >> between UInt and uint is other than one is a subset of >> >> >> Int and the other is a native type. They act exactly >> >> >&g

Re: Bug to report: cardinal called an integer

2020-01-13 Thread Paul Procacci
d, no one is telling me percisely what the difference > >> between UInt and uint is other than one is a subset of > >> Int and the other is a native type. They act exactly > >> the same. > > > > Hi All, > > > > Off line, Paul told me what the

Cannot invoke this object (REPR: Null; VMNull)

2019-12-14 Thread Paul Procacci
method test at /git-repos/test/lib/Loader.pm6 (Loader) line 115 in method load at /git-repos/lib/Loader.pm6 (Loader) line 132 in block at ./test.pl6 line 7 As stated earlier, when I merge the class and the initialization logic into the same source file and run from there, no error occurs. Am I doing this wrong? Thanks, Paul Procacci -- __ :(){ :|:& };:

Re: Quoting issue in Windows

2019-12-03 Thread Paul Procacci
- # php -r "print '\'';" ' # php -r "print '\\';" \ # php -r "print '\a';" \a Example python3.6 **unique**: --- # python3.6 -c "print('\'')"

Re: rmdir question

2019-12-02 Thread Paul Procacci
ample. It throws an exception with a detailed error message. >> To delete non-empty directory, see rmtree in File::Directory::Tree module. >> >> Seems to me I should not have to import a module for >> this. Most rmdir command have a "parents" flag. Am >>

Re: Dynamic export/import of symbols into global namespace

2019-09-20 Thread Paul Procacci
that to apply to subsets. I was obviously doing something wrong. Have a great one folks and thanks for the eyes. ~Paul On Fri, Sep 20, 2019 at 4:01 PM William Michels wrote: > "Declaring a list of variables with lexical (my) or package (our) scope" > > https://docs.perl6.org

Dynamic export/import of symbols into global namespace

2019-09-20 Thread Paul Procacci
As the subject suggests, I'd like to dynamically export/import symbols from a source file into the global scope of the program. How would one accomplish this? Given the below, it yields an error _which I expect_. How do I dynamically pull in the subset 'What'? File: Testing.pm6 ---

Re: Variable character class

2019-09-02 Thread Paul Procacci
I don't know then. I've created the following ticket: https://github.com/perl6/doc/issues/2999 Feel free to place your own input there if you feel the need. On Mon, Sep 2, 2019 at 12:37 PM William Michels wrote: > Sorry Paul, I don't get the correct answer in any of the thr

Re: Variable character class

2019-09-02 Thread Paul Procacci
Was talking to folks over on the #perl6 IRC channel. It appears the recommended way is: sub matching_chars(Str $chars_to_match, Str $str) { # warnings, treats as string not variable $str ~~ /<$_>/ given "<[$chars_to_match]>"; } ~Paul On Sat, Aug 31, 2019 at 9:5

Re: Variable character class

2019-09-01 Thread Paul Procacci
n/env perl6 > use v6; > > sub matching_chars(Str $chars_to_match, Str $_) { > print "Looking for $chars_to_match in '$_'- "; > my regex x { $chars_to_match ** 1 }; > m/<[]>/; > } > say matching_chars('24680', '19584203&#x

Re: Variable character class

2019-08-31 Thread Paul Procacci
worked for me in the very small testing I did. ~Paul On Sat, Aug 31, 2019 at 9:54 PM yary wrote: > I found something easy in Perl 5 that's puzzling me in Perl 6- specifying > a character class via a variable. > > Perl 5: > sub matching_chars { > (my $chars_to_m

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

Re: subnet calculator

2019-01-11 Thread Paul Procacci
http://jodies.de/ipcalc Download link at bottom of page. On Fri, Jan 11, 2019 at 3:08 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > Anyone know if someone has written a program like this > in Perl that will run locally and not require the Internet? > > http://www.s

Re: Need Golf!

2018-11-08 Thread Paul Procacci
Hi Laurent, I certainly appreciate the other potential references. I will certainly explore them. You got me thinking now about what would be considered the most optimal. I'll explore that on my own and if I feel the need report any huge descrepancies. Thanks for the response! ~Paul O

Re: Need Golf!

2018-11-08 Thread Paul Procacci
$end_y < .start_y || $start_x > .end_x || $start_y > .end_y || $end_x < .start_x }).so; On Thu, Nov 8, 2018 at 4:27 PM Paul Procacci wrote: > I don't like this: > > > for %!panels<>:k { > die Some::Exception.new.throw >unless $start_y > %

  1   2   3   4   5   6   7   8   9   10   >