Re: getting comb to return match objects

2019-11-17 Thread Joseph Brenner
Oh, you know, think I've spotted a source of confusion in this thread... Liz-- I think my accident-- replied to me directly, and we kept going talking about this without cc-ing the list. So yeah, I pointed out there was a bug with the routine form of comb that wasn't in the Str method, and she ran

Re: getting comb to return match objects

2019-11-17 Thread Parrot Raiser
What do the official tests for this show? On 11/16/19, Joseph Brenner wrote: > William Michelswrote: > >> I went over this with Joe as well, and I was >> equally confused. > > Part of our trouble was we were playing around with the > routine form of comb (rather than the Str method), whic

Re: getting comb to return match objects

2019-11-16 Thread Joseph Brenner
William Michels wrote: > I went over this with Joe as well, and I was > equally confused. Part of our trouble was we were playing around with the routine form of comb (rather than the Str method), which had a bug in it with the :match option (which lizmat just fixed). Even when we tried the Righ

Re: getting comb to return match objects

2019-11-16 Thread Elizabeth Mattijsen
I think https://github.com/rakudo/rakudo/commit/dd2f072d6aae04bfcf2603c6bdcd2f2e7d804ea8 fixed it. > On 16 Nov 2019, at 18:57, Timo Paulssen wrote: > > Oh dang! > > This may very well be a rakudobug. I've actually never used the sub form > of comb, only ever the method form, for which the "ma

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
Oh dang! This may very well be a rakudobug. I've actually never used the sub form of comb, only ever the method form, for which the "match" named parameter definitely exists: "a;b;c".comb(/\w/, match => True); (「a」 「b」 「c」) Someone will have to fix that and then the code from my mail will retroa

Re: getting comb to return match objects

2019-11-16 Thread William Michels via perl6-users
Hello Timo, and thank you for taking the time to explain how "comb" routine signatures work. I have no doubt your description is the correct way to use comb routine(s) in Raku/Perl6. First of all, I should preface my remarks by saying that I'm using Rakudo (moar) 2019.07.1, with the Linenoise modu

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
Hi Bill, In your repl examples you're actually passing the True or False as a positional parameter, which makes it go into the slot for $limit, not the slot for :$match. In order to pass true or false for the "match" named parameter you have different syntactical options:   comb(/\w/, "a;b;c", m

Re: getting comb to return match objects

2019-11-16 Thread William Michels via perl6-users
Hi Yary, I went over this with Joe as well, and I was equally confused. So if I understand what you're saying correctly, if we see something like "Bool :$match" that says we should drop the dollar-sign ($) and enter ":match" to set "Bool" = True, and thus return the list of match objects? On anot

Re: getting comb to return match objects

2019-11-11 Thread yary
The syntax is in the declaration you pasted in your email > multi subcomb(Regex:D $matcher, Str:D $input, $limit = Inf, Bool :$match) The colon in "Bool :$match" makes it a named argument. Not sure where definitive docs are, decent starting point is https://docs.perl6.org/type/Signature#Posit

Re: getting comb to return match objects

2019-11-10 Thread Joseph Brenner
Thanks, that form does what I want-- I don't see how I could've understood that from the docs, though. For example, I don't see any place where the :match adverb is mentioned for either the method or routine form of comb. On 11/10/19, Elizabeth Mattijsen wrote: > dd "foobar".comb(/./, :g, :mat

Re: getting comb to return match objects

2019-11-10 Thread Elizabeth Mattijsen
dd "foobar".comb(/./, :g, :match); (「f」 「o」 「o」 「b」 「a」 「r」) > On 10 Nov 2019, at 23:46, Joseph Brenner wrote: > > Can someone give me an example of how to use the comb routine to > return a list of match objects? > > The documentation here: > > https://docs.perl6.org/type/Str#routine_comb >