Re: XML module question?

2021-07-16 Thread David Warring
The XML::Writer module side-steps any ordering issues by directly serializing data structures to xml: $ raku -M XML::Writer -e'say XML::Writer.serialize: :wpt[ :lat<42>, :long<69>, "blah" ]' blah On Sat, Jul 17, 2021 at 4:48 AM Bruce Gray wrote: > > On Jul

Re: ^methods doesn't show all methods

2021-02-16 Thread David Warring
I'm getting this on Rakudo blead. $ raku -v Welcome to Rakudo(tm) v2020.12-129-g291cc5f39. Implementing the Raku(tm) programming language v6.d. Built on MoarVM version 2020.12-100-gc93531608. $ raku -e'my $s = set 2, 4, 6; say $s.^methods>>.name.sort;' (ACCEPTS ASSIGN-KEY AT-KEY BUILDALL Bag BagHa

Re: Is LibraryMake still current?

2019-12-22 Thread David Warring
Hi Fernando, I'm still in the habit of using LibraryMake. E.g. for https://github.com/p6-xml/LibXML-raku released in this last few months. Regards, David On Sun, Dec 22, 2019 at 7:47 AM Fernando Santagata < nando.santag...@gmail.com> wrote: > Hello, > > What can I use to help building native code

Re: Fastest way to convert from a Buf to a Str?

2019-02-03 Thread David Warring
Are all characters in the range 0-255, ie latin-1 characters? You could then try: my $str = $buf.decode("latin-1"); There's one potential issue if your data could contain DOS end of lines ("\r\n"), which will get translated to a single logical "\n" in the decoded string. - David On Sun, Feb

Re: Are 64 bit natives universally available?

2017-08-27 Thread David Warring
s, afaik. > > > On 27 Aug 2017, at 22:42, David Warring wrote: > > > > Quick question. > > > > I just want to doublle check that int64, uint64 are universally > available via Perl 6, before introducing them into modules. e.g. > > % perl6 -e

Are 64 bit natives universally available?

2017-08-27 Thread David Warring
Quick question. I just want to doublle check that int64, uint64 are universally available via Perl 6, before introducing them into modules. e.g. % perl6 -e'my uint64 $n = 99; say $n' 99 - David

Re: Bi-directional communication with another process

2017-07-27 Thread David Warring
Thanks Timo, A Proc::Async example, after reading the doco. Agree, that't better, even for the simple case :-) - David my $proc = Proc::Async.new('sh', '-c', 'for x in `seq 1 1` ; do echo "o$x"; echo "e$x" 1>&2; done'); # subscribe to new output from out and err handles: $proc.stdout.tap(-> $

Re: Bi-directional communication with another process

2017-07-27 Thread David Warring
Perl 5 and C have the select call that lets you determine which of a group of file-descriptor are ready for reading and writing. I thought it might be useful here. https://en.wikipedia.org/wiki/Select_(Unix) I've found a module by Tadzik, https://github.com/tadzik/IO-Select, but it's looking defu

Re: ding!

2017-05-31 Thread David Warring
Does printing an ASCII BEL character do what you want? perl6 -e'print "\x7"' On Thu, Jun 1, 2017 at 3:23 PM, ToddAndMargo wrote: > Hi All, > > Does Perl 6 have a build in "ding" sound, or do I > need to make a system call (which I do all > the time in bash script)? > > Many thanks, > -T > > --

Re: Union

2016-04-12 Thread David Warring
home at the end > of the week although I only have little endian Intell chips. I will have to > look around for others. Btw, are there still chips storing big endian > paired in two bytes? So your example number would become 0x23, 0x01, 0x67, > 0x45 ? > > Thanks again, > Marcel &g

Re: Union

2016-04-11 Thread David Warring
Hi Marcel, With regard to checking for endianess. I don't think there's anything built in NativeCall that directly determines this, but hopefuly the following should do it, without resorting to a C compiler. use NativeCall; sub little-endian returns Bool { my $i = CArray[uint32].new: 0x0123456

Re: Custom accessor compose via traits

2015-07-30 Thread David Warring
t's got a pretty simple tied interface to arrays and hashes, which are a bit more evolved than the above. hash methods are also overrride: AT-KEY ( $foo) , and ASSIGN-KEY ($foo = 42) It's an experiment, which is so far, progressing pretty well, the above is just a nit. - David On Fri, J

Custom accessor compose via traits

2015-07-30 Thread David Warring
The example below is combines traits (S14) Lvalue subs (S06) to create a base class SimpleTiedHash that ties Attributes to the hash using the 'Entry' accessor. PDFCatalog is an example instance class. This mostly works well. But SimpleTiedHash currently has a hacky way of overriding the built-in

Re: Need Help with Perl 6 Module Test::Builder

2015-04-01 Thread David Warring
Hi Tom, I'm seeing the failure(s) as well. I've put in a PR that hopefully addresses this issue - https://github.com/soh-cah-toa/p6-test-builder/pull/2. While we're waiting for the author, you can try checkout out, and building https://github.com/dwarring/p6-test-builder.git Cheers, David On T

Re: match an empty string?

2014-07-12 Thread David Warring
Hi Marc, This looks like a Perl 5 complementary character match: [^:]* But it means something quite different in Perl6. From S05 Bracket rationalization [ ... ] is no longer a character class. It now

Re: Gather, take, newbie questions

2013-12-11 Thread David Warring
Hi Jacinta, I get a bit further with my build of Perl 6, which at least runs: % perl6 fib.pl 0 Are you maybe using an old Perl6? Try: % perl6 -e'say $*PERL' ("name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2013.11-22-g262e600", "release-number" => "", "build-date" => "2013-12-0

Re: Perl 6 / Rakudo unicode code point ranges

2013-02-20 Thread David Warring
the following much simpler rule should suffice: token nonascii {<- [\x0..\x7F]>} (also using \x7F rather than \c[0x7F] - as suggested) Thanks, - David > On Mon, Feb 18, 2013 at 11:29 PM, David Warring > wrote: > >> Hi Guys, >> A quick question. >> >> I

Perl 6 / Rakudo unicode code point ranges

2013-02-18 Thread David Warring
ing a problem implementing a concise regex/grammar rule for the above. Looking for advice. Cheers, David Warring