»ö« 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.
Herby_ o/ 00:30
\o 00:33
timotimo heyo 00:35
Herby_ timotimo: how goes it?
timotimo bearable, and you? 00:36
Herby_ I have the next few days off, so I can't complain too much
can I call python modules in Perl 6, on windows 10? 00:47
[Coke] it got up to 10ºC today here, was soooo warm compared to last few weeks. 01:21
timotimo .tell herby_ sorry i disappeared for RSI break and didn't come back for a whole while 01:23
yoleaux timotimo: I'll pass your message to herby_.
moritz o/ 06:03
Geth doc/master: 4 commits pushed by (Luca Ferrari)++ 07:12
wictory[m] Hi! How often does people here run "zef nuke"? 07:46
moritz like, twice a year? 07:52
wictory[m] I get sometimes that "zef install --force-install ." does not have an effect. The annoying thing is that it sometimes takes some to figure that out. I often figure it out by putting a "foobar".say; statement somewhere in a library and expect an output from somewhere, if theres no output I probably need to nuke everything. 08:16
Is this the experience of other too? :)
*others
Geth doc/master: 4 commits pushed by (Luca Ferrari)++ 09:18
Geth doc: a236911ff5 | (Luca Ferrari)++ | doc/Language/traps.pod6
Add Pair/Scalar trap and link to the Pair documentation.

As per discussion on issue #1728, after the commits about Pair.freeze it should be better to have this behavior listed also as 'trap'.
Close #1728
09:31
synopsebot Link: doc.perl6.org/language/traps
jkramer m: class Foo { has Str @.bar where *.elems == 3 }; Foo.new(bar => <one two three>).note 11:08
camelia Type check failed in assignment to @!bar; expected <anon> but got Str ("one")
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
jkramer Why does this not work?
The where thingy seems to add another typecheck that for some reason fails
masak m: class Foo { has @.bar where *.elems == 3 }; say Foo.new(bar => <one two three>) 11:11
camelia Type check failed in assignment to @!bar; expected <anon> but got Str ("one")
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
masak m: class Foo { has @.bar where *.chars == 3 }; say Foo.new(bar => <one two three>)
camelia Type check failed in assignment to @!bar; expected <anon> but got Str ("three")
in submethod BUILDALL at <tmp> line 1
in block <unit> at <tmp> line 1
masak m: class Foo { has @.bar where *.chars == 3 }; say Foo.new(bar => <one two blb>) 11:12
camelia Foo.new(bar => Array[<anon>].new("one", "two", "blb"))
masak seems the `where` is typechecking each element of the array
jkramer Ooooh
masak which I'm pretty sure is not the way it's s'posed to work
jkramer Hmm, that doesn't seem right
masak at least it feels surprising to me
jkramer Yup
masak feel free to submit a rakudobug
jkramer I will, thanks 11:15
buggable New CPAN upload: Sub-Util-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 11:48
Geth doc: 873dc76745 | (Luca Ferrari)++ | doc/Language/terms.pod6
Improve constant lexical example.

Provide an example of how a 'my constant' is visible only within a block and can therefore override the 'our' scoped constant.
Add also an insight about the compilation error when referencing an out of scope 'my constant'.
12:18
synopsebot Link: doc.perl6.org/language/terms
Geth doc: c0184ade3c | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/pod.pod6
add note about bigint capability
12:50
synopsebot Link: doc.perl6.org/language/pod
jkramer Is there a shortcut for creating a copy of an object with only one/some values changed, instead of copying all unchanged values manually? I.e. Foo.new(:a(self.a), :b(self.b), ... :changed-attribute(123)) 12:51
I guess I can somehow turn the object into a hash and use that as argument?
raschipi You need to implement a copy constructor manually 12:52
jkramer Found it 12:55
Mu has .clone which allows to override public attributes 12:56
So self.clone(:changed-attr(123)) works
raschipi Just remember that is a very shallow copy.
jkramer Yup, but that's ok for my purposes right now
alexk6 m: subset Int8 of Int where -0x80 <= * <= 0x7F; my $t = (Int8); given $t { when (Int8) { say "ok" }}; 13:02
camelia ok
alexk6 subset Int8 of Int where -0x80 <= * <= 0x7F; my $t = (Int); given $t { when (Int8) { say "ok" }};
m: subset Int8 of Int where -0x80 <= * <= 0x7F; my $t = (Int); given $t { when (Int8) { say "ok" }};
camelia Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
alexk6 does anyone know why this gives me an error? 13:07
m: subset Int8 of Int where -0x80 <= * <= 0x7F; my $t = (Int); if $t eqv (Int8) { say "ok" }; # this works 13:10
camelia ( no output )
raschipi The message is less than awesome but Int doesn't fit the Int8 pidgeonhole. 13:11
Like it says on the tin, it's a subset
raschipi Or you just wanted it to fail quietly like the other case? 13:13
alexk6 raschipi: yes, i just wanted to do something depending on the type 13:16
raschipi m: subset Int8 of Int where -0x80 <= * <= 0x7F; my $t = Int.new; given $t { when (Int8) { say "ok" }};
camelia ok
timotimo checking eqv doesn't check things like constraints at all
that's why it doesn't explode to try the Int against that 13:17
alexk6 but why does it work then with Int8? 13:18
m: subset Int8 of Int where -0x80 <= * <= 0x7F; my $t = (Int8); given $t { when (Int8) { say "ok" }};
camelia ok
timotimo now you're checking type inheritance 13:19
and Int8 trivially derives from Int8 13:20
raschipi timotimo: where would be the best place to catch that exception? 13:29
timotimo m: subset Int8 of Int where try -0x80 <= * <= 0x7F; my $t = (Int); given $t { when (Int8) { say "ok" }}; 13:33
camelia Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
timotimo m: subset Int8 of Int where { try -0x80 <= $_ <= 0x7F }; my $t = (Int); given $t { when (Int8) { say "ok" }};
camelia ( no output )
timotimo i'd do it like that ^
alternatively
m: subset Int8 of Int:D where -0x80 <= * <= 0x7F; my $t = (Int); given $t { when (Int8) { say "ok" }};
camelia ( no output )
raschipi nice 13:34
alexk6 timotimo++ 13:43
jkramer Is there some neat hyper-operator syntax sugar for doing simple math operations? I'd like to do something like @numbers>>.-(33) 15:20
masak m: my @numbers = 100, 200, 300; say @numbers >>->> 33 15:21
camelia [67 167 267]
masak m: my @numbers = 100, 200, 300; say @numbers »-» 33
camelia [67 167 267]
jkramer Sweet, thanks! 15:22
timotimo m: my @numbers = 100, 200, 300; say -<<@numbers
camelia [-100 -200 -300]
Zoffix m: subset Int8 of Int where { try -0x80 <= $_ <= 0x7F }; for ^50_000 { Int ~~ Int8; 42 ~~ Int8 }; say now - INIT now 16:19
camelia 1.713140481
Zoffix m: subset Int8 of Int where !.DEFINITE || -0x80 <= $_ <= 0x7F; for ^50_000 { Int ~~ Int8; 42 ~~ Int8 }; say now - INIT now 16:19
camelia 0.37768372
Zoffix m: subset Int8 of Int where .WHAT =:= Int || -0x80 <= $_ <= 0x7F; for ^50_000 { Int ~~ Int8; 42 ~~ Int8 }; say now - INIT now 16:20
camelia 0.3785938
leont What is the install logic around bin/? In particular can I put .pod's in there or not? 16:22
Zoffix m: use nqp; subset Int8 of Int where nqp::isconcrete($_) && nqp::isfalse(nqp::isbig_I(nqp::decont($_))) && nqp::isge_i(-0x80, $_) && nqp::isge_i($_, 0x7F); for ^50_000 { Int ~~ Int8; 42 ~~ Int8 }; say now - INIT now 16:24
camelia 0.5124472
Zoffix Kinda surprised $_ is conted there :\
raschipi leont: /bin is just for what a user will call in the command line as a command. 16:26
But you'd use /usr/bin unless it's a very basic system command. 16:27
ilmari raschipi: I presume leont meant bin/ inside a perl6 distribution repo/tarball, not /bin on the filesystem
raschipi Ops
raschipi goes get more coffee. 16:28
Zoffix leont: not aware of any official docs on the topic, but looks like zef does install everything it finds: github.com/ugexe/zef/blob/master/l...m6#L73-L90
leont Ah, good to know 16:29
leont received a PR that adds a bin/README.pod, and I was wondering if that would blow up
titsuki m: use Perl:ver<6.*>; 18:03
camelia ===SORRY!===
Perl is a builtin type, not an external module
titsuki is this a bug?
[Coke] no, Perl is a builtin type.
if you want to specify a version, that's not the syntax, I don't think.
m: say $*PERL.^name; 18:04
camelia Perl
titsuki This test says the above one works: github.com/perl6/roast/blob/master...e-perl-6.t
[Coke] that test isn't run.
github.com/rakudo/rakudo/blob/mast...ctest.data 18:05
it's from 2009 and probably speculative and can probably be removed.
titsuki Coke: I see. thanks! 18:06
[Coke] m: use 5;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
use used at line 1
[Coke] m: use v5;
camelia 5===SORRY!5=== Error while compiling <tmp>
No compiler available for Perl v5
at <tmp>:1
------> 3use v57⏏5;
[Coke] m: use v6; 18:07
camelia ( no output )
Geth marketing: 9f4c3dab32 | (Zoffix Znet)++ | 2 files
Apply changes from Mark Keating

  - For FOSDEM 2018 prints
  - Bleed fixes and print marks; no content changes
18:42
Herby_ o/ 19:41
yoleaux 01:23Z <timotimo> Herby_: sorry i disappeared for RSI break and didn't come back for a whole while
Voldenet m: my uint8 $x = 2; my uint8 $y = 4; $y = $y xor $x; say $y 19:43
camelia 4
Voldenet am I doing something wrong, or is 2 xor 4 really 4? 19:44
AlexDaniel Voldenet: it's logical xor 19:45
although… wait what…
Voldenet m: my uint8 $x = 2; my uint8 $y = 4; $y = $y +^ $x; say $y
camelia 6
Voldenet Ah
magic operators
AlexDaniel yeah that's what you were looking for, but what's 4?
Voldenet 4 is a num... wait 19:46
AlexDaniel aaaaaaaaaaaah
Voldenet >Returns the operand that evaluates to True in boolean context
AlexDaniel m: my uint8 $x = 4; my uint8 $y = 2; $y = $y xor $x; say $y
camelia 2
AlexDaniel yeah
m: my uint8 $x = 4; my uint8 $y = 2; $y = ($y xor $x); say $y
camelia Cannot unbox a type object (Nil) to an unsigned int.
in block <unit> at <tmp> line 1
Zoffix ZOFFLOP: hung stresstest (looks like hung on t/spec/S17-promise/nonblocking-await.t) 19:48
AlexDaniel Voldenet: R#1389
synopsebot R#1389 [open]: github.com/rakudo/rakudo/issues/1389 [LTA] No “Useless use” warning for xor
Voldenet Oh, thanks. 19:49
Zoffix oops, wc 20:01
El_Che releasable6: status 20:02
releasable6 El_Che, Next release in 7 days and ≈22 hours. No blockers. Unknown changelog format
AlexDaniel m: my uint8 $x = 2; my uint8 $y = 4; $y = $y xor $x; say $y 20:50
camelia 4
AlexDaniel e: my uint8 $x = 2; my uint8 $y = 4; $y = $y xor $x; say $y
AlexDaniel e: my uint8 $x = 2; my uint8 $y = 4; $y = $y xor $x; say $y 20:50
evalable6 WARNINGS for /tmp/9jgKModjC_:
4
Useless use of $x in sink context (line 1)
AlexDaniel Voldenet: ↑ there (same snippet) 20:51
Zoffix++
moritz m: say 2 xor 4 21:01
camelia WARNINGS for <tmp>:
2
Useless use of constant integer 4 in sink context (line 1)
TEttinger ?
moritz is it because it can constant-fold the arguments, and know that the second operand won't be used?
m: say 0 xor 4
camelia WARNINGS for <tmp>:
0
Useless use of constant integer 4 in sink context (line 1)
moritz m: say 4 xor 0 21:02
camelia WARNINGS for <tmp>:
4
Useless use of constant integer 0 in sink context (line 1)
TEttinger isn't 2 xor 4 6?
jnthn moritz: Precedence, I think
AlexDaniel TEttinger: it's logical xor, you're talking about +^
jnthn It compiles as (say 4) xor 0
lizmat also, xor is logical
moritz m: say (2 xor 4)
camelia Nil
moritz m: say (0 xor 4)
camelia 4
moritz jnthn: right 21:03
TEttinger of course it's +^, that totally makes sense... uh...
is bitwise xor the same as addition in galois field 2? 21:04
or carryless addition?
AlexDaniel sometimes someone just says something… and I realize that I'm so stupid :D 21:05
moritz TEttinger: carryless addition, yes 21:06
TEttinger gotcha
moritz AlexDaniel: nah, it's just jargon
TEttinger I was wondering why I see circled plus as the sign for it
AlexDaniel: I don't understand galois field stuff either, I'm going to need to at some point
moritz that's just with modulus, right? 21:07
TEttinger I think so, per bit maybe?
AlexDaniel what's with circled plus? Wasn't it just a circled disjunction, where a circle stands for… whatever it does
I mean, there's ⊻ also, I never thought there's any logic behind the symbols :) 21:08
TEttinger like in C, operations on uint8_t will operate in GF(256)
I think
but that's also called "do stuff mod 256"
so I'm not sure where mr./ms./dr. galois comes in
geekosaur worked out how to describe such subsets mathematically, probably 21:09
TEttinger AlexDaniel: there's confusingly different usage of various terms for bitwise XOR in mathy CS papers 21:10
AlexDaniel OK the original question isn't too bad. Wikipedia++ 21:13
TEttinger I saw a circled plus and circled x used here www.pcg-random.org/pdf/hmc-cs-2014-0905.pdf 21:14
page 30 or 32
AlexDaniel TEttinger: as for +^ making sense, it's a regular c-style ^ with + in front of it to indicate that's it's a numeric thingie. ^ itself is used for Junctions, with a similar logic 21:21
TEttinger: same goes for all other ops
like +| and +& 21:22
maybe this should be explained in more detail in our docs?
i.e. the difference between `^`, `+^`, `xor` 21:23
masak .oO( "strangely consistent" operators ) 21:25
TEttinger it makes more sense than JS needing ~~ before using any bitwise ops on numbers 21:26
I've also seen ^^^ and ||| used to refer to the bitwise versions in other langs 21:27
dylanwh obviouls you should need one symbol per byte. ^^^^ for 32bit integers and ^^^^^^^^ for 64bit. 21:34
Voldenet That's pretty cool, actually, but what if I needed a xor for nibbles? 21:36
geekosaur `
:p
Voldenet ah, ´ and ` 21:37
perfectly sound
dylanwh and 16 <'s for a 64bit bit-shift 21:40
dylanwh might actually make this as an esolang. XD 21:41
geekosaur language designed for an ancient bit-slice cpu? 21:43
dylanwh yes 21:46
tbrowder anyone have any ideas to help track down a malformed utf8 char in an otherwise ASCII file? 23:03
jnthn m: Buf.new(ord('a'), ord('a'), 0xc3, 0x28, ord('a')).decode('utf-8') 23:06
camelia Malformed UTF-8 at line 1 col 3
in block <unit> at <tmp> line 1
jnthn So, slurp($file, :bin).decode('utf-8')
tbrowder jnthn: thanks! 23:20
tusooa AlexDaniel: I think it is because xor is looser than function call, just like and/or? 23:47
AlexDaniel yeah