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.
>>>>
>>
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
>
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
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
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"
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)
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
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
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
.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
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
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,
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'
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()
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
# 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
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
How does a Match compare to a Parcel?
--
Jonathan Dataweaver Lang
»
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
# 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
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«foobarbar»
* masak submits rakudobug
Expected output: «foobarfoobar».
The problem here is that .print is
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
# 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
# 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;
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
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
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
# 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
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
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
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:
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
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
33 matches
Mail list logo