»ö« 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.
Geth_ whateverable: 8c3b7e5777 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
sanify method reworked

Resolves issue #182. Tests needed.
00:01
AlexDaniel /o\ wrong issue number /o\ 00:02
MasterDuke i haven't pulled, you could fix the comment and force push 00:04
AlexDaniel MasterDuke: but I did pull on the server already… I can reset HEAD^ maybe but uhhhh… 00:05
MasterDuke up to you
Geth_ whateverable: a08f2e0065 | (Aleks-Daniel Jakimenko-Aleksejev)++ | 2 files
sanify method reworked

Resolves issue #167. Tests needed.
See this discussion: irclog.perlgeek.de/perl6-dev/2017-...i_14890127
00:06
AlexDaniel well, done
MasterDuke cool 00:07
AlexDaniel well, it's better than hating myself for the rest of my life :) 00:08
lookatme morning 00:26
alphah hello, What would be a good way to parse big files 10 GB by Grammar? 00:46
in terms of memory and speed 00:47
timotimo if you can, try to match it line-by-line or in chunks 00:49
alphah timotimo how does Grammar parse file? does it read the whole file or line by line? 00:50
timotimo the whole file 00:51
and texts tend to become 4x the size because we do fancy unicode stuff
alphah so if I have 10 GB file and 8 GB memory the program will not run right? 00:51
timotimo correct 00:52
well, i don't think it forces all of it to be in memory at the same time, though it might fail to allocate anyway? 00:53
you can just try to slurp the file and see if the program explodes
(might want to save all open documents before you do this)
alphah I will do this test later and see, but assuming memory allocation will fail, so what i need to do is to read the file by chunks and let Grammar parse each chunk alone,, or there is a way parse all chunks and produce one match data structure at the end? 00:56
timotimo you can create a match object manually and put the sub-matches in by hand 00:57
alphah ok, will look into that as well 00:58
Thanks timotimo 01:00
Geth ecosystem/japhb-Text-MiscUtils: 4ece62af66 | japhb++ (committed using GitHub Web editor) | META.list
Add japhb/Text-MiscUtils to ecosystem
02:31
ecosystem: japhb++ created pull request #351:
Add japhb/Text-MiscUtils to ecosystem
Geth ecosystem: albastev++ created pull request #352:
Add Grammar::Modelica to ecosystem
03:24
Geth ecosystem: 4277fe5175 | albastev++ (committed using GitHub Web editor) | META.list
Add Grammar::Modelica to ecosystem

See github.com/albastev/Grammar-Modelica
03:53
ecosystem: eb49dc8c48 | Altai-man++ (committed using GitHub Web editor) | META.list
Merge pull request #352 from albastev/master

Add Grammar::Modelica to ecosystem
ecosystem/japhb-Text-MiscUtils: 4277fe5175 | albastev++ (committed using GitHub Web editor) | META.list
Add Grammar::Modelica to ecosystem

See github.com/albastev/Grammar-Modelica
ecosystem/japhb-Text-MiscUtils: eb49dc8c48 | Altai-man++ (committed using GitHub Web editor) | META.list
Merge pull request #352 from albastev/master

Add Grammar::Modelica to ecosystem
ecosystem/japhb-Text-MiscUtils: 245dddcb6b | Altai-man++ (committed using GitHub Web editor) | META.list
Merge branch 'master' into japhb-Text-MiscUtils
ecosystem: 4ece62af66 | japhb++ (committed using GitHub Web editor) | META.list
Add japhb/Text-MiscUtils to ecosystem
ecosystem: 245dddcb6b | Altai-man++ (committed using GitHub Web editor) | META.list
Merge branch 'master' into japhb-Text-MiscUtils
ecosystem: dac3c56c44 | Altai-man++ (committed using GitHub Web editor) | META.list
Merge pull request #351 from perl6/japhb-Text-MiscUtils

Add japhb/Text-MiscUtils to ecosystem
ab6tract . 07:18
yoleaux 18 Jul 2017 22:00Z <lizmat> ab6tract: (g => -5).Bag === bag(), that's why, you probably want Mixes ?
ab6tract m: dd [(^)] ( g => 5 ).Mix, ( g => -5 ).Mix 07:19
camelia ("g"=>10).Mix
ab6tract .tell lizmat i see :)
yoleaux ab6tract: I'll pass your message to lizmat.
abraxxa zostay: are you interessted in debugging the DOM::Tiny install issue I've pasted yesterday? 08:22
Geth ecosystem: 9f5533a520 | (Alexey Melezhik)++ (committed using GitHub Web editor) | META.list
Add Sparky - continues integration server.

Sparky is a continues integration server based on Sparrow/Sparrowdo ecosystem.
09:37
nine Seeing print "Skip? "; my $do = <STDIN>; chomp $do; next if $do eq 'y'; really motivates me to port some of our scripts to Perl 6 ;) 11:10
Voldenet nine: actually, this line could be very similar to perl6 12:10
sub prompt { print shift; my $x = <>; chomp $x; $x }; next if prompt("Skip? ") eq "y" 12:11
the last part works in perl6 ;)
nine Voldenet: I know, but no one writes that if there's only a single prompt in the script. 12:12
The other part is MAIN subs and the auto generated usage message. That's sooo incredibly useful :) 12:13
Voldenet Yeah, that is awesome
but tbh, the thing I find the most useful in p6 so far is threading + threadpools + async + channels 12:14
it's so above the forking black magic from p5 12:15
nine And just this week I wrote this image cache cleaner daemon in Perl 6 because of builtin IO::Notification and IO awesomeness in general: gist.github.com/niner/b65597abab2b...e939421a44
jnthn Cute :) 12:18
nine Had to write this thing myself because I want to pass the name of the cache file off to nginx for delivery while all existing caching solutions would give me the file's content. But seriously, this was fun to implement :) 12:20
zostay abraxxa: sure
I'm interested. 12:21
abraxxa zostay: ok, I have also time now
zostay Oh, if you mean do I have time now? not really 12:22
ab6tract nine: why the use lib:from<Perl5> ? 12:23
abraxxa zostay: I guess I have some test env var set which triggers those tests to be run
nine ab6tract: it's part of our CMS's codebase and all included scripts do: use FindBin qw($Bin); use lib "$Bin/../lib"; 12:24
abraxxa zostay: it's test #6 of Test::META used in t/999-meta.t 12:25
zostay: 'Artistic' is not included in github.com/jonathanstowe/Test-META...nseList.pm 12:26
the version is missing
zostay: no idea why it doesn't fail here travis-ci.org/zostay/p6-DOM-Tiny#L2381 12:27
zostay But it is there, github.com/zostay/p6-DOM-Tiny/blob...META6.json 12:29
abraxxa zostay: there seems some other issue as github.com/zostay/p6-DOM-Tiny/blob...6.json#L25 reads "license" : "Artistic-2.0", mine "license" : "Artistic",
zostay That's my confusion 12:30
abraxxa zostay: see github.com/zostay/p6-DOM-Tiny/issues/2 12:32
zostay I don't understand. Why is zef not installing the latest code from github? 12:35
nine zostay: zef update? 12:38
ab6tract nine: ah, i see :)
zostay abraxxa: ^^^ 12:39
abraxxa zostay: because you haven't released a new version?
zostay There's no release process. Have you tried a zef update? 12:40
abraxxa I hope that zef doesn't install just the current HEAD of master branch of a github repo! 12:41
currently trying
timotimo it does if you use the modules.perl6.org ecosystem and don't give a tag or commit name 12:41
abraxxa yes, also fails after zef update
zostay It does until we get better build tools. Changing tags in the ecosystem is not practical imo 12:42
zostay Waiting for pause to become sop 12:43
nine zostay: why wait? 12:43
zostay Is there toolchain for it? 12:44
timotimo what's "sop" agains
nine zostay: Inline::Perl5 is already hosted on and installed from CPAN and I haven't heard any complaints. mi6 makes uploading just trivial 12:45
nine timotimo: Standard Operating Procedures 12:45
timotimo lh
ah
zostay Then, how do we get zef to go there instead?
timotimo doesn't it prefer pause already? 12:46
zostay I will consider it when I get back to p6 stuff. 12:47
nine timotimo: yes it does 12:48
abraxxa ===> Found: DOM::Tiny:ver('0.3.3'):auth('github:zostay') [via Zef::Repository::LocalCache]
zef update doesn't change that
nine timotimo: at least if the version of the module on PAUSE is newer than what's listed in the ecosystem's META.list
zostay I can bump the v# if that will help 12:49
abraxxa I expected DOM::Tiny:ver('0.3.3'):auth('github:zostay') using the tag '0.3.3' or a release with that version if installing from github 12:51
I've deleted ~/.zef/tmp and ~/.zef/store and trying again now
now it installed correctly 12:52
so zefs local cache handling is suboptimal
zostay v0.3.4 pshed 12:55
pushed
zostay releases through master tagged branches is the suboptimal part 13:00
abraxxa zostay++ 13:12
Geth doc: 64912fb222 | (Brian Duggan)++ | doc/Language/py-nutshell.pod6
Mention that filter=grep in py-nutshell

Resolves #1420
13:13
abraxxa zostay: fails to install ;(
but that might be another zef bug 13:14
zef upgrade DOM::Tiny
abraxxa it works when I again delete the zef store and tmp dir contents 13:24
araraloren_ evening 14:34
pmurias araraloren_: evening
araraloren_ :) 14:35
andrzejku araraloren_, hey 14:35
ugexe you cant have mutatate a version of a distribution and blame the cache 15:17
release by putting your github commit id in the source-url then 15:19
raschipi He's pushing under the same version number and them expects zef to somehow know it changed? That's not how any of this works. 15:25
Skarsnik Hello 16:09
Skarsnik is there a way to have the variable of a for @ -> $ contruct writable? 16:09
jnthn <-> 16:10
Skarsnik I got an error 16:12
m: for 1..5 <-> $foo {;}
camelia Parameter '$foo' expected a writable container, but got Int value
in block <unit> at <tmp> line 1
Skarsnik do I need to declare the variable before so?
jnthn Oh, you can only do that if you actually have writable containers 16:14
Which you could if you had an array there
You'll need for 1.5 -> $foo is copy { }
Skarsnik Oooh
Skarsnik yeah it was is copy 16:14
I tried is write xD
Skarsnik Thx jnthn :) 16:19
jnthn
.oO( is rong )
16:22
tony-o m: sub x { "x".say; }; sub y { "y".say; }; sub z {"z".say;}; &x.wrap(&y); &y.wrap(&z); z; 16:32
camelia z
tony-o is that right? 16:33
jnthn Looks like, you didn't change z?
&y.wrap(&z) means "wrap &y with &x" 16:34
grr
&y.wrap(&z) means "wrap &y with &z"
tony-o oops, i'm forgetting some stuff
was trying to simplify another issue, and forgetting some callsames 16:35
tony-o trying to track down: Cannot invoke this object (REPR: Null; VMNull) 16:47
while 'wrap'ing subs
gist.github.com/tony-o/458a31973a3...42ef943c9d 16:49
i can `dd $req` but i can't `$req.params<stuff>` without that exception 16:50
tony-o ahh..missing `multi sub` 16:55
nadim o/ 17:18
is there a way to trace where a Seq is consummed ? 17:19
lizmat you mean, in a backtrace kind of way ? 17:21
nadim yes 17:23
I think the hardest thing in P6 is tracking consummed Seqs 17:24
that's made worse when a call to dd on a data structure makes things work!
fatguy i have class required attribute like this 'has Int $!profileid is required;', and i initiate it like 'my $profile = ::(module)::Profile.new(profileid => 1);' 17:25
nadim so the "debugging" tool makes the bug go away.
fatguy but exception throwed "The attribute '$!profileid' is required, but you did not provide a value for it."
nadim $!var removes the accessor, no? 17:26
lizmat nadim: yes
hmmm... re consuming 17:27
lizmat nadim: do you actually have the Seq in a variable at some point ? 17:27
nadim lizmat: last entry was for fatguy. not sure but should'nt it be $.profile_id 17:28
nadim lizmat: I this case I put it directly in an array 17:28
lizmat: I this case I put the Seq directly in an array 17:29
lizmat that does make it clear where gets consumed, no ?
fatguy i tried $.profileid also, same result, confused... 17:29
lizmat if it's anything like "my @a = Iterable, it's the Array.STORE that consumes the Seq
nadim here is the code nopaste.linux-dev.org/?1159866 17:30
I tried to peper it with .cache, i guess I have to try again
or maybe make a list out of it first 17:31
perlpilot m: class C { has $.profileid is required; }; C.new( profileid => 1 );
camelia ( no output )
lizmat nadim: I don't see the problem?
perhaps maybe precedence of ' ' ~ $foo ?
nadim later I get: This Seq has already been iterated, and its values consumed 17:32
perlpilot fatguy: There's probably a few things that you aren't telling us, but as you can see from the above example, it works if you use $.profileid
nadim and if I dump the array I get: @fs = [Seq.new-consumed(),] 17:32
lizmat ah, you're actually storing the Seq inside @fs[0], is that intentional? 17:34
Zoffix nadim: what version of Perl 6 you got? 17:34
nadim a week old or so
lizmat: yes the array contains a lists of Seqs 17:35
Zoffix nadim: ah ok. There was a massive bug with Seqs where methods failed to find cache that was fixed sometime in April
nadim Zoffix: then it's not that build it last week 17:36
I wrapped the whole thing in a ().cache and it seems to work
lizmat nadim: is there a reason you want to wait for the Seq to be consumed ? 17:37
nadim wait? I store the seq in an array, and later when the rendering is done the seqs are consummed
and the reason would be that i don't know who is going to consume them 17:38
either the normal dumper renderer or a DHTML generator
Zoffix nadim: I see you storing it in an array element. Shove .list after the map?
m: Seq.^lookup('iterator').wrap: -> | { say "touched in"; nextsame }; <a b c>.grep('a').say
camelia touched in
touched in
No exception handler located for catch
at <unknown>:1 (/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception)
from SETTING::src/core/Exception.pm:452 (/home/camelia/rakudo-m-inst-1/share…
Zoffix Unsure what exception it's whining about, but that'd be one way to trace where a seq is consumed 17:39
Zoffix m: Seq.^lookup('iterator').wrap: -> | { say "touched in" ~ (callframe(-1).?name||''); nextsame }; sub foo { <a b c>.grep('a').say }() 17:39
camelia touched in
touched in
No exception handler located for catch
at <unknown>:1 (/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm:print_exception)
from SETTING::src/core/Exception.pm:452 (/home/camelia/rakudo-m-inst-1/share…
Zoffix bah
nadim looks like something that's good to keep, I put this code somewhere 17:40
lizmat nadim: so that I understand: you basically have a dispatch table with blocks that close over some variables that depend on using a dumping renderer or the DHTML renderer ?
Zoffix nadim: there's also a list of all the methods that cache Seqs automatically: rakudo.party/post/Perl-6-Seqs-Drug...tothecache 17:42
nadim: but if you don't care about your Seq being a seq, just store in in an array or .List it to store it in a List form you can re-use until you're blue in a face
.map returns a Seq for example.. If you want to re-use that @fs[0] data, pop a .List on the end of your .map 17:43
nadim Zoffix: the problem is 80% due that I am hard headed, Yes I can put it in a list but it is actually a sequence as it is consummed once only, just trying to be a purist and regretting it. 17:44
fatguy perlpilot: the class does role, if i remove the does, it works. but i still can't figure it out 17:46
nadim lizmat: I have a block of data, the data dump with colors separated from the string representation, that block has different type of consummers. DHTML, ANSI color dumper, Curses dumper 17:47
Zoffix .map returns a Seq for example.. If you want to re-use that @fs[0] data, pop a .List on the end of your .map
oops
nadim hehe
I'll probably end up making lists out of it because the curses dumper supports dynmic folding, so the Sequences will be consummed multiple times 17:49
lizmat that feels like a good idea 17:50
fwiw, Seqs should be mostly invisible
nadim even though I have not measured, I think it's also an efficiency problem, making Lists, Arrays, of a Seq must have a cost. 17:53
nadim the dumper is already not fast enough for my taste, although not too bad. 17:53
Zoffix m: Seq.^lookup("iterator").wrap: sub (|) { say "touched in: "; for 3..20 { try say "\t -> {.name || <anon>} ({.file}:{.line})" with callframe($_).code }; put(); nextsame; }; sub foo { <a b c>.grep("a").say }() 17:54
camelia touched in:
-> CALL-ME (SETTING::src/core/Routine.pm:85)
-> cache (SETTING::src/core/Seq.pm:22)
-> gist (SETTING::src/core/Seq.pm:143)
-> gist (SETTING::src/core/Mu.pm:581)
-> say (SETTING::src/core/io_operators.pm:22)
-> say (SE…
Zoffix nadim: output's a bit verbose, but it does manage to mention to routine where the seq is being consumed: gist.github.com/zoffixznet/2c2b0ad...b65a1fd401
nadim Zoffix: looks good to me 17:54
can always filter the list out 17:55
tony-o is blead on the fritz? 17:56
Zoffix m: gist.github.com/zoffixznet/02c6b10...32a9d907d2 17:58
camelia Not consumed yet
touched in:
-> CALL-ME (SETTING::src/core/Routine.pm:85)
-> foo (<tmp>:10)
-> <unit> (<tmp>:1)

ABCAlready consumed
touched in:
-> CALL-ME (SETTING::src/core/Routine.pm:85)
-> foo (<tmp>:10)
-> <unit> (<…
Zoffix hm, locally that SEGVs
on 2017.05-297-g608e886 17:59
This version also says when the seq is already consumed or not when its iterator is poked at: gist.github.com/zoffixznet/2c2b0ad...b65a1fd401 18:02
How to make your own Seqs: rakudo.party/post/Perl-6-Seqs-Drug...ll--Part-2 </shameless-plug> 18:03
nadim saving this for the cold days 18:04
Zoffix tony-o: probably won't help your case, but I think whenever you're using `wrap` you also need to put `use soft` in your code 18:05
Zoffix There's also a whole bunch of tickets with .wrap exploding, especially in procompiled modules (search perl6.fail/ for "wrap"). Perhaps, try sticking `no precompilation`? 18:06
Zoffix zostay: zef already considers stuff on pause when looking for the newest dist. App::Mi6 supports uploading dists to PAUSE. And "soon enough" modules.perl6.org will list CPAN dists too 18:09
tony-o Zoffix++ - i'll give that shot when i finish nuking p6, getting something about a grapheme when i just run perl6 -e '"hi".say;' 18:14
Zoffix: would i do 'no precompilation' in the module doing the wrapping, the consumer of the module, or both? 18:15
Zoffix jsimonet: you're just misinterpreting the result. There's nothing illegal in `3.3/0` you get back a Rat that's got `33` as numerator and `0` as denominator. The explosion happens when you try to get the Str view of that Rat which does try to divide 33 by 0. The error can probably be improved by saying the division is happening in a Rat :/
tony-o: no idea. Try all three cases?
m: say (3.3/0).nude 18:16
camelia (33 0)
tony-o Zoffix: thanks for the info
is soft preventing all subs in that file from being inlined? 18:18
Zoffix I think so
tony-o so, maybe methods that don't need to be wrapped should be elsewhere 18:19
Skarsnik is there something nice to plot graph from p6 data? x) 18:20
tony-o Skarsnik: a module? 18:22
github.com/azawawi/perl6-graphics-plplot #maybe? 18:23
Zoffix ChristopherBottoms, that issue sounds like your zef is way outdated, as it was a bug in it that got fixed I think some time in spring. Are you sure your system is using the RC Star's zef and not some other one you had installed previously? 18:24
Skarsnik let's try github.com/colomon/Benchmark-Plot maybe
ugexe Skarsnik: perlgeek.de/blog-en/perl-6/2017-01...ython.html "Perl 6 By Example: Plotting using Matplotlib and Inline::Python" 18:25
Skarsnik Not sure how useful it can be : gist.github.com/Skarsnik/9052b9a5b...0d267f0a60 but there is a weird drop of perf after 2017.02 18:27
Zoffix Without code it's pretty useless :) 18:29
Zoffix Might as well say "some things got slightly slower" 18:30
Zoffix &
Skarsnik The code is just a call to Gumbo (C lib) to parse an signifiant html file (11k elements) then transforming then in Perl 6 object, so basicly it's recursly goes through the C struct then creating XML perl6 object. 18:38
lizmat Skarsnik: does --profile give any clues ? 18:39
Skarsnik The time on this test is after the call to the C lib from the end of the creation of all the object
Skarsnik What rekudo version should I use? or do you want a --profile for each version (it's the average time of 50 executions) 18:41
Skarsnik I guess I could run this stripping the XML object creation to compare 18:42
lizmat Skarsnik: any help in finding why the performance dropped, would be welcome :-) 18:43
Skarsnik anyways to exit a when statement? 18:49
lizmat Skarsnik: alas, "leave" is not yet implemented 18:53
m: when 42 { leave } 18:54
camelia ( no output )
lizmat m: $_ = 42; when 42 { leave }
camelia leave not yet implemented. Sorry.
in block <unit> at <tmp> line 1
zostay m: given 'foo' { when 'foo' { say 'A'; proceed; say 'B'; } }
camelia A
lizmat TIL proceed 18:55
zostay there's also succeed which is pretty much the same, but lets you give it an argument which becomes the result for the given {} 18:58
i don't think i've actually used either in code
i tend to prefer multis to given blocks
hythm Hi 18:59
m: grammar Log { token TOP { <alnum>+} }; class LogAction { method TOP($/) { say $v } }; sub MAIN($v) {} 19:00
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$v' is not declared
at <tmp>:1
------> 3 class LogAction { method TOP($/) { say 7⏏5$v } }; sub MAIN($v) {}
hythm I want to use $v variable (reading it from command args, in LogAction method 19:00
how can I do that? 19:01
hythm grammar Log { token TOP { <alnum>+} }; class LogAction { method TOP($/) { say $v } }; sub MAIN($v) {my $m = Log.parse("hello", actions => LogAction.new)} 19:05
tony-o Skarsnik: is that not specific to benchmarking? 19:06
Skarsnik What do you mean? x) 19:07
tony-o Benchmark::Plot 19:10
andrzejku hey 19:11
how can I check operation system 19:12
nine $*KERNEL.name 19:13
raschipi m: say $*KERNEL.name 19:13
camelia linux
nine $*VM.osname takes only half the time though ;) 19:14
andrzejku oh thnks actually I tried to find some globals description in
documentation but it was hard ;d
raschipi There's $DISTRO.name too.
zostay andrzejku: for future reference: docs.perl6.org/language/variables#..._variables 19:15
Skarsnik tony-o, Oh right, well I am doing some benchmark ^^ 19:16
zostay i meant to click on dynamic variables, tho
raschipi andrzejku: If you want to detect if it's windows, there's $*DISTRO.is-win 19:17
hythm I'll rephrase my question, hopefully this time I be more clear: how to pass a command line arg variable to grammar action method? 19:18
tony-o Skarsnik: ah 19:23
zostay hythm: just add a has $.v to LogAction and pass that through and change the referenced far to $!v or $.v 19:26
zostay m: grammar Log { token TOP { <alnum>+} }; class LogAction { has $.v; method TOP($/) { say $.v } }; sub MAIN($v) {my $m = Log.parse("hello", actions => LogAction.new(:$v))} 19:26
camelia Usage:
<tmp> <v>
zostay m: grammar Log { token TOP { <alnum>+} }; class LogAction { has $.v; method TOP($/) { say $.v } }; sub main($v) {my $m = Log.parse("hello", actions => LogAction.new(:$v))}; main(42) 19:27
camelia 42
hythm Thanks zostay, That what I needed 19:34
andrzejku hey guys who to get %APPDATA% variable on windows? 19:44
Skarsnik probably @*ENV ? 19:46
or %*ENV
lizmat, I started the benchmark script again to do 100 iterations instead of 50, I will check to have profile for each rakudo release tommorow, since this will take a while 19:47
andrzejku how to run external command?
Skarsnik shell "command" 19:48
there is lot of way
andrzejku Skarsnik okay thnks I got it 19:48
srry
Skarsnik my $proc = shell "PERL6_GUMBOLIB=/usr/local/lib/libgumbo.so.1 " ~ $file.IO.path ~ '/install/bin/perl6 ' ~ $torun, :out; 19:49
for $proc.out.lines -> $line {
do stuff with the output}
for an example 19:50
perlpilot raiph++ I just read your answer to the .bib parsing question on SO. That could almost be a whole chapter in a Perl 6 book.
zostay i usually prefer to run instead to avoid involving the shell if i can 19:52
Skarsnik yes, but it's more tedious to call
zostay m: run "ls"
camelia run is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in sub run at src/RESTRICTED.setting line 14
in block <unit> at <tmp> line 1
Skarsnik since you have to pass each arguments separatly
And I was not sure how to easily pass the PERL6_GUMBOLIB tibbit easily in this case 19:53
andrzejku Skarsnik what does it mean Str:D ? d? 19:54
Skarsnik Defined
zostay m: my $f = "foo.txt; rm *"; shell "cat $f"; # why i don't use shell
camelia shell is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 1
in sub shell at src/RESTRICTED.setting line 15
in block <unit> at <tmp> line 1
lizmat m: say "foo" ~~ Str 19:55
camelia True
lizmat m: say "foo" ~~ Str:D
camelia True
lizmat m: say Str ~~ Str
camelia True
lizmat m: say Str ~~ Str:D
camelia False
zostay i don't trust that any particular use of shell will never ever involve user input
Skarsnik m: say Str ~~ Str:U; 19:56
camelia True
zostay m: say "foo" ~~ Str:_; say Str ~~ Str:_; say Str:D ~~ Str:_; say Str:U ~~ Str:_; 19:58
camelia True
True
True
True
Skarsnik :_? 20:01
lizmat :_ is the same as absence 20:02
so Str:_ is the same as Str
zostay it's there for java programmers who are used to stating every tiny detail explicitly (*ducks out*) 20:03
lizmat but Str might be different in some contexts in the future, when a pragma like "use default :D" might force Str to be Str:D
*then* you would need :_ to force either defined or undefined
Skarsnik I wish there was a pragma to force type checking of method/sub at compile time x)
lizmat type checking of subs already happens at compile time 20:04
Skarsnik I am pretty sure 99% of program never add method at runtime
lizmat m: sub a(Int $a) {}; a "foo"
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling a(Str) will never work with declared signature (Int $a)
at <tmp>:1
------> 3sub a(Int $a) {}; 7⏏5a "foo"
lizmat Skarsnik: with role composition, this may be easier to do than you think 20:05
m: my $a = 42 but role { method gist() { "foo" } }; say $a
camelia foo
Skarsnik but probably will force the compiler to check more stuff? 20:06
lizmat the whole idea of spesh / JIT is that code needing optimization for a particular run of a program will get optimized on the fly
Skarsnik It's more for type checking/Validation that optimisation for me 20:07
andrzejku hi I got a problem 20:14
Failed to copy file: illegal operation on a directory why I cann't copy to directory
with IO:Path
geekosaur probably it's being literal and requires a filename, not a directory name, as the destination 20:16
Skarsnik dunno, what function did you use?
andrzejku X::IO::Copy 20:17
geekosaur docs.perl6.org/type/IO::Path#routine_copy and it looks to me like it does not support the common idiom where the destination is a directory and a file with the same basename as the original is created 20:19
andrzejku geekosaur I just take basename 20:25
:)
andrzejku but it could be fixed in the future 20:25
usually people copy to dir 20:26
i suppose
geekosaur if you think it should be changed, file a rakudobug 20:27
I suspect that this is the lower level operation and it might be best to reserve that behavior for a higher level one. 20:28
andrzejku ok
geekosaur and users should use the higher level one because they often care about metadata that the lower level one will not handle for them
permissions, extended attributes, etc. 20:29
andrzejku geekosaur I need to go
so :D
thnks for info and bye
tony-o .when leont 21:05
geekosaur .seen leont 21:07
yoleaux I saw leont 10 Jul 2017 12:02Z in #perl6: <leont> Would I need a rakudobrew build-zef? Or can I assume it's already there?
tony-o .tell leont - i'm looking into it but on moar-blead i'm getting 'Iteration past end of grapheme iterator' on all tests for YAMLish 21:09
yoleaux tony-o: I'll pass your message to leont.
tony-o ty geekosaur
hythm hello, I'm writing a script to parse large files, the script parses http log files and create a hash of each domain and the status code. I'm using Grammar to parse the file line by line, but can't figure out how to gather all data from each line in one hash. any idea how to do that? here is the code gist.github.com/hythm7/f80b2d291df...437b72fcef 21:44
jnthn hythm: I'd probably write an actions class with a hash attribute, and write the action method that is called after each line to insert into the hash 21:45
hythm jnth, I tired that, (probably i did it wrong), beacuse when i try to print the hash at the end i find it empty,, then I commented these hash lines in the code gist above 21:48
will look into that more and will try to do it right this time 21:52
raiph perlpilot: Thank you so much for reading it and giving me that feedback. :) 22:05
raiph moritz: if you're allowed to use bits from SO given an author's permission, and if any of stackoverflow.com/a/45181464/1077672 is useful for your regex book, feel free to copy whatever you want (cf perlpilot's comment) 22:10