FAQ
# New Ticket Created by Lloyd Fournier
# Please include the string: [perl #128278]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=128278 >


multi regex-dispatch(/fo+/) { };
multi regex-dispatch(/ba+/) {};
regex-dispatch("foo");

Calling regex-dispatch(Str) will never work with any of these multi
signatures:
     (Int $ where { ... })
     (Int $ where { ... })

Obviously what I meant was dispatch it to the one matching. correct answer
is to do $ where /../. A literal regex could be an alias for that like a
literal "foo" is an alias for $ where "foo". Otherwise make it a compile
time error saying you can't use a literal regex in a signature.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl6-compiler @
categoriesperl
postedMay 28, '16 at 12:19p
activeMay 28, '16 at 12:19p
posts1
users1
websiteperl6.org

1 user in discussion

Lloyd Fournier: 1 post

People

Translate

site design / logo © 2019 Grokbase