»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
mudman Exactly what does using the ‘@‘ sigil on a variable name imply? 00:01
raschipi Perl6 will use different interfaces when dealing with it.
mudman So, its a “promise” that the thing does the positional role? If so, how strong a promise? 00:02
jnthn m: my @a := 1 00:04
camelia Type check failed in binding; expected Positional but got Int (1)
in block <unit> at <tmp> line 1
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.
m: my @a := 1 but Positional 00:05
camelia ( no output )
jnthn Also it implies, on a variable declaration, that (by default) an Array container should be created there
And assignment is thus into that container
m: my @a = 1..5; my @b = @a; @b[2]++; say @a
camelia [1 2 3 4 5]
jnthn m: my $a = list 1..5; my $b = $a; $b[2]++; say @a 00:06
camelia 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
jnthn m: my $a = list 1..5; my $b = $a; $b[2]++; say $a
camelia 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 …
jnthn m: my $a = [1..5]; my $b = $a; $b[2]++; say $a
camelia [1 2 4 4 5]
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:07
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:08
00:09 lizmat left 00:14 silug left
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:17
00:20 rindolf left 00:23 Cabanossi left, Cabanossi joined
raschipi mudman, makes sense? 00:24
00:29 markong left 00:33 cdg joined 00:38 cdg left 00:41 pecastro left 00:43 jstuder left 00:47 mingdao left, pecastro joined 00:51 adu joined 00:53 pmurias left 01:00 statisfiable6 left 01:01 statisfiable6 joined
Voldenet Can I somehow easily set affinity of the thread? 01:06
01:06 aborazmeh joined, aborazmeh left, aborazmeh joined
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:09
01:10 mcmillhj joined
raschipi Voldenet: P6 threads are m:n so that information isn't easily manipulated. 01:10
The threads you see don't correspond to operating system threads. 01:11
Voldenet Oh, so I can't really count on doing stuff on uv_thread_t and expect it to work, eh 01:12
raschipi No, the P6 scheduler can remap the user threads to any operating system threads at any time. 01:13
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
I guess what comes from C, stays in C
raschipi You could try to write a scheduler that keeps these things fixed, they're pluggable. 01:15
01:15 mcmillhj left
raschipi You can provide your own Scheduler implementation that decides what to run, where, when. 01:16
Voldenet Ah, so _theoretically_ I could implement /pure pthreads/ scheduler in native C 01:17
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:18
Let them block, Linux can just swap them out. 01:20
Voldenet Yeah, and with OS threads we'd get some fancy features (like affinity bound producer-consumer queues) 01:21
raschipi Especially important when Numa is around. 01:22
01:22 mcmillhj joined
raschipi Try to make fork work too. 01:23
There's an alternative Scheduler implementation: github.com/jnthn/p6-test-scheduler 01:24
01:24 wamba left 01:27 mcmillhj left
timotimo raschipi: the scheduler is for tasks, not for threads 01:30
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?
Voldenet Oh..., so I actually could use pthread_setaffinity_np
timotimo what can't see os threads? 01:33
and what does "see" mean?
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
thread is a pthread plus management datastructures that belong to moarvm, usually also including a libuv event loop
well, callables + arguments i guess 01:35
01:35 konsolebox left
b2gills $*SCHEDULER.queue(:hint-affinity) 01:36
timotimo b2gills: that only tells it to put the task into the affinity queues 01:37
01:39 sena_kun left
timotimo affinity queues have the property that the general queue will never steal tasks from them when it's bored 01:39
01:39 mcmillhj joined 01:40 mson left
raschipi It might be enough. 01:41
timotimo the OS is, of course, still free to pingpong that thread between processors
pthread_setaffinity_np with pthread_self (via nativecall) should work if you do Thread.new yourself 01:42
01:44 mcmillhj left
Voldenet Oh wow, it lives! :D 01:44
I got 15% free performance just by setting affinities :P 01:45
01:49 konsolebox joined
timotimo cool 01:49
01:52 llfourn left 01:55 mudman left 02:00 lizmat joined 02:03 adu left 02:05 lizmat left 02:09 mudman joined
timotimo what kind of machine is it, ooc? many cores? some NUMA kind of deal? 02:09
timotimo bed & 02:11
mudman [sorry: was called away] raschip: yes thankyou, that’s clear. 02:12
02:14 mson joined
raschipi mudman: ask away if you have any 02:34
mudman well, since you ask…. jnthn’s last example; 02:38
m: my $a = [1..5]; my $b = $a; $b[2]++; say $a
camelia [1 2 4 4 5] 02:39
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:40
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 …
raschipi One is an scalar container and the other is an array container created by '[ ]'
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:42
It's not a deep copy. 02:43
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]?
raschipi Answered before you asked.
mudman ah.. 02:44
raschipi "(now two) arrays" There's only one array.
02:44 evalable6 left, evalable6 joined, ChanServ sets mode: +v evalable6
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:45
02:45 ilbot3 left
mudman well then, I need to think about that for a bit because in my (distorted) view, the assignment from $a to $b could just as well be a bind… let me play with the repl for a bit lest I waste you’r time 02:46
s/you’r/your/ 02:47
raschipi A variable in it's usual state points to a container that points to an object. Binding changes the first level while asignement changes the second. 02:48
02:49 mingdao joined
mudman Yes, I’m pretty sure I’ve got that… but in the example, didn’t $a and $b end up pointing to the same container? 02:49
… or two seperate containers each pointing to the same object (ie the (singular) array)? 02:50
raschipi In that case there's 3 levels of redirection. From the variables to 2 containers which point to another container (which is the array).
mudman Thankyou, that’s clear (although, I’ve said that before :-) 02:51
raschipi Sometimes you just need to hear it again.
mudman indeed 02:52
02:53 comborico1611 left
raschipi And it's also important the fact that P6 treats an array and a container pointing to an array the same, it auto unboxes. 02:53
mudman yes, as I’ve read… the scalar container will “hide itself” whereas an array or hash container makes no such effort. 02:54
02:56 ilbot3 joined, ChanServ sets mode: +v ilbot3
raschipi It's important to chase pointers even when the language doesn't have either pointers or references. 02:57
mudman “to chase pointers” meaning chase down exactly what’s going on here as I’m trying to do? 02:58
raschipi catb.org/jargon/html/C/chase-pointers.html 02:59
03:01 prettty-girl left, video-girl-yutub joined 03:02 lizmat joined 03:08 Herby_ left 03:23 Cabanossi left 03:24 Cabanossi joined, raiph left 03:25 konsolebox left 03:34 konsolebox joined 03:39 mcmillhj joined 03:44 mcmillhj left 03:47 troys_ is now known as troys 03:48 cdg joined 03:49 konsolebox left 03:51 Cabanossi left 03:52 cdg left 03:54 Cabanossi joined 03:55 kitsunenokenja joined 03:58 noganex joined 03:59 konsolebox joined 04:01 noganex_ left
araralonre__ Hi 04:02
04:03 araralonre__ is now known as araralonren
raschipi hey 04:03
araralonren I used Cro::HTTP::Client simulate search on some site 04:04
I do a post, and get a Response from the .post method 04:05
Then I call the .body-text, and get a Promise
The Promise status is always Planned except when I set CRO_DEBUG=1
sorry CRO_TRACE=1 04:06
04:06 mcmillhj joined
araralonren gist.github.com/araraloren/b714822...9ff5cd9b66 04:07
This is the POST method
Thanks 04:08
04:09 japhb left 04:11 japhb joined, mcmillhj left 04:15 konsolebox left 04:20 mcmillhj joined 04:21 Cabanossi left 04:23 Cabanossi joined 04:25 mcmillhj left, konsolebox joined 04:30 konsolebox left 04:31 mcmillhj joined 04:33 cpage_ joined 04:36 mcmillhj left 04:37 japhb left 04:38 japhb joined 04:40 mson left 04:52 Cabanossi left 04:53 Cabanossi joined 04:57 raiph joined 04:59 mcmillhj joined 05:00 cpage_ left 05:04 mcmillhj left, konsolebox joined 05:08 kitsunenokenja left 05:11 mcmillhj joined 05:16 mcmillhj left 05:19 benchable6 left, benchable6 joined, ChanServ sets mode: +v benchable6 05:21 khw left 05:22 Cabanossi left 05:23 Cabanossi joined 05:29 raschipi left 05:30 konsolebox left
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:30
05:38 llfourn joined 05:40 konsolebox joined 05:47 konsolebox left 05:48 aborazmeh left, konsolebox joined 05:57 BenGoldberg left 05:59 troys is now known as troys_ 06:03 mudman left 06:10 AlexDaniel left, konsolebox left 06:11 mudman joined, konsolebox joined 06:23 konsolebox left 06:25 konsolebox joined 06:30 troys_ is now known as troys 06:36 konsolebox left 06:37 konsolebox joined 06:40 mson joined 06:42 konsolebox left 06:43 cpage_ joined, konsolebox joined 06:48 konsolebox left 06:49 konsolebox joined 06:50 cpage_ left 06:52 Cabanossi left 06:53 Cabanossi joined 07:03 konsolebox left 07:05 konsolebox joined 07:11 mcmillhj joined 07:16 mcmillhj left 07:19 ivans_ joined 07:22 ivans left 07:23 konsolebox left 07:26 konsolebox joined 07:28 mcmillhj joined 07:32 parv joined 07:33 mcmillhj left 07:39 darutoko joined 07:40 troys left 07:46 konsolebox left, mcmillhj joined 07:48 konsolebox joined 07:51 Cabanossi left, mcmillhj left
lizmat commute to LPW& 07:52
07:52 lizmat left 07:53 Cabanossi joined 07:58 mcmillhj joined 08:00 konsolebox left 08:01 konsolebox joined 08:03 mcmillhj left
araralonren How can I open a file using Perl6 under windows? 08:06
perl6 -e "say \"result.txt\".IO.lines" # Failed to open file F:\作业\搜索日志\result.txt: No such file or directory 08:07
The file is exists
08:08 konsolebox left 08:09 konsolebox joined 08:10 mcmillhj joined
araralonren :( And `perl6 -e "say \"result.txt\".IO.e"` # This return True 08:12
But I can not open that file
08:14 mcmillhj left 08:16 konsolebox left
geekosaur o.O 08:17
that sounds like something gone wrong at either nqp or moarvm level, tbh 08:18
08:18 konsolebox joined
araralonren oh 08:21
08:25 mcmillhj joined 08:28 konsolebox left 08:29 konsolebox joined, rindolf joined 08:30 mcmillhj left 08:34 domidumont joined 08:36 konsolebox left 08:37 domidumont left, konsolebox joined 08:41 mcmillhj joined 08:42 konsolebox left 08:44 konsolebox joined 08:45 philomath_ joined 08:46 mcmillhj left, philomath_ is now known as philomath
Voldenet araralonren: the lowest you can get is `use nqp; my $f := nqp::open("result.txt", "r");`... 08:47
...but "open" call is what sets the error, probably 08:49
araralonren :( windows is suck 08:50
Voldenet github.com/MoarVM/MoarVM/blob/mast...ile.c#L454
08:50 mson left
Voldenet here's where the errors probably occurs, but I have no idea what actually happened 08:50
08:50 wamba joined
Voldenet does it break for any file or just this one? 08:51
araralonren yeah, maybe the encode IDK too
yeah every file
Maybe because the path has Chinese letter 08:52
IDK
08:54 mcmillhj joined
araralonren Yeah, I test it. It's the path problem, but I wonder why it failed 08:58
08:59 mcmillhj left 09:05 Cabanossi left 09:08 Cabanossi joined 09:10 mcmillhj joined
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:14
09:15 rindolf left, mcmillhj left, cpage_ joined, philomath left
araralonren Hmm, I change the path to English, that's not worth currently :) 09:18
There also some problem when using Perl6 in windows 09:19
09:22 mcmillhj joined
Voldenet but yeah, it works under wsl just fine 09:23
after some magic
i.imgur.com/swmdZMK.png 09:24
09:27 mcmillhj left 09:28 sena_kun joined 09:31 greppable6 left, greppable6 joined, ChanServ sets mode: +v greppable6 09:37 philomath joined 09:38 mcmillhj joined 09:43 mudman left, mcmillhj left
araralonren Voldenet, yeah, works for me too, but it has some problem. 09:44
I usually using rakudo under msl
Voldenet uhm, it's not full unix yet, has tons of problems ;\ 09:45
geekosaur yeh, and it wouldn't surprise me if autoconverting between utf16 Windows internal representation and utf8 for msl has glitches 09:46
09:48 cpage_ left 09:49 geospeck joined 09:57 mcmillhj joined 09:59 philomath left 10:01 mcmillhj left 10:06 Cabanossi left 10:08 Cabanossi joined 10:09 geospeck left 10:10 parv left 10:12 mcmillhj joined 10:17 mcmillhj left, mudman joined 10:26 mcmillhj joined 10:30 mcmillhj left 10:34 TEttinger left 10:41 setty1 joined 10:43 espadrine left 10:55 espadrine joined 11:05 Cabanossi left 11:08 Cabanossi joined 11:37 mudman left 11:38 kaare_ left 11:40 |oLa| left, kaare_ joined
stmuk from pbs.twimg.com/media/DPeBpbFW4AAv62v.jpg 11:41
to pbs.twimg.com/media/DPeW-B1XcAUTipS.jpg 11:42
selling well!
11:46 lizmat joined 11:48 espadrine left, rindolf joined 11:54 philomath joined 11:57 llfourn left 11:58 philomath left 12:12 someuser left 12:13 someuser joined 12:14 |oLa| joined 12:25 espadrine joined 12:32 llfourn joined
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:37
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.
timotimo hold on, Inline::Perl6 actually embeds a perl5 inside perl6
i.e. when the perl5 interpreter finds Inline::Perl6, it'll exec a perl6 that then uses Inline::Perl5 to call the original script
at which point it can then just "do nothing" when Inline::Perl6 is loaded, because the perl6 is already there 12:40
12:40 lizmat left
jnthn I don't think it can exec it though, since it's all in the same process :) 12:40
Not to mention that I've seen code setting up MoarVM to run something
But yes, NativeCall will be involved too
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
timotimo Inline::Perl5 binds libperl.so or what it's called
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 12:55 markong joined 12:56 poohman joined 13:00 lizmat left 13:07 domidumont joined 13:09 domidumont left, domidumont joined 13:19 geospeck joined, geospeck left 13:20 |oLa| left
Geth doc: 4ca111db51 | (Jan-Olof Hendig)++ | doc/Type/Range.pod6
Added examples to int-bounds and fixed a typo
13:21
synopsebot Link: doc.perl6.org/type/Range
13:24 domidumont left 13:36 kitsunenokenja joined 13:42 robertle joined 13:46 Alikzus left 13:54 Alikzus joined 14:04 llfourn_ joined 14:06 llfourn left, Cabanossi left 14:07 lizmat joined 14:08 Cabanossi joined 14:18 geospeck joined 14:25 coverable6 left, coverable6 joined, ChanServ sets mode: +v coverable6 14:27 AlexDaniel joined 14:30 AlexDaniel left 14:31 AlexDaniel joined 14:43 lizmat left 14:44 lizmat joined 14:45 Alikzus left, lizmat left 14:47 Alikzus joined 15:03 philomath joined 15:06 Cabanossi left 15:08 Cabanossi joined 15:10 espadrine left
moritz does anybody want to write an advent post about Perl 6 modules on CPAN? 15:16
15:20 TimToady left 15:21 TimToady joined 15:22 kitsunenokenja left 15:24 awwaiid left 15:25 tangible6 left, tangible6 joined 15:30 isBEKaml joined 15:33 espadrine joined
Geth doc: fc30df5bcb | (Moritz Lenz)++ | doc/Language/modules.pod6
Elaborate a bit on CPAN upload

  * use language "Target Directory" as it is used on PAUSE
  * declare up-front that this is the preferred way of doing things
15:34
synopsebot Link: doc.perl6.org/language/modules
ecosystem: 3f1d3fa39e | (Moritz Lenz)++ | PULL_REQUEST_TEMPLATE.md
Mention CPAN uploads in pull request template
15:38
15:43 isBEKaml left
moritz I think timotimo++ inspired the last commit 15:44
timotimo yeah i think i pointed that out, i might not be the only one (or even the first) 16:07
16:13 evalable6 left, evalable6 joined, ChanServ sets mode: +v evalable6 16:22 ponbiki joined
moritz perlpunks.de/paste/show/5a1998d5.b53.8b # number of modules by source 16:22
16:22 ponbiki left 16:23 ponbiki joined
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:34
16:45 cdg joined 16:51 Cabanossi left 16:53 Cabanossi joined 16:54 philomath left 16:55 poohman_ joined
SmokeMachine jnthn: hi... im trying to write that test... but i can't find a way to make that work... 16:57
this is my try:
www.irccloud.com/pastebin/02Zcq1m7/
but it times out...
16:59 poohman left, poohman_ is now known as poohman 17:03 konsolebox left
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...
jnthn Yeah, that'll do it :)
17:09 konsolebox joined
SmokeMachine that worked for ThreadPoolScheduler but not for CurrentThreadScheduler... :( 17:11
17:11 araralonren left 17:12 wander joined 17:13 sena_kun left
wander I've seen a file of roast named "S05-mass". What is "mass" means? 17:13
timotimo "a whole bunch of tests" 17:14
or "similar tests" 17:15
"a whole bunch of similar tests"
jnthn SmokeMachine: No, I don't think it makes sense there
SmokeMachine: Could try with Supply.on-demand instead
.oO( There's so many tests, it took a whole Maß to write them... )
17:16
17:16 khw joined 17:20 Cabanossi left 17:23 Cabanossi joined
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...
wander to me it seems like "misc" or "mess" 17:24
timotimo yeah 17:25
the major information in this case comes from the folder containing it
wander well :P 17:26
17:31 lizmat joined 17:39 geospeck left 17:43 silug joined
SmokeMachine jnthn: github.com/perl6/roast/pull/358 17:49
jnthn SmokeMachine: Left two small comments 17:51
SmokeMachine jnthn: I wrote a question... 17:53
jnthn Yeah, answered :) 17:54
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
jnthn Or a multi that takes Str, & :P 17:56
SmokeMachine jnthn: that would make sense... 17:57
I changed to 5 seconds... should I merge it?
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
I cant seem t ofind a "filter" routine in the docs
lizmat m: dd <1 2 3 4 5 6>.grep( * %% 2 ) 18:02
camelia (IntStr.new(2, "2"), IntStr.new(4, "4"), IntStr.new(6, "6")).Seq
lizmat m: say <1 2 3 4 5 6>.grep( * %% 2 )
camelia (2 4 6)
tyil oh
nice
thanks :3
18:08 kitsunenokenja joined 18:09 espadrine left 18:10 Rawriful joined
jnthn SmokeMachine: It's merged :) 18:13
SmokeMachine :) 18:14
Im doing the same for zip-latest now...
18:15 zakharyas joined 18:24 lizmat left 18:28 mson joined
SmokeMachine jnthn: the original tests of zip-latest are different from the docs... it isn't done on any are done: github.com/perl6/roast/blob/master...test.t#L16 18:40
is it ok to change the tests or the docs should be changed? 18:41
18:41 cdg left 18:42 cdg joined 18:47 cdg left 18:51 darutoko left
SmokeMachine m: react whenever Supply.from-list(^4).throttle(4, 1) { .say } 18:51
camelia (timeout)0
SmokeMachine shouldn't it become done when the original supply become done? 18:52
gagalicious is perl6 more popular than perl5 now? coz perl5 is good enough already and perl6 seems to be in dormant mode forever? 19:03
SmokeMachine looks the $done is never being seted: github.com/rakudo/rakudo/blob/mast...y.pm#L1434 19:05
timotimo gagalicious: where did you get the info about "dormant mode forever"? 19:06
El_Che gagalicious: your statement kind of contradict itself 19:08
19:08 geospeck joined
timotimo i think perhaps one 5 got switched with a 6 by accident 19:08
19:08 domidumont joined
El_Che we kind of agreed that Perl isn't like the Highlander 19:09
"There Can Be Only One" does not apply
19:12 wander left
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:19
timotimo m: say Str.^methods 19:22
camelia (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 …
geospeck yes, that's what I was looking for. Thank you very much timotimo! 19:23
19:25 Aaronepower left 19:26 pecastro left, pecastro joined 19:30 zakharyas1 joined 19:37 zakharyas left 19:41 domidumont left 19:43 cdg joined 19:45 zakharyas1 left 19:49 ivans_ left, ivans joined 19:55 Jan joined, Jan is now known as Guest79602 19:59 Guest79602 left 20:02 pmurias joined 20:20 Mrofnet joined, Morfent left 20:22 Merfont joined 20:23 video-girl-yutub left 20:24 Mrofnet left 20:25 wander joined
wander How about "value context"? 20:25
moritz what abouti t?
wander It says it's "sink, Boolean, string, or numeric", so what is "sink"?
moritz void
wander is `given $var { when / pattern / { ...} }' "sink"? 20:26
or I cannot find a direct example of it quickly :3 20:27
moritz $x; 1 20:29
the $x is in sink context
because nothing uses the value
m: 1; 2;
camelia 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
wander yes, I know these are "void" 20:32
what I meet is "Specifically, a /.../ matches immediately in a value context (sink, Boolean, string, or numeric)"
20:33 s0me0ne-unkn0wn left
wander so is there an example of matching in a "sink" context? 20:33
moritz m: 'abc' ~~ /a { say "I'm matching"}/; 20:35
camelia I'm matching
moritz ^^ your example
wander Just around! 20:37
Thank you.
20:45 yqt joined 20:51 Cabanossi left 20:53 Cabanossi joined, cpage_ joined 21:00 geospeck left 21:01 Herby_ joined
Herby_ o/ 21:01
El_Che >~~{o 21:02
21:15 espadrine joined 21:19 wander left
Herby_ rookie question: are grammars helpful if you don't the order of objects in a string? 21:22
sorry, the order of patterns 21:23
teatime can be
21:23 cpage_ left
Herby_ for example, if I wanted to parse a torrent name: The Walking Dead S05E03 720p HDTV x264-ASAP[ettv] 21:23
I dont know that the title will always come first, or that the season and episode would be before the resolution 21:24
I was looking at trying my hand at porting this python module to p6: github.com/divijbindlish/parse-torrent-name 21:26
since I havent really used grammars much, I thought this might be a good exercise
21:27 Sgeo left 21:28 mudman joined 21:31 Rawriful left 21:33 dogbert17 left
El_Che Herby_: I don't se why not 21:34
see
the parts have recognizable parts 21:35
so you'll end up with something more reasable than a simple regex 21:36
21:36 Sgeo joined
Herby_ El_Che: thanks 21:37
21:53 cdg left, cdg joined 21:59 mudman left 22:02 Merfont left 22:06 silug left 22:07 giraffe joined 22:14 setty1 left 22:22 Cabanossi left 22:23 Cabanossi joined 22:25 cdg left, TEttinger joined 22:26 Morfent joined, cpage_ joined 22:28 TEttinger left 22:35 cdg joined 22:37 char_var[buffer] joined 22:40 cdg left 22:44 konsolebox left 22:46 konsolebox joined 22:58 konsolebox left 22:59 konsolebox joined 23:14 yqt left, robertle left 23:24 rindolf left 23:26 konsolebox left 23:27 konsolebox joined 23:32 konsolebox left 23:34 konsolebox joined 23:38 pmurias left 23:43 konsolebox left 23:45 konsolebox joined 23:50 konsolebox left 23:51 Cabanossi left 23:52 konsolebox joined 23:53 Cabanossi joined