Re: getting comb to return match objects

2019-11-17 Thread Joseph Brenner
Paulssen wrote: >>>> 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. >>>> >>

Re: getting comb to return match objects

2019-11-17 Thread Parrot Raiser
I wasn't > even sure if the ":match" flag was supposed to be positional > or not-- a point Yary picked up on. > >> So if I understand what you're >> saying correctly, if we see something like "Bool >> :$match" that says we should drop the dollar-sign >

Re: getting comb to return match objects

2019-11-16 Thread Joseph Brenner
hat 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? Something like that. The ":$match" decl

Re: getting comb to return match objects

2019-11-16 Thread Elizabeth Mattijsen
different syntactical options: >>> >>> comb(/\w/, "a;b;c", match => True) # maybe the simplest is using a pair >>> >>> comb(/\w/, "a;b;c", :match) # using "colon pair" syntax; it's syntax that >>> puts a colon at the beg

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
uot; syntax; it's syntax that >> puts a colon at the beginning and makes a pair >> >> comb(/\w/, "a;b;c", :match(True)) # :match is short for match => True, and >> :match(True) is long for match => True >> >> comb(/\w/, "a;b;c"

Re: getting comb to return match objects

2019-11-16 Thread William Michels via perl6-users
uot;, :match(True)) # :match is short for match => True, and > :match(True) is long for match => True > > comb(/\w/, "a;b;c", :!match) # putting a ! after the : negates the pair, > i.e. it's now match => False > > comb(/\w/, "a;b;c", :match(False)

Re: getting comb to return match objects

2019-11-16 Thread Timo Paulssen
ss a value for $limit   comb(/\w/, "a;b;c", 2, :match) # output up to two results, as match objects Here's a few comments on the examples you pasted: > On another note (or possibly the same note), I tried code similar to > Joe's > with fair success. I was able to get the REP

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 re

Re: getting comb to return match objects

2019-11-11 Thread yary
t; >> 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 > >> > >> Mentions a boolean optio

Re: getting comb to return match objects

2019-11-10 Thread Joseph Brenner
.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: >> >> ht

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://do

getting comb to return match objects

2019-11-10 Thread Joseph Brenner
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 Mentions a boolean option to get match objects: > If $matcher is a Regex, each Match object is > converted to a Str,

[perl #125293] [BUG] Match objects don't roundtrip through .perl

2017-09-12 Thread Christian Bartolomaeus via RT
The tests in question have been unfudged with roast commit https://github.com/perl6/roast/commit/6db316eaae. (This was probably fixed with merging the 'uncurse' branch.) The last example from the last comment (using EVAL) works as expected, too: $ ./perl6-m -e 'say Map.new("a", 42).perl.EVAL'

[perl #125293] Match objects don't roundtrip through .perl

2015-06-06 Thread Christian Bartolomaeus via RT
As far as I understand it, the problem can be golfed to the following: $ perl6 -e 'say EnumMap.new(a, 42).perl' EnumMap.new(:a(42)) $ perl6 -e 'say EnumMap.new(a, 42).perl.perl' EnumMap.new(:a(42)) $ perl6 -e 'say EnumMap.new(a, 42).perl.EVAL' EnumMap.new()

[perl #125293] Match objects don't roundtrip through .perl

2015-05-30 Thread Will Coleda via RT
Additionally, there's a test that refers to operator on the match object, which dies with: This representation (Null) does not support associative access in block unit at t/spec/S05-match/perl.rakudo.moar:23 That is skipped. -- Will Coke Coleda

[perl #125293] Match objects don't roundtrip through .perl

2015-05-30 Thread via RT
# New Ticket Created by Will Coleda # Please include the string: [perl #125293] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/Ticket/Display.html?id=125293 There's a failing test in S05-match/perl.t for this. Looks like the topmost hash

r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread pugs-commits
Author: moritz Date: 2010-08-12 21:10:33 +0200 (Thu, 12 Aug 2010) New Revision: 31972 Modified: docs/Perl6/Spec/S05-regex.pod Log: [S05] specify what .keys, .values and .kv do on Match objects Modified: docs/Perl6/Spec/S05-regex.pod

Re: r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread Jon Lang
How does a Match compare to a Parcel? -- Jonathan Dataweaver Lang

[perl #74694] [BUG] Match objects can have negative .chars in Rakudo

2010-04-27 Thread Carl Mäsak
␤» masak moritz_: still don't manifest that bug. moritz_ masak: just submit it; one more ticket I can close when I get proper Match objects running in Perl 6 * masak submits rakudobug

[perl #67882] BUG: Trouble mixing match objects and ranges

2009-07-26 Thread via RT
# New Ticket Created by Solomon Foster # Please include the string: [perl #67882] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=67882 Rakudo commit version: 241545b9d6c73f95bd8e5255187c30d5e77e6381 Parrot revision

[perl #65208] .print on Match objects does not print anything in Rakudo

2009-05-14 Thread Patrick R. Michaud via RT
On Tue Apr 28 07:44:46 2009, masak wrote: masak rakudo: grammar A { regex TOP { foo } }; A.parse(foo).say; say bar; A.parse(foo).print; say bar p6eval rakudo ae5e29: OUTPUT«foo␤bar␤bar␤» * masak submits rakudobug Expected output: «foo␤bar␤foobar␤». The problem here is that .print is

Re: [perl #65208] .print on Match objects does not print anything in Rakudo

2009-05-14 Thread Patrick R. Michaud
On Thu, May 14, 2009 at 11:34:21AM -0700, Patrick R. Michaud via RT wrote: I'm not sure what the correct behavior should be here, so I'm converting this ticket into a request to confirm/clarify the spec. Followup... Larry has since clarified that .print on a Cursor object (used while

[perl #65610] Match objects are mutable in Rakudo, and after they're changed .perl breaks

2009-05-13 Thread Carl Mäsak
# New Ticket Created by Carl Mäsak # Please include the string: [perl #65610] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=65610 masak rakudo: my $m = foo ~~ /foo/; $mgreeting = OH HAI; say $m.perl p6eval rakudo

[perl #65208] .print on Match objects does not print anything in Rakudo

2009-04-28 Thread Carl Mäsak
# New Ticket Created by Carl Mäsak # Please include the string: [perl #65208] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=65208 masak rakudo: grammar A { regex TOP { foo } }; A.parse(foo).say; say bar;

Re: [perl #39135] Problem with concat on Match objects

2006-05-23 Thread Leopold Toetsch
Am Samstag, 13. Mai 2006 05:36 schrieb Patrick R.Michaud (via RT): I've run into the following problem using concat with Match objects from PGE.  The code below performs a match, then attempts to concatenate a string with the results of the returned Match object: This is now fixed, I've

Re: [perl #39135] Problem with concat on Match objects

2006-05-15 Thread Leopold Toetsch
Patrick R.Michaud (via RT) wrote: I've run into the following problem using concat with Match objects from PGE. The code below performs a match, then attempts to concatenate a string with the results of the returned Match object: There are several problems with the internals of objects

Re: [perl #39135] Problem with concat on Match objects

2006-05-15 Thread Patrick R. Michaud
On Mon, May 15, 2006 at 03:29:23AM -0700, Leopold Toetsch via RT wrote: Patrick R.Michaud (via RT) wrote: I've run into the following problem using concat with Match objects from PGE. The code below performs a match, then attempts to concatenate a string with the results

[perl #39135] Problem with concat on Match objects

2006-05-12 Thread via RT
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #39135] # in the subject line of all future correspondence about this issue. # URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39135 I've run into the following problem using concat with Match objects from PGE

Re: Match objects

2005-12-26 Thread Patrick R. Michaud
On Fri, Dec 23, 2005 at 02:09:19PM +, Luke Palmer wrote: What sort of match object should this return, supposing that it didn't infinite loop: x ~~ / [ [ (x) ]* ]* / Should $/[0][0] be x, or should $/[0][0][0] be x? If it's the latter, then when do new top-level elements get

Re: Match objects

2005-12-26 Thread Luke Palmer
On 12/26/05, Patrick R. Michaud [EMAIL PROTECTED] wrote: On Fri, Dec 23, 2005 at 02:09:19PM +, Luke Palmer wrote: x ~~ / [ [ (x) ]* ]* / As I understand things, $/[0][0] would be x. Hmm, that seems wrong. Consider: xxxyxxyxy ~~ / [ [ (x) ]* (y) ]* / I argue that by the

Re: Match objects

2005-12-26 Thread Patrick R. Michaud
On Mon, Dec 26, 2005 at 07:34:06PM +, Luke Palmer wrote: On 12/26/05, Patrick R. Michaud [EMAIL PROTECTED] wrote: On Fri, Dec 23, 2005 at 02:09:19PM +, Luke Palmer wrote: x ~~ / [ [ (x) ]* ]* / As I understand things, $/[0][0] would be x. Hmm, that seems wrong. Consider:

Re: Match objects

2005-12-26 Thread Luke Palmer
On 12/26/05, Patrick R. Michaud [EMAIL PROTECTED] wrote: I argue that by the structure of that rule, you should be able to tell which xs go with which y. ... Is there a counterargument that I'm not seeing? I'd say that if you want a structured rule, it should be written that way, as in

Match objects

2005-12-23 Thread Luke Palmer
What sort of match object should this return, supposing that it didn't infinite loop: x ~~ / [ [ (x) ]* ]* / Should $/[0][0] be x, or should $/[0][0][0] be x? If it's the latter, then when do new top-level elements get added? / [ [ { say +$/[0][] } # is this