Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-11-25

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:01 mudman Exactly what does using the ‘@‘ sigil on a variable name imply?
00:01 raschipi Perl6 will use different interfaces when dealing with it.
00:02 mudman So, its a “promise” that the thing does the positional role?  If so, how strong a promise?
00:04 jnthn m: my @a := 1
00:04 camelia rakudo-moar f82433bfd: OUTPUT: «Type check failed in binding; expected Positional but got Int (1)␤  in block <unit> at <tmp> line 1␤␤»
00:04 raschipi It will refuse to put anything that doesn't implent Positional in there. Because it knows it won't be able to index ("[ ]") into it.
00:05 raschipi m: my @a := 1 but Positional
00:05 camelia rakudo-moar f82433bfd: ( no output )
00:05 jnthn Also it implies, on a variable declaration, that (by default) an Array container should be created there
00:05 jnthn And assignment is thus into that container
00:05 jnthn m: my @a = 1..5; my @b = @a; @b[2]++; say @a
00:05 camelia rakudo-moar f82433bfd: OUTPUT: «[1 2 3 4 5]␤»
00:06 jnthn m: my $a = list 1..5; my $b = $a; $b[2]++; say @a
00:06 camelia rakudo-moar f82433bfd: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared. Did you mean '$a'?␤at <tmp>:1␤------> 3a = list 1..5; my $b = $a; $b[2]++; say 7⏏5@a␤»
00:06 jnthn m: my $a = list 1..5; my $b = $a; $b[2]++; say $a
00:06 camelia rakudo-moar f82433bfd: OUTPUT: «Cannot resolve caller postfix:<++>(Int); the following candidates␤match the type but require mutable arguments:␤    (Mu:D $a is rw)␤    (Int:D $a is rw)␤␤The following do not match for other reasons:␤    (Bool:D $a is rw)␤    (Bool:U $a …»
00:06 jnthn m: my $a = [1..5]; my $b = $a; $b[2]++; say $a
00:06 camelia rakudo-moar f82433bfd: OUTPUT: «[1 2 4 4 5]␤»
00:07 jnthn So from those two, 1) assinging into @a makes mutable containers for each element, and 2) assignment between @-sigil things is copying, not by reference
00:08 raschipi In this last jnthn example, only one array was created by the [ ]. If there was @-sigiled variables involved, other arrays would be created and asigned.
00:17 raschipi So, to tie into my "uses other interfaces" comment above: if the variable has $, '=' will modify it's container. But if it has @, '=' will copy into the array.
00:23 Cabanossi joined #perl6
00:24 raschipi mudman, makes sense?
00:33 cdg joined #perl6
00:47 pecastro joined #perl6
00:51 adu joined #perl6
01:01 statisfiable6 joined #perl6
01:06 Voldenet Can I somehow easily set affinity of the thread?
01:06 aborazmeh joined #perl6
01:06 aborazmeh joined #perl6
01:09 Voldenet I've thought of using pthread_setaffinity_np on MVMThreadBody's thread (I guess it might work on unix), but that'd be incredibly bruteforce way to do this
01:10 mcmillhj joined #perl6
01:10 raschipi Voldenet: P6 threads are m:n so that information isn't easily manipulated.
01:11 raschipi The threads you see don't correspond to operating system threads.
01:12 Voldenet Oh, so I can't really count on doing stuff on uv_thread_t and expect it to work, eh
01:13 raschipi No, the P6 scheduler can remap the user threads to any operating system threads at any time.
01:14 Voldenet Well, I wish to get some of that stuff in the future, though even libuv devs don't have much love for that approach
01:14 Voldenet I guess what comes from C, stays in C
01:15 raschipi You could try to write a scheduler that keeps these things fixed, they're pluggable.
01:16 raschipi You can provide your own Scheduler implementation that decides what to run, where, when.
01:17 Voldenet Ah, so _theoretically_ I could implement /pure pthreads/ scheduler in native C
01:18 raschipi P6 uses m:n to save memory as I understand it. A user thread that gets blocked stops using a OS thread from the pool. This avoids needing a lot of threads. But I don't know of any motive why it couldn't just launch a new OS thread and keep it 1:1.
01:20 raschipi Let them block, Linux can just swap them out.
01:21 Voldenet Yeah, and with OS threads we'd get some fancy features (like affinity bound producer-consumer queues)
01:22 raschipi Especially important when Numa is around.
01:22 mcmillhj joined #perl6
01:23 raschipi Try to make fork work too.
01:24 raschipi There's an alternative Scheduler implementation: https://github.com/jnthn/p6-test-scheduler
01:30 timotimo raschipi: the scheduler is for tasks, not for threads
01:31 timotimo when you create a Thread.new, you'll get what you'd get from pthread_create
01:31 raschipi OK, so it also can't see OS threads?
01:31 Voldenet Oh..., so I actually could use pthread_setaffinity_np
01:33 timotimo what can't see os threads?
01:33 timotimo and what does "see" mean?
01:34 raschipi Let me rephrase. What's the difference between 'tasks' and 'threads'?
01:34 timotimo task is a callable that gets pushed into a queue
01:34 timotimo thread is a pthread plus management datastructures that belong to moarvm, usually also including a libuv event loop
01:35 timotimo well, callables + arguments i guess
01:36 b2gills $*SCHEDULER.queue(:hint-affinity)
01:37 timotimo b2gills: that only tells it to put the task into the affinity queues
01:39 timotimo affinity queues have the property that the general queue will never steal tasks from them when it's bored
01:39 mcmillhj joined #perl6
01:41 raschipi It might be enough.
01:41 timotimo the OS is, of course, still free to pingpong that thread between processors
01:42 timotimo pthread_setaffinity_np with pthread_self (via nativecall) should work if you do Thread.new yourself
01:44 Voldenet Oh wow, it lives! :D
01:45 Voldenet I got 15% free performance just by setting affinities :P
01:49 konsolebox joined #perl6
01:49 timotimo cool
02:00 lizmat joined #perl6
02:09 mudman joined #perl6
02:09 timotimo what kind of machine is it, ooc? many cores? some NUMA kind of deal?
02:11 * timotimo bed &
02:12 mudman [sorry: was called away] raschip: yes thankyou, that’s clear.
02:14 mson joined #perl6
02:34 raschipi mudman: ask away if you have any
02:38 mudman well, since you ask…. jnthn’s last example;
02:38 mudman m: my $a = [1..5]; my $b = $a; $b[2]++; say $a
02:39 camelia rakudo-moar f82433bfd: OUTPUT: «[1 2 4 4 5]␤»
02:40 mudman … the second assignment, $b = $a; assignment b/w two scalars means “make a copy of whatever’s in container $a and put the copy into $b”
02:41 raschipi You need to know there's two containers there.
02:41 mudman … in this case though, there was an array container in $a.  So a copy of the container was made - i.e a new array …
02:41 raschipi One is an scalar container and the other is an array container created by '[ ]'
02:42 raschipi What is copied (a new one is created) is the scalar container and bot point ot the array container (which there's only one).
02:55 raschipi It's not a deep copy.
02:55 mudman … but the copy is sort-of shallow: i.e. the (now two) arrays are using the same set of scalar containers…  yes/no/[you’re crazy]?
02:55 raschipi Answered before you asked.
02:55 mudman ah..
02:55 raschipi "(now two) arrays" There's only one array.
02:55 evalable6 joined #perl6
02:55 raschipi Array don't just pop up, they need to be created. Either by Array.new, [], or the default action on declaring a @ variable.
02:56 ilbot3 joined #perl6
02:56 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:57 raschipi It's important to chase pointers even when the language doesn't have either pointers or references.
02:58 mudman “to chase pointers” meaning chase down exactly what’s going on here as I’m trying to do?
02:59 raschipi http://catb.org/jargon/html/C/chase-pointers.html
03:01 video-girl-yutub joined #perl6
03:02 lizmat joined #perl6
03:24 Cabanossi joined #perl6
03:34 konsolebox joined #perl6
03:39 mcmillhj joined #perl6
03:48 cdg joined #perl6
03:54 Cabanossi joined #perl6
03:55 kitsunenokenja joined #perl6
03:58 noganex joined #perl6
03:59 konsolebox joined #perl6
04:02 araralonre__ Hi
04:03 raschipi hey
04:04 araralonren I used Cro::HTTP::Client simulate search on some site
04:05 araralonren I do a post, and get a Response from the .post method
04:05 araralonren Then I call the .body-text, and get a Promise
04:05 araralonren The Promise status is always Planned except when I set CRO_DEBUG=1
04:06 araralonren sorry CRO_TRACE=1
04:06 mcmillhj joined #perl6
04:07 araralonren https://gist.github.com/araraloren/b71482265faa2c103340d99ff5cd9b66
04:07 araralonren This is the POST method
04:08 araralonren Thanks
04:11 japhb joined #perl6
04:20 mcmillhj joined #perl6
04:23 Cabanossi joined #perl6
04:25 konsolebox joined #perl6
04:31 mcmillhj joined #perl6
04:33 cpage_ joined #perl6
04:38 japhb joined #perl6
04:53 Cabanossi joined #perl6
04:57 raiph joined #perl6
04:59 mcmillhj joined #perl6
05:04 konsolebox joined #perl6
05:11 mcmillhj joined #perl6
05:19 benchable6 joined #perl6
05:23 Cabanossi joined #perl6
05:30 Voldenet timotimo: a regular xeon, apparently for some workloads logical cpus help a little bit - i've set up my producers and consumers to communicate via physical cores with HT instead of "just let OS plan it", it's pretty obvious why it's faster in that config tho
05:38 llfourn joined #perl6
05:40 konsolebox joined #perl6
05:48 konsolebox joined #perl6
06:11 mudman joined #perl6
06:11 konsolebox joined #perl6
06:25 konsolebox joined #perl6
06:37 konsolebox joined #perl6
06:40 mson joined #perl6
06:43 cpage_ joined #perl6
06:43 konsolebox joined #perl6
06:49 konsolebox joined #perl6
06:53 Cabanossi joined #perl6
07:05 konsolebox joined #perl6
07:11 mcmillhj joined #perl6
07:19 ivans_ joined #perl6
07:26 konsolebox joined #perl6
07:28 mcmillhj joined #perl6
07:32 parv joined #perl6
07:39 darutoko joined #perl6
07:46 mcmillhj joined #perl6
07:48 konsolebox joined #perl6
07:52 lizmat commute to LPW&
07:53 Cabanossi joined #perl6
07:58 mcmillhj joined #perl6
08:01 konsolebox joined #perl6
08:06 araralonren How can I open a file using Perl6 under windows?
08:07 araralonren perl6 -e "say \"result.txt\".IO.lines" # Failed to open file F:\作业\搜索日志\result.txt: No such file or directory
08:07 araralonren The file is exists
08:09 konsolebox joined #perl6
08:10 mcmillhj joined #perl6
08:12 araralonren :( And `perl6 -e "say \"result.txt\".IO.e"` # This return True
08:12 araralonren But I can not open that file
08:17 geekosaur o.O
08:18 geekosaur that sounds like something gone wrong at either nqp or moarvm level, tbh
08:18 konsolebox joined #perl6
08:21 araralonren oh
08:25 mcmillhj joined #perl6
08:29 konsolebox joined #perl6
08:29 rindolf joined #perl6
08:34 domidumont joined #perl6
08:37 konsolebox joined #perl6
08:41 mcmillhj joined #perl6
08:44 konsolebox joined #perl6
08:45 philomath_ joined #perl6
08:47 Voldenet araralonren: the lowest you can get is `use nqp; my $f := nqp::open("result.txt", "r");`...
08:49 Voldenet ...but "open" call is what sets the error, probably
08:50 araralonren :( windows is suck
08:50 Voldenet https://github.com/MoarVM/MoarVM/blob/master/src/io/syncfile.c#L454
08:50 Voldenet here's where the errors probably occurs, but I have no idea what actually happened
08:50 wamba joined #perl6
08:51 Voldenet does it break for any file or just this one?
08:51 araralonren yeah, maybe the encode IDK too
08:51 araralonren yeah every file
08:52 araralonren Maybe because the path has Chinese letter
08:52 araralonren IDK
08:54 mcmillhj joined #perl6
08:58 araralonren Yeah, I test it. It's the path problem, but I wonder why it failed
09:08 Cabanossi joined #perl6
09:10 mcmillhj joined #perl6
09:14 Voldenet I was going to suggest perl6 under wsl, but now that I'm trying to run it, it just dies, I'm pretty unsure if it's worth the effort though
09:15 cpage_ joined #perl6
09:18 araralonren Hmm, I change the path to English, that's not worth currently :)
09:19 araralonren There also some problem when using Perl6 in windows
09:22 mcmillhj joined #perl6
09:23 Voldenet but yeah, it works under wsl just fine
09:23 Voldenet after some magic
09:24 Voldenet https://i.imgur.com/swmdZMK.png
09:28 sena_kun joined #perl6
09:31 greppable6 joined #perl6
09:37 philomath joined #perl6
09:38 mcmillhj joined #perl6
09:44 araralonren Voldenet, yeah, works for me too, but it has some problem.
09:44 araralonren I usually using rakudo under msl
09:45 Voldenet uhm, it's not full unix yet, has tons of problems ;\
09:46 geekosaur yeh, and it wouldn't surprise me if autoconverting between utf16 Windows internal representation and utf8 for msl has glitches
09:49 geospeck joined #perl6
09:57 mcmillhj joined #perl6
10:08 Cabanossi joined #perl6
10:12 mcmillhj joined #perl6
10:17 mudman joined #perl6
10:26 mcmillhj joined #perl6
10:41 setty1 joined #perl6
10:55 espadrine joined #perl6
11:08 Cabanossi joined #perl6
11:40 kaare_ joined #perl6
11:41 stmuk from https://pbs.twimg.com/media/DPeBpbFW4AAv62v.jpg
11:42 stmuk to https://pbs.twimg.com/media/DPeW-B1XcAUTipS.jpg
11:42 stmuk selling well!
11:46 lizmat joined #perl6
11:48 rindolf joined #perl6
11:54 philomath joined #perl6
12:13 someuser joined #perl6
12:14 |oLa| joined #perl6
12:25 espadrine joined #perl6
12:32 llfourn joined #perl6
12:37 ZzZombo How doable is embedding Perl6 into, say, a C++ application? Or at least compile for a different target virtual machine that is embedded into said program?
12:39 timotimo you can embed a moarvm into any c/c++ program, or in fact anything that can call into C
12:39 jnthn There's not yet a formal API, but it's been done. See Inline::Perl6.
12:39 timotimo hold on, Inline::Perl6 actually embeds a perl5 inside perl6
12:39 timotimo i.e. when the perl5 interpreter finds Inline::Perl6, it'll exec a perl6 that then uses Inline::Perl5 to call the original script
12:40 timotimo at which point it can then just "do nothing" when Inline::Perl6 is loaded, because the perl6 is already there
12:40 jnthn I don't think it can exec it though, since it's all in the same process :)
12:40 jnthn Not to mention that I've seen code setting up MoarVM to run something
12:40 jnthn But yes, NativeCall will be involved too
12:42 jnthn Oh, also I see what timotimo meant: it's not quite "exec" so much as "just use MoarVM to invoke perl6.moarvm with a "use TheBinding" and TheBinding uses NativeCall to set up callbacks that can be used from C/C++ land
12:42 ZzZombo ah, I always wondered how exactly do those two work. Do they actually run the respective Perl executables? How do they get info out of them
12:42 timotimo Inline::Perl5 binds libperl.so or what it's called
12:44 jnthn Yeah, and Inline::Perl6 mostly re-uses Inline::Perl5 for all the heavy lifting, and just has a bit to load libmoar and set that up
12:44 ZzZombo interesting.
12:46 lizmat joined #perl6
12:55 markong joined #perl6
12:56 poohman joined #perl6
13:07 domidumont joined #perl6
13:09 domidumont joined #perl6
13:19 geospeck joined #perl6
13:20 |oLa| left #perl6
13:21 Geth ¦ doc: 4ca111db51 | (Jan-Olof Hendig)++ | doc/Type/Range.pod6
13:21 Geth ¦ doc: Added examples to int-bounds and fixed a typo
13:21 synopsebot Link: https://doc.perl6.org/type/Range
13:21 Geth ¦ doc: review: https://github.com/perl6/doc/commit/4ca111db51
13:36 kitsunenokenja joined #perl6
13:42 robertle joined #perl6
13:54 Alikzus joined #perl6
14:04 llfourn_ joined #perl6
14:07 lizmat joined #perl6
14:08 Cabanossi joined #perl6
14:18 geospeck joined #perl6
14:25 coverable6 joined #perl6
14:27 AlexDaniel joined #perl6
14:31 AlexDaniel joined #perl6
14:44 lizmat joined #perl6
14:47 Alikzus joined #perl6
15:03 philomath joined #perl6
15:08 Cabanossi joined #perl6
15:16 moritz does anybody want to write an advent post about Perl 6 modules on CPAN?
15:21 TimToady joined #perl6
15:25 tangible6 joined #perl6
15:30 isBEKaml joined #perl6
15:33 espadrine joined #perl6
15:34 Geth ¦ doc: fc30df5bcb | (Moritz Lenz)++ | doc/Language/modules.pod6
15:34 synopsebot Link: https://doc.perl6.org/language/modules
15:34 Geth ¦ doc: Elaborate a bit on CPAN upload
15:34 Geth ¦ doc:
15:34 Geth ¦ doc: * use language "Target Directory" as it is used on PAUSE
15:34 Geth ¦ doc: * declare up-front that this is the preferred way of doing things
15:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/fc30df5bcb
15:38 Geth ¦ ecosystem: 3f1d3fa39e | (Moritz Lenz)++ | PULL_REQUEST_TEMPLATE.md
15:38 Geth ¦ ecosystem: Mention CPAN uploads in pull request template
15:38 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/3f1d3fa39e
15:44 moritz I think timotimo++ inspired the last commit
16:07 timotimo yeah i think i pointed that out, i might not be the only one (or even the first)
16:13 evalable6 joined #perl6
16:22 ponbiki joined #perl6
16:22 moritz http://perlpunks.de/paste/show/5a1998d5.b53.8b # number of modules by source
16:23 ponbiki joined #perl6
16:34 AlexDaniel fwiw I think greppable6 supports cpan, github and gitlab, but I'd love to add bitbucket and notabug. I just need someone to upload a module there :)
16:45 cdg joined #perl6
16:53 Cabanossi joined #perl6
16:55 poohman_ joined #perl6
16:57 SmokeMachine jnthn: hi... im trying to write that test... but i can't find a way to make that work...
16:57 SmokeMachine this is my try:
16:57 SmokeMachine https://www.irccloud.com/pastebin/02Zcq1m7/
16:57 SmokeMachine but it times out...
17:06 jnthn SmokeMachine: I'd not implement Tappable directly; $*SCHEDULER.cue does not return a Tap object that can be passed to the tap(...) function, though, which is what'll be going wrong
17:06 SmokeMachine I think Im going to use Supply.interval...
17:06 jnthn Yeah, that'll do it :)
17:09 konsolebox joined #perl6
17:11 SmokeMachine that worked for ThreadPoolScheduler but not for CurrentThreadScheduler... :(
17:12 wander joined #perl6
17:13 wander I've seen a file of roast named "S05-mass". What is "mass" means?
17:14 timotimo "a whole bunch of tests"
17:15 timotimo or "similar tests"
17:15 timotimo "a whole bunch of similar tests"
17:15 jnthn SmokeMachine: No, I don't think it makes sense there
17:15 jnthn SmokeMachine: Could try with Supply.on-demand instead
17:16 jnthn .oO( There's so many tests, it took a whole Maß to write them... )
17:16 khw joined #perl6
17:23 Cabanossi joined #perl6
17:23 wander timotimo: still confuse, what information of the test can I get after reading the name?
17:23 SmokeMachine I tried using .from-list, but that already worked before the fix...
17:24 wander to me it seems like "misc" or "mess"
17:25 timotimo yeah
17:25 timotimo the major information in this case comes from the folder containing it
17:26 wander well :P
17:31 lizmat joined #perl6
17:43 silug joined #perl6
17:49 SmokeMachine jnthn: https://github.com/perl6/roast/pull/358
17:51 jnthn SmokeMachine: Left two small comments
17:53 SmokeMachine jnthn: I wrote a question...
17:54 jnthn Yeah, answered :)
17:55 jnthn I understand why the message that goes with a subtest goes at the end, but sometimes I wish it came first :)
17:55 timotimo implement an alternative called "testsub" where the description goes at the front
17:56 jnthn Or a multi that takes Str, & :P
17:57 SmokeMachine jnthn: that would make sense...
17:57 SmokeMachine I changed to 5 seconds... should I merge it?
18:00 tyil is there an easy way to filter a list, ie <1 2 3 4 5 6>.filter(sub($x) { $x % 2 == 0 }) # <2, 4, 6>
18:00 tyil I cant seem t ofind a "filter" routine in the docs
18:02 lizmat m: dd <1 2 3 4 5 6>.grep( * %% 2 )
18:02 camelia rakudo-moar 4003b93f6: OUTPUT: «(IntStr.new(2, "2"), IntStr.new(4, "4"), IntStr.new(6, "6")).Seq␤»
18:02 lizmat m: say <1 2 3 4 5 6>.grep( * %% 2 )
18:02 camelia rakudo-moar 4003b93f6: OUTPUT: «(2 4 6)␤»
18:02 tyil oh
18:02 tyil nice
18:02 tyil thanks :3
18:08 kitsunenokenja joined #perl6
18:10 Rawriful joined #perl6
18:13 jnthn SmokeMachine: It's merged :)
18:14 SmokeMachine :)
18:14 SmokeMachine Im doing the same for zip-latest now...
18:15 zakharyas joined #perl6
18:28 mson joined #perl6
18:40 SmokeMachine jnthn: the original tests of zip-latest are different from the docs... it isn't done on any are done: https://github.com/perl6/roast/blob/master/S17-supply/zip-latest.t#L16
18:41 SmokeMachine is it ok to change the tests or the docs should be changed?
18:42 cdg joined #perl6
18:51 SmokeMachine m: react whenever Supply.from-list(^4).throttle(4, 1) { .say }
18:51 camelia rakudo-moar 4003b93f6: OUTPUT: «(timeout)0␤»
18:52 SmokeMachine shouldn't it become done when the original supply become done?
19:03 gagalicious is perl6 more popular than perl5 now? coz perl5 is good enough already and perl6 seems to be in dormant mode forever?
19:05 SmokeMachine looks the $done is never being seted: https://github.com/rakudo/rakudo/blob/master/src/core/Supply.pm#L1434
19:06 timotimo gagalicious: where did you get the info about "dormant mode forever"?
19:08 El_Che gagalicious: your statement kind of contradict itself
19:08 geospeck joined #perl6
19:08 timotimo i think perhaps one 5 got switched with a 6 by accident
19:08 domidumont joined #perl6
19:09 El_Che we kind of agreed that Perl isn't like the Highlander
19:09 El_Che "There Can Be Only One" does not apply
19:19 geospeck Is there any way to get all the methods that an object responds to? For example in Ruby you can call "obj.methods" and it prints all the methods that obj responds to.
19:22 timotimo m: say Str.^methods
19:22 camelia rakudo-moar 4003b93f6: OUTPUT: «(BUILD Capture Int Num chomp starts-with ends-with substr-eq contains indices index rindex pred succ comb match subst-mutate subst ords lines parse-base parse-names samecase samemark samespace word-by-word trim-leading trim-trailing trim words encode …»
19:23 geospeck yes, that's what I was looking for. Thank you very much timotimo!
19:26 pecastro joined #perl6
19:30 zakharyas1 joined #perl6
19:43 cdg joined #perl6
19:49 ivans joined #perl6
19:55 Jan joined #perl6
20:02 pmurias joined #perl6
20:20 Mrofnet joined #perl6
20:22 Merfont joined #perl6
20:25 wander joined #perl6
20:25 wander How about "value context"?
20:25 moritz what abouti t?
20:25 wander It says it's "sink, Boolean, string, or numeric", so what is "sink"?
20:25 moritz void
20:26 wander is `given $var { when / pattern / { ...} }' "sink"?
20:27 wander or I cannot find a direct example of it quickly :3
20:29 moritz $x; 1
20:29 moritz the $x is in sink context
20:29 moritz because nothing uses the value
20:29 moritz m: 1; 2;
20:29 camelia rakudo-moar 4003b93f6: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤Useless use of constant integer 2 in sink context (line 1)␤»
20:30 s0me0n3-unkn0wn joined #perl6
20:32 wander yes, I know these are "void"
20:32 wander what I meet is "Specifically, a /.../ matches immediately in a value context (sink, Boolean, string, or numeric)"
20:33 wander so is there an example of matching in a "sink" context?
20:35 moritz m: 'abc' ~~ /a { say "I'm matching"}/;
20:35 camelia rakudo-moar 4003b93f6: OUTPUT: «I'm matching␤»
20:35 moritz ^^ your example
20:37 wander Just around!
20:37 wander Thank you.
20:45 yqt joined #perl6
20:53 Cabanossi joined #perl6
20:53 cpage_ joined #perl6
21:01 Herby_ joined #perl6
21:01 Herby_ o/
21:02 El_Che >~~{o
21:15 espadrine joined #perl6
21:22 Herby_ rookie question: are grammars helpful if you don't the order of objects in a string?
21:23 Herby_ sorry, the order of patterns
21:23 teatime can be
21:23 Herby_ for example, if I wanted to parse a torrent name: The Walking Dead S05E03 720p HDTV x264-ASAP[ettv]
21:24 Herby_ I dont know that the title will always come first, or that the season and episode would be before the resolution
21:26 Herby_ I was looking at trying my hand at porting this python module to p6: https://github.com/divijbindlish/parse-torrent-name
21:26 Herby_ since I havent really used grammars much, I thought this might be a good exercise
21:28 mudman joined #perl6
21:34 El_Che Herby_: I don't se why not
21:34 El_Che see
21:35 El_Che the parts have recognizable parts
21:36 El_Che so you'll end up with something more reasable than a simple regex
21:36 Sgeo joined #perl6
21:37 Herby_ El_Che: thanks
21:53 cdg joined #perl6
22:07 giraffe joined #perl6
22:23 Cabanossi joined #perl6
22:25 TEttinger joined #perl6
22:26 Morfent joined #perl6
22:26 cpage_ joined #perl6
22:35 cdg joined #perl6
22:37 char_var[buffer] joined #perl6
22:46 konsolebox joined #perl6
22:59 konsolebox joined #perl6
23:27 konsolebox joined #perl6
23:34 konsolebox joined #perl6
23:45 konsolebox joined #perl6
23:52 konsolebox joined #perl6
23:53 Cabanossi joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo