»ö« 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.
00:02 lowin joined
Geth doc: f71865883d | (Will "Coke" Coleda)++ | 2 files
fix typo

toggled means both set & unset; don't need to negate it.
00:06
doc: cfea1b40a7 | (Will "Coke" Coleda)++ | doc/Language/terms.pod6
This isn't Perl
synopsebot Link: doc.perl6.org/language/terms
timotimo We're not in Perl anymore.
00:06 pmurias left 00:08 lichtkind left 00:10 dct left 00:12 mempko joined 00:19 bwisti joined 00:32 wamba left 00:38 comborico1611 joined 01:02 cdg joined 01:07 cdg left 01:09 shinobicl left 01:16 leont left 01:17 markong left, unicodable6 left, quotable6 left, unicodable6 joined, quotable6 joined, ChanServ sets mode: +v quotable6 01:18 comborico1611 left 01:20 jeek joined 01:27 astj_ joined 01:28 astj__ joined 01:29 shinobi-cl joined 01:30 astj left 01:31 leont joined 01:32 astj_ left 01:35 klapperl left 01:36 klapperl joined 01:44 lowin left 01:48 troys is now known as troys_ 01:52 lowin joined 01:58 eliasr left 01:59 mempko left 02:09 shinobi-cl left 02:10 shinobi-cl joined 02:17 astj joined 02:20 astj__ left 02:31 astj_ joined 02:35 astj left 02:42 cdg joined 02:45 ilbot3 left 02:47 cdg left 02:48 Sgeo left 02:52 lowin left 02:53 lowin joined 02:56 cdg joined, ilbot3 joined, ChanServ sets mode: +v ilbot3 03:00 leont left 03:04 astj joined 03:05 astj__ joined, troys_ is now known as troys, astj left 03:06 astj joined, mempko joined 03:07 astj_ left 03:09 astj__ left 03:20 Sgeo joined 03:31 lowin left 03:39 leont joined 03:44 lowin joined 03:45 troys is now known as troys_ 03:55 leont left 03:56 ufobat_ joined 03:57 bloatable6 left, bloatable6 joined, ChanServ sets mode: +v bloatable6 03:59 ufobat left 04:01 astj_ joined 04:05 astj left 04:06 lowin left 04:12 lowin joined 04:14 leont joined
syntaxman I'm using zef to install Jupyter::Kernel, but it fails saying that Net::ZMQ can't find the libzmq.so.5 library... which is in /usr/local/lib 04:24
My firm belief is that asking dumb questions in public will make the answer pop into your brain. 04:31
.
ldconfig saves the day.
04:31 Mithaldu joined 04:37 stmuk_ joined 04:38 Cabanossi left 04:39 Cabanossi joined, stmuk left 04:40 cdg left
geekosaur rubber duck debugging saves the day again :p 04:53
04:55 cdg joined 04:59 cpage_ joined 05:00 cdg left 05:12 ufobat_ left 05:13 troys_ is now known as troys 05:20 khw left 05:34 leont left 05:50 leont joined 05:55 shinobi-cl left 06:00 troys left, shinobi-cl joined
shinobi-cl hi all. How should a bidimensional array handle .elems? I think it should return a pair of (number of columns, number of rows). 06:11
moritz or it could return the number of rows 06:16
and @a[0].elems returns the number of columns
or the other way round, depending on whether your array is row-major or column-major 06:17
or .elems could return $rows * $columns, and you have separate methods for accessing those individually
shinobi-cl i think i will use your last suggestion. Thanks! :) 06:24
06:30 darutoko joined
shinobi-cl can i use AT-POS with something different that a Int? Like a Pair? my $cell = $myobj[('A', 1)] ? 06:32
I thikn that associative makes more sense, i just want to know if it is pssible :) 06:34
moritz should be possible, yes
you can look in rakudo's file src/core/array_slice.pm to see what kind of stuff is supported 06:35
you can certainly pass an Iterable to .[] 06:36
shinobi-cl Thank you very much, moritz++ 06:37
06:40 leont left 06:49 kerframil joined 06:50 domidumont joined 07:00 lowbro joined, lowbro left, lowbro joined, domidumont1 joined 07:02 domidumont left 07:05 domidumont joined 07:08 domidumont1 left 07:11 domidumont left 07:12 domidumont joined 07:17 cdg joined 07:21 cdg left 07:22 kerframil left 07:28 shinobi-cl left 07:33 |oLa| joined 07:37 dudebbn__ joined 07:39 dudebbn_ left 07:51 lookatme joined 07:52 kerframil joined 07:59 wamba joined 08:10 abraxxa joined 08:24 mniip left 08:27 aeruder joined 08:28 rindolf joined, mniip joined 08:40 leont joined 08:51 scimon joined 08:53 zakharyas joined 08:59 zakharyas left 09:09 leont left 09:10 cgfbee joined 09:18 dakkar joined 09:19 cgfbee left
lizmat clickbaits p6weekly.wordpress.com/2018/01/15/...blue-note/ 09:24
09:24 cgfbee joined 09:25 wamba left
DrForr is baited. 09:30
09:39 andrewalker joined 09:43 leont joined 09:51 sftp joined
El_Che DrForr: I have some timesharing opportunities you'd be interested in 10:05
DrForr Oh dear.
Oh, got it. Sorry, I'm still a little stiff from a bad night's sleep. 10:10
moritz
.oO( would you like to multi task with me? ) :D
10:12
DrForr Let's not go there at the moment :) 10:13
I'll be OK by FOSDEM, I just need to remember to stretch. 10:15
scimon lizmat++ on the weekly :) 10:19
10:19 wamba joined 10:21 cdg joined 10:31 eliasr joined 10:32 leont left 10:33 sftp left 10:35 sftp joined 10:53 zakharyas joined 10:54 wamba left
Geth doc/fluca1978-backtracking: 10 commits pushed by (Luca Ferrari)++
review: github.com/perl6/doc/compare/00000...869e2eecaa
11:02
jnthn m: my @a[2;4]; say @a.elems; say @a.shape 11:04
camelia 2
(2 4)
jnthn That's what Perl 6 does with the built-in multi-dimensional arrays, fwiw :) 11:05
(Referring to question in backlog)
m: my @a[2;4]; say [*] @a.shape
camelia 8
jnthn And the other thing is easy too :)
Altreus is that the volume 11:09
m: my @a[2;5;4]; say [*] @a.shape;
camelia 40
Altreus :o
Altreus flexes repl
timotimo m: my @a[2;4] = (1, 2, 3, 4; 9, 9, 9, 9)
camelia ( no output )
timotimo m: my @a[2;4] = (1, 2, 3, 4; 9, 9, 9, 9); say @a.elems; .say for @a
camelia 2
1
2
3
4
9
9
9
9
timotimo i'm not very happy with the difference in what .elems gives and what you get in a for loop :\ 11:10
Altreus surely .elems is going to be 2
timotimo yeah, it gave 2 11:11
then iterated over 8 elements :)
Altreus oh 11:12
one would have expected more []s
I'm mildly confused by the various ways I can use (), [], and ; 11:14
jnthn .elems is made to give the first dimension so that we can make @a[*-1;*-1] style things work
11:14 wamba joined
timotimo ah, hm 11:14
jnthn (In the future, they won't yet)
Altreus So it seems like a shaped array is a bit WIP right now 11:15
is there a document on how it's supposed to work? I'm interested 11:16
It seems a little bit surprising because you don't know you've got a shaped array when you start iterating
jnthn Partial views of multi-dim arrays were deferred to a future language version; doing them efficiently needs some careful work. 11:18
But the "iterate the leaves" behavior was settled
I think S09 is the best place to look for info on the full set of speculated features 11:19
Altreus I guess you can always just have a multidimensional array without p6 knowing its shape
jnthn If you don't declare a shape, you just have an array of arrays 11:20
Which is fine
The storage strategy will be different then 11:21
When a shape is provided then a single blob of memory is used for all the data
Altreus that makes sense 11:22
hopefully not a sploit ;)
jnthn No, it enforces the dimensions 11:25
timotimo if you want the sploit, you use CArray 11:27
11:28 travis-ci joined
travis-ci Doc build passed. Luca Ferrari 'Add backtracking term to the glossary. 11:28
travis-ci.org/perl6/doc/builds/329414192 github.com/perl6/doc/compare/7d480...9e2eecaab0
11:28 travis-ci left
Geth doc: fluca1978++ created pull request #1733:
Fluca1978 backtracking
11:34
11:35 scovit joined 11:40 cdg left 11:46 committable6 left, committable6 joined 11:50 pmurias joined
pmurias rt.perl.org/Public/Bug/Display.html?id=125682 - this ticket can still be reproduced on rakudo.moar just with a longer year 11:51
12:15 markong joined
jkramer Is there a List/Array method that takes a matcher, removes all matching elements from array and returns them? I thought I've seen something like that but can't remember 12:21
yoleaux 13 Jan 2018 04:14Z <Zoffix> jkramer: the `where` on variable thing makes sense to me and contrary to what was suggested in the channel earlier, I don't think it's a bug. The difference lies in that when you use a `where` in a parameter, it concerns a single transaction: binding a value to parameter. When you use `where` with attribute/variable, however, it checks the *values* whenever they're modified. It'd be weird if doing
13 Jan 2018 04:15Z <Zoffix> jkramer: @foo[42] = 1337 would invoke `where` callable with the entire array instead of just the value we're interested in
timotimo jkramer: depending on how exactly you want it to behave, your best bet is probably @list .= grep(none(your-matcher)); 12:22
m: my @a = ^100; @a .= grep(none(*.is-prime)); say @a
camelia [0 1 4 6 8 9 10 12 14 15 16 18 20 21 22 24 25 26 27 28 30 32 33 34 35 36 38 39 40 42 44 45 46 48 49 50 51 52 54 55 56 57 58 60 62 63 64 65 66 68 69 70 72 74 75 76 77 78 80 81 82 84 85 86 87 88 90 91 92 93 94 95 96 98 99]
12:24 stmuk joined
geekosaur comb? 12:24
timotimo oh, wait, you want the removed bits returned
you can get that with classify/categorize 12:25
if you're okay with the array having holes afterwards, you can do slicing
12:25 stmuk_ left
jkramer timotimo: But does it return the other elements? I basically want to partition a list into two groups based on the matcher. .classify and categorize are ok, but getting a hash back is a bit of a hassle sometimes when I just want to lists 12:25
moritz m: say (1..5).classify(*.is-prime) 12:26
camelia {False => [1 4], True => [2 3 5]}
jkramer Basically Haskell's groupBy :)
timotimo m: say (1..10).classify(*.is-prime)<True False>.perl
camelia (Any, Any)
timotimo oops, has to be objects
m: say (1..10).classify(*.is-prime){True, False}.perl
camelia ($[2, 3, 5, 7], $[1, 4, 6, 8, 9, 10])
timotimo there you get two lists ;)
jkramer Hmm I guess that'll do :D
Thanks
timotimo YW
moritz m: my (:True(@primes), :False(@non-primes)) := (1..10).classify(*.is-prime); say @non-primes.perl 12:27
camelia [1, 4, 6, 8, 9, 10]
timotimo that's a lot wordier, but also rather a bit prettier
perlawhi1l m: (1..10).classify(*.is-prime).values 12:30
camelia ( no output )
perlawhi1l m: say (1..10).classify(*.is-prime).values
camelia ([2 3 5 7] [1 4 6 8 9 10])
timotimo perlawhi1l: it isn't guaranteed what order True and False will hash in
bisectable6: :{True => 1, False => 2}.values.say 12:31
bisectable6 timotimo, Bisecting by output (old=2015.12 new=cf15435) because on both starting points the exit code is 0
timotimo no, not the right bot
bisectable6 timotimo, bisect log: gist.github.com/aee7d6186ecf0bb2b6...016193d066
timotimo, (2017-02-22) github.com/rakudo/rakudo/commit/1c...24e4d0d5d3
timotimo committable6: releases :{True => 1, False => 2}.values.say
committable6 timotimo, ¦2015.12,2016.01.1,2016.02,2016.03,2016.04,2016.05,2016.06,2016.07.1,2016.08.1,2016.09,2016.10,2016.11,2016.12,2017.01,2017.02: «(1 2)␤» ¦2017.03,2017.04.3,2017.05,2017.06,2017.07,2017.08,2017.09,2017.10,2017.11,2017.12,HEAD(cf15435): «(2 1)␤»
timotimo regardless of what this says! don't rely on it 12:32
AlexDaniel committable6: all :{True => 1, False => 2}.values.say 12:33
committable6 AlexDaniel, gist.github.com/d0993097c22c7c90b2...ab26eeb0aa
AlexDaniel ↑ that's a better picture :) 12:34
ah no
same
AlexDaniel is blind
12:37 pmurias left 12:39 pmurias joined 13:07 wamba left 13:08 famra joined 13:11 pilne left
perlawhi1l There was a big change a few months back... if I recall, a new JIT for Moar. approximately when was that 13:16
(or hey, if you have the exact commit, i won't complain)
13:18 wamba joined
AlexDaniel well, the rakudo commit is right there 13:21
13:27 rgrau left 13:30 aindilis left 13:31 aindilis joined 13:34 famra left, rgrau joined 13:37 foobar` left
timotimo 2017.10 13:39
perlawhi1l: ^- that's the release of moarvm that merged it
jkramer m: my (@a, @b) = (^5, 2..3, 7..9).classify(so * (&) (3..4)){True, False}; say @a.perl; say @b.perl; 13:41
camelia [[^5, 2..3], [7..9,]]
[]
jkramer How do I make the False-result go into @b? 13:42
perlawhi1l timotimo: thanks
jkramer m: my (@a, @b) = |(^5, 2..3, 7..9).classify(so * (&) (3..4)){True, False}; say @a.perl; say @b.perl;
camelia [[^5, 2..3], [7..9,]]
[]
timotimo jkramer: you're gonna need := instead of =
13:42 pochi left
jkramer m: my (@a, @b) := |(^5, 2..3, 7..9).classify(so * (&) (3..4)){True, False}; say @a.perl; say @b.perl; 13:42
13:42 pochi joined
camelia [^5, 2..3]
[7..9,]
13:42
jkramer Oh nice, thanks :)
timotimo m: my (@a, @b) := (^5, 2..3, 7..9).classify(so * (&) (3..4)){True, False}; say @a.perl; say @b.perl; 13:44
camelia [^5, 2..3]
[7..9,]
timotimo no need for the prefix:<|> either
scimon So you can't have private multi methods. Is that a "We'd like to but not implemented it" or a "Not going to happen" thing? And if it's the second case can someone give me a rationale?
13:45 famra joined
jkramer m: my (@a, @b) := |(^5, 2..3, 7..9).classify(so * (&) (10..11)){True, False}; say @a.perl; say @b.perl; 13:46
camelia Type check failed in binding to parameter '@a'; expected Positional but got Any (Any)
in block <unit> at <tmp> line 1
jkramer How can I prevent that?
Oh whatever I'll just use the hash then, this is too much hassle now :) 13:47
jnthn scimon: I don't see any reason why we can't have it, it's just figuring out a good way to implement it
scimon That's cool. :)
timotimo oh, if it doesn't have any results in one of them?
m: my (@a, @b) := {a => (1, 2, 3)}<a b> 13:48
camelia Type check failed in binding to parameter '@b'; expected Positional but got Any (Any)
in block <unit> at <tmp> line 1
timotimo m: my ($a, $b) := {a => (1, 2, 3)}<a b>; say $a; say $b 13:49
camelia (1 2 3)
(Any)
timotimo m: my ($a, $b) := {b => (1, 2, 3)}<a b>; say $a; say $b
camelia (Any)
(1 2 3)
timotimo m: my ($a, $b) := {c => (1, 2, 3)}<a b>; say $a; say $b
camelia (Any)
(Any)
timotimo m: my (@a, @b) := {a => (1, 2, 3)}<a b>.>>.list; say @a.perl; say @b.perl
camelia (1, 2, 3)
(Any,)
timotimo no, that doesn't help
m: my (@a, @b) := {a => (1, 2, 3)}<a b> >>//>> Empty; say @a.perl; say @b.perl
camelia Too few positionals passed to '<unit>'; expected 2 arguments but got 0
in block <unit> at <tmp> line 1
timotimo nope.
13:53 cdg joined 13:56 stmuk_ joined 13:57 stmuk left
jkramer Is there some syntax sugar to make this a bit nicer/shorter? .reduce({ ($^a.min min $^b.min)..^($^a.max max $^b.max) }) 13:58
(2..4, 1..3, 3..6).reduce({ ($^a.min min $^b.min)..^($^a.max max $^b.max) })
m: (2..4, 1..3, 3..6).reduce({ ($^a.min min $^b.min)..^($^a.max max $^b.max) }).say
camelia 1..^6
jnthn m: say (2..4, 1..3, 3..6).reduce(&minmax) 14:03
camelia 1..6
jnthn That's pretty close, I think
jkramer Uhmm ok I'll have to figure out how/why that works first :D I looked into minmax but couldn't see how it's useful for reduce 14:04
jnthn I don't know without looking either ;) 14:05
timotimo m: say 2..4 minmax 9..100
camelia 2..100
timotimo m: say 2..4 minmax 1..100
camelia 1..100
timotimo i suppose minmax is defined on two ranges, too
m: say 2..4 minmax 50
camelia 2..50
timotimo m: say 2..4 minmax 0
camelia 0..4
jkramer Ohh so minmax is an operator, I was just looking the method Range.minmax
timotimo heh. 14:06
14:10 famra left 14:11 squashable6 left, squashable6 joined 14:13 bisectable6 left 14:14 bisectable6 joined, ChanServ sets mode: +v bisectable6
jkramer Isn't the minmax operator documented anywhere? It's mentioned on docs.perl6.org/language/operators in the precendence table, but with no explanation 14:17
14:21 pmurias left
scimon So the more I play with multi methods the more I love there awesomeness. 14:21
wamba m: with "ab" { say  m/ [ <?after a> (.*)] $ /; say m:P5/(?=a)(.*)$/} 14:22
camelia 「b」
0 => 「b」
「ab」
0 => 「ab」
14:22 Kaiepi left 14:23 Kaiepi joined 14:27 dylanwh joined, pmurias joined 14:39 releasable6 left, greppable6 left, statisfiable6 left, releasable6 joined, greppable6 joined, statisfiable6 joined
AlexDaniel m: say 5 minmax 8 minmax 3 14:41
camelia 3..8
AlexDaniel cool
perlawhi1l m: say [minmax] 5, 8, 3, 2, 7 14:43
camelia 2..8
AlexDaniel jkramer: github.com/perl6/doc/issues/1734
perlawhi1l if you actually want the min and max values for assignment, you can also use the 'bounds' (or 'int-bounds') methods 14:47
m: my ($min, $max) = ( [minmax] 5, 8, 3, 2, 7).bounds; say $min; say $max;
camelia 2
8
AlexDaniel m: say minmax 5, 8, 3, 2, 7 14:55
camelia 2..8
14:56 pmurias left 14:59 zakharyas left, zakharyas joined 15:04 kerframil left, zakharyas left 15:08 pmurias joined
[Coke] m: Promise.in(4).then: { say 'yawn' } 15:13
camelia ( no output )
[Coke] m: await Promise.in(4).then: { say 'yawn' }
camelia yawn
timotimo the process shuts down before the promise gets resolved
15:15 pmurias left
[Coke] Yes, I wasn't reporting a bug, just correcting my typo. 15:19
timotimo OK
15:23 famra joined
scimon So, how polished do people thing a module should be before release? 15:29
*think* 15:30
lizmat it should have some documentation and some tests that don't fail ? 15:31
15:31 dylanwh left
lizmat
.oO( release early, release often )
15:31
El_Che scimon: if you plan to change the API dramatically, state it in the doc
scimon Oh yeah. Definitely. 15:32
15:32 dylanwh joined
El_Che scimon: you can use version numbers for that 15:32
scimon In this case it's a bare bones of what I'd like it to do but it's enough I can start using it in tests for other modules. So I figure I can share it. It might be helpful.
Righto. It's on it's way. 15:35
15:37 famra left 15:38 lowbro left, pmurias joined
jkramer AlexDaniel: Thanks! 15:39
That reminds me that I wanted to report a bug a few days ago but I don't remember what it was
buggable New CPAN upload: Test-HTTP-Server-0.1.0.tar.gz by SCIMON cpan.metacpan.org/authors/id/S/SC/...1.0.tar.gz 15:42
15:42 geospeck joined 15:43 geospeck left
lizmat jkramer: maybe a memory problem :-) 15:44
lizmat has that all the time :-( 15:47
moritz try to get another gig of RAM, maybe? :-)
jkramer Ok I remember now. Where would I report a bug regarding class attributes? In rakudo I guess? 15:48
moritz yes
Geth doc: 3157e72c19 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Rat.pod6
Fix Rat parametarization

  (even tho rakudo doesn't yet implement it as a native type, it's
better than a type that doesn't exist)
  github.com/rakudo/rakudo/commit/cf15435575
  github.com/rakudo/rakudo/commit/6977680bd9
15:55
synopsebot Link: doc.perl6.org/type/Rat
15:56 Zoffix joined
Zoffix jkramer: did you see my robot message to you? 15:56
jkramer Zoffix: No, what should I look for? :) 15:58
Zoffix jkramer: I don't think it's a bug. What behaviour for `has @.foo where …` do you expect when `Foo.foo[0] = 42;` is performed? The where executed with the entire Array?
jkramer: irclog.perlgeek.de/perl6/2018-01-16#i_15695964
m: -> @a where +* { @a = (); dd @a}([1,]) 15:59
camelia []
Zoffix If anything, ^ that is a bug because the `where` is lost, but I think that ship has sailed...
16:00 wamba left
jkramer Ah ok. Hmm I still think it's weird/wrong. You could still use the where to check on every element if that's what you really want to do, but if this is the default there's no way to check on things like array length etc. 16:00
16:00 Kaiepi left, Kaiepi joined
jkramer I also wouldn't expect @foo[42] = 1337 to cause a constraint check on @foo but on @foo[42], but isn't that what subtyping with Array[Int] etc is for? 16:02
Zoffix m: my @a where { dd $_; True } := [<a b c>] 16:05
camelia Type check failed in binding; expected Positional[<anon>] but got Array ($["a", "b", "c"])
in block <unit> at <tmp> line 1
Zoffix m: my $a where { dd $_; True } := [<a b c>]
camelia ["a", "b", "c"]
Zoffix jkramer: ok, file away then :) github.com/rakudo/rakudo/issues/new
16:10 comborico1611 joined 16:12 cdg left
jkramer github.com/rakudo/rakudo/issues/1414 16:12
comborico1611 Hello
Zoffix \o 16:13
timotimo do we have a nice little factoid for how to begin a slang on camelia?
Zoffix How about: "Don't do it, because there's no official interface" 16:14
:)
huggable: slang
huggable Zoffix, mouq.github.io/slangs.html Make an op that chains right (uses unsupported feature: slangs): BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 smaller 3
16:16 troys joined
timotimo aaw 16:18
we'll have something some day i guess 16:19
Zoffix I wonder what that'd look like... Would we just freeze pieces of the grammar? To be modifieable only under the same conditions as routines/methods? 16:20
timotimo BEGIN { $?LANG.refine_slang('MAIN', role { token ws { <_ws> | "like" ","? } }); }; sub like, hi() { say like, "how are you" }; like hi() 16:21
m: BEGIN { $?LANG.refine_slang('MAIN', role { token ws { <_ws> | "like" ","? } }); }; sub like, hi() { say like, "how are you" }; like hi()
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3 { <_ws> | "like" ","? } }); }; sub like7⏏5, hi() { say like, "how are you" }; like
expecting any of:
new name to be defined
timotimo m: BEGIN { $?LANG.refine_slang('MAIN', role { token ws { <_ws> | "like" ","? } }); }; { sub like, hi() { say like, "how are you" }; like hi() }
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3 <_ws> | "like" ","? } }); }; { sub like7⏏5, hi() { say like, "how are you" }; like
expecting any of:
new name to be defined
timotimo :(
Zoffix You can't modify ws that easily
timotimo oh, i'd have to match whitespace around it, too
m: BEGIN { $?LANG.refine_slang('MAIN', role { token ws { <_ws> | <_ws> "like" ","? <_ws> } }); }; { sub like, hi() { say like, "how are you" }; like hi() } 16:22
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3s> "like" ","? <_ws> } }); }; { sub like7⏏5, hi() { say like, "how are you" }; like
expecting any of:
new name to be defined
timotimo :(
16:26 Zoffix left 16:37 domidumont left 16:38 cdg joined 16:43 cdg left 16:52 Abid joined
Abid help 16:53
16:54 Abid left 16:58 khw joined
timotimo what a brief existence abid had 16:58
geekosaur abid them adieu >.>
16:59 abraxxa left 17:12 troys is now known as troys_ 17:23 coverable6 left, benchable6 left, coverable6 joined, ChanServ sets mode: +v coverable6, benchable6 joined, ChanServ sets mode: +v benchable6 17:25 cdg joined 17:28 scimon left 17:30 cdg left, cdg joined, cdg left
TEttinger is there any way to do that "like, " slang using comments instead of ws? 17:31
17:31 cdg joined, troys_ is now known as troys, cdg_ joined 17:36 cdg left, dakkar left 17:38 wamba joined
timotimo should be 17:38
i was too lazy to investigate any further
17:47 as_ joined 17:51 as_ left 18:00 Zoffix joined
Zoffix TEttinger: comments are part of ws. You also can't override ws/comments in mainline. perl6advent.wordpress.com/2017/12/01/#ho-ho-ho 18:01
18:17 Ven`` joined
TimToady m: my ($a, $b) := (^5, 2..3, 7..9).classify(so * (&) (10..11)){True, False}; say $a.perl; say $b.perl; 18:17
camelia Any
$[^5, 2..3, 7..9]
TimToady jkramer: ^^^
Zoffix TimToady: FWIW there's expert opinion wanted. RE: why `@foo where …` applies to the entire array in params, but to individual elements in variables: github.com/rakudo/rakudo/issues/14...-358021893 18:20
TimToady someone probably just implemented the one as an anonymous subset, so it distributes like a subset type 18:25
we should probably make them consistent
Zoffix Noted. 18:29
18:30 cdg_ left
TimToady otoh, binding is for the whole array, and most varaiables are constructed piecemeal by individual assignments that each have to be checked, so the situations aren't equivalent 18:31
lizmat m: sub a(@a[3]) { }; dd &a.signature # this feels wrong 18:32
camelia :(@a[3] where { ... })
TimToady if you checked the whole array every time you assigned, that would be a lot of overhead
going the other way, how would you then write a constraint on the whole binding? 18:33
so maybe it would be a foolish consistency...
Zoffix m: subset Foo where { dd "[$_]"; $_ ne "z" }; -> Foo @a { @a[1] = "z"}(Array[Foo].new: <a b c>) 18:35
El_Che "Perl 6: foolishly consistent" is not that bad
camelia "[a]"
"[b]"
"[c]"
"[a b c]"
"[z]"
Type check failed in assignment to ; expected Foo but got Str ("z")
in block <unit> at <tmp> line 1
El_Che :)
Zoffix I think I see a consistent path here.
`my @foo where …` and `:(@foo where …)` typecheck the binding to Positional + where. And `my Foo @foo` and `:(Foo @foo …)` typecheck the elements on STORE 18:36
18:36 darutoko left
TimToady or we could always distribute on @, but require $ binding to check entire array 18:36
that would still be potentially incompatible, so something for .d boundary 18:37
Zoffix so `my @foo where … = …` wouldn't even invoke the where
Oh wait yeah it would 18:38
TimToady well, it could, since there's =
Zoffix `my @foo where * !~~ Array = 42` would type-check blow up, while `my @foo where * !~~ List = 42` would work.
18:39 setty1 joined
Zoffix Oh wait the second too would blow up 'cause it's Array is a List :) 18:39
But the point is the default container would be checked against the where
TimToady no, we'd make it consistent by applying the where to each element, not the whole thing
Zoffix In the parameters?
That'd have a huge amount of fallout :o 18:40
TimToady which is why we'd have to do it on the .d boundary, like I said
18:40 reportable6 left 18:41 nativecallable6 left, reportable6 joined, nativecallable6 joined
Zoffix -1 on that. It'd be removing a feature. 18:41
We even use it in core: github.com/rakudo/rakudo/blob/mast...oc.pm#L228 18:42
TimToady arguably, there are few wheres on variables, so one could do it the other way with less fallout, but that would tend to violate people's expectations when they assign individual elements instead
but if we did it that way, at least we could point people to the subtype to get a where that applies individually 18:43
s/subtype/subset/
Zoffix Yeah, +1 on that and we'd keep a way to get typecheck on the whole array if you want it
when binding, like in params
TimToady okay, I'm happier with that 18:44
Zoffix \o/
18:45 cdg joined 18:47 Kaiepi left, Kaiepi joined 18:54 Zoffix left 19:01 foobar` joined
buggable New CPAN upload: P5tie-0.0.4.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.4.tar.gz 19:02
19:02 Ven`` left 19:03 troys is now known as troys_ 19:35 leont joined 19:39 cdg_ joined 19:43 cdg left 19:44 cdg_ left, comborico1611 left 19:47 Kaiepi left 19:51 comborico1611 joined 19:54 dct joined, mempko left 19:56 Ven`` joined, Ven`` left 19:57 Ven`` joined
rightfold
.oO(Fibonacci numbers are like Merkle trees)
20:29
TEttinger rightfold: have you heard of fibonacci heaps? 20:30
en.wikipedia.org/wiki/Fibonacci_heap
20:35 zakharyas joined 20:40 DoverMo joined 20:44 pilne joined 20:50 dct left, evalable6 left 20:51 evalable6 joined, ChanServ sets mode: +v evalable6 20:53 DoverMoo joined, DoverMo left 20:59 DoverMoo left
buggable New CPAN upload: P5tie-0.0.5.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.5.tar.gz 21:02
New CPAN upload: Tie-Array-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz
21:04 mempko joined 21:41 dct joined 21:49 zakharyas left 21:51 cdg joined 22:06 dct left 22:11 dogbert2 left 22:12 dct joined 22:15 Ven`` left 22:21 troys_ is now known as troys 22:26 comborico1611 left 22:29 Ven`` joined 22:30 comborico1611 joined 22:31 Sgeo left, espadrine joined 22:37 Ven`` left 22:38 Ven`` joined 22:39 dct left 22:44 dct joined 22:50 setty1 left 22:55 Ven`` left 23:05 bhm joined 23:13 |oLa| left 23:18 rindolf left 23:19 pmurias left 23:37 Sgeo joined 23:50 wamba left, mempko left 23:53 markong left 23:58 dct left