This channel is intended for people just starting with the Raku Programming Language (raku.org). Logs are available at irclogs.raku.org/raku-beginner/live.html Set by lizmat on 8 June 2022. |
|||
00:38
saint- joined
00:39
saint- left
00:50
discord-raku-bot left,
discord-raku-bot joined
01:21
saint- joined
01:50
discord-raku-bot left,
discord-raku-bot joined
01:54
discord-raku-bot left
01:55
discord-raku-bot joined
02:50
discord-raku-bot left,
discord-raku-bot joined
03:33
rf left
03:50
discord-raku-bot left,
discord-raku-bot joined
05:50
discord-raku-bot left
05:51
discord-raku-bot joined
06:14
Heptite left
06:50
discord-raku-bot left
06:51
discord-raku-bot joined
07:51
discord-raku-bot left,
discord-raku-bot joined
08:51
discord-raku-bot left,
discord-raku-bot joined
08:55
discord-raku-bot left
08:56
discord-raku-bot joined
09:03
samebchase left
09:51
discord-raku-bot left,
discord-raku-bot joined
12:51
discord-raku-bot left
12:52
discord-raku-bot joined
14:27
loken joined
14:51
discord-raku-bot left
14:52
discord-raku-bot joined
15:18
loken left
15:37
Heptite joined
15:51
discord-raku-bot left
15:52
discord-raku-bot joined
|
|||
stevied | what response is the scary red messages at raku.land/github:labster/File::Directory::Tree trying to elicit? | 16:00 | |
should I be worried about using the module? | |||
does this mean the module might be hacked? | 16:01 | ||
16:03
Guest14 joined
|
|||
Guest14 | Hi | 16:04 | |
stevied | hi | 16:05 | |
16:05
Guest14 left
16:06
jgaz joined
16:17
rf joined
|
|||
rf | How can I restrict a match capture? For example if I want to capture the match between two '/', $my-text ~~ /^ '/'$<m>=[.*]'/' $/, in this case it always keeps the '/' on the end, how can I just match what's between? | 16:18 | |
m: '/hello-bob/' ~~ /^ '/'$<m>=[.*]'/' $/; | 16:20 | ||
camelia | ( no output ) | ||
stevied | captures are done with open/close parens | ||
rf | m: '/hello-bob/' ~~ /^ '/'$<m>=([.*])'/' $/; | ||
camelia | ( no output ) | ||
rf | Could you show me an example? :D | 16:21 | |
stevied | yeah | ||
i forget how to use this bot. hold on. | |||
rf | No problem! | 16:22 | |
stevied | m: 'hello-bob' ~~ /^(\w).*/; say $0; | 16:23 | |
here, the first letter is captured into the variable $0 | |||
m: 'hello-bob' ~~ /^(\w)(\w).*/; say $0; say $1; | 16:24 | ||
next set of parens is captured with $1, and so on | 16:25 | ||
rf | m: 'hello-bob' ~~ /^(\w)(\w).*/; say $0; say $1; | ||
camelia | 「h」 「e」 |
||
rf | I see, but can I do this named? | ||
stevied | yes | ||
rf | m: '/hello-bob/' ~~ /^'/'$<m>=(.*)'/'/; say $0; say $1; | 16:26 | |
camelia | Nil Nil |
||
rf | m: '/hello-bob/' ~~ /^ '/' $<m>=(.*) '/' $/; say $0; say $1; | ||
camelia | Nil Nil |
||
rf | m: '/hello-bob/' ~~ /^ '/' $<m>=(.*) '/' $/; say $<m>; | ||
camelia | 「hello-bob」 | ||
rf | Ah | ||
Nice. Thank you! | |||
stevied | docs.raku.org/language/regexes#Nam...ion_syntax | 16:27 | |
np | |||
rf | One more little regex thing, '/hello-bob' ~~ /^ '/' $<m>=(.*) '/'? $/ | 16:36 | |
How can I stop it from matching the / in this case, maybe it's there maybe it's not but I don't want to see it. | |||
m: '/hello-bob' ~~ /^ '/' $<m>=(.*) '/'? $/; say $<m>; | 16:37 | ||
camelia | 「hello-bob」 | ||
rf | m: '/hello-bob/' ~~ /^ '/' $<m>=(.*) '/'? $/ say $<m>; | ||
camelia | ===SORRY!=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> /hello-bob/' ~~ /^ '/' $<m>=(.*) '/'? $/⏏ say $<m>; expecting any of: infix infix stopper statement end s… |
||
rf | m: '/hello-bob/' ~~ /^ '/' $<m>=(.*) '/'? $/; say $<m>; | ||
camelia | 「hello-bob/」 | ||
rf | I tried the m:1st adverb but it still died | 16:38 | |
stevied | don't use (.*) | ||
rf | Err, produced the wrong result. | ||
stevied | you want to use a negation match instead and matching anything that is NOT a / | ||
that's done with <-[/]> | 16:39 | ||
that's done with `<-[/]>` | |||
rf | m: '/hello-bob/' ~~ /^ '/' $<m>=(.*) <-[/]>? $/; say $<m>; | 16:40 | |
camelia | 「hello-bob/」 | ||
stevied | m: '/hello-bob/' ~~ /^ '/' $<m>=(<-[/]>) '/'? $/; say $<m> | ||
rf | Ahh, see I tried what I just wrote above last night when trying this but I see now. I need to match anything but the /. | 16:41 | |
Thanks again :D | |||
stevied | np | ||
i forgot a '+' sign on mine, hold on | 16:42 | ||
m: '/hello-bob/' ~~ /^ '/' $<m>=(<-[/]>+) '/'? $/; say $<m> | |||
there we go | |||
rf | m: '/hello-bob/' ~~ /^ '/' $<m>=(<-[/]>+) '/'? $/; say $<m> | ||
camelia | 「hello-bob」 | ||
rf | Yeah, perfect. Thanks a lot! | ||
stevied | oh, the other option is to make the capture non-greedy with `(.*?)` | 16:43 | |
with non-greedy, it will not suck up everything to the end. | 16:44 | ||
I think that would also work in your case | |||
m: '/hello-bob/' ~~ /^ '/' $<m>=(.*?) '/'? $/; say $<m> | |||
yeah, so that works, too. thought it's probably a little slower | 16:45 | ||
yeah, so that works, too. though it's probably a little slower | |||
rf | Cool, I'll test out both | 17:00 | |
I though the 1st adverb might have done it, but it counted it all as one match too :( | 17:01 | ||
17:52
discord-raku-bot left,
discord-raku-bot joined
18:20
samebchase joined
|
|||
JsExplorerNeil | Hi. I was wondering - is Raku ready for production use on jvm, js and moarvm? I just need an awesome scripting language so it doesn't need to be "blazingly fast" 😉 | 18:59 | |
Nemokosch | Hello. MoarVM is the "state of art" runtime, JVM might work but doesn't necessarily have advantages and the JS backend is mostly a "proof of concept" at this point, simply because of the lack of resources for implementing it properly. | 19:25 | |
20:52
discord-raku-bot left,
discord-raku-bot joined
21:52
discord-raku-bot left,
discord-raku-bot joined
22:26
saint- left
22:41
jgaz left
23:44
rf left
23:52
discord-raku-bot left
23:53
discord-raku-bot joined
|