»ö« 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:00 lizmat joined 00:02 mcmillhj left 00:03 MasterDuke joined 00:04 lizmat left
pilne the more i tinker around with perl6, the more i get the feeling that it either has a way to do anything, or using what it does have, to create any known (maybe not "optimized, or perfectly idiomatic" but "usable") abstraction in computer science i.e: monads, and maybe some unknown, it just seems stupidly flexible in allowing one to define both data, and how you work with that data. 00:07
like, it defaults to rats, which is stupidly smart. but there is a very complete numeric tower available explicity, and if some kind you want isn't already there, defining it should be trivial if you can define the way a math function would work on it. 00:08
00:09 mcmillhj joined 00:13 pochi_ joined, pochi left 00:14 mcmillhj left 00:15 itaipu left, Cabanossi left 00:16 Cabanossi joined 00:17 itaipu joined 00:20 pecastro left
Geth DBIish: 90b5f294b5 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.pod
Fix word

  `data` is already a plural; singular being `datum`
00:20
00:29 mcmillhj joined 00:34 mcmillhj left 00:38 itaipu left, lookatme joined
lookatme morning .o/ 00:38
00:41 lizmat joined 00:45 itaipu joined
Geth doc: 87c5c64231 | (Will "Coke" Coleda)++ | 2 files
test examples on doc/Language/5to6-perlvar.pod6
00:46
00:46 lizmat left
Geth doc: 53d9ad5b02 | (Will "Coke" Coleda)++ | 2 files
pass xt/aspell.t
00:54
00:58 pecastro joined 01:08 espadrine_ left 01:09 Actualeyes joined 01:13 hartenfels joined, Cabanossi left 01:16 Cabanossi joined 01:17 aindilis` left 01:22 aborazmeh joined, aborazmeh left, aborazmeh joined 01:24 mcmillhj joined 01:29 mcmillhj left 01:45 ilbot3 left 01:48 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:00 mcmillhj joined 02:02 pilne left 02:05 mcmillhj left 02:14 Cabanossi left 02:16 Cabanossi joined 02:17 mcmillhj joined 02:21 mcmillhj left 02:22 pecastro left 02:33 pecastro joined 02:42 noganex_ joined 02:46 noganex left
BenGoldberg ZofBot, It's actually easy to take Data (singular) and make it (him?) plural. Just grab the Star Trek android, and clone him. Now you have Datas. 02:55
03:11 itaipu left 03:13 itaipu joined 03:15 Cabanossi left 03:16 raschipi joined
raschipi BenGoldberg: Just FYI, data is plural, datum is the singular. 03:16
03:16 Cabanossi joined
raschipi As Zoffix said above, saw the commit now. 03:17
lucs Meh, data is English, datum is Latin.
raschipi It's a word in English that came from Latin. It keeps it's singular and plural declinations. 03:18
03:19 Actualeyes left
raschipi Like 'campus', plural is 'campi'. 03:19
03:19 araujo left
TEttinger dataz 03:20
BenGoldberg But, if Data is a *name*, and you've got more than one of that person, then what? 03:37
lucs BenGoldberg: What TEttinger said :) 03:38
BenGoldberg is surpised that nobody pointed out that Data, being an android, is not clonable. 03:40
raschipi Just use dd to clone an android. rsync works too. 03:42
03:44 khw left, raschipi left 03:46 itaipu left 03:47 aborazmeh left 03:57 Cabanossi left 03:59 Cabanossi joined 04:01 hartenfels left
BenGoldberg Heh :) 04:06
geekosaur has everyone forgotten the replacement TNG doctor (3rd season iirc) arguing with Data over his name? 04:21
My take is that, while the English word "data" did in fact have the Latinate usage through early 20th century, it became a collective noun after that. 04:24
(Quite a few words related to computing changed meaning and/or usage in that period. Including "computing" itself, for that matter.) 04:30
geekosaur is also considering pointing at "Shatterday" re "then what?" 04:32
04:35 pecastro left 04:38 xtreak joined 04:41 pecastro joined 04:43 mcmillhj joined 04:46 curan joined 04:50 mcmillhj left, fatguy joined 04:51 Actualeyes joined 05:01 astj joined, astj_ left 05:02 mcmillhj joined 05:05 lookatme left 05:06 mcmillhj left, lookatme joined 05:07 mcmillhj joined 05:08 kurahaupo left 05:11 kurahaupo joined, mcmillhj left 05:21 kyan joined 05:22 mcmillhj joined 05:25 astj left 05:26 astj joined 05:30 mcmillhj left 05:43 Cabanossi left 05:44 wamba joined 05:45 Cabanossi joined 05:46 simonm joined 05:51 BenGoldberg left 05:52 skids left 05:58 simonm left 06:06 lookatme left 06:07 lookatme joined, domidumont joined 06:09 dwarring left 06:13 domidumont left, domidumont joined 06:23 domidumont left 06:38 xtreak left, xtreak joined 06:41 lowbro joined, lowbro left, lowbro joined 06:43 xtreak left, xtreak joined 06:47 itaylor57 left 06:48 awwaiid left 06:50 wamba left 06:54 rindolf joined 06:55 awwaiid joined 07:02 Actualeyes left 07:03 lookatme left, lookatme joined 07:04 Actualeyes joined 07:12 lizmat joined 07:25 espadrine_ joined 07:26 vetmaster joined
fatguy can i store db handle in class attribute ? is it best practice ? 07:27
masak fatguy: re "can" -- sure 07:28
fatguy: re "best practice" -- that's less about db handles and more about class attributes, if you ask me
a class attribute is basically a global variable
and so all lessons about testability and dependency injection apply
fatguy masak: i'm in doubt on how to manage my dbh, do you have any general tips ? 07:31
07:31 rindolf left
vetmaster how to set a rule/token in grammar, that can get another token and match something in it? 07:33
fatguy masak: currently i private my dbconfig and connection method and only allow statement to be passed from other class 07:34
masak fatguy: not sure I have any general tips. "keep database handling fairly separate from other stuff", maybe?
m: grammar G { token TOP { <foo> }; token foo { "foo" } }; say ?G.parse("foo") 07:35
camelia True
masak vetmaster: ^ like that?
vetmaster no, meant something like this: grammar A { rule TOP { <a> } token a { <-[/]>+ } }; 07:36
and token b 07:37
like token b ( -> a ) { $a ~~ /\w/ }
it's pseudocode, i know
masak ...I'm sorry, I don't understand
are you talking about passing a rule/token to another as a parameter?
masak .oO( Higher Order Tokens ) 07:38
vetmaster i. e. I have a substring matched by <-[/]>+
moritz HOT, sounds like a great companion to HOP :-)
07:38 wamba joined
vetmaster and I want to match another substring from the above substring :-) 07:38
zengargoyle_ HOP probably could use a p6 version. that might rock.
moritz zengargoyle_: write it! :-) 07:39
masak vetmaster: I still don't understand, but I can start somewhere that I do understand, and hopefully that'll help
vetmaster: you can pass strings to regexes
moritz vetmaster: I don't understand what you mean by "match another substring from the above substring"
vetmaster: regexes can match strings
masak m: my $str = "fo+"; say "this is foolish" ~~ /<$str>/ 07:40
camelia 「foo」
moritz vetmaster: maybe it's it's easier if you start by describing what problem you want to solve
masak vetmaster: does this mechanism help with what you want to do?
vetmaster example string: "abc /def, aff/ test"
07:41 pecastro left
vetmaster '/<-[/]>+' will match '/def, aff' 07:41
zengargoyle_ i would think of it as what bits of your <-[/]>+ do you want.?
vetmaster \w+
zengargoyle_ and rewrite it as a combination of the bits you want vs the whole <-[/]>+ bit.
vetmaster I want to match all \w+ in '/def, aff' 07:42
moritz and what do you want to do with the stuff in there that's not \w+ ?
07:42 rindolf joined, darutoko joined
vetmaster it can be ignored 07:43
so, it's not important
moritz in general, something like [ /<-[/]>+ ] & [(\w+) .*?]
07:43 domidumont joined
moritz wait, '/' [ <-[/]>+ ] & [(\w+) .*?] 07:44
vetmaster will that match both 'def' and 'aff'?
moritz that extracts the first word from the match
no, just def
vetmaster but how to match all \w+?
what if '/' [ <-[/]>+ ] & [(\w+) .*?] + 07:45
moritz [ [\w+]* % [<-alnum-[/]>+] ]
that's a different approach
words separated by characters that are neither words nor /
[ (\w+)* % [<-[/]>+?] ] # with non-greedy regexes and captures 07:46
m: say '/abc def' ~~ / '/' [ (\w+)* % [<-[/]>+?] ] / 07:47
camelia 「/abc def」
0 => 「abc」
0 => 「def」
moritz you can see that it caputres abc and def separately
07:49 domidumont left
zengargoyle_ m: my $toss = /<[/]>/; 'abc /def, aff/ test' ~~ /(<-[/]>+)* % <$toss>/ 07:51
camelia ( no output )
zengargoyle_ m: my $toss = /<[/]>/; say 'abc /def, aff/ test' ~~ /(<-[/]>+)* % <$toss>/
camelia 「abc /def, aff/ test」
0 => 「abc 」
0 => 「def, aff」
0 => 「 test」
zengargoyle_ probably missing something while on wild goose chase. :)
07:53 darutoko left 07:55 g4 joined 07:58 pecastro joined
vetmaster why it doesn't work? ideone.com/azSvMK 08:10
08:14 dakkar joined
zengargoyle_ i only know about '<' and '>' being used with other rules. what do you expect? 08:15
zengargoyle_ thinks it just looks wrong but not sure ... 08:16
08:18 vetmaster_ joined
zengargoyle_ ^ [ \w+ || \s ] + $ 08:18
08:18 lookatme left 08:19 lookatme joined, vetmaster left
zengargoyle_ m: grammar A { rule TOP { ^ <word>* %% <space> $ }; token word { \w+ }; token space 08:26
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed regex
at <tmp>:1
------> 3ce> $ }; token word { \w+ }; token space7⏏5<EOL>
zengargoyle_ { \s }; }; my $str = 'the quick brown fox jumps over the lazy dog'; say A.parse
m: grammar A { rule TOP { ^ <word>* %% <space> $ }; token word { \w+ }; token space { \s }; }; my $str = 'the quick brown fox jumps over the lazy dog'; say A.parse($str).gist; 08:27
camelia 「the quick brown fox jumps over the lazy dog」
word => 「the」
space => 「 」
word => 「quick」
space => 「 」
word => 「brown」
space => 「 」
word => 「fox」
space => 「 」
word => 「jumps」
space => …
08:29 goon_ joined, robertle joined 08:30 aborazmeh joined, aborazmeh left, aborazmeh joined 08:35 pmurias joined
pmurias is &foo := &bar supposed to work? 08:35
lookatme rule TOP {
^ <string> $ <?{ say $/; }>
}
token string {
[ \w || \s ]+
}
}
my $str = "the quick brown fox jumps over the lazy dog";
say A.parse($str); 08:36
evalable6 lookatme, Full output: gist.github.com/434338ad132e408319...b794acfeb9
(exit code 1) 04===SORRY!04=== Error while compiling /tmp/z7AeMHJef3
Variabl…
masak lookatme: please don't paste big chunks of code into the channel. use gist or some other pastebin service, and link to it ;)
lookatme pmurias, why not ~~ 08:37
masak, oh, sorry
masak pmurias: yes, I think `&foo := &bar` is supposed to work
m: sub bar { say "OH HAI" }; my &foo := &bar; foo()
camelia OH HAI
masak pmurias: ...and it does, in Rakudo
pmurias m: my sub bar {say "OH HAI" };my sub foo {"will be rebound"}; &foo := &bar; foo() 08:39
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use bind operator with this left-hand side
at <tmp>:1
------> 3ub foo {"will be rebound"}; &foo := &bar7⏏5; foo()
lookatme ...
masak pmurias: hm. not sure I'd expect that one to work.
lookatme In your situation &foo not a container, I think
vetmaster_ m: say '/substring ' ~~ /<-[/]>+/;
camelia 「substring 」
masak pmurias: mostly because we make certain static assumptions/guarantees about subs. 08:40
vetmaster_ m: say '/substring ' ~~ /<-[/]>+ <after \s>/;
camelia 「substring 」
after => 「 gnirtsbus/」
lookatme It's a item in symbol table, I guess
vetmaster_ m: say '/substring ' ~~ /<-[/]>+ (?=\s)/; 08:41
camelia 5===SORRY!5=== Error while compiling <tmp>
Quantifier quantifies nothing
at <tmp>:1
------> 3say '/substring ' ~~ /<-[/]>+ (?7⏏5=\s)/;
vetmaster_ what is equvalient to (?=\s) ?
lookatme It's like function in C, you can not modify a function name in run time. 08:42
masak vetmaster_: <?before \s>
lookatme Or point to other function.
08:43 nadim joined 08:44 aborazmeh left 08:45 mcmillhj joined
vetmaster_ m: say '~/~/~/~/ substring ' ~~ /<-[\/~]>+/; 08:49
camelia 「 substring 」
vetmaster_ m: say '~/~/~/~/substring ' ~~ /<-[\/~]>+ <?before \s>/; 08:50
camelia 「substring」
08:52 mcmillhj left 08:55 goon_ left 08:57 holyghost joined 09:04 lookatme left, holyghost left 09:13 Actualeyes left 09:16 lookatme joined
samcv how do i find the source file of a link using perl 6? 09:18
i know how to create links. but how do i find out where a link links to
09:19 nowan left
lookatme A link? 09:21
symbol link under linux ?
or something else ? 09:22
09:22 nowan joined 09:29 mr-foobar left
zengargoyle_ samcv: it looks like it's not brought up to perl 6 level, but there's nqp::readlink. 09:31
09:32 mr-foobar joined
zengargoyle_ it may be method 'resolve' in IO::Path, but i can't figure how to make it go from "alink" -> "notalink" when `ln -s notalink alink` 09:34
09:34 sivoais left
zengargoyle_ samcv: IO::Path.new('alink').resolve --> "/opt/rakudobrew/git_reference/notalink".IO 09:37
where `ln -s notalink alink` 09:38
zengargoyle_ yay, ack + guesswork wins! 09:39
09:39 AlexDaniel joined 09:41 sivoais joined, vetmaster_ left
lookatme m: say ".".IO ~~ :l; 09:41
camelia False
09:41 cognominal left
zengargoyle_ lookatme: i think '.' is a hardlink.... 09:46
'alink'.IO ~~ :l --> True for me 09:47
haven't played with hardlinks enough to know if they're porable or even exposed by the libuv that does all the file stuff. 09:48
lookatme zengargoyle_, no, it's symlink 09:50
09:51 vetmaster joined
vetmaster m: say 'string' ~~ /[g-x]/; 09:51
camelia 5===SORRY!5===
Unrecognized regex metacharacter - (must be quoted to match literally)
at <tmp>:1
------> 3say 'string' ~~ /[g7⏏5-x]/;
Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']'
at <tmp>:1
------> 3say…
vetmaster m: say 'string' ~~ /[g..x]/;
camelia Nil
lookatme Create with .link or .symlink, check with :l for symlink,
vetmaster how to match all symbols from "g" to "x" in 'string'? 09:52
[g-x] in PCRE
lookatme m: say 'string' ~~ /[a..z]/;
camelia Nil
lookatme m: say 'string' ~~ /[a .. z]/;
camelia Nil
zengargoyle_ lookatme: i've never really looked but `ls` shows soft-links differently so i assumed . was a hard link.
lookatme zengargoyle_, oh I misunderstand you, but directory not support hardlink 09:54
zengargoyle_ i sorta guess it's neither and special-cased in filesystem management stuff.
ah, that's more like my thinking.
vetmaster > how to match all symbols from "g" to "x" in 'string' 09:55
is it impossible in Perl6 regex?
zengargoyle_ m: 'the quick brown fox jumped over the lazy dog' ~~ /<[g..x]>/
camelia ( no output )
lookatme m: say 'string' ~~ /<[a..z]>/; 09:56
camelia 「s」
lookatme m: say 'string' ~~ /[a s .. z]/;
camelia Potential difficulties:
Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)
at <tmp>:1
------> 3say 'string' ~~ /[a7⏏5 s .. z]/…
lookatme m: say 'as..z' ~~ /[as..z]/;
camelia 「as..z」
zengargoyle_ m: 'the quick brown fox jumped over the lazy dog'.comb: /<[g..x]>/ 09:57
camelia ( no output )
zengargoyle_ huh..
lookatme vetmaster, it's <[]>, not [], <[]> is character set, [] is non-capture group
zengargoyle_ m: say 'the quick brown fox jumped over the lazy dog'.comb: /<[g..x]>/ 09:58
camelia (t h q u i k r o w n o x j u m p o v r t h l o g)
lookatme bye, off work :) 09:59
09:59 lookatme left
zengargoyle_ m: say 'the quick brown fox jumped over the lazy dog' ~~ m:g/<[g..x]>/ 09:59
camelia (「t」 「h」 「q」 「u」 「i」 「k」 「r」 「o」 「w」 「n」 「o」 「x」 「j」 「u」 「m」 「p」 「o」 「v」 「r」 「t」 「h」 「l」 「o」 「g」)
zengargoyle_ the 'say' gets me every time. :/ 10:00
vetmaster is there any special characters to match only upper-case \w ? 10:03
* are
zengargoyle_ i think \w covers things that may not have 'upper' at all.
10:04 salv0 left, salv0 joined
zengargoyle_ because \w is 'word' and some characters in other languages don't have upper/lower. 10:04
you might have to go to the unicode thingies and craft your own \w like thing if you want specifics. 10:05
vetmaster m: say 'abbr. sec.' ~~ /[ \w+\. || <[A..Z> ] + % [" "+]/ 10:06
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<assert>; couldn't find final '>'
at <tmp>:1
------> 3 'abbr. sec.' ~~ /[ \w+\. || <[A..Z> ] +7⏏5 % [" "+]/
vetmaster m: say 'abbr. sec.' ~~ /[ \w+\. ] + % [" "+]/
camelia 「abbr. sec.」
vetmaster m: say 'C' ~~ /<[A..Z]>/ 10:07
camelia 「C」
vetmaster m: say 'c' ~~ /<[A..Z]>/
camelia Nil
vetmaster m: say 'UPPER' ~~ /<[A..Z]>/
camelia 「U」
vetmaster m: say 'lower' ~~ /<[A..Z]>/
camelia Nil
vetmaster m: say 'КАПС' ~~ /<[А..Я]>/
camelia 「К」
vetmaster m: say 'некапс' ~~ /<[А..Я]>/ 10:08
camelia Nil
vetmaster ok, it works
zengargoyle_ not going to support ぜん :P 10:09
vetmaster m: say 'abbr. sec.' ~~ /[ [ \w+\. ] + % [" "+] || <[A..Z]>/
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in metachar:sym<[ ]>; couldn't find final ']'
at <tmp>:1
------> 3' ~~ /[ [ \w+\. ] + % [" "+] || <[A..Z]>7⏏5/
expecting any of:
infix stopper
vetmaster m: say 'abbr. sec.' ~~ /[ [ \w+\. ] + % [" "+] || <[A..Z]> ]/
camelia 「abbr. sec.」
vetmaster m: say 'C' ~~ /[ [ \w+\. ] + % [" "+] || <[A..Z]> ]/
camelia 「C」
10:12 Cabanossi left
zengargoyle_ vetmaster: there probably are unicode properties that match what you want, you could build a 'is-alphanumeric and is-not-lower' sort of character class, but it is too hard to come up with off the top of my head. :) 10:13
10:15 Cabanossi joined, jameslenz left
TEttinger Ll is lower-case letters, but you don't want title case letters either 10:22
(since they kinda contain lower case letters) 10:23
10:24 xtreak left
TEttinger Lu is upper case letters 10:24
m: say "Mario Mario & Luigi Mario in Super Mario Brother 3" ~~ /[ <:Lu+Nd> ]/ 10:27
camelia 「M」
TEttinger not sure how to get all matches 10:28
10:28 cognominal joined
TEttinger m: say "Mario Mario & Luigi Mario in Super Mario Brother 3".comb /[ <:Lu+Nd> ]/ 10:28
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3per Mario Brother 3".comb /[ <:Lu+Nd> ]/7⏏5<EOL>
expecting any of:
prefix
term
TEttinger m: say("Mario Mario & Luigi Mario in Super Mario Brother 3".comb /[ <:Lu+Nd> ]/)
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3per Mario Brother 3".comb /[ <:Lu+Nd> ]/7⏏5)
expecting any of:
prefix
term
TEttinger hmmmmm
m: say("Mario Mario & Luigi Mario in Super Mario Brother 3".comb: /[ <:Lu+Nd> ]/) 10:29
camelia No such method 'Nd' for invocant of type 'Match'
in block <unit> at <tmp> line 1
TEttinger m: say("Mario Mario & Luigi Mario in Super Mario Brother 3".comb: /[ <:Lu+:Nd> ]/)
camelia (M M L M S M B 3)
TEttinger there we go. 10:30
zengargoyle_ m: say 'ぜん三'.comb: /[ <:Lu+:Nd> ]/ 10:34
camelia ()
10:35 TEttinger left 10:39 jameslenz joined 10:41 astj left, astj joined 10:43 Cabanossi left
zengargoyle_ m: say 'Mario Mario & Luigi Mario in Super Mario Brother 3 ぜん三'.comb: /[ <-:Ll+:Nd> ]/ 10:44
camelia (M M & L M S M B 3 ぜ ん 三)
10:45 Cabanossi joined
zengargoyle_ not going to try for all of the ands and ors to get everything to work. :P 10:45
10:47 espadrine_ left 10:58 rindolf left 11:04 nadim left 11:09 itaylor57 joined 11:16 nadim joined 11:23 pecastro left 11:27 xtreak joined, wamba left 11:28 cdg joined, Cabanossi left 11:30 Cabanossi joined, domidumont joined 11:31 xtreak left, bioduds joined
bioduds Hello, everyone 11:31
Can someone please understand why this does not work?
vetmaster what? 11:32
bioduds grammar DIG { token TITLE { ( .* ) } token URL { ( .* ) } rule TOP { '; <<>> ' <TITLE> ' <<>> ' <URL> } } class DIG::Actions { method TOP ($/) { say "TITLE: " ~ $/<TITLE>; say "URL: " ~ $/<URL>; } }
DIG.new.parse( '; <<>> DiG 9.10.3-P4-Ubuntu <<>> seed.bitcoin.sipa.be', :actions( DIG::Actions.new ) ).made;
moritz bioduds: please use a nopaste service
bioduds I can get the url but not the title 11:33
moritz bioduds: don't use .*
bioduds what should I use, moritz? 11:34
moritz bioduds: what does the data format say?
bioduds DiG 9.10.3-P4-Ubuntu 11:35
moritz then token TITLE { 'DiG 9.10.3-P4-Ubuntu' }
vetmaster m: grammar A { rule TOP { [ \w+ || \d+ ] }; token a { \w+ }; token a.b { \d+ }; }; 11:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed regex
at <tmp>:1
------> 3\w+ || \d+ ] }; token a { \w+ }; token a7⏏5.b { \d+ }; };
11:36 apfel joined
vetmaster m: say 'abcd2' ~~ /\w+<?before \d>/ 11:39
camelia 「abcd」
vetmaster m: say 'abcde' ~~ /\w+<?before \d>/
camelia Nil
apfel hi there, im playing with perl6 for the first time and im confused, i guess i missed something, pastebin.com/XxiuCWzF this failes to receive messages from the server, it just prints IO::Socket::Async.new ... 11:41
vetmaster m: say 'Яблоко' ~~ /<[А..ЯЁа..я]>/;
camelia 「Я」
vetmaster m: say 'zблоко' ~~ /<[А..ЯЁа..я]>/; 11:42
camelia 「б」
lizmat apfel: that looks like *very* perl 5 centric code 11:46
did you have a look at docs.perl6.org/type/IO::Socket::Async ?
bioduds let me try 11:48
apfel i have some perl5 experience, and yes, i took a look at IO::Socket::Async 11:50
bioduds nope, none of these work 11:51
I'm confused. RegExes always drive me nuts
11:51 cdg left, kyan left 11:52 cdg joined
bioduds it's a simple string, I just wanna catch that 11:52
DiG 9.10.3-P4-Ubuntu
I already delimited it
I don't understand why it does not fetch it
vetmaster m: say 'word' ~~ /\w+ % [\s+]/ 11:54
camelia 「w」
vetmaster m: say 'word' ~~ /[\w+] % [\s+]/
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing quantifier on the left argument of %
at <tmp>:1
------> 3say 'word' ~~ /[\w+] %7⏏5 [\s+]/
vetmaster m: say 'word' ~~ /<\w+> % [\s+]/
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3say 'word' ~~ /<7⏏5\w+> % [\s+]/
Unrecognized regex metacharacter \ (must be quoted to match literally)
at <tmp>:1
------> 3s…
nine apfel: what rakudo version are you using? 11:56
11:57 araraloren joined
bioduds me? 11:57
araraloren evening o/
bioduds bioduds@BITWORKERS ~/bitworkers/EscrowChain/dev $ perl6 -version This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-53-g66c6dda implementing Perl 6.c.
apfel nine: i used rakudobrew to install it, perl6 -V -> pastebin.com/HMrYv1kp 11:59
araraloren ^_^ 12:00
nine apfel: perl6::version=2015.11 that's the beta?!
apfel nine: oh, ok, then i try to get a newer one and check again, thank you 12:01
araraloren Em, the last version is 2017.04 or 05
nine apfel: on the current version it sorta works. But it will only print once I press ^D, i.e. once STDIN gets closed. So I'm not sure the asynchronous stuff works well with STDIN.
apfel nine: wired, with the version i have STDIN works fine, but the receiving part is not working 12:02
i will try a newer version
12:05 cyphase left, kyan joined
vetmaster how to parse 'expr- ession' as 'expression' inside a grammar 12:06
?
12:08 raschipi joined
araraloren A word contain hyphen ? 12:08
vetmaster yes 12:09
12:12 vetmaster left
araraloren m: say 'expr-ession' ~~ /<[\w\-]>+/; # ? 12:12
camelia 「expr-ession」
12:14 vetmaster joined, Cabanossi left, cyphase joined 12:15 Cabanossi joined
vetmaster but it matches 'expr-ession' 12:16
12:16 cdg_ joined
bioduds nope 12:16
araraloren m: say 'expr- ession' ~~ /<[\w\ \-]>+/; 12:17
camelia 「expr- ession」
araraloren m: say 'expr- ession' ~~ /<[\w\s\-]>+/;
camelia 「expr- ession」
12:17 cdg left
araraloren I dont' know what you want to do. So I just write regex match that string you offered 12:18
12:20 kyan left
bioduds do I need to put it inside parenthesis in order to capture it? 12:20
raschipi Parenthesis make capture groups, yes. 12:21
And [ ] is non-capturing groups
bioduds ok 12:22
it does capture the string
I mean if I put it literally
vetmaster m: say 'aql' ~~ /<[abcd]>+/;
camelia 「a」
bioduds why can't I use .* ?
shouldn't it simply catch all inside there?
moritz .* catches the outside too 12:23
Geth doc: 23790123c7 | (Jan-Olof Hendig)++ | doc/Type/Pair.pod6
Fixed a few example outputs
12:24
12:24 domidumont1 joined 12:25 domidumont left
vetmaster say ' - test' ~~ /\s*-\s*.*/ 12:26
evalable6 vetmaster, Full output: gist.github.com/2da3dbfac2612dc13d...eaa4e20b9d
(exit code 1) 04===SORRY!04===
Unrecognized regex metacharacter - (must be q…
vetmaster m: say ' - test' ~~ /\s*-\s*.*/
camelia 5===SORRY!5===
Unrecognized regex metacharacter - (must be quoted to match literally)
at <tmp>:1
------> 3say ' - test' ~~ /\s*7⏏5-\s*.*/
Unable to parse regex; couldn't find final '/'
at <tmp>:1
------> 3say ' - test' ~~ /\s*-7…
vetmaster m: say ' - test' ~~ /\s*\-\s*.*/ 12:27
camelia 「 - test」
vetmaster "-" should be escaped when matching literally!
bioduds say 'no quotes' ~~ / <-[ " ]> + /; # matches characters except " 12:29
evalable6 「no quotes」
Juerd Escaped or quoted. I find it easier to read when quoted: /\s* '-' \s* .*/
12:29 pecastro joined
bioduds I used this and it doesn't work 12:29
Juerd bioduds: Can you be more specific? "Doesn't work" doesn't work :)
jnthn The rule in Perl 6 regexes is fairly simple: everything except alphanumeric chars should be escaped or quoted 12:30
nadim hi, can one define multies depending on the calling context ?
bioduds yes
12:31 kerosene joined
bioduds I'm trying this: rule TOP { '; <<>> ' <-[ " ]> + ' <<>> ' <URL> } 12:31
12:31 kerosene left
bioduds which according to documentation, <-[ " ]> + should match anything except " 12:31
but it does not
prints nothing
when I do say "URL: " ~ $/<URL>; 12:32
Is that more clear now
vetmaster another question: is it possible to import token only if all symbols of it are non-numbers (<-[\d]>) ?
bioduds I'm sorry if I'm not passing the message through
vetmaster don't worry, both our questions will be answered :-) 12:33
Juerd bioduds: Try printing $/ first, to see if the regex matched at all 12:34
perlpilot vetmaster: btw, \D is an easier way to say "not digit" 12:35
Juerd bioduds: Can you give an example of the string you're matching against?
zengargoyle_ bioduds: can you post the thing you're trying to parse somewhere? i'm not sure why you would match not quote when the next match starts with a space.....
bioduds no and yes 12:36
zengargoyle_ becase no quote includes spaces and the <<>> thing as well.
Juerd I'm staring at that "; <<>> " and wonder what kind of program generates output like that, and why.
bioduds here is the string to match: ; <<>> DiG 9.10.3-P4-Ubuntu <<>> seed.bitcoin.sipa.be
Juerd Ah, dig!
bioduds the DiG 9.10.3-P4-Ubuntu is a variable
perlpilot bioduds: have you tried Grammar::Debugger?
12:37 domidumont1 left
bioduds I want to load both DiG 9.10.3-P4-Ubuntu and the url 12:37
raschipi Grammar::Debugger is borked
zengargoyle_ it look like you would be matching '; <<>> somethinghere <<>> URLHERE
bioduds on different variables
12:37 itaipu joined
Juerd bioduds: Since that does match your regex up until <URL>, I think your definition of URL might be broken. 12:37
bioduds precisely zengargoyle
that is exactly what I want, for start, this is only DIG first line
I was able to get the URL 12:38
moritz so what can be inside the somethinghere?
zengargoyle_ <-[ " ]> does not only match something, it matches everyting else unless URL has a "
bioduds but the somethinghere you pointed does not load
perlpilot raschipi: is it? That's a pity.
zengargoyle_ i would guess something is \S+
12:38 wamba joined
bioduds ok, I understande that zen 12:38
raschipi Zoffix, do you know what's worng with Grammar::Debugger? 12:39
zengargoyle_ since you're looking for the spaces on either side of the something.
bioduds how would I go around that blind matching approach, I was under the impression that since I delimited it, it would be wise enough to only match inside the delimiter
12:40 eveo joined
perlpilot bioduds: are you using token or rule in your grammar? rule has significant whitespace and since they don't backtrack, if your whitespace gets eaten, you won't match 12:40
bioduds I tried both perlpilot
eveo How can I get the same version string as in perl6 -v output? $*PERL.compiler.version.Str gives "2017.05.297.g.608.e.886" but I want "2017.05-297-g608e886"
bioduds I'm on trial and error now which makes me feel stupid, lol :) 12:41
12:41 zakharyas joined
perlpilot bioduds: well, perhaps it's just the not-backtracking of token that's causing your problem? Try regex instead? 12:41
eveo raschipi: nothing's wrong with Grammar::Debugger 12:42
bioduds regex? inside grammar? 12:43
vetmaster why perl6 doesn't like this: <meaning>+ % [;\⏏s*] ?
bioduds regex TOP { ... } ?
perlpilot yeah, instead of: token { ... }, use regex { ... }
12:43 mcmillhj joined
vetmaster "?" sign is not a part of the given regex 12:44
perlpilot vetmaster: `;` is non-alphanumeric
bioduds oh, it worked
eveo vetmaster: what does the error message say?
zengargoyle_ m: say '; <<>> DiG 9.10.3-P4-Ubuntu <<>> seed.bitcoin.sipa.be' ~~ rx { '; <<>> ' (\S+) \s (\S+) ' <<>> ' (.*) }
camelia 「; <<>> DiG 9.10.3-P4-Ubuntu <<>> seed.bitcoin.sipa.be」
0 => 「DiG」
1 => 「9.10.3-P4-Ubuntu」
2 => 「seed.bitcoin.sipa.be」
vetmaster eveo: couldn't find final ']' at /home/sivan/selkup-perl6/SRDS_Main_Parser.p6:49
bioduds that is regex zengargoyle, right? 12:45
eveo vetmaster: that's a poor error message. Should say this:
m: /;/
camelia 5===SORRY!5=== Error while compiling <tmp>
Unrecognized regex metacharacter ; (must be quoted to match literally)
at <tmp>:1
------> 3/7⏏5;/
expecting any of:
term
vetmaster eveo: yeah, I see it in the top of error list
zengargoyle_ should translate pretty well, not much difference except for whitespace and backtracking between regex, rule, token.
vetmaster Unrecognized regex metacharacter ; (must be quoted to match literally) at .../SRDS_Main_Parser.p6:49 12:46
zengargoyle_ just harder to test on one line. :)
vetmaster so, ";" must be quoted
eveo Yeah, or you can escape it with a backslash
zengargoyle_ non-alphanumeric needs quotes... or escape. 12:47
i'd probably put '<<>>' in a token and re-use it
and maybe 'DiG'
perlpilot That's a little weird that the unquoted ; would cause the other error. I guess it treats the ; as a sequence point and things go wonky. 12:48
bioduds I worked but I can't isolate it
zengargoyle_ rule { ^ ';' <angles> <dig> <title> <dig> <angles> <url> $ }
rule { ^ ';' <angles> <dig> <title> <angles> <url> $ } 12:49
raschipi zengargoyle_: I think that won't match because nothing matches the whitespace.
Juerd "$input = %commands{$input} // Entity.load($input) // $input;" bothers me because $input is repeated. Is there a form of assignment that only assigns if the RHS is defined?
zengargoyle_ gives .wh (whitespace) instead of single space, but you can fix that other ways, or use \s 12:50
12:50 wamba left
zengargoyle_ and title and url are just \S+ 12:50
[Coke] eveo: the version method is called on Perl6::Compiler, which inherits from HLL::Compiler in nqp, and is defined here: github.com/perl6/nqp/blob/05e5d75c...#L545-L558 12:51
perlpilot raschipi: rules have significant whitespace, so the whitespace in the rule should match the whitespace in the string.
eveo Juerd: you can write that as $_ = %commands{$_} // Entity.load($_) // $_ given $input;
12:51 fatguy left
Juerd eveo: Still repeats something, and I'd like to avoid every use of $_ that I can :) 12:51
bioduds it is confusing when to use rule token regex
Juerd eveo: By the way, it's not the $input in {} or () that bother me, but the // $input at the end. 12:52
12:52 geekosaur left
eveo Juerd: $input = $_ with %commands{$input} // Entity.load($input) 12:52
bioduds \S+ won't work
Juerd eveo: Nice one!
12:53 geekosaur joined
perlpilot bioduds: mostly, you start off with `token` and remember that they don't backtrack (that means that greedy regex like .* will keep what they match) 12:53
Juerd eveo: I wrote it as with %commands{$input} // Entity.load($input) -> $object { $input = $object }
perlpilot bioduds: IMHO of course 12:54
eveo Juerd: can write it as with %commands{$input} // Entity.load($input) -> { $input = $^object }
[Coke] eveo: (that said, I can't see immediately where $!backend is coming from.)
Juerd Hm, could even just use "if"...
eveo [Coke]: I guess I'll just parse $*PERL.compiler.version to something github would accept as a commit reference 12:55
Oh! It's already done somewhere
zengargoyle_ i think..... token doesn't backtrack. rule makes whitespace very flexible. regex is regex. :)
eveo buggable: eco Sourcery
buggable eveo, CoreHackers::Sourcery 'Helper for showing actual source code locations of core subs and methods': github.com/zoffixznet/perl6-CoreHa...s-Sourcery
eveo there
12:55 xtreak joined
zengargoyle_ bioduds: gist.github.com/6c3732e6a688a07aa5...5b06db4039 12:55
bioduds I don't understand this backtrack concept
vetmaster m: say 'food, fast' ~~ /\w+ % [\s+]/
camelia 「f」
Geth doc: d973eb02ae | (Jan-Olof Hendig)++ | doc/Type/Parameter.pod6
Added a few more examples
12:56
bioduds could you please try to explain me what is backtrack? :)
12:56 rindolf joined, wamba joined
bioduds thanks for the link zen, trying it here 12:56
vetmaster m: say 'food, fast' ~~ /[\w+ % [\s+]]/ 12:57
camelia 「f」
eveo bioduds: token = whitespace is ignored; rule = it inserts <ws> token where you have whitespace between atoms; regex = backtracking; backtracking = "going back and retrying another combination instead of failing a match"
vetmaster m: say 'food, fast' ~~ /[\w+ % [\s+]]+ % [\,\s*]/
camelia 「f」
zengargoyle_ if it is matched once, it is matched always, if some further match fails, the testing can't go back and undo the token and try something else.
vetmaster m: say 'food, fast' ~~ /[[\w+] % [\s+]]+ % [\,\s*]/
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing quantifier on the left argument of %
at <tmp>:1
------> 3say 'food, fast' ~~ /[[\w+] %7⏏5 [\s+]]+ % [\,\s*]/
bioduds I have a lot to learn 12:58
thank you guys
zengargoyle_ thinks token turns off backtracking and it's the default so regex does it.
eveo rules also don't backtrac 12:59
bioduds one question: you do like new RegEx system in Perl6, right? Or are you not satisfied?
zengargoyle_ you can tell a regex to ignore ws and to not backtrack effectivly making it the same as token.
eveo bioduds: it felt overly verbose when first switching to it, but now I feel it's much clearer, especially when writing large grammars
zengargoyle_ it's just what the default behavior is without adding a bunch of flags to pick exactly what you want.
perlpilot bioduds: totally satisfied :) 13:00
bioduds ok, thanks. So I will invest time in learning it through ;)
Cheers, guys.
eveo bioduds: In fact, I still pause for a bit when trying to remember if it's (?<=) for lookbehind, but in Perl 6 it's <after>. Like a proper english word
perlpilot I do feel a little pang of longing for Perl 5 regex sometimes when my character classes get a little verbose and would be expressed more simply in P5
13:01 wamba left
eveo There's :P5 adverb for taht ;) 13:01
perlpilot indeed.
13:01 eveo left
araraloren m: say "ab" ~~ m:P5/a(?=b)/; 13:01
camelia 「a」
zengargoyle_ bioduds: the Grammar section in the Think Perl 6 book might help a bit. 13:04
13:05 rouking joined
rouking Hey guys 13:05
zengargoyle_ skipped over it but guesses it does a decent job of explaining things.
raschipi rouking: hello 13:06
zengargoyle_ can only read a JSON parser so many times
rouking I'm just getting into Perl 6 from Perl 5, and I'm wondering what the proper way to include multiple files for a module is (some files need to be publicly exposed, some don't, if that makes a difference)
zengargoyle_ not sure what 'include' means in this context. 13:08
nor 'publicly exposed' ... 13:09
rouking Should I just use a `require` for files that don't have any exported subs/vars, or make it a submodule and `use` that? I guess what I really want to know is, how does Perl search for files that are part of any fiven module?
given*
zengargoyle_ ah, sorry, i don't know how that works myself. :) 13:10
raschipi rouking: what problems are you facing when you tried?
rouking I haven't begun writing anything yet. Wanted to know more about it before I dove in 13:11
I've just got a basic file structure down that follows the recommendations on the ecosystem github page
araraloren rouking, have you read document: docs.perl6.org/language/modules#Di...ng_Modules 13:12
rouking Yes, read that page
raschipi And this one: docs.perl6.org/language/modules#Ex..._Importing
Ulti ^ that one is more relevant 13:13
rouking Read that as well
13:13 pecastro left
rouking I think I get the exporting thing, just don't know the proper way to structure something with multiple files 13:13
perlpilot rouking: like Perl 5, `require` is still runtime and `use` is still compile time.
rouking: largely you do it the same as you would in Perl 5 13:14
rouking right
araraloren What yuo mean multiple files ? The file your module depend on ? 13:15
zengargoyle_ my rough understanding is that everything in a module is private. except there are things that are exported.
Ulti require is also now lexically scoped so if you dont use something at runtime you dont necessarily have to import it
araraloren s/file/files/
zengargoyle_ i.e. no sneaky My::SubModule::unexported_method($stuff) 13:16
rouking Yes
perlpilot zengargoyle_: unless it's declared as and `our` sub :)
(and it wouldn't be a method then in any case)
zengargoyle_ but i forget the disctinction between our and 'is export'
araraloren our is package variable 13:17
rouking So I'm getting the impression that I treat every file as if it were its own independent module/submodule, and then have the public-facing API files `use` them like `Use MyModule::MyModuleComponent`? 13:18
zengargoyle_ i.e. no sneaky My::SubModule::unexported_method($object, $stuff) ---- presto method :P
13:18 skids joined
zengargoyle_ rouking: yeah, i just don't know about the not public part. 13:19
araraloren rouking, just put them in submodule
rouking I mean, I guess there's no problem with submodules exporting things as long as I make it clear in the documentation which parts the user should access 13:20
does anyone happen to know where zef throws the actual code for installed modules? 13:21
araraloren The document said: In the provides section, include all the namespaces provided by your distribution and that you wish to be installed, only module files that are explicitly included here will be installed and available with use or require in other programs.
In META6.json file ,there is a `provides` field
zengargoyle_ i think i ran into this ages ago when asking about testing functions.... you have to export them to actually be able to test them.... :(
rouking Ah okay, that makes sense
13:22 cdg joined
araraloren rouking, so other can not access you private module 13:22
s/other/others/
zengargoyle_ if not in the provides, i'm not sure it gets installed.
rouking and I assume my own code will be able to access the module, but why? does it search the whole module's lib directory or something? 13:23
private modules*
I will try and look at some larger projects in the ecosystem to get an idea 13:24
nine There are no private modules
It's the same as with Perl 5
zengargoyle_ rouking: where the modules go is sorta a long story.... mine are in /opt/perl6/share/perl6/site but you'll only see a *whole* lot of SHA1 like filenames with some extensions.
nine That said, there actually are: module Foo { my module Bar { #`( Bar is lexically scoped, and thus only visible in Foo) } } 13:25
rouking Right
bioduds what is the best approach to use self local written modules?
13:25 pecastro joined, cdg_ left
bioduds I mean, if I have a center grammars.pm6 for instance 13:26
where I want to put all my grammars and use around
Ulti rouking OO is now a much bigger deal for dealing with these sorts of exposed footprint problems too
zengargoyle_ PERL6LIB
13:26 apfel left
nine bioduds: please put each grammar into its own file. You'll thank yourself later on :) 13:27
rouking Right, so if I had several internal files that were not listed in the provides section, and I added my module to the ecosystem, those would also be downloaded but not listed publicly?
that is, available for `use` 13:28
nine rouking: no, there are not internal files
bioduds ok, but how do I go around reusing them?
nine rouking: we only install what's listed in "provides". So if you want it installed, you have to list it there. Then it can be loaded by anyone.
bioduds: with "use"? :) 13:29
perlpilot bioduds: "use MyGrammar;" (I don't understand your question)
rouking Right okay
that's fine
bioduds Do I need to use lib 'PATH' ?
cause I'm trying on a pm6 file
zengargoyle_ bioduds: you can make like ~/perl6/lib/MyGrammar.pm6 and use PERL6LIB env variable to add ~/lib/perl6
perlpilot bioduds: if it's not in the default search path, yes 13:30
bioduds I wanted to make sure I'm struturing my project cleverly
*structuring
perlpilot oh no! Don't do things "cleverly", do them in a way that makes the most sense ;)
nine bioduds: follow docs.perl6.org/language/modules#Di...ng_Modules
zengargoyle_ or zef can install to 'vendor' instead of 'site' if you want to keep your private stuff separate from everybody elses stuff. 13:31
nine bioduds: even if you don't plan on distributing the code, the structure makes sense
zengargoyle_: vendor is meant for distro packages.
Ulti then at the top of that structure you just need to do `perl6 -I ./lib`
zengargoyle_ yeah, meant for and used for are two different things. :P 13:32
araraloren nine, But I wonder if a pm6 file in my module don't provides anything for user, just reference by other file in my module ?
rouking Right. I'm not too concerned about some code being public, just making sure that all my code will be there and linked together
nine araraloren: how do you know that no user ever will find that module useful?
araraloren: and even if, where's the harm in exposing something noone is interested in? 13:33
bioduds great, thanks mans
13:33 kyclark joined, xtreak left
nine zengargoyle_: there's also the ~/.perl6 repo for your private stuff. 13:34
13:34 xtreak joined
zengargoyle_ is ~/.perl6 installable into via zef? i thought it was just precomp for random scripts, -I. etc. 13:35
rouking So I'm looking at this file here: github.com/tokuhirom/p6-WebSocket/...bSocket.pm and I feel like that's not the appropriate place for the pod stuff? 13:36
That should be under doc, right?
araraloren nine, yeah, you are right, it's no harm :)
13:38 xtreak left 13:39 xtreak joined
nine zengargoyle_: ~/.perl6 is a full repository. You can install into it with zef --install-to=home 13:40
araraloren rouking, yeah, I think perl5's module author is like write document in main pm file ? I don't know ~~
Maybe I should extract my module document to doc/xx.pod6 . 13:41
rouking araraloren: I get the impression that's the right thing to do, yeah 13:42
13:43 aborazmeh joined, aborazmeh left, aborazmeh joined
zengargoyle_ nine: cool, just figured that out the hard way. 13:43
13:43 skids left
zengargoyle_ makes me not dislike ~/.perl6 so much. 13:44
13:48 itaipu left
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ <\w || \s> + % [\s*\d\)\*] 13:49
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing infix inside []
at <tmp>:1
------> 3) yet another group' ~~ <\w || \s> + % [7⏏5\s*\d\)\*]
expecting any of:
bracketed infix
infix
infix stopper
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [\s*\d\)\*]/
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [\s*\d\)\*]/
Unrecognized regex metacharacter \ (must be quoted to match …
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [ [\s*\d\)\s* ] *]/
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [ [\s*\d\)\s* ] *]/
Unrecognized regex metacharacter \ (must be quoted to…
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [ [\s*\d\)\s* ] ]/
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [ [\s*\d\)\s* ] ]/
Unrecognized regex metacharacter \ (must be quoted to …
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [ <\s*\d\)\s* >* ]/ 13:50
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [ <\s*\d\)\s* >* ]/
Unrecognized regex metacharacter \ (must be quoted to…
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [ (\s*\d\)\s*)* ]/
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [ (\s*\d\)\s*)* ]/
Unrecognized regex metacharacter \ (must be quoted to …
zengargoyle_ try [] instead of <>
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [ [\s*\d\)\s*]* ]/
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [ [\s*\d\)\s*]* ]/
Unrecognized regex metacharacter \ (must be quoted to …
vetmaster zengargoyle_: doesn't work
zengargoyle_ well < sure is never going to. :{
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /<\w || \s> + % [ [\d\)] * ]/ 13:52
camelia 5===SORRY!5===
Unrecognized regex metacharacter < (must be quoted to match literally)
at <tmp>:1
------> 3another pair 3) yet another group' ~~ /<7⏏5\w || \s> + % [ [\d\)] * ]/
Unrecognized regex metacharacter \ (must be quoted to match…
zengargoyle_ vetmaster: <\w is nothing that is valid.
13:52 curan left
vetmaster m: say 'some words 2) another pair 3) yet another group' ~~ /[\w || \s] + % [ [\s*\d\)\s* ] *]/ 13:52
camelia 「some words 2) another pair 3) yet another group」
araraloren m: say 'some words 2) another pair 3) yet another group' ~~ /[\w || \s]+ % [ \s* \d \)]*/ 13:53
camelia 「some words 2) another pair 3) yet another group」
zengargoyle_ < is used for sub-rules and variable interpolation and bunches of stuff but not just chars.
vetmaster zengargoyle_: thank you!
araraloren I think you should careful reading document about regex first 13:54
13:55 avalenn left 13:58 avalenn joined 13:59 cdg left 14:00 bwisti joined
bioduds if I use PERL6LIB it interferes with code hinting in Atom 14:01
I mean, Atom IDE codehinting does not get it
14:02 lucasb joined
zengargoyle_ totally believable. had similar issues with vim and PERL5LIB at times. :/ 14:02
bioduds I had to restart it 14:03
and worked
14:03 kyclark left
bioduds but, since I am under dev, it may get confused as I go messing code around 14:03
at least syntax is clean
14:13 Cabanossi left, hchienjo joined
hchienjo Hello everyone. I have a simple question concerning IO.watch 14:13
zengargoyle_ vetmaster: yay 14:15
14:15 g4 left, Cabanossi joined
hchienjo react { whenever $f.IO.watch -> $change { say "{$change.path} with event {$change.event}"; } } this simple code for watching and reporting changes in a directory produces lots of repetitive output for once file in case one adds a file in the watched directory 14:15
zengargoyle_ m: say 'some words 2) another pair 3) yet another group' ~~ /[[<[\w]-[\d]>*]* %%\s]* %% [\d\)]/
camelia 「some words 2) another pair 3) yet another group」
hchienjo Like for instance, I can see /data/projects/perl/URA/html_files/chi with event FileChanged several times in a row if chi is created in the watched directory. Is this standard behaviour? 14:16
zengargoyle_ same \w+ will end up matching the \d of 2)
Juerd An idea for a next version of Perl 6: a keyword "just" that does something and then leaves the current block, as in "just print 'Nope' if expr;", doing a return or next or whatever is appropriate in its context. 14:17
Went through some of my recent code and it'd save me quite some code where I have conditional block just to group a print and a return/next together.
AlexDaniel “leave”? 14:21
lizmat yeah, feels like the first legit usage of "leave" to me 14:22
Juerd The thing is, once it is its own statement, it no longer functions as a shortcut
araraloren m: { { { LEAVE { "LEAVE NOW".say; } }}};
camelia LEAVE NOW
AlexDaniel not LEAVE :) 14:23
Juerd I have code where I do stuff like "return reply 'hi'" because the return value is ignored anyway
Saves me from doing { reply 'hi'; return; }
araraloren What leave ?_?
AlexDaniel a NYI thingy
araraloren oh.
AlexDaniel m: if True { leave; say 42 }
camelia leave not yet implemented. Sorry.
in block <unit> at <tmp> line 1
14:24 zakharyas left
Juerd I have a few if/else's that I could easily rewrite for 'just' too. 14:24
lizmat Juerd: isn't 'just' the unimplemented 'leave' ? 14:25
Juerd lizmat: If leave takes an arbitrary expression that is consequently ignored, then yes.
lizmat ah, yes, good point
14:26 hchienjo__ joined, itaipu joined
Juerd just note "Meh" if cond; 14:26
# followed by 10 lines of actual code
lizmat leave is specced to take parameters 14:27
Juerd Most code that I write must ignore most failure modes, but not without logging them
lizmat 'just note "Meh" if $cond' would return True though
14:27 hchienjo left
Juerd So I have a lot of unless (assertion) { log ...; return; } 14:27
14:27 hchienjo__ left
Juerd And the same with s/return/next/ 14:27
14:28 wamba joined
Juerd lizmat: The 'just' that I'm thinking of, would return the same as a bare return; 14:28
zengargoyle_ macros!
14:28 hchienjo__ joined
lizmat m: for ^10 { LEAVE .say } # would work already 14:28
camelia 0
1
2
3
4
5
6
7
8
9
nine Why not log ... and return if cond;?
Juerd nine: Because I want control flow to be at the start of the line for easier scanning 14:30
zengargoyle_ log might fail. :P
log ... || True and return
Juerd Well, log typically doesn't fail because of logarithms :( 14:31
So it's often called printlog, logline, etc.
pmurias m: multi foo(int $x) {say "doesn't work"};foo(123)
camelia Cannot resolve caller foo(Int); none of these signatures match:
(int $x)
in block <unit> at <tmp> line 1
pmurias m: sub foo(int $x) {say "doesn't work"};foo(123) 14:32
camelia doesn't work
pmurias isn't it a bit strange that a sub takes a Int in place of an int while a multi doesn't?
araraloren m: sub foo(int $x) {say "doesn't work"};foo(int.new(123)) 14:33
camelia doesn't work
araraloren 123 is Int, not int
Oh, that's strange. :P 14:34
m: sub foo(int $x) {say "doesn't work"}; say &foo.signature ~~ \(123); foo(123) 14:38
camelia False
doesn't work
14:38 domidumont joined
araraloren Maybe this is a BUG 14:38
lucasb m: multi foo(int $x) { "works now" }; say foo(123) # :D
camelia works now
araraloren The signature not match, but sub call successed 14:39
lizmat araraloren: agree that looks like a bug
araraloren m: multi sub foo(int $x) {say "doesn't work"}; say &foo.signature ~~ \(123); foo(123)
camelia False
Cannot resolve caller foo(Int); none of these signatures match:
(int $x)
in block <unit> at <tmp> line 1
araraloren buggable: help 14:40
buggable araraloren, tags | tag SOMETAG | eco | eco Some search term | speed
lizmat m: multi sub a(int $a) { say $a }; a(42) # bug I would say
camelia Cannot resolve caller a(Int); none of these signatures match:
(int $a)
in block <unit> at <tmp> line 1
araraloren pmurias, I think you can report it via .. Em I don't know .. haha 14:41
14:41 apfel joined, eveo joined
eveo pmurias: no, it's not a bug. 14:42
m: multi sub foo(int $x) {say "doesnt work"}; say &foo.candidates».grep: *.cando: \(my int $ = 123)
camelia (())
eveo ^ that might be
14:43 apfel left
lucasb m: multi f(int) {'i'}; multi f(Int) {'I'}; say f(1) 14:43
camelia i
lucasb m: multi f(int) {1+2}; multi f(Int) {'I'}; say f(1)
camelia I
14:43 pecastro left 14:44 Cabanossi left, domidumont left
araraloren Em O_O 14:44
lucasb ^^ showing that the function block matters
eveo inlining
pmurias: here's a ticket: rt.perl.org/Ticket/Display.html?id...xn-1433016 and here's explanation why it isn't: irclog.perlgeek.de/perl6-dev/2016-...i_13462673 14:45
14:45 Cabanossi joined
eveo Basically. I've learned there are no bugs in dispatch. Nothing this obvious, at least. It's been worked on for ~10 years and the things that may seem LTA or puzzling have a reason behind them, because of another interaction in args. 14:46
We just need to well-document the dispatch rules so they could be refered to. 14:47
eveo &
14:47 eveo left 14:49 pecastro joined 14:51 xtreak left, vetmaster left
zengargoyle_ m: say ²²; say '²²'.Int 14:52
camelia 4
Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5²²' (indicated by ⏏)
in block <unit> at <tmp> line 1
zengargoyle_ yep, totally obvious. :P
14:53 eveo joined
eveo P.S.: I meant dispatch rules, not the bug lucasb showed above. 14:53
14:53 mcmillhj left
eveo Pretty sure there's a ticket for it and there are some native candidates in rakudo that are commented out due to it. 14:54
14:54 domidumont joined
eveo zengargoyle_: ² is not a digit 14:54
Here's the ticket for lucasb's bug: rt.perl.org/Ticket/Display.html?id=128655 14:55
14:55 eveo left
Juerd "===SORRY!===\nCannot invoke this object (REPR: Null; VMNull)" 14:56
Any way to get a file name or line number from that? :)
araraloren m: multi f(int) {'i'}; multi f(Int) {'I'}; say f(1)
camelia i
araraloren m: multi f(int) {1+2}; multi f(Int) {'I'}; say f(1) 14:57
camelia I
araraloren haha :(
Geth doc: 522455afba | (Jan-Olof Hendig)++ | doc/Type/CallFrame.pod6
Fixed a couple of broken links
14:58 lowbro left, ggoebel left, xtreak joined 15:00 alimon left
lizmat Juerd: if you could golf that, we could figure out what's going on 15:01
Juerd: in general, you should never see that error
jnthn Juerd: It's probably an internal compiler error; --ll-exception will likely give some explanation 15:02
15:02 alimon joined
jnthn Or at least show where it's going on 15:04
pmurias: The multi/only discrepancy is correct and I must have explained it half a dozen times by now. 15:05
(So it'll be in the logs somewhere :))
15:06 sufrostico joined, sufrostico left, kyan joined 15:07 mcmillhj joined 15:09 domidumont left
Juerd lizmat: Hard to golf, as it happened when I moved a class to its own .pm file... 15:09
lizmat :-(
Juerd gist.github.com/anonymous/91c67f4b...e592dece30 with --ll-exception 15:10
15:11 ggoebel joined 15:12 wamba left
Juerd I'll try upgrading perl6 first :) 15:13
15:15 skids joined 15:16 xtreak left 15:20 fatguy joined
Juerd Nope, still breaks 15:20
tony-o http::server::async now times out connections and successfully closes them at the end of the client interaction 15:21
yoleaux 30 May 2017 22:23Z <Zoffix> tony-o: you got unmerged PR: github.com/tony-o/perl6-data-dump/pull/28
30 May 2017 22:41Z <Zoffix> tony-o: and one more: github.com/tony-o/perl6-data-dump/pull/29
Juerd gist.github.com/anonymous/643c652f...d779f3c1a4 # updated --ll-exception
tony-o oh dear
.tell Zoffix data-dump PRs merged .. 15:22
yoleaux tony-o: I'll pass your message to Zoffix.
Juerd Problem golfed to: perl6 -I. -MFoo -e'my @foo is Foo where Str' with in Foo.pm: "unit class Foo is Array;" 15:26
Should I send this to rt? :)
15:26 Celelibi joined 15:27 aborazmeh left, domidumont joined
jnthn Juerd: Yes, please 15:28
Juerd Sent 15:29
pmurias jnthn: one of Zoffix++ alter egos explain the reason for that to me 15:30
jnthn Ah, cool :)
lizmat pmurias: link ? 15:31
15:34 itaipu left 15:36 aborazmeh joined, aborazmeh left, aborazmeh joined, itaipu joined 15:37 araujo joined 15:40 aborazmeh left 15:43 pecastro left, pecastro joined 15:44 araraloren left
robertle is it just me, or are perl6 regexes really slow (compared to perl5)? 15:47
I am doing quite a bit of digging in logfiles for correlations, and because I had to change one of my existing script, I rewrote it in perl6 15:48
15:48 pecastro left, pecastro joined
robertle and it's about 50 times slower. now I know that all of this is work in progress, but isn't that surprising? 15:49
AlexDaniel robertle: well, a lot of things in rakudo are slower than in perl 5. Maybe if you show us the code, we'd be able to find some easy ways to improve the performance 15:50
robertle: there's also this thing which attempts to track performance of rakudo against perl5: github.com/japhb/perl6-bench 15:52
15:52 khw joined
robertle not really looking for a fix, I can get a coffe while it does the work. but I was surprised. I have done some other bits in perl6 and while it wasn't super-crazy fast, I also never experienced anything really slow 15:54
this one goes through a file and matches each line against a number of regexes 15:55
I did a --profile out of curiosity, but I am not sure I interpret this correctly
thinking about it, I guess my surprise was because I assumed that the regex macth would just be handed down to the VM and then done there natively, but now that I think about it that is obviosuly not what is happening 15:56
AlexDaniel doesn't mean that it has to be slow :) 15:57
robertle nope. I need to play with this a bit more... 16:00
16:02 mcmillhj left
raschipi TimToady already said that his next focus will be making it fast 16:02
Said he already knows how to do it, just lacking a round tuit. 16:03
robertle eh, now I got something interesting: pastebin.com/v2A9LKAS 16:04
I added a fast-path using Str.index to each match
this cuts execuion time against a 100k line file into a quarter!
raschipi print "1\n"; --> Which language is this? 16:06
moritz the engine is currently mostly used as a grammar engine, so things like scanning and fixed-substring optimizations aren't necessarily very fast or present
16:06 cdg joined
robertle raschipi: bad perl5 16:07
16:07 itaipu left
raschipi heh 16:07
moritz robertle: python2
robertle but that's not the problem, it happened when making a perl5 case to compare against
but isn't it interesting that using index() helps? shouldn't a regex engine do pretty much that anyway for any regex that starts with a defined character sequence? 16:08
16:08 itaipu joined
raschipi Yes it should, but no one went and implented it yet. 16:08
robertle interesting stuff! 16:09
moritz I thought I implemented such an optimization 16:10
but it might not work in all cases (like case-insensitive pattern)
raschipi robertle: Which version are you running?
benchable6: pastebin.com/raw/v2A9LKAS 16:11
benchable6 raschipi, I cannot recognize this command. See wiki for some examples: github.com/perl6/whateverable/wiki/Benchable
16:14 Unavowed joined
robertle raschipi: 2017.05-358-g8efffb1 on MoarVM 2017.05-59-gf17adad 16:15
the script needs a large input file, so not directly executable 16:16
I could come up with a more synthetic case...
16:19 robertle left
pmurias lizmat: irclog.perlgeek.de/perl6/2017-06-07#i_14699088 16:21
lizmat pmurias++ 16:22
16:28 Actualeyes joined
AlexDaniel benchable6: releases pastebin.com/raw/v2A9LKAS 16:41
benchable6 AlexDaniel, Successfully fetched the code from the provided URL.
AlexDaniel, starting to benchmark the 19 given commits
AlexDaniel not sure if this will work, there were some open issues for benchable6
raschipi It also doesn't have input
benchable6 AlexDaniel, benchmarked the given commits, now zooming in on performance differences 16:42
raschipi m: say (4.0 + 3i).cis
camelia MoarVM panic: Memory allocation failed; could not allocate 79872 bytes
fatguy how can i check whether its the last loop in hash ? 16:43
16:46 benchable6 left, robertle joined
AlexDaniel fatguy: LAST ? 16:50
16:50 kyclark joined
AlexDaniel fatguy: but actually I don't understand your question fully. What do you mean by “in hash”? 16:50
16:50 Actualeyes left 16:52 dakkar left
lucs guesses: iterating over hash keys, wants to know when the iteration hits the last key. 16:53
fatguy AlexDaniel: i hv something like : for sort %result.keys -> $key { .say for @a; say 'last' if 'last item in $key ???'}
16:53 pilne joined
raschipi m: my %h = 1=> 'a', 2 => 'b', 3=> 'c'; for %h.keys { LAST { say "last! "}; say %h<<$_>>; } 16:53
camelia (a)
(c)
(b)
last!
AlexDaniel m: my %h = <a 1 b 2 c 3>; for %h.keys { .say; LAST { say “Okay, $_ was the last one” } } 16:54
camelia a
c
b
Okay, b was the last one
AlexDaniel raschipi: are you sure %h<<$_>> is correct? 16:55
fatguy great thanks ! 16:56
lucs How to go about to get something like «a␤c␤Last is b␤» ? 16:57
pilne note: if i had money like trump, i'd be throwing it at capable and willing people who are working on perl6, since i'm currently only slowly moving towards understanding how to do it myself.
lucs asks, because it's there.
raschipi AlexDaniel: << >> is called "qqww" "Word quoting with interpolation and quote protection" 16:58
< > doesn't interpolate
AlexDaniel raschipi: which means that it doesn't work and you shouldn't use it like this 16:59
unless you put quotes
but then it is even more pointless
use %h{$_} instead 17:00
fatguy what if its the first one ? is it FIRST ?
AlexDaniel yea 17:01
raschipi Why do you say it doesn't work?
AlexDaniel m: my %h = ‘hello world’ => 42; my $x = ‘hello world’; say %h<<"$x">>
camelia 42
AlexDaniel m: my %h = ‘hello world’ => 42; my $x = ‘hello world’; say %h<<$x>>
camelia ((Any) (Any))
AlexDaniel well it does work, but doesn't do what you want
17:01 mcmillhj joined
lizmat m: my %h = ‘hello world’ => 42; my $x = ‘hello world’; say %h{$x} 17:02
camelia 42
17:02 _cronus joined
AlexDaniel yes, %h{} 17:02
raschipi I don't understand the docs, then: docs.perl6.org/language/operators#...%AB_%C2%BB 17:03
_cronus hello everyone. Could someone please explain to me the difference between the following:
for 'data.txt'.IO.lines { .say; .chars.say };
my $data = 'data.txt'.IO.lines; for $data { .say; .chars.say };
AlexDaniel raschipi: the docs are wrong. Should be %color«cherry "$fruit"»
_cronus I would expect these to be the same, but I get different result. 17:04
raschipi Thanks for correcting me, I got it from the docs.
17:06 hchienjo__ left
pilne _cronus=> why would you expect them to be the same? 17:07
raiph _cronus: the `$` in `$data` tells P6 to assume `$data` is to be primarily treated as a single thing
pilne one is just a loop, the other is asking for data to be stored a certain way (:
AlexDaniel _cronus: “for @$data” should work
_cronus: or maybe use @data instead?
raiph _cronus: the method name `.lines` is intended to imply the result is to be treated as a plural thing 17:08
_cronus pilne: since $data is set to 'data.txt'.IO.lines I would expect it to behave the same. please note that it's the 3rd day trying to learn the language. 17:10
pilne oh, i'm not being critical, i'm just trying to see how you saw it is all.
i'm pretty green with it as well, it surprises me, but it has been very consistent about using what surprised me. so it's not like the same thing surprises me over and over by doing different things in different contexts. 17:11
17:11 setty1 joined
AlexDaniel raschipi: I've created this: github.com/perl6/doc/issues/1369 17:12
pilne the only negative for me from learning perl6 is that i find myself wrinkling my nose at idiomatic code in other languages because it feels like i am having to think around how the language wants me to program, instead of implementing it how i think about the problem. 17:13
raiph _cronus: in Perl 6 `$` denotes Singular Item. (Note how `$` is an `S` overlaying an `I`)
raschipi AlexDaniel: I don't see it as a trap, because I'm used to this kind of interpolation in the shell. Well, it's a trap on both.
AlexDaniel raschipi: yup
_cronus pilne, AlexDaniel: thanks, I still need to get my head around $@%.
17:13 espadrine_ joined
raschipi AlexDaniel: I just copied the usage from the docs, so if it were clarified in the docs it would be enough. 17:14
pilne $ is a singular context, kinda like "i have one of these" (granted, it could be one thing, that holds multiple other things... etc.)
@ is a "counting indexed" thing, and % is a map indexed thing.
at least that's how i see and use them so far. 17:15
_cronus pilne: perl6 seems to be a great language, but comming from python/javascript sometimes it seems confusing ( albeit not as confusing as python when I was trying to learn it). 17:18
17:18 eveo joined
raiph _cronus: an `@` denotes a Plural list of Items each of which is at (one reason for the `@`) an integer Position (0, 1, 2 etc.) 17:21
_cronus: an `%` denotes a Plural list of pairs of objects (note the two little `o` things in `%`) 17:22
_cronus raiph: nice explanation - very easy to remember, thanks. 17:23
pilne freedom, and a lot of "operators/symbols" can be a bit overwhealming at first, but i have found them logical once i know what they are doing (when looking at rosetta code).
rightfold m: class Hole { has Str $.name; method ACCEPTS(Mu $other) { die "Matched hole {$.name.perl} against {$other.perl}" } }; sub hole($name) { Hole.new(:$name) }; sub square(Int:D $x) { $x * $x }; square(hole("x")) 17:24
camelia Type check failed in binding to parameter '$x'; expected Int but got Hole (Hole.new(name => "x"))
in sub square at <tmp> line 1
in block <unit> at <tmp> line 1
17:24 _cronus left
raschipi What's the difference between using @ and | before a variable? 17:26
raiph _cronus: yw :)
raschipi He's gone. 17:27
raiph raschipi: ah. thx. 17:28
17:28 vetmaster joined
eveo speaking of Seqs and for loops. Does `for` always turn a Seq into a list? 17:28
iterating over one and looking at RAM climb suggests it's keeping old values 17:29
raschipi No, there wouldn't be much point for Seqs then.
raiph raschipi: I'd say `@` means treat variable as a single thing that contains a list of items.
raschipi It will only free memory when the GC runs.
eveo raschipi: and that happens when? I just had to restart my box because looping over a seq of generated strings nommed all my RAM 17:30
raschipi Wll, something else might be keeping the values around.
eveo Like what? It's just a Seq and a for loop 17:31
raschipi 'for' itself doensn't.
Geth doc: 4d55691f48 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 5 files
Attempt to improve the situation with issue #1369

Please revise.
Generally, we shouldn't show wrong usage anyway, but it may be possible that I misunderstood some of the examples.
17:31 andrzejk_ joined
raiph raschipi: I'd say `|` in arglist context means splat variable into a list of arguments 17:31
andrzejk_ hi
:)
what's up?
raschipi Up is a Pixar film 17:32
andrzejk_ :)
I miss perl6 :<
no have time to look here
eveo Ah OK 17:33
Damn. My faulty test setup prevented me from telling _cronus not to use the @$lines 17:34
raiph eveo: yeah, `@` means caching 17:35
17:36 lizmat left
eveo .tell _cronus people told you to use @$lines the other day. Don't. .IO.lines gives you a Seq, which doesn't keep its values around after you iterate over them, which is a handy thing to do if you're, say, iterating over 10GB file. The reason for $lines {} iterates over the entire Seq is because it's containerized. Use for $lines<> {} to decont it and then it'll iterate a line at a time AND won't keep the lines 17:37
yoleaux eveo: I'll pass your message to _cronus.
eveo around. See more at docs.perl6.org/language/glossary#i...ntry-Reify and docs.perl6.org/language/containers
.tell _cronus around. See more at docs.perl6.org/language/glossary#i...ntry-Reify and docs.perl6.org/language/containers
yoleaux eveo: I'll pass your message to _cronus.
17:37 vetmaster left
eveo m: say (4.0 + 3i).cis 17:37
camelia -0.0325429996401541-0.0376789775748652i
eveo raschipi ^
fatguy if i have 2 nested loop, how can i check in the second loop if the item in first loop is the last one ? 17:38
eveo raschipi: where in the docs is «» used for hash?
perlpilot fatguy: whyfor would you do this? :) 17:39
raschipi docs.perl6.org/language/operators#...%AB_%C2%BB
eveo Thanks 17:40
17:41 lizmat joined
AlexDaniel raschipi: I've just fixed that example 17:42
raschipi: github.com/perl6/doc/commit/4d55691f48
17:42 pmurias left
raschipi It could use some explanation about expansion, that it will look for multiple values if there are multiple words in the variable 17:43
Because that's useful sometimes... I use it in shell, could come in handy in perl6.
17:44 zakharyas joined
raschipi Just like in the shell, got to know when to do direct interpolation and when to quote. 17:44
fatguy perlpilot: i hv dd like this: {:Linux($["http_proxy=10.0.0.1:3128", "dns=10.0.0.254"]), :Linux_Webserver($["ansible_connection=ssh", "http_port=80", "http_user=heman"])}
17:44 Cabanossi left 17:45 Cabanossi joined
fatguy perlpilot: i just need to print the second group with "\n" but not for the last one 17:45
eveo fatguy: just join with "\n" 17:46
perlpilot fatguy: usually ... what eveo said
fatguy: or you could iterate to the penultimate item and then output the last one separately 17:47
fatguy: or you could keep a "look ahead" item in a $var
eveo m: say join "♥", (for ^3 -> $n { (for "a".."c" { "$n:$_" })})
camelia 0:a♥0:b♥0:c♥1:a♥1:b♥1:c♥2:a♥2:b♥2:c
fatguy i need to have double "\n\n" between the group but not the last one 17:48
perlpilot then join with "\n\n" insted 17:49
eveo fatguy: ok... well, join on "\n\n"
17:49 eveo left 17:51 nadim left
fatguy perlpilot: my expected output: [Linux]\nhttp_proxy=xxx\ndns=xxx\n\n[Linux_Webserver]\n...http_port=80\n 17:51
timotimo raschipi: do you still have the code around that grew boundlessly? 17:53
oh
it was actually eveo who said that?
raschipi It was me at first, then he did it again and it worked 17:54
In my computer it still eats all memory 17:55
m: say (4.0 + 3i).cis
camelia -0.0325429996401541-0.0376789775748652i
18:00 grondilu_ left 18:02 cdg left 18:05 eveo joined
eveo raschipi: it eats memory because your perl6 is too old :) 18:05
raschipi Did you just fix it? 18:07
eveo Yes.
raschipi Nice eveo++
18:09 andrei joined
andrei Hi ! I see something strange. 18:10
m: sub infix:<w> { $^a + $^b } ; 1 w 2
camelia ( no output )
andrei sub infix:<w> { $^a + $^b }
and then later: 1 w 2 18:11
eveo Yeah?
andrei I get "two terms in a row"
eveo m: sub infix:<w> { $^a + $^b } ; say 1 w 2
camelia 3
eveo andrei: you sure you got spaces around the w?
m: sub infix:<w> { $^a + $^b } ; say 1 w2
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3sub infix:<w> { $^a + $^b } ; say7⏏5 1 w2
Two terms in a row
at <tmp>:1
------> 3sub infix:<w> { $^a + $^b } ; say 7⏏051 w2
expecting any of:
18:12 Celelibi left
eveo Only infixes that aren't made out of the same characters that can be used for terms are allowed to be without spaces 18:12
andrei m: sub infix:<w> { $^a + $^b } ; say 1 w 2
camelia 3
andrei spaces where? 18:13
eveo andrei: around `w`
andrei It all works fine if I use this my infix in the same line where I define it. I am talking about Perl6 REPL
18:13 Celelibi joined
eveo Ah 18:13
andrei It seems like REPL fails to remember. This only happens with infix 18:14
eveo andrei: seems that doesn't work in REPL
(yet) 18:15
andrei: you should report it as a bug
huggable: rakudobug
huggable eveo, Report bugs by emailing to [email@hidden.address] please include [BUG] at the start of the subject for it to be automatically tagged by the RT system.
andrei OK
what is the right procedure to dump the info regarding the details of my installation? (I installed by rakudobrew) 18:16
eveo perl6 -v
Well, there's also perl6 -V, tho in this case it's not really needed 18:17
timotimo yeah, this is an artifact of how the repl is implemented ... it's basically one big hack ;)
eveo :)
andrei I checked it works OK if I save in file and execute normally. Problem only present in REPL. 18:18
timotimo yup
we can probably grab the perl6 braid at the end of compiling the individual lines and re-use it at the start of the new ones 18:19
that would allow infix operators like that to continue existing, i expect
18:19 fatguy left
bioduds hi guys, I'm progressing on grammars 18:22
I hit a spot now I don't know what to do
where can I post code?
perlpilot bioduds: gist is fine
bioduds here gist.github.com/bioduds/409bee9f1f...8cffef8221 18:24
18:24 eveo left
bioduds so, the thing is 18:24
I managed to read the line
but the line repeats
and I would like to get all in an array 18:25
but now I only get the last IP
did I make myself clear?
AlexDaniel bioduds: can you post the full code? 18:27
bioduds: not just the grammar
bioduds yes, just a second
perlpilot bioduds: btw, when you get the kinks worked out, consider making this into a module and adding it to the ecosystem (you may already be thinking that, but I thought I'd mention it anyway) 18:29
andrei my @a=1..* ; reduce({last if $^b > 100 ; $^a.say ; $^a + $^b }, 0 , |@a )
freezes with heavy smoke from CPU
is there any way to reduce over infinite list?
andrzejk_ what relation has perl6 and weed?
moritz andrzejk_: try (1..*).reduce(...) 18:30
sorry, meant andrei
18:30 zakharyas left, st_elmo joined
andrei this answers his question, too :) 18:30
moritz the two of you do make it hard, requiring 5 characters before tab completion is unambiguous 18:31
andrzejk_ andrei ye perfect
bioduds there, complete code gist.github.com/bioduds/409bee9f1f...8cffef8221
yes, perlpilot, this might be an actual useful module, right? parsing the dig command
I will yes. I also have some others that when are done I will make public such as Blake SHA-3 18:32
I'm happy now cause I'm getting the hang of Grammars, something I was willing to learn for sometime but never actually could put my hands on 18:33
andrei andrzejk_ , this works, thanks. This kind of makes sense even...
bioduds so, what I could not grasp how to do is, I have this list of URL, PORT... AND IP and I want all the info in an array, not just the first or the last 18:34
cause when I parse <ANSWER> I get the first and if I do <ANSWER>+ it handles me the last
andrzejk_ andrei ye, I got high too
bioduds ops, I am wrong 18:35
sorry guys
perlpilot when you match with <ANSWER>+, you should get an array
bioduds <ANSWER>+ actually gets me all of them
COOL
raschipi bioduds: Have you tried docs.perl6.org/routine/subparse
bioduds I knew Grammars was a way to go, thanks for incentivizing me to learn it earlier mans :D
I actually got it saspchipi please disconsider my help ask :D 18:36
I'm seeing now why Grammars is powerful 18:37
and why even the compiler uses it, correct?
18:37 andrzejk_ left
jnthn Yes, a Perl 6 grammar is used to parse Perl 6. :) 18:40
perlpilot bioduds: behold the wonder of a domain specific language ;-) 18:41
bioduds yeah, man. It's a thrilling experience! This is the reason I'm building a blockchain in Perl6! Quite audacious, I know! :D But so far it has beeing paying off eversince 18:42
18:43 Cabanossi left 18:45 Cabanossi joined
moritz m: say 'abcdefg' ~~ /.**4/ 18:47
camelia 「abcd」
bioduds P6 is so cool 18:50
;)
got it all parsed!!
moritz m: say 'abcdefg' ~~ /.**?4/
camelia 「abcd」
moritz m: say 'abcdefg' ~~ /.**?4..5/
camelia 「abcd」
moritz m: say 'abcdefg' ~~ /.**4..5/
camelia 「abcde」
bioduds Would someone be interested in revising my newbie code so I can upload this module to modules.perl6.org ?
moritz bioduds: cool!
bioduds I will place in gist in a minute
Here it is: gist.github.com/bioduds/409bee9f1f...8cffef8221 18:52
parses dig [website] 18:53
18:53 Brumbass joined
Brumbass Hi guys. I've implemented a DESTROY method on my perl6 class - however the method is never called. Doesn't the destroy method exist in perl6 ? Is there another way to make a destructor ? 18:54
Thanks in advance :)
perlpilot bioduds: don't worry if it's too newbie. If the code does something useful people will use it and some of those people will have suggestions on how to improve the code and then you've made a community :-) 18:55
moritz Brumbass: DESTROY is only called when the GC actually collects objects, which doesn't happen at program exit for performance reasons
Brumbass: if you actually need code to be called, LEAVE or END phasers might be an option 18:56
18:56 lichtkind joined
moritz (though many cleanup tasks, such as closing file handles, don't actually need to happen at program exit time, since the OS does them for you) 18:56
bioduds okey, perlpilot 18:57
Brumbass hm I see, I see. Thanks moritz :)
bioduds let me wrap it then the way it should
perlpilot moritz: LEAVE phasers are nice, but it would be nicer still perhaps if there was a phaser you could set on your objects that gets run when they go out of scope 19:00
moritz perlpilot: something like python's "with" context manager, maybe? 19:01
perlpilot I dunno. That's still coming at the problem from the "right" end (where the scope is located) I think it would be interesting if you could set it on the object for any time a scope is exited. 19:07
19:07 Brumbass left
perlpilot Sounds expensive though 19:07
moritz also, even though the scope might be exited, the object itself could still be referenced 19:08
lizmat m: my $a will leave { say "goodbye" } = 42; say $a 19:16
camelia 42
goodbye
lizmat perlpilot: ^^^
my $dbh will leave *.disconnect = DBIish.connect("foo") # intent 19:17
moritz I know that this works, but it shifts the work to the user
first of all, she has to know which method to call
lizmat ah, you mean that the .connect would do this automatically ?
moritz second, has to take care to only do it if the corresponding open/connect etc. worked 19:18
python's model is that there's a fixed method that's called when a "managed" context is left
lizmat and how do you indicate a managed context ? 19:19
moritz so you can write with open(fielname) as file: ....
and when the of the with .... is left, there's a method (iirc) __EXIT___ called on the variable (here "file")
lizmat I mean, the only thing we really need is a way to indicate that a scope must run its phasers even if it doesn't find any at compile time
Geth doc: de19b020b8 | (Jan-Olof Hendig)++ | doc/Language/control.pod6
A few tiny corrections
19:20
lizmat then the .connect could add the necessary phaser through introspection
moritz so, the user is responsible for saying "use this in a managed context", and the library author is responsible for responding to that
19:21 cdg joined, wamba joined
moritz lizmat: adding phasers to existing, already compiled (possibly precompiled and JITted) code sounds pretty hairy to me 19:21
19:22 TEttinger joined
lizmat moritz: atm it's all about calling Block.fire_phasers 19:22
afaik 19:23
:-)
jnthn Something like Python's with, or C#'s using, plus a Closable or whatever role is likely the way to go
It's a well understood solution.
19:23 cdg left
moritz +1 19:23
lizmat jnthn: but would that allow .connect to return something that would do the right thing without the user needing to do anything else ? 19:24
19:24 cdg joined
moritz lizmat: no, and I don't think that's desirable 19:24
jnthn lizmat: That isn't the problem I'm proposing we solve. I'm proposing we solve the "standard way to do the resource release"
In genearl we don't know the user's intent in .connect 19:25
lizmat true
jnthn What if they are returning the thing .connect returned? :)
lizmat yeah :-) 19:27
jnthn So I think the intent has to be indicated. Making that not involve much boilerplate (for example, needing to know close vs disconnect vs whatever) is desirable.
lizmat my $a is managed = DBIish.connect() ??? 19:28
jnthn There's two ways, I think. One is to do the using (C#) or with (Python) style approach. This has the upside of introducing a scope, and the downside of introducing a scope. :)
An alternative would be something on a variable declaration 19:29
Yeah, though I wonder if we can't do better than a trait
moritz note that the resource release action doesn't have to be tied to a variable
it could hang on an anonymous object 19:30
jnthn Yeah, this is the advantage of a with/using that I have seen put to good use
moritz (coud use "my $ is managed = ..." there, might feel a bit jucky)
jnthn using (new TransactionScope()) { ... } to indicate a transaction scope for example, which is rolled back if uncommitted. 19:31
It's kinda nice that in the Perl 6 case, when you *do* want a variable, then we can do `using open('foo') -> $fh { }` 19:32
moritz I'm warming up to the idea :-)
jnthn I'm not sold on "using" at all though
(as a name)
Skype call; bbiab
moritz knowing TimToady, he'll likely come up with a name that no language uses for that yet :-) 19:34
lizmat ,oO( tracking open('foo') -> $fh { } ) 19:35
rightfold Haskell did that, calling it "bracket" 😂
moritz managed open('foo') -> $fh { }
19:36 domidumont left
moritz
.oO( open('foo') as a service -> $fh { ... } )
19:36
lizmat which would imply the parameters to the block would get a method called on them on scope exit ?
19:38 andrzejk_ joined
rightfold borrow 19:39
moritz lizmat: yes 19:40
lizmat that could almost be done with a module in the ecosystem 19:41
moritz apart from the syntax, it's a one-liner
m: sub using($obj, &code) { LEAVE $obj.LEAVE; code($obj }; 19:42
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')'
at <tmp>:1
------> 3j, &code) { LEAVE $obj.LEAVE; code($obj 7⏏5};
moritz m: sub using($obj, &code) { LEAVE $obj.LEAVE; code($obj) };
camelia ( no output )
rightfold moritz: will this work with return?
moritz rightfold: you mean if &code return()s through the scope? yes 19:43
19:43 lostinfog joined
rightfold Ok 19:43
perlpilot LEAVE is already nice that way
rightfold Nice
moritz the value comes from making the IO handles in core respond to that kind of API
(so mostly method LEAVE() { self.close }) 19:44
19:44 cdg left 19:45 cdg joined
AlexDaniel
.oO( cork open(…) { … } )
19:48
19:49 patrickz joined
[Coke] huggable: stop telling people to use [BUG] 19:54
huggable [Coke], nothing found
nine keep open $file { }
moritz nine: more like undo open $file { ... } :-) 19:55
19:57 nowan left
perlpilot keep/undo are more about success/failure than just scope exit though 19:57
moritz right 19:58
20:00 colomon left 20:01 nowan joined, lichtkind left
perlpilot imagines a LEAVE method that gets attached to the LEAVE phaser of any block in which an object gets instantiated 20:04
nine I got to admit that Python's "with" seems to fit the purpose very well
perlpilot I didn't like it at first, but it's growing on me. 20:05
20:06 nowan left 20:07 nowan joined 20:08 nowan left 20:09 nowan joined
[Coke] wonders if we have a p6 impl of PSGI. 20:15
\o/ 20:16
lizmat ,oO( beleave open('foo') -> $fh { } )
moritz [Coke]: we do, in fact 20:17
zengargoyle_
.oO( behave open('foo') -> $fh { } )
lizmat ,oO( consider open('foo') -> $fh { } ) 20:19
moritz
.oO( begone open('foo') -> $fh { } )
lizmat ,oO( deem open('foo') -> $fh { } ) 20:20
[Coke] now to figure out how to .. psgi.
lizmat github.com/tokuhirom/p6-Crust # [Coke] 20:22
20:23 patrickz left
[Coke] lizmat: oh, thanks, I was looking at a different module! 20:24
20:27 raschipi left 20:29 raiph left, raiph joined 20:30 brrt joined
AlexDaniel wha… what? What security hole… 20:31
[Coke] so, with mod_perl, I can do something that just modifies the http headers; is that possible with PSGI? Or am I required to serve the content of the page as well at that point? 20:33
zengargoyle_ i've only used p5 PSGI stuff. you generally return [ $code, [ @headers ], $content ] or something similar. content can be a string or array or some sort of stream. 20:38
20:39 itaipu left
zengargoyle_ usually wrapped up a bit nicer (just returning content, everything else automatic). i'd think PSGI should let you controll everything from the status code on down the line. 20:40
[Coke] $content: right, I have an app somewhere else; I'm trying to inject an http header on the reverse proxy that is sitting in front of it. Guessing something like mod_perl is a better fit there than PSGI. 20:41
lizmat [Coke]: nginx probably is
perlpilot mod_perl is almost never the answer 20:42
[Coke] lizmat: we already have an apache install here.
lizmat [Coke]: in my (rather limited) experience, Apache / mod_perl is basically superseded by nginx / PSGI 20:44
performance wise and memory usage wise 20:45
20:46 itaipu joined
zengargoyle_ clueless about advanced web-scale stuff. :/ 20:46
rightfold Don't use Apache if you don't have to 21:00
brrt heh, that's not fair at all
apache is a well-engineered web server 21:01
jnthn [Coke]: There's a way to configure an apache reverse proxy to inject a header, iirc 21:02
Just as a directive in the reverse proxy config
Pretty sure I did that last autumn 21:03
brrt i suspect the question is how much dynamic do you need
if a lot, mod_perl might be a decent solution
jnthn Ah, true :-)
Yeah, I didn't need anything dynamic
brrt alternatively you can have lua scripting in nginx
lizmat afaik, you can also execute perl code inside nginx 21:04
nginx.org/en/docs/http/ngx_http_perl_module.html 21:05
21:06 SCHAPiE left
brrt that is pretty cool 21:07
lizmat basically mod_perl for nginx
pilne This really is odd to me: perl6maven.com/benchmarking-crypt-in-perl6 21:09
i've played with the code with the "bench" module
and "0" trips runs significantly slower than anything from 1-1000.
after about 1,000 there is a slowdown, but it seems to be "as expected" 21:10
(and i bumped iterations to 10,000.
21:11 SCHAPiE joined
[Coke] this has to be pretty dynamic (e.g. look stuff up in a DB) 21:11
bioduds question: unit package allows me to re-use the namespace?
so that I may re-use the same unit package? 21:12
jnthn It's kinda funny to benchmark cryptographic hash algorithms, in that being hard to run fast, especially on specialized hardware, is considered a feature. :)
lizmat bioduds: package is something that is rarely needed for "ordinary" usage
jnthn bioduds: Yes, the unit shouldn't change the semantics of package otherwise 21:13
pilne i just found the article poking around, and crypto being an interest of mine, as well as things that would benefit from benchmarking, said "what the hell" and managed to perplex myself! lol. 21:14
21:15 salv0 left
bioduds so I may have, for instance in two modules: unit package EC::Grammars; and in each one I declare, for instance grammar DIG and grammar OTHER that will be able to be imported later simply by use EC:Grammars if both modules are installed? 21:15
Voldenet Is there some website that can be used to run perl6 in the browser with js backend or would i have to compile it? 21:17
21:18 itaipu left
Voldenet I've seen it used in nodejs and probably a lot of methods won't work on a browser, but something might work 21:20
21:24 Spot___ joined, tbrowder_ joined, itaipu joined, peteretep_ joined, PotatoGim_ joined, jnap__ joined 21:27 lucs_ joined, mcmillhj left, petercom1and joined
lucasb specs commits is not getting logged to the channel like the other repos? 21:27
lizmat Voldenet: there's at least one: glot.io/new/perl6
lucasb: maybe on #perl6-dev ? 21:28
lucasb oops, sorry, it is :)
21:29 leego_ joined, Spot__ left, stux|RC-only left, peteretep left, tbrowder left, PotatoGim left, rodarmor left, chansen_ left, jnap_ left, petercommand left, lucs left, ggoebel left, Spot___ is now known as Spot__, tbrowder_ is now known as tbrowder, jnap__ is now known as jnap_, PotatoGim_ is now known as PotatoGim, peteretep_ is now known as peteretep
lucasb I wonder if the <space> charclass is the same as \s ? 21:30
21:30 stux|RC-only joined, jhill__ is now known as jhill
lucasb I think yes. I'm saying this because I just noticed this latest commit the specs repo 21:30
"Remove <sp> as an alias for \s"
21:31 brrt left, itaipu left 21:32 SCHAPiE left
Voldenet lizmat: it's only running server-side perl, not browser-side 21:32
lizmat Voldenet: I'm afraid we won't have any browser-side Perl 6 until the js backend is in good enough shape 21:33
Voldenet: what's wrong with it being server-side?
21:33 itaipu joined
Voldenet lizmat: if you want to run client-side UI code then _a lot_ ?:) 21:33
s/\?// 21:34
but I'm patient, I'll wait
lizmat Voldenet: unless pmurias can tell you otherwise, we're not there yet
lucasb Voldenet: there is fglock.github.io/Perlito/perlito/perlito6.html
but idk its current state 21:35
Voldenet lucasb: Wow, thank you, that what I was looking for!
Back to tinkering then
21:36 Actualeyes joined 21:39 ggoebel joined
bioduds Can someone please take a quick look at gist.github.com/bioduds/409bee9f1f...8cffef8221 and tell me if this code is good to upload to modules.perl6.org ? I want to make a nice contribution 21:39
lizmat Voldenet: fwiw, perlito is an implementation of Perl 6 completely separated from Rakudo 21:40
21:40 setty1 left 21:41 mcmillhj joined
Voldenet lizmat: Yeah, but it's good enough. Far better than regular JS (needs a few wrappers, but it compiles into decent js) :) 21:42
21:43 pmurias joined 21:44 toolforger joined
toolforger p6: say ²³ 21:44
camelia 8
21:44 SCHAPiE joined
timotimo i think it's been quite a while since perlito6 was last touched, i think it was considered "finished", though? 21:44
toolforger p6: say ³²
camelia 9
pmurias timotimo: fglock++ focuses his effort on the Perl 5 version 21:45
21:46 mcmillhj left
toolforger p6: say 3^2 21:47
camelia one(3, 2)
21:48 skids left
toolforger say 3***2 21:48
evalable6 toolforger, Full output: gist.github.com/e3d192d9549921d592...7b0f6c39ca
(exit code 1) 04===SORRY!04=== Error while compiling /tmp/OleGZTqEjD
Two ter…
toolforger p6: say 3**2
camelia 9
Voldenet m: given Channel.new { .send("a"); say .receive } 21:50
camelia a
21:50 andrzejk_ left
lucasb oh, "say" triggers the bot? 21:51
say wat
no
toolforger It's the p6: prefix
oh right
Voldenet welp, perlito6 is not very having much features from perl6 apart from the syntax
toolforger the "say 3***2" somehow triggered a large response
AlexDaniel toolforger: well, it shouldn't've worked in the first place :) 21:52
say 42
Voldenet they can be implemented, but eh, i'll wait for moar ;-)
evalable6 42
lucasb say NaN
evalable6 NaN
toolforger Eh. Why doesn't "say wat" give an output then?
p6: say wat
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
wat used at line 1. Did you mean 'WHAT'?
toolforger say wat
... strange... 21:53
Voldenet p6: say .WHAT
camelia (Any)
AlexDaniel toolforger: evalable6 guesses if it is code or not :)
say .WHAT
evalable6 (Any)
toolforger Ah, the good old DWIM effect :-)
AlexDaniel toolforger: but evalable6 works a little bit differently than camelia, it gists large output
maybe it shouldn't, I don't know 21:54
people get too surprised with non-camelia-like output
Voldenet say .WHAT.WHAT
evalable6 (Any)
Voldenet That's not the answer I expected.
21:55 itaipu left 21:57 mcmillhj joined, toolforger left
jnthn .WHAT gives a type object, and .WHAT on a type object is identity 21:59
So .WHAT and .WHAT.WHAT.WHAT.WHAT mean the same thing
rouking What's the idiomatic way to get the difference of two lists? that is, one list excluding any elements repeated in another list? Like (1, 2, 3) - (1, 3) == (2) 22:01
22:02 mcmillhj left, st_elmo left 22:03 eveo joined
eveo m: say keys (1, 2, 3) ∖ (1, 3) 22:03
camelia (2)
jnthn m: say (1, 2, 3) (-) (1, 3)
camelia set(2)
TEttinger m: say keys (1, 2, 3, 1, 2, 3) ∖ (1, 3) 22:04
camelia (2)
jnthn <-- too lazy to Unicode :P
eveo I think there was a nicer way without sets, but I forget what it was
TEttinger m: say keys (1, 2, 3, 1, 2, 3) (-) (1, 3)
camelia (2)
22:04 firstdayonthejob joined
TEttinger oops 22:04
m: say (1, 2, 3, 1, 2, 3) (-) (1, 3)
camelia set(2)
TEttinger huh
jnthn The keys makes it not a set any more :)
TEttinger is there a way to keep duplicates? 22:05
jnthn (-) is just the texas spelling of ∖
TEttinger wat
jnthn Not if you're using a set operation, no.
TEttinger that's not a \
eveo or maybe I'm thinking of something else
nope
u: ∖
unicodable6 eveo, U+2216 SET MINUS [Sm] (∖)
eveo Looks very different from \ on my font
TEttinger my font shows them as identical... that's a homograph attack waiting to happen 22:06
jnthn Mine doesn't render them... :/
eveo hah
Yeah, hide your sets! They might get divided :P
jnthn Pretty sure my other machine gets them right :)
rouking m: (1, 2, 3) ∖ (1)
camelia WARNINGS for <tmp>:
Useless use of "∖" in expression "(1, 2, 3) ∖ (1)" in sink context (line 1)
TEttinger en.wikipedia.org/wiki/IDN_homograph_attack
22:06 kyclark left
rouking m: say (1, 2, 3) ∖ (1) 22:06
camelia set(3, 2)
TEttinger it's just silly that unicode even hs that as an option 22:07
eveo jnthn: Failure.self => { self!throw unless $!handled; self } yey or nay? :)_
rouking is there a way of doing it without special chars
22:07 Actualeyes left
rouking oh (-) 22:07
eveo So you could do `has $.some-value = 'blah'.IO.mkdir.self;` and have it explode right there and then if it is a falure
rouking m: say (1, 2, 3, 4) (-) (2, 4)
camelia set(1, 3)
rouking nice
eveo rouking: yeah, (almost) all the special chars have alternatives: docs.perl6.org/language/unicode_texas.html 22:08
jnthn eveo: Hmmmm...but is there a method self outside of Failure, for if the value is fine?
eveo jnthn: Mu.self returns self
m: dd 42.self
jnthn m: say 42.self
camelia 42
eveo lol
jnthn I think that seems fine enough 22:09
eveo cool
jnthn m: sub f { fail 'oops' }; say f().item
camelia oops
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
jnthn m: sub f { fail 'oops' }; say f().item.WHAT
camelia (Failure)
jnthn Yeah, .item does The Other Thing
So we're not removing the choice :)
22:11 firstdayonthejob left
pmurias m: my sub bar() {};my multi foo(int $foo) {456;}; say foo(123) 22:11
camelia 456
pmurias jnthn: ^^ I should fix that? 22:12
* should I fix that?
22:12 Cabanossi left 22:13 mcmillhj joined
jnthn pmurias: Ah, that's the one what with --optimize=0 the dispatch fails? 22:13
pmurias yes 22:14
m: my sub bar() {};my multi foo(int $foo) {bar(); 456;}; say foo(123)
camelia Cannot resolve caller foo(Int); none of these signatures match:
(int $foo)
in block <unit> at <tmp> line 1
jnthn Yeah, I think that's an accident :)
I suspect it inlines the first
And not the second
22:15 Cabanossi joined
pmurias I'll fixed that after some sleep, good night everyone 22:15
22:15 pmurias left
jnthn 'night 22:15
22:15 robertle left 22:17 mcmillhj left, rindolf left 22:19 mcmillhj joined
AlexDaniel m: my $aaa = 42; my $aаa = 69; say $aaa × $aаa 22:19
camelia 2898
AlexDaniel TEttinger: ↑ basically any language that supports non-ascii characters in identifiers 22:20
TEttinger heh true
it's mostly a quirk of unicode I guess
22:21 lucasb left
TEttinger m: my $a = 42; my $a = 69; say $a × $a 22:22
camelia 5===SORRY!5===
Bogus postfix
at <tmp>:1
------> 3my $a = 42; my $a7⏏5 = 69; say $a × $a
expecting any of:
constraint
infix
infix stopper
postfix
statement end
statement…
22:22 eveo left
TEttinger aw 22:22
JVM allows BOM in identifiers
j: my $a = 42; my $a = 69; say $a × $a
camelia ( no output )
TEttinger odd 22:23
jnthn In .Net it's quite common to use e for the name of a caught exception. But it's also common to use it as the name for an event in an event handler. I noticed that you could use е for one and e for the other. :P
22:24 mcmillhj left
El_Che jnthn: isn't e the thing you're suppose to ignore in Java? :) 22:25
22:26 mcmillhj joined
jnthn All I know is NIO is the thing I *wish* I could ignore in Java :P 22:27
22:30 mcmillhj left
El_Che jnthn: there is nio2 22:32
22:34 cdg_ joined 22:37 cdg left 22:39 geekosaur left 22:40 geekosaur joined 22:42 cdg_ left, mcmillhj joined 22:47 mcmillhj left 22:49 mcmillhj joined, Actualeyes joined 22:53 TimToady left 22:55 TimToady joined 22:57 greatflamingfoo joined, mcmillhj left 23:03 Actualeyes left 23:11 raschipi joined 23:18 Actualeyes joined
greatflamingfoo I'm having some problems overriding ws in a grammar. It's causing an otherwise matching sting to not match and I don't know why. gist.github.com/anonymous/6a0cfa87...5784984869 23:19
23:20 skids joined 23:21 chansen_ joined, rodarmor joined
bioduds Hello, friends. My module is ready to upload. github.com/bioduds/EC-Grammars-DIG Can someone please help me to upload it? 23:22
23:23 Actualeyes left 23:25 wamba left 23:27 Cabanossi left 23:29 lostinfog left 23:30 BenGoldberg joined, Cabanossi joined, Actualeyes joined
AlexDaniel bioduds: you should create a pull request for github.com/perl6/ecosystem 23:30
bioduds Let me do it AlexDaniel, can you please guide me?
I clicked on New Pull request 23:31
now I don't know what to do 23:32
AlexDaniel bioduds: I think this guide should give enough information: docs.perl6.org/language/modules.ht...ng_Modules 23:33
bioduds: but possibly not
“Create a PR on ecosystem adding your module to META.list, or ping someone on IRC (#perl6 at freenode) to get help having it added.”
bioduds I read that already, and it actually says there go to the irc to get help to upload, lol
AlexDaniel well, that doesn't really help :)
yeah
bioduds nope, lol 23:34
raschipi bioduds: Open the META.list file and click in the pencil icon in the top right
AlexDaniel bioduds: well, you just have to change the META.list list file and add a link to your repo
you can do it on github directly just like raschipi said
raschipi Then add a link to the raw meta6.json in you module at the end.
bioduds oh, quite easy
that's it? 23:35
AlexDaniel or, you can fork it, then clone the repo, change the file, commit it, push it, and then make a pull request :)
raschipi Then submit and it will be a PR
AlexDaniel: Clicking in the pencil will fork it automatically.
AlexDaniel yes-yes, I'm just talking about a harder way…
the pencil should submit a pull request automatically too I think, no? 23:36
AlexDaniel is definitely not a pencil guy
bioduds so I just paste the git address there in?
AlexDaniel bioduds: well, similarly to other links there, yeah
bioduds to the META5.json?
raschipi bioduds: It should look like the other links, with the "raw." at the start.
AlexDaniel bioduds: yes
raschipi Doesn't send the PR automatically, no. 23:37
bioduds great
done
Should it list on modules.perl6.org automatically? 23:38
AlexDaniel I see no PR yet
bioduds: yes, once the PR is there and once somebody merges it, it should appear
bioduds great, thanks 23:39
I hope my efforts help the ecosystem
AlexDaniel wait but, there's no PR yet :)
raschipi bioduds: You changed just your own copy of the file. That's what git is all about, after all. 23:41
Now you need to send a special message in github so people can pull your changes.
AlexDaniel raschipi: I don't think he did, not yet: github.com/bioduds/ecosystem/commits/master
23:42 ergaerfjngoaiwef joined
AlexDaniel ah, I see 23:42
patch-1 branch
23:42 ergaerfjngoaiwef left
raschipi Yeah, I'm looking at his repo and I don't see the changes. 23:42
23:43 ergaerfjngoaiwef joined
AlexDaniel no, the change is there: github.com/bioduds/ecosystem/commi...df61c1be9e 23:43
23:43 ergaerfjngoaiwef left
raschipi Did it for you 23:44
Ops, no you need to accept the terms... 23:45
Then send it to the main ecosystem
23:46 mcmillhj joined
raschipi bioduds, now go back to github.com/perl6/ecosystem and click the "Create pull request" button 23:47
"New Pull Request", even 23:48
Then the link "compare across forks" at the top. Find your own copy in the box in the left. 23:49
The second box is the patch-1 branch github created for you 23:50
23:50 mcmillhj left