Re: A natural opportunity for Raku?

2022-02-12 Thread Matthew Stuckwisch
Yes, absolutely. There were some early examples with Tony O'Dell's inline SQL module. It doesn't actually check the syntax, and just passes off everything between 'sql' and ';'. You can see it at . I'm sure it could be updated today to check off

Re: about binary protocol porting

2021-12-29 Thread Matthew Stuckwisch
The SNES compiler write ups reminded me I need to get back into creating a made-for-binary regex system. Once I get done with some other projects I'm knee deep in, I'll sit down to really get a feel for RakuAST and then it'll be all go from there (and of course, as always, I welcome

Re: Date.new("2024-02-29").later( :1year)

2021-12-13 Thread Matthew Stuckwisch
I don't think there is a standard. But the same will happen with .later(:1month) on a month with 31 days where the day is 31, or a DateTime with a leapsecond advancing by a unit larger than a second. It minimizes the changes in nominal units. On Mon, Dec 13, 2021, 05:23 rir wrote: > > REPL

Re: Why does .new initialize?

2021-07-19 Thread Matthew Stuckwisch
In general, the idea of initialized doesn't mean a lot in Raku, at least not at the language level. At any given time, any variable has a value. By default, if you've typed a variable, it's initially set to the type itself (Any is the default type, so the default default value). The only

Re: searching for a blog

2021-07-18 Thread Matthew Stuckwisch
I think it was Daniel Sockwell (codesections) that played around with it. See the blog entry at and the associated Pod::Literate module at . There's also my Test::Inline (I know I

Re: Buf to Str

2021-06-09 Thread Matthew Stuckwisch
Another way to do this could be to just create your own method. my method decode-c(Blob:) { self.subbuf(^self.first(0,:kv)[0]).decode } my $string-with-zero = Buf.new: 72, 101, 108, 108, 111, 0, 32, 119, 111, 114, 108, 100, 33; say $string-with-zero.decode; say $string-with-zero. The output of

Re: locations relative to script location

2021-03-30 Thread Matthew Stuckwisch
Using $*PROGRAM.parent for the directory of the current script is what I've always used, and it works well. Note that if you do .add('../../../'), you may need to also call .resolve at some point, but I generally just use .parent several times. (I think at worst case I've only ever gone up

Re: Module Documentation

2021-03-15 Thread Matthew Stuckwisch
So here's my 2¢, which will probably be followed up with some actual development of stuff (I do put my money where my mouth is… although it might take me a while to save up to spend it ha). Some of the minor details could, of course, easily be adjusted, so don't fixate too much on them. Right

Re: 'CALL-ME' Math problem?

2021-03-02 Thread Matthew Stuckwisch
But why do that when you can add a CALL-ME to the number classes that does multiplication?  Int.^add_fallback( {$^i.defined && $^m eq 'CALL-ME'}, -> $, $ { * * * } ); say 5(4); # 20 On Tue, Mar 2, 2021, 09:08 Daniel Sockwell wrote: > Kevin Pye wrote: > > Just because mathematics

Re: dimensions in a multidimensional array

2021-02-05 Thread Matthew Stuckwisch
I think he meant doing something like this (with fuller handling for out of bounds, exceptions throwing, slices, etc): role Shaped[*@dimensions] { has @!multipliers = @dimensions.reverse.produce(&[*])[0..*-2].reverse.Slip, 1; method AT-POS(*@indices where all @dimensions Z>

Re: \n and array question

2020-11-14 Thread Matthew Stuckwisch
The <…> and «…» constructors break on whitespace. So will actually produce the following array: ["a,b,c,d,e,f"] It's only one item. If we placed space after the comma, that is, , you'd get a six item list, but with the commas attached to all but the final: ["a,", "b,", "c,", "d,",

Re: "ICU - International Components for Unicode"

2020-09-29 Thread Matthew Stuckwisch
In #raku it was mentioned that it would be nice to have a $*UNICODE variable of sorts that reports back the version, but not sure how that would be from an implementation POV. I'm also late to the discussion, so pardon me jumping back a bit. Basically, ICU is something that lets you quickly