»ö« 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.
Juerd Reading 5to6-nutshell, and it reminds me how much Perl 5's $arrayref->@* makes me feel like jumping ship :) 00:00
Juerd $foo->$#* with its 5 non-alphanumerics after the variable is so much uglier than $foo.end 00:01
ugexe if there was something like a $*WHAT-CUR-LOADED-ME then we could have `$*WHAT-CUR-LOADED-ME.need("MyLib")` 00:08
where CUR can then handle any remapping of paths to source 00:09
er, or `use lib "My::Lib"` even 00:13
lookatme morning ヽ(•̀ω•́ )ゝ 00:55
samcv morning lookatme 03:15
lookatme samcv, It's almost noon now. (≖ ‿ ≖)✧ 03:17
samcv it's 8pm for me here 03:18
working more on moarvm's unicode normalizer :) have 4 more GraphemeBreakTest.t tests passing
ones with the Prepend property introduced in unicode 9.0 03:19
really happy about that
before 9.0 there were only Extend. so the combining charater always came after the base character
with prepend, the combiing character comes before the base character
lookatme samcv++, sounds great. 03:23
samcv i'm pretty confident we should be passing 100% of tests by the end of the week (fingers crossed) 03:24
at least unless there are any unforseen issues
lookatme (^.^)y (fingers crossed) 03:27
I have to review my c/c++ knowledge, and find a new job in the next months. 03:34
samcv j: say "\0".uniname; # <control-0000> 04:01
camelia NULL
samcv there's a bunch of RT's actually i need to go through and close now 04:03
j: say uniname("\x[80]") 04:04
camelia LATIN 1 SUPPLEMENT 80
samcv m: say uniname("\x[80]")
camelia <control-0080>
samcv ok that is still a bug on jvm
bisectable6, say ('a' x 10000).IO.open; 04:09
bisectable6 samcv, Bisecting by output (old=2015.12 new=f0c3bf7) because on both starting points the exit code is 1
samcv, bisect log: gist.github.com/da75432d7785e4bdc0...4e6084b49c
samcv, (2015-12-25) github.com/rakudo/rakudo/commit/07...dc61f84053
samcv, The result looks a bit unrealistic, doesn't it? Most probably the output is different on every commit (e.g. 「bisect: say rand」)
geekosaur think the bot needs to be taught to ignore the filenames 04:19
samcv yea 04:20
geekosaur or munge the commit hashes
bioduds hey friends 04:21
would IO::Socket::Async be the way to go in order to build TCP P2P communication?
lookatme Yeah, IO::Socket::INET or IO::Socket::Async 04:38
samcv nice. now down to only 6 perl6 tests (3 graphemeclusterbreak.txt tests) failing 05:11
excellent 05:12
samcv so close 05:12
szabgab hi there 05:26
p6: my @x = 2, 3; say @x.^name
camelia Array
szabgab In which case would @something.^name return anything else than "Array" ? 05:27
szabgab (or Array[type]) 05:28
Xliff What would be the best way to check the repo chain for a specific file? 05:32
Xliff szabgab: Given that you are using the @ symbol, why do you expect it would say anything else? 05:33
Alternatively, what are you trying to do?
szabgab Trying to understand Perl 6 :) 05:34
Xliff m: my Array[Str] @b = <one two three>; say @b.^name
camelia Type check failed in assignment to @b; expected Array[Str] but got Str ("one")
in block <unit> at <tmp> line 1
Xliff m: my Str @b = <one two three>; say @b.^name
camelia Array[Str]
szabgab But more specifically I am trying to figure out how to call the variables? 05:35
Xliff So yes, if you specify a type, then you would get something different than "Array"
m: my Str @b = <one two three>; say @b[0]; say @b[0].^name;
camelia one
Str
Xliff ^^ Like this?
szabgab m: my Str @b = <one two three>; say @b.^name 05:36
camelia Array[Str]
szabgab that's still an Array
bioduds thanks, lookatme
szabgab so if I understand correctly a @-variable allways holds an array
Xliff I'm a little confuesed, then.
Yes, but an @ variable with an index [] returns the item in that position. 05:37
szabgab that's ok
szabgab But you don't call it a @-variable normally right? You call them arrays? 05:37
Xliff As a whole, the @ denotes an Array, yes. 05:39
But arrays imply a collection of elements.
szabgab ok, so how do we call a variable that has a $ sigil?
Xliff m: my $a = 3; say $a; 05:40
camelia 3
Xliff The diffence between perl5 and perl6 is that you don't switch sigils when you are accessing something from an array.
szabgab I mean what's its name? Do you call them "$ variables" ? "Scalar variables?"
Xliff Perl5 -- my @a = (1, 2, 3); say $a[2] == 3; 05:41
szabgab I think I understand that part. What I don't know is the name I should use when discussing them.
Xliff Perl6 -- my @a = (1, 2, 3); say @a[2] == 3
% == Hash, @ = Array, $ = Scalar
szabgab So you call $qqrq a Scalar variable even though in an hold any container type 05:42
It can hold an Array, a List, and yes also a Scalar type 05:43
szabgab I wonder if that's not confusing. 05:44
Xliff Some folks refer to $ as "typeless" 05:45
I disagree. Maybe it's the perl5 coder in me that has already gone through the work and can understand things.
Things that new people might balk at.
But in Perl6.... everything is a reference. 05:46
So for a $ variable to contain a literal, or a reference to an object or a % or a @ is just natural.
For new people, maybe "typeless" would be easier to understand. 05:47
But that will trip people up in the long run.
m: class A { }; my A $a = A.new; say $a.^type;
camelia No such method 'type' for invocant of type 'Perl6::Metamodel::ClassHOW'. Did you mean any of these?
take
tree

in block <unit> at <tmp> line 1
Xliff m: class A { }; my A $a = A.new; say $a.WHAT;
camelia (A)
Xliff So the type of $a in this case.... is A 05:48
m: say 1.WHAT; say "a".WHAT;
camelia (Int)
(Str)
szabgab m: class A { }; my A $a = A.new; say $a.^name
camelia A
szabgab So you say you are ok using the same name "scalar" for both the variable type and the data type. 05:50
szabgab (That was a question actually :) 05:53
Xliff Scalar for the variable type. And the actual type for the data type. 05:54
If we are going to be exact.
szabgab Hmm I did not see the difference between your phrasing and mine. 05:55
parv thanks eveo for the correction re .signature (via log of the day past) 05:56
yoleaux 8 Jun 2017 12:14Z <eveo> parv: that's entirely incorrect tho, which is why it's best not to guess. &{Str.NFC}.signature gives you a block that calls Str.NFC and you're calling signature on that block. You could stick anything into that block and still get the same signature. The correct way is Str.^lookup('NFC').candidates».signature. You should use .candidates bit for subs too, otherwise you only get the sig of the proto
Xliff You said: "So you say you are ok using the same name "scalar" for both the variable type and the data type." 05:57
I am making a distinction between "variable" type and "data" type.
Xliff Since there are actual types AND type checking in P6, that is something that must be considered. 05:58
szabgab Xliff: I think we are saying the same thing here :) 06:02
moritz hi all, totally off-topic question question coming up 07:44
masak :)
moritz I have some software that I want to instrument; in particular, I want an easy way to add some feature counters
(and I want to instrument more than one software)
masak what's a "feature counter"?
moritz masak: I want to track how often a feature is used 07:45
masak ah.
like... logging?
moritz so the idea is I send a UDP packet or something to a server whenever a certain feature is used
and then I get some kind of time-resolved statistics per feature 07:46
parv as, home calling.
masak .oO( the UDP packet contained a joke but I'm not sure the server got it )
masak moritz: would the server getting the UDP packets need to be world-reachable? 07:46
moritz masak: with logging, I have to store quite some data; I just want it to increment a counter per feature, maybe with a resolution of a day or so
masak: since it's server-side software, it's enough if it's reachable from our local network 07:47
masak ah; good
moritz so, the question is: what kind of software can I use for that?
I'm pretty sure others have the same needs
but I'm not sure what to google for 07:48
Xliff What would be the best way to check the repo chain for a specific file? 07:59
Or directory, rather
masak moritz: I have no idea -- if your need has a well-known name, I do not know it 08:05
moritz: if it comes down to sending a UDP packet to a certain IP/port, do you need a pre-packaged software solution for that?
moritz masak: not for the sending; for storing the time-series DB on the server, and showing graphs for that etc. 08:07
masak still sounds quite close to a logging solution to me -- with some requirements on how to display the log afterwards 08:08
lookatme real-time display ? 08:10
tadzik moritz: maybe statsd? 08:11
I recall using that at $work, with (I think) graphite (?) for later analysis? 08:12
nine Xliff: your question doesn't make a lot of sense to me. What directory are you looking for? 08:15
Xliff: to elaborate. Your question doesn't make a chance, because the repo chain is a linked list of objects that do the CompUnit::Repsoitory role. It has nothing to do with the file system. 08:16
hobbs moritz: yeah, statsd is a common way to go about that. It takes UDP input in a simple format, aggregates, and sends to one of several things, but graphite is the most common
moritz: and for graphite servers I recommend go-carbon (the new version w/embedded carbonserver) + carbonapi, and then grafana as frontend. Sounds slightly intimidating, but it's miles easier to set up than the old stuff :) 08:18
nine why the hell did I write "a chance" instead of "sense"?? 08:26
zengargoyle m: 08:27
m: > my Array[Str] @x = Array[Str].new(<a b c>), Array[Str].new(<d e f>); say @x.^name; dd @x;
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix > instead
at <tmp>:1
------> 3>7⏏5 my Array[Str] @x = Array[Str].new(<a b
zengargoyle m: my Array[Str] @x = Array[Str].new(<a b c>), Array[Str].new(<d e f>); say @x.^name; dd @x; 08:28
camelia Array[Array[Str]]
Array[Array[Str]] @x = Array[Array[Str]].new(Array[Str].new("a", "b", "c"), Array[Str].new("d", "e", "f"))
hobbs nine: you have no chance to survive make your time? 08:34
moritz hobbs, tadzik: thanks, I'll look at statsd 08:36
avar Discussion (at a distance) about what the unification plan for p5 and p6 is, on p5p: rt.perl.org/Public/Bug/Display.htm...xn-1464910 09:14
rindolf Hi all! Why is the third say printing "True" here - paste.debian.net/970739/ ? 09:51
jnthn == is numeric equality
yoleaux 01:34Z <japhb> jnthn: Why does a968d2759c9c16e76e57718063f968a7152795a5 specify a non-power-of-two buffer size?
01:34Z <japhb> jnthn: (Or to be more specific, not a power of 2 and not a power of two minus 1 either)
rindolf jnthn: ah 09:52
jnthn And an array in numeric context is its number of elements
rindolf jnthn: ah
jnthn: perl6maven.com/arrays-in-perl6 - so this is misleading
llfourn rindolf: yes that's incorrect 09:53
~~ would check they have the same content
rightfold Use eqv
llfourn (or that) 09:54
rindolf llfourn: would ~~ check that in the same order? 09:59
llfourn yep
rindolf llfourn: i see - thanks 10:06
timotimo imgur.com/gallery/XOT47 - beautiful 11:21
CacoS Hello, everyone! 11:28
CacoS Is there a pdf version of this page: perl6intro.com/? 11:29
timotimo github.com/rakudo/star/tree/master/docs - this has one. not sure if an up-to-date version is made available regularly 11:30
CacoS timotimo: thanks :), I used www.printfriendly.com/ on it. 11:32
araraloren evening .o/ 11:33
timotimo github.com/hankache/perl6intro - this tells you how to .pdf it 11:35
CacoS Thank you. See you later, bye ! 11:39
MARTIMM what can cause 'Missing serialize REPR function for REPR Decoder (Rakudo::Internals::VMBackedDecoder)'. it is thrown without a linenumber. It think while parsing but I am not sure. 12:36
jnthn Trying to serialize an I/O handle, most probably. 12:40
So, most probably something happening in a BEGIN or constant or similar 12:41
MARTIMM jnthn: That might be possible. It pops up in Log::Async and there is a lot of I/O and some phasers
jnthn It's possible that in the past we silently allowed I/O handles to be serialized, on the understanding that they'd only explode if you ever tried to use them in the future 12:43
If this is a regression, then we probably would want to go back to doing that
MARTIMM jnthn: I'm afraid I don't understand this. I understood that it is serialized by default to utf-8, does it explode when wrong characters are sent? 12:48
jnthn Ah, I was talking about the serialization that happens when a module is compiled 12:49
We have to preserve stuff that comes to exist at BEGIN time
It sounds like an I/O handle is ending up in that set of things, probably unintentionally 12:50
MARTIMM jnthn: ok. aren't the handles closed then. could close them and reopen in the BEGIN phase? 12:51
MARTIMM jnthn: in a new() the handle $*OUT is used from an INIT phase 12:52
bioduds hey guys 13:02
can you help me out with something? 13:03
I'm posting the gist
gist.github.com/bioduds/f4acfdc129...205c7413b5 here 13:04
please, how can I actually get the IPs as a list, in an array, for instance? 13:05
interesting, I found the answer, changing from token to rule 13:08
thanks mans
solved here
colomon bioduds: that makes it seem like a problem with your grammar? 13:10
araraloren :) 13:11
bioduds_ disconnected 13:12
colomon is scratching his head in puzzlement at how { d+ . d+ . d+ . d+ } could work as a rule
colomon m: say “100.1.2.45” ~~ m:s/ \d+ \. \d+ \. \d+ \. \d+ / 13:13
camelia 「100.1.2.45」
colomon guess that’s how
colomon m: say “100.1.2. 45” ~~ m:s/ \d+ \. \d+ \. \d+ \. \d+ / 13:16
camelia 「100.1.2. 45」
colomon bioduds_: I think maybe you should be leaving ADDRESS as a token and changing TOP so the list of ADDRESSs can have spaces between them 13:17
(can / MUST have spaces between them)
colomon that might be as simple as adding a space between <ADDRESS> and + 13:18
bioduds_ thanks colomon 13:19
actually I only needed to change token to rule in ADDRESS
colomon bioduds_: that doesn’t work righjt
bioduds_ still getting the hang of this great thing called grammars 13:20
no, it works
colomon please see above
bioduds_ thanks for looking after it
colomon it changes your grammar so an address can have spaces in it
bioduds_ let me see
colomon and spaces after it, which is why it helps the problem you are looking at
Geth doc: 9729894c3a | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Failure.pod6
Remove duplicate word; closes #1371
13:22
lucasb good morning 13:26
araraloren :)
bioduds_ great, thanks :D 13:31
Geth doc: 8ee169b496 | (Jan-Olof Hendig)++ | doc/Type/UInt.pod6
A couple of code related fixes. eveo++

More can be done here
13:32
lucasb re discussion in the mailing list about what to call $var 13:34
I think I call them a scalar variable, even if that is not entirely accurate 13:35
but maybe P6 prefer to simply call them "dollar-sigiled" variable?
*P6 folks
zengargoyle m: say '192.168.1.1' ~~ token { ^ [ \d ** 1..3 ] ** 4 % '.' $ } 13:38
camelia 「192.168.1.1」
zengargoyle though when parsing machine generated output.... /\S+/ those things are dumping 32bit integers to ntoa() or something and the chances of something going wrong are exceedingly nil. 13:40
colomon zengargoyle: if you want to get paranoid, you also want to make sure the numbers are less than 256, no? 13:42
perlpilot lucasb: "scalar" works. as does "item" 13:43
IMHO of course
mspo what's the unicode bot again: 13:44
zengargoyle if a program (`dig` in this case) then internally it's a 32bit number or an IP structure using common IP->String conversions... it can't generate a false IP from a 32bit number
mspo u: U+E630
unicodable6 mspo, U+E630 <Private Use> [Co] ()
lucasb perlpilot: agreed, thanks
mspo u: U+E635
unicodable6 mspo, U+E635 <Private Use> [Co] ()
mspo bummer I see a webpage saying those are dr seuss characters
mspo www.evertype.com/standards/csur/seuss.html 13:45
zengargoyle sure, do extreme checking if it's input from a user... but it's like you're not going to see a malformed IP in a Cisco router log.
mspo that's a lot of credit to cisco 13:46
zengargoyle hehe.
[Coke] docs/xt/duplicates.t found its first docubug (after the initial run). whee. 13:48
zengargoyle is just coming off of a 16 year stint as network engineer/programmer. oh, the horror's i've seen.... 13:49
perlpilot bioduds_: I just saw the TPC schedule and noticed a tutorial by Damian Conway-- www.perlconference.us/tpc-2017-dc/t...d_grammars Made me think of your recent attempts at parsing dig output. 13:52
bioduds_: if you're going to TPC, you might want to spend the extra $150 and attend Damian's tutorial
bioduds_ oh, perlpilot that is awesome, I'm a great fan of Dr. Conway
I'm definitely looking into it, thanks man :) 13:54
perlpilot sure 13:54
bioduds_ this here A little less line noise, please: Perl6 Regexen. also looks promissing to my current stage 13:56
Let me just say I'm baffled with Grammars
zengargoyle m: say '192.168.1.9' ~~ token { ^ [ \d ** 1..3 ] ** 4 % '.' $ }
camelia 「192.168.1.9」
bioduds_ I mean, I knew it was bringing something quite remarkable but I am experiencing it now
[Coke] well, we'll try to help where we can. 13:57
bioduds_ this conference will be in DC? That means Washington?
zengargoyle wonders where to even put the <=255 check in there, and now thinks d is to broad, if we're going for human input. :)
colomon zengargoyle: presumably the “right” way to do it is to have a “decimal byte” token or somesuch 13:58
bioduds_: the problem with your original gist was that you didn’t allow anything to separate <ADDRESS> tokens 13:59
bioduds_ yep, I can see that now :)
great, thanks :) 14:00
colomon bioduds_: you needed somthing like <ADDRESS> + instead of <ADDRESS>+
bioduds_ yep, I did change to rule ADDRESS and it did the trick
I mean, I'm trying to build a com system that will actually look like a talk between P2P nodes 14:01
so messages though very english-ish must comply to format
Geth doc: 6a196550fd | (Jan-Olof Hendig)++ | doc/Type/Thread.pod6
Added docs for Thread.Numeric
zengargoyle then again, just a plain 32bit int or hex is sometimes used for non-canonical IP representation. 14:02
bioduds_ in TCP/IP it would right? 14:05
travis-ci Doc build errored. Zoffix Znet 'Remove duplicate word; closes #1371' 14:12
travis-ci.org/perl6/doc/builds/241190217 github.com/perl6/doc/compare/a037a...29894c3aad
zengargoyle bioduds_: in the actual IP layer, and IP address is just a chunk of 32bits (4bytes). the dotted quad is just a convential representation. 14:13
bioduds_ I didn't understand yet how the layers work 14:14
they are serial?
header layers then TCP layers in a row?
[Coke] m: my $set = SetHash.new(); $set<a>=True; sub visit(:$set is copy) { $set<b> = True }; visit(:$set); say $set<b>;
camelia True 14:15
[Coke] Does "is copy" not work on containers?
[Coke] switches this over to an array, maybe.
jnthn It's only one level deep; here its the Scalar that is the container 14:16
[Coke] I would say that maybe should go under doc traps, if it's not there already. 14:17
zengargoyle not quite, but it's hard to know where to start. wikipedia on the OSI 7 layer model or the TCP/IP layer model. i'm just saying that the dotted-quad (192.168.1.1) form for an IP address is just a thing for humans to read/write. the 'real' IP address is just 32bits of ones and zeros. 14:18
and if the output comes from a program, (especially a network oriented program) the IPs are probably really stored as the 32bit numbers and just converted to the dotted-quad on output. 14:19
Geth doc: e327a96a23 | (Jan-Olof Hendig)++ | doc/Type/Tap.pod6
Removed methods which are no longer present. jnthn++
14:20
zengargoyle there are standard library functions to do this. if it comes out of a network tool, there's no need to check the formatting because it will always be correct. 14:21
(\S+) will match an IP from a computer just fine. on the bonus side, it also matches a hostname (example.com). 14:23
[Coke] zengargoyle: another way to say that is you're not necessarily mapping IP addresses, you're mapping the-things-that-this-tool-generates-that-look-like-IPs. 14:23
[Coke] (is copy) yay, fixed a bug in a one-off p6 script for Dayjob there. 14:24
zengargoyle it's only if you're matching input from humans that you need to do the \d ** 1..3 ] ** 4 % ',' thing which still isn't good enough to actually check human input. 14:25
[Coke]: i try not to think that deeply about it. just years of doing just this sort of stuff and learning that for the most part, it's easier to catch it on failure to bind. then you can accept IP or DNS hostname and it doesn't matter. and a simple aton() tells you if it's valid or not. 14:28
but yeah the-things-that-this-tool-generates-that-look-like-IPs are just \S+ and there's an almost certainty that they're validly formatted because you can't toss a 32bit number into ntoa() and get a badly formatted IP. 14:32
it's like checking that a string is hex when you know it was printed with %x 14:33
or testing that 2 + 2 == 4 14:34
m: say '192.168.1.9' ~~ token { ^ ( \d ** 1..3 ) <?{ +$/ <= 255 }> ** 4 % '.' $ } 14:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Can only quantify a construct that produces a match
at <tmp>:1
------> 3d ** 1..3 ) <?{ +$/ <= 255 }> ** 4 % '.'7⏏5 $ }
zengargoyle still can't figure this out, think you may have to break it down to a subrule for the byte or use captures or something. 14:36
it seems to not like asserts in the middle of the ** ** % sort of thing. 14:38
jnthn You're quantifying a zero-width assertion there 14:39
The ** applies to the last atom
Maybe you wanted [ ( \d ** 1..3 ) <?{ $/ <= 255 }> ] ** 4 % '.' 14:40
zengargoyle m: say '192.168.1.9' ~~ token { ^ [ \d <?{ $/ <= 255 }> ** 1..3 ] ** 4 % '.' $ } 14:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Can only quantify a construct that produces a match
at <tmp>:1
------> 3token { ^ [ \d <?{ $/ <= 255 }> ** 1..3 7⏏5] ** 4 % '.' $ }
zengargoyle i was trying to avoid the captures.... 14:43
works, but i don't quite get it. :) guess i'll have to think on it for a while. thanks. 14:45
jnthn Yeah, $/ isn't quite right, would need to be ~$0 or so 14:47
ctilmes zengargoyle: does it determine that 292.168.1.9 is a bad IP address?
jnthn It was the wrong precedence I was trying to point out
zengargoyle is there some reasong that it has to be () around that bit instead of []
jnthn Yes, so $/ contains the right thing :)
Otherwise $/ is the whole thing matched so far
ctilmes zengargoyle: never mind I see the <= now
zengargoyle ctilmes: i'm also just assuming that \d is >= 0 :P 14:48
m: '192.168.1.9' ~~ token { ^ [ (\d ** 1..3 <?{ ~$0 <= 255 }>) ] ** 4 % '.' $ } 14:49
camelia Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
zengargoyle m: '192.168.1.9' ~~ token { ^ [ (\d ** 1..3 ) <?{ ~$0 <= 255 }> ] ** 4 % '.' $ } 14:50
camelia Cannot convert string to number: trailing characters after number in '03192⏏5 168' (indicated by ⏏)
in regex at <tmp> line 1
in block <unit> at <tmp> line 1
moritz m: '192.168.1.9' ~~ token { ^ [ (\d ** 1..3 ) <?{ ~$0[*-1] <= 255 }> ] ** 4 % '.' $ } 14:53
camelia ( no output )
moritz m: say so '192.168.1.9' ~~ token { ^ [ (\d ** 1..3 ) <?{ ~$0[*-1] <= 255 }> ] ** 4 % '.' $ }
camelia True
moritz explanation: the () is quantified, so $0 becomes an array 14:54
m: say so '192.168.1.955' ~~ token { ^ [ (\d ** 1..3 ) <?{ ~$0[*-1] <= 255 }> ] ** 4 % '.' $ }
camelia False
zengargoyle yay! moritz++ 14:56
zengargoyle i guess you suffer the capture for the sake of the assert and probably fix it up at the end with make. 14:59
zengargoyle idly wonders if Regexp::Common* would port with :P5 15:07
travis-ci Doc build errored. Jan-Olof Hendig 'Removed methods which are no longer present. jnthn++' 15:13
travis-ci.org/perl6/doc/builds/241212941 github.com/perl6/doc/compare/6a196...27a96a23a3
as_ rakudo: say 1 if 3 !≠ 3 15:15
camelia 1
as_ is this correct that !≠ also exists? :-)
[Coke] ! (anything) exists, aye. 15:23
it's the same magic that makes != work
zengargoyle and makes ²² == 4 work. :P 15:24
colomon r: say 3 !> 3
camelia True
zengargoyle magic is so weird.
colomon r: say 3 !!> 3
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say 37⏏5 !!> 3
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
stateme…
5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say 37⏏5 !!> 3
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
statem…
[Coke] zengargoyle: no, that's different.
colomon r: say 3 !?!> 3 15:25
camelia 5===SORRY!5=== Error while compiling <tmp>
Negation metaoperator not followed by valid infix
at <tmp>:1
------> 3say 3 !7⏏5?!> 3
expecting any of:
infix
infix stopper
5===SORRY!5=== Error while compiling <tmp>
Negation metaoperator not followed by valid infix
at <tmp>:1
------> 3say 3 !7⏏5?!> 3
expecting any of:
infix
infix stopper
colomon not enough magic. :)
[Coke] colomon: are you meaning to also be testing JVM?
(if not, m: works)
colomon [Coke]++ # out of practice colomon
zengargoyle it's a kind of magic....... One dream one soul one prize one goal… 15:26
colomon one golden glimpse
colomon consults ancient lyrics files from pre-web days. “glance” not “glimpse" 15:28
zengargoyle m: say 2⁼⁼2 15:57
camelia 5===SORRY!5=== Error while compiling <tmp>
Bogus postfix
at <tmp>:1
------> 3say 27⏏5⁼⁼2
expecting any of:
infix
infix stopper
postfix
statement end
statement modifier
zengargoyle m: my \n = 2; say 2ⁿ; 16:03
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3my \n = 2; say 27⏏5ⁿ;
zengargoyle m: my \ⁿ = 2; say 2ⁿ; 16:08
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3my \ⁿ = 2; say 27⏏5ⁿ;
zengargoyle m: my \ⁿ = 2; say ⁿ 16:09
camelia 2
lucasb m: say 2 ![![![![==]]]] 2 16:40
camelia True
[Coke] well, it's not not not not NOT wrong. 16:54
lucs How to perl6ishly iterate over two arrays in parallel? 16:59
colomon lucs: for @a Z @b -> $a, $b 17:00
lucs Ah man, that is so cool :)
colomon hopes he got the syntax right, but that is the idea
lucs Thanks
[Coke] m: my @a = <a b c>; my @b = <e f g>; for @a Z @b -> ($a, $b) { say "$a,$b"} #yup, you did 17:01
colomon m: my @a = 1..3; my @b = 4..6; for @a Z @b -> $a, $b { say “$a is less than $b” }
camelia a,e
b,f
c,g
1 4 is less than 2 5
Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
[Coke] if they won't match up, use $b?
[Coke] colomon: also, use ()s 17:01
colomon m: my @a = 1..3; my @b = 4..6; for @a Z @b -> ($a, $b) { say “$a is less than $b” } 17:02
[Coke] (or flatten, or...)
TimToady note that it stops on the shorter list, if they can be different lengths
[Coke] m: my @a = <a b c d>; my @b = <e f g>; for @a Z @b -> ($a, $b?) { say "$a,$b"} #yup, you did 17:03
camelia a,e
b,f
c,g
[Coke] ah, probably need the flattening there, and not () 17:04
colomon () with no flattening worked on my local p6 build a second ago
m: my @a = 1..3; my @b = 4..6; for @a Z @b -> ($a, $b) { say “$a is less than $b” }
camelia 1 is less than 4
2 is less than 5
3 is less than 6
Geth doc: 8fc44c4428 | (Jan-Olof Hendig)++ | doc/Type/Tap.pod6
Fixed broken example code. jnthn++, ugexe++
17:06
Geth doc: e6c3b65958 | (Jan-Olof Hendig)++ | doc/Type/Supply.pod6
No closing argument here. Was removed in 2015
17:32
bioduds_ amazingly, grammars are letting me build a P2P communication as if the two nodes were talking to each other 17:39
bioduds_ I'm about to post it so you may see if it interests you guys 17:42
timotimo intriguing 17:43
eveo lucs: along with Z there's also roundrobin that doesn't stop when one list gets exhausted: docs.perl6.org/routine/roundrobin 17:47
m: my @a = <a b c d>; my @b = <e f g>; for roundrobin @a, @b -> ($a, $b = "X") { say "$a,$b"} 17:48
camelia a,e
b,f
c,g
d,X
travis-ci Doc build errored. Jan-Olof Hendig 'Fixed broken example code. jnthn++, ugexe++' 17:48
travis-ci.org/perl6/doc/builds/241274748 github.com/perl6/doc/compare/e327a...c44c442843
bioduds_ steemit.com/blockchain/@bitworkers...ng-to-each 17:51
zengargoyle m: my @a = <a b c>; my @b = <e f g h>; for @a <<,>> @b -> ($a, $b) { say "$a,$b"}
camelia a,e
b,f
c,g
a,h
bioduds_ there you go, unimplemented, only sketched out
zengargoyle bioduds_: did you catch the end of the IP matching chatter? 17:52
bioduds_ yes zengargoyle, perfectly :D I'm finding this so nice because, from start, my messaging system is injection protected, you know? 17:53
Because it won't backtrack, right?
bioduds_ If it comes with scrambled information, then it simply does not execute 17:54
or with injection attempts
it will simply fail :D
zengargoyle yeah, Klingon programing. better to die. 17:56
zengargoyle thinks that was a mst talk but can't remember a quotable quote. 17:57
bioduds_ lol
with honor
zengargoyle but the \d needs to be something else to restrict to actual 0..9 17:58
\d will match weird unicode digit things.
bioduds_ I'm subseting it afterwards
zengargoyle sweet!
bioduds_ yep :D P6 is SWEET!!
bioduds_ join me in this "First Perl6 Blockchain" quest!! :D all help is hugely appreciated!! 18:00
bioduds_ Decentralized Justice! :D 18:00
zengargoyle www.youtube.com/watch?v=KWIl9pP2BF8 -- Paul Fenwick, my bad. 18:01
sorta different, but sorta the same.
it is better to die() in the attempt then to return() in failure. 18:03
zengargoyle en.wikipedia.org/wiki/Robustness_principle 18:10
Be conservative in what you do, be liberal in what you accept from others 18:12
such a mismatch. 18:13
perlpilot I've always called that that Postel Principle (after the RFC editor Jon Postel) 18:16
oh, the wikipedia article says as much :)
zengargoyle heh, 18:18
geekosaur yes, noble idea but also led to a lot of broken implementations that ignored 'be conservative' because all the 'be liberal' impls let them get away with it 18:21
zengargoyle bioduds_: i'd also humbly ask that you think about treating IP as IP and not as IPv4. v4 is the dotted-quad thingy, but there's v6 which is 128bits usually in a crazy dead:beaf::dead:beaf format.
not supporting v6 as well as v4 is a bane to all existance. :P 18:22
bioduds_ yes, zengargoyle. This was noticed before by me. You see, I am using bitcoin protocol as a model and it does allows ipv6 communication. Thank you very much for pointing out zengargoyle++
you are totally right, is like being stuck in pre-history
question: can I type a token? 18:24
token Int TOKEN { ... } for instance
zengargoyle that's like the second reason i usuall just use \S+ and let it fail in the later in the networking bits. input (dotted-quad, IPv6, hostname) output IP connection. the lower levels won't take bad input. it just moves the errors into different levels of your code. 18:26
"that's not a valid IP" vs "can't connect to 'whatever-bad-thing-you-gave-me'" 18:27
totally may not apply to your particular case. :)
bioduds_ you mean I should handle the errors in this case? 18:33
how would I do that? It simply fails. I actually tried using with $.attribute else shout out error but it never executes
is there a way to catch these non-executing rules? 18:34
one other thing: method new {} is like a constructor? 18:35
zengargoyle i think we went off in different directions. :) 18:36
bioduds_ no, sorry, my mistake 18:38
I wen't a completely different question
surely got you confused
let's go back on the first issue
zengargoyle nah, i just missed it while typing or thinking. :) 18:39
bioduds_ the data input treatment
you was saying you rather go loose with \S+ instead of trying to go precisely with the input data, right?
thing is I need some stringency here due to the fact I'm building a sort of a com protocol 18:40
zengargoyle myself, i would only validate an IP if i was putting it into a database or file as a text string. and would still probably do validation some other way.
bioduds_ I'll check on that possibility 18:41
since these are P2P nodes I must be carefull not to save too much info not to flood the node 18:42
zengargoyle an IP as 'a thing you connect to another machine' if you validate the actual token, it doesn't matter. if you pass a bad IP to the connect it will fail. catch the error when connecting.
bioduds_ ok, got it
like assume it is right
if it is not, it simply won't connect
ok
makes sense
geekosaur if it's a comm protocol you migth want to just punt and use the raw value (u32 for ipv4, u128 for ipv6) and not try to validate because you can't really
there are some seriously weird network configs out there 18:43
zengargoyle it has to be right to actually connect.
anything you catch as 'wrong' wouldn't actually even make it to the 'try to connect' phase. 18:44
bioduds_ it does, otherwise it will fail which is no major issue since the node will pass to the next trial
until it fills in his max-node connections
zengargoyle it will fail fast.
bioduds_ great, one other question 18:45
zengargoyle connect to 999.999.999.999 will return fail immediatly because it's not actually valid.
bioduds_ should I go with IO::Socket::Async or IO:Socket::INet ?
zengargoyle no clue... 18:46
bioduds_ I'm assuming INet is synchronous 18:48
zengargoyle thinks jnth just did some work on async stuff related to IO::Socket::Async and ...::Inet 18:49
but it's deep magic and MoarVM and libuv stuff that i don't fully understand. :{ 18:50
6guts.wordpress.com/2017/06/08/sor...ronous-io/ 18:52
bioduds_ reading it ... 18:58
tx man, I need to stay sharp on everything about P6 if I want this project to succeed
zengargoyle you might have to wait around and try asking again when the people who know are awake. :P
zengargoyle i *think* they want to make IO::Socket::INet work exactly like you would expect it to and the ...::Async was a temporary measure to work around INET not quite working as expected yet. but i might be totally wrong. 19:06
bioduds_ ok 19:07
you taught me the export PERL6LIB 19:08
do I need to put every folder in my project in it?
like so: =/home/bioduds/bitworkers/EscrowChain/dev/lib,/home/bioduds/bitworkers/EscrowChain/dev/lib/core,/home/bioduds/bitworkers/EscrowChain/dev/lib/network,/home/bioduds/bitworkers/EscrowChain/dev/lib/grammars
zengargoyle you probably want ugexe. :) i think you could just `zef --to=home install .` and not worry about it that much. 19:11
cygx m: sub foo { my $x = 0; say("a $x") andthen say("b $x") andthen $x = 1 }; foo; foo 19:13
camelia a 0
b 0
a 0
b 1
cygx ^ bug?
mspo gate.schedar.uberspace.de/vslides/2...ptr.html#0 19:15
nice
zengargoyle i'd think you just need /home/bioduds/bitworkers/EscrowChain/dev/lib -- but i don't know enough about your setup. i don't know that much beyond the simple adding `PERL6LIB=lib` to replace the `-Ilib` sort of usage. 19:16
zengargoyle if you do a `perl6 -B` you can see the repo::chain that's being used. -- repo::chain=inst#/home/zen/.perl6 ... -- 19:18
and if you do a `PERL6LIB=lib perl6 -V` you'll see -- file#/home/zen/p6/p6-Algorithm-Trie-libdatrie/lib 19:19
you can think around the 'inst#' vs 'file#' bits and play around with PERL6LIB until it works. :) and use those same sort of strings in the '--to' option of `zef` to install things into a special location. it all sorta depends 19:22
and it's my bedtime so i'm calling it a night because it's too hard to think. :) but it's been a nice back and forth. 19:24
lucasb m: for ^7 { my $x = 10; 1 andthen print "$x " andthen $x = 20 andthen $x = 30 andthen $x = 40 } 19:33
camelia 10 40 30 30 30 30 30
lucasb cygx: strange, indeed 19:34
but then, I have no idea what andthen does :) 19:35
perlpilot cygx: looks like a bug to me
lucasb it seems like the print statement is caching some wrong values from past iterations
cygx lucasb: andthen checks the LHS for definedness and conditionally executes the RHS, setting $_ 19:36
lucasb cygx: ah, thanks. 19:37
cygx and somehow, it creates a closure over the wrong $x
perlpilot cygx: lucasb's example is even more bizarre
lucasb would you say andthen is like a topicalizer "and" ?
cygx lucasb: almost - definedness vs truthiness 19:38
lucasb ah, got it
perlpilot idly wonders if orelse has a similar problem. 19:41
perlpilot I guess not since the short circuit flips 19:42
perlpilot m: sub foo { my $x = 0; do { say("a $x"); Any } orelse do { say("b $x"); Any } orelse do { $x = 1; Any } }; foo; foo; 19:45
camelia a 0
b 0
a 1
b 1
perlpilot yeah, something isn't scoping right
cygx rakudobugged as RT#131548 19:51
synopsebot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=131548
Xliff nine: Still here? 20:18
OK, I am trying to search through the P6 equivalent of @INC to see if there are files installed in a specific directory (ie namespace)
Previously, I could do this: for @($*REPO.repo-chain).grep({$_ ~~ CompUnit::Repository::FileSystem || $_ ~~ CompUnit::Repository::Installation }) -> $c { ... } 20:20
Xliff And do naughty things to $c.path-spec to accomplish what I need. Would that still work? 20:21
bioduds_ thanks 20:44
I had to leave after I asked
thanks for the answers zen
user3 How can I store a reference to variable $x in variable $z This doesn't work: 21:02
m: my $x=5; my $y := $x; my $z = $y; $x=8; say $z; # 5
camelia 5
user3 this should be 8 if that worked 21:03
jnthn m: my $x=5; my $y := $x; my $z := $y; $x=8; say $z;
camelia 8
user3 ok, but what if want to store the reference into the variable $z rather than create a new alias? 21:05
user3 can that be done at all? 21:06
jnthn Could do it with a Capture or a List 21:08
Capture probably is the more natural fit, I guess
m: my $x=5; my $y := $x; my $z = \$y; $x=8; say $z[0]; 21:09
camelia Potential difficulties:
To pass an array, hash or sub to a function in Perl 6, just pass it as is.
For other uses of Perl 5's ref operator consider binding with ::= instead.
Parenthesize as \(...) if you intended a capture of a single v…
jnthn heh
It's so unidiomatic to do it in Perl 6 it's a warning :P
m: my $x=5; my $y := $x; my $z = \($y); $x=8; say $z[0];
camelia 8
user3 wow
jnthn This probably means 21:10
oops
This probably means it's a case of "there's a different, better, way to do what you're trying to do"
cygx jnthn: we had some fun with andthen/orelse in the backlog 21:11
m: for ^7 { my $x = 10; 1 andthen print "$x " andthen $x = 20 andthen $x = 30 andthen $x = 40 }
camelia 10 40 30 30 30 30 30
cygx something ain't closureing right... 21:12
jnthn Yeah, I saw.
Indeed.
jnthn I've no idea what the impl of those two look like, alas. But I can guess they're missing a clone or a capturelex in the code-gen or some such 21:12
sammers hi #perl6 21:21
beginner is there a finally block for exceptions in perl6? 23:29
geekosaur I think you want LEAVE
beginner geekosaur : thank you...will try it 23:31
geekosaur something along the lines of: { code... ; CATCH { #`{ catch exceptions } ... }; LEAVE { #`{ run when done } ... } }