»ö« 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:01 mcmillhj left
timotimo what i like to do is have a channel where i send a specific number of permits and when i want to do something that consumes a resource i receive from the channel and when that part of code is done it sends on the channel 00:02
actually, it might be better to "await" the channel, because that can suspend the task back to the thread pool i assume 00:03
guifa Hmm, I'll look into trying that. Although ultimately all this is just trying out different features. As long as my project runs, multi or single threaded, my dissertation advisor will be happy haha 00:05
Geth doc/car-grant-midrat: f644d9dd66 | (Zoffix Znet)++ | doc/Language/numerics.pod6
Start writing Numerics guide
00:06
00:07 mcmillhj joined 00:12 mcmillhj left 00:17 Herby_ joined
Herby_ how do I convert a number into a character? for example, getting the ascii value of 126 00:18
my googlefu is failing 00:19
00:20 kurahaupo_ joined, vcv_ left
Herby_ "42".char 00:22
m: 42.char
camelia No such method 'char' for invocant of type 'Int'. Did you mean any of these?
can
chars
chop
chr

in block <unit> at <tmp> line 1
00:23 kurahaupo left
guifa .ord 00:25
00:25 mcmillhj joined
Herby_ m: 42.ord 00:25
camelia ( no output )
Herby_ m: say 42.ord
camelia 52
guifa err, wait, wrong direction 00:26
chr is what you want
Herby_ m: say 42.chr 00:27
guifa p6: say 42.chr
camelia *
Herby_ thanks :)
was reading this reddit thread on brute forcing hello world: www.reddit.com/r/ProgrammerHumor/c...world_now/ 00:28
was going to try a p6 solution
00:29 camelia left 00:30 camelia joined, mcmillhj left 00:31 ChanServ sets mode: +v camelia 00:32 w_richard_w joined 00:33 guifa left 00:34 kurahaupo_ left 00:35 kurahaupo joined
Herby_ ta da! gist.github.com/sylints/0fd150aaa7...c85f8f56e5 00:41
00:44 thowe joined
thowe Hi, Perl6. Tell me things that will make me happy. 00:44
MasterDuke Herby_: fwiw, rakudo doesn't lift the @target_array.elems out of the loop, so it's being called for every iteration. elems is pretty fast, so it frequently doesn't matter, but good to know
Herby_ thowe: I just brute-forced hello world
MasterDuke: I didn't know that. Thanks!
thowe OK, cool. I didn't know Hello World required much in the way of force, but you do you. 00:45
00:45 mcmillhj joined
Herby_ MasterDuke: would it be overly complicated to somehow multi-thread it? so one thread starts at the beginning, the other thread starts at the end, and they meet in the middle? 00:45
maybe threading isn't the right term. those concepts are pretty foreign to me
00:46 kurahaupo left, kurahaupo joined
Voldenet afair not many interpreters/compilers optimize that case when you call .length, .elems, .count or similar, because they assume mutability of the collection 00:48
MasterDuke you'd have to be careful since it (generally) isn't safe to write to an array from multiple threads, but yeah, you could do that
00:50 mcmillhj left
MasterDuke Voldenet: true. however, i don't think rakudo lifts any sort of sub/method call out 00:50
but i think it's just that the optimization hasn't been implemented yet, not that the language precludes it 00:53
00:59 kurahaupo left, kurahaupo joined
Voldenet huh, I've tried my luck in implementing bruteforce hello world 01:02
but it doesn't work 01:03
my @a = "Hello world".comb; my $b = @a.elems; loop { my @c = (^$b).map({ "Helowrd ".comb.roll }); @c.join("").print; sleep(.001); "\r".print; return if @c eq @a }
I'm not sure why
;>
oh, I should've put the `print "\r"` after return
Herby_ first glance i didnt understand your Helowrd :) 01:05
01:05 mcmillhj joined
Voldenet my @a = "Hello world".comb; my $b = @a.elems; loop { my @c = (^$b).map({ "Helowrd ".comb.roll }); @c.join("").print; last if @c eq @a; "\r".print } 01:05
now it works*
*if your computer is lucky 01:06
Herby_ m: my @a = "Hello world".comb; my $b = @a.elems; loop { my @c = (^$b).map({ "Helowrd ".comb.roll }); @c.join("").print; last if @c eq @a; "\r".print }
Voldenet I guess the bot isn't too lucky. ;D
camelia (timeout)Hw w wHe
Herby_ camelia isnt feeling well today
01:06 AlexDaniel left
Voldenet I could've just given him the 32..126 chrs, but it would probably take ages 01:08
Herby_ your code is still chugging along on my computer :)
01:09 markong left, kurahaupo left 01:10 mcmillhj left, kurahaupo joined
Voldenet theoretically this should take forever 01:10
;D
my @a = "Hello world".comb.Array; my $b = @a.elems; my @al = @a.unique.Array; my @c = @a.map({""}); loop { @c .= map({ @al.roll }); @c.join("").print; last if @c eq @a; "\r".print } 01:17
this should run more ops/sec
and it would probably be even faster if I just dropped the map
Herby_ can you work some parallel/async/concurrency magic on it?
Voldenet Hm, I am not sure if it's worth it 01:18
timotimo you mean just put .race in one place and suddenly it's super fast? ;) 01:21
Herby_ timotimo: exactly!
01:23 kurahaupo left, mcmillhj joined, kurahaupo joined
Voldenet huh... 01:27
there's a performance difference between "for ^$b { ... }" and "... for ^$b" 01:28
01:28 mcmillhj left
Voldenet ix.io/18Uh 01:28
The sample code when I can benchmark it
timotimo right, one has a lexical scope of its own and that is harder to optimize 01:29
Voldenet meh, I guess it depends on the state of the cpu 01:30
it's equally fast now
01:35 kurahaupo left 01:36 kurahaupo joined 01:39 mcmillhj joined 01:42 FROGGS_ joined 01:45 mcmillhj left 01:46 FROGGS left, ilbot3 left 01:50 zachk left, kurahaupo left 01:51 kurahaupo joined 01:56 ilbot3 joined, ChanServ sets mode: +v ilbot3 01:59 mcmillhj joined 02:04 mcmillhj left 02:05 kurahaupo left 02:06 kurahaupo joined 02:07 mcmillhj joined, spacedbat joined
spacedbat I'm writing a perl6 repl mode for emacs, and I'd like it to print a version banner when it starts up 02:08
currently it just prints "To exit type 'exit' or '^D'" 02:09
02:09 mcmillhj_ joined, mcmillhj_ left, mcmillhj_ joined
timotimo if you want you can start up the perl6 with -MMyReplStartupStuff 02:10
spacedbat that leads to my question - how do I get the version, build and other parameters that perl5 has in the Config module? 02:11
timotimo you mean perl6?
spacedbat well, I know how to get them in perl5
timotimo oh
spacedbat not in perl6
timotimo i only read half the sentence
m: say $*PERL; say $*VM 02:12
camelia Perl 6 (6.c)
moar (2018.04.34.g.25.f.165.ad.7)
timotimo m: say $*PERL.perl; say $*VM.perl
camelia Perl.new(compiler => Compiler.new(id => "FF60E53B83E216DE11280A60669EBE56B93D633B", release => "", codename => "", name => "rakudo", auth => "The Perl Foundation", version => v2018.04.21.g.24.a.907747, signature => Blob, desc => Str), name => "Perl 6"…
spacedbat sweet, that'll do the trick
thanks 02:14
timotimo yw
02:14 mcmillhj_ left 02:16 kurahaupo left, kurahaupo joined
spacedbat VM.version 02:22
hah wrong window
02:23 mcmillhj_ joined 02:26 kurahaupo left 02:27 kurahaupo joined 02:28 mcmillhj_ left 02:34 mcmillhj left 02:37 mcmillhj joined, kurahaupo left, kurahaupo joined 02:41 mcmillhj left 02:47 wamba joined, mcmillhj joined 02:49 kurahaupo left, kurahaupo joined 02:52 mcmillhj left 03:01 kurahaupo left, kurahaupo joined, mcmillhj joined 03:06 mcmillhj left 03:13 kurahaupo left 03:14 kurahaupo joined 03:16 eliasr left 03:18 kurahaupo left, mcmillhj joined 03:21 stan7 left 03:23 mcmillhj left 03:27 athenot joined 03:29 Tison joined 03:30 athenot_ joined 03:32 athenot left, Herby__ joined
spacedbat my next question: is there a way to run some code supplied on the command line, say via the -e flag, and lastly evaluate an expression to start the REPL? 03:33
03:38 mcmillhj joined 03:39 Zoffix joined
spacedbat any ideas how to start the repl from within a perl6 program, as though perl6 was run without arguments? 03:40
Zoffix Kinda, but it involves using unsupported code 03:41
spacedbat ah - what I'm aiming to do is print a banner when my emacs perl6 repl starts
Zoffix perl6 -e 'say "Look, ma! A banner!\n\n"; use nqp; nqp::getcomp("perl6").interactive' 03:42
spacedbat timotimo suggested using -M but that would involve creating a file which complicates things a bit - ideally I'd be able to supply the banner as a -e one liner and go on to the repl
ok, and nqp::getcomp is unsupported/likely to change?
Zoffix It is unsupported. It might change, dunno 03:43
03:43 mcmillhj left
spacedbat right... I've read some of your stuff online, I want to thank you for your works Zoffix 03:43
Zoffix :) 03:44
spacedbat ok that works a treat - I might support customizing the initialization of the repl so if the needed incantation changes it will be easy for users to adapt 03:46
Zoffix spacedbat: or maybe this works too: perl6 -e 'say "A banner\n"; run $*EXECUTABLE' 03:47
a perl-within-perl
more exactly: perl6 -e 'say "A banner\n"; my $ = run $*EXECUTABLE'
(the second version doesn't sink the Proc so if someone types exit(42) in REPL there's no "The spawned process exited unsuccessfully" message 03:48
)
03:52 mcmillhj joined
spacedbat right, I was doing the $*EXECUTABLE trick before but to get the banner by passing it -v 03:53
however the banner then appeared later than I wanted it to
thanks for the tip 03:54
does perl6 have an equivalent of exec (replace current process?)
Zoffix nope
03:55 mcmillhj_ joined
spacedbat maybe there's a posix lib, or I guess I could just nativecall it 03:55
Zoffix As for appearing later. Hmm, maybe try setting $*OUT.out-buffer: False; before printing the banner. If you're not running with a tty STDOUT, it'll be buffered.
"by passing it -v" what does that mean? 03:56
spacedbat by later I mean, it printed To exit type 'exit' or '^D' first
then the banner
I was doing this first thing after the repl started: say run($*EXECUTABLE.Str, '-v', :out).out.slurp-rest 03:57
I'm an old hand at perl5 but a bit rusty, much less familiar with perl6 03:58
03:58 wamba left
Zoffix Seems to print fine when you pass the code in -e gist.github.com/zoffixznet/665f492...47bc9fa47d 03:58
There's also a switch to have a silent repl
spacedbat yes I noticed that, but I want this to be interactive 03:59
I like the run $*EXECUTABLE trick, but I'd rather not spawn an extra process that lingers
04:00 mcmillhj_ left
spacedbat there's a few things for me to try now, cheers 04:00
Kaiepi node has a repl module to allow people to do this
spacedbat I noticed there is a REPL trait - seen a gist where someone made a custom repl 04:02
Zoffix That might've been mine from awhile back when we had to workaround a bug that made it into the release 04:04
spacedbat this was it: gist.github.com/regnarg/3b98a0b5f3...c1bb0da3ff
04:05 mcmillhj left
Zoffix Ah 04:05
Well, it's using the same nqp::getcomp('perl6'); I showed above
spacedbat yes
I don't need all that extra stuff, would like this to be vanilla perl6 repl with a banner to start with 04:06
I'm going to contribute it to the perl6-mode for emacs
04:10 mcmillhj joined 04:15 mcmillhj left 04:22 mcmillhj joined
Herby__ are there any tutorials floating about on the "Whatever" operator? 04:23
other than the official docs
Zoffix Haven't read it, but there's this article: perl6advent.wordpress.com/2017/12/...of-perl-6/ 04:24
04:24 khw left
Herby__ great, thanks 04:25
04:27 mcmillhj left 04:31 Tison left
Geth doc: 9c0ca74e52 | 陈梓立++ (committed using GitHub Web editor) | META6.json
Update META6.json
04:34
04:37 ParsonsNose left 04:39 athenot_ left 04:41 MasterDuke left, mcmillhj joined 04:46 mcmillhj left 04:59 mcmillhj joined 05:01 andrzejk_ joined 05:04 mcmillhj left 05:15 entonian joined, skids left 05:17 mcmillhj joined 05:20 entonian left 05:22 mcmillhj left 05:29 mcmillhj joined 05:33 mcmillhj left 05:35 andrzejk_ left, Herby__ left 05:38 Util left, Util joined 05:40 sauvin joined 05:45 irco left 05:54 mcmillhj joined 05:56 BenGoldberg left
Zoffix How to get nqp::stringify op in HLL? It looks like it's added but it ain't available: github.com/perl6/nqp/blob/master/s...ps.nqp#L95 05:58
nqp: say(nqp::stringify("42"))
camelia 42
Zoffix m: use nqp; say(nqp::stringify("42"))
camelia ===SORRY!===
No registered operation handler for 'stringify'
05:59 robertle left, mcmillhj left 06:01 AlexDaniel joined 06:08 darutoko joined 06:12 mcmillhj joined, todd joined
todd hi all. A mystery. This works: $ClipStr ~~ s:global/"\t"/"\n"/; for split( "\n", $ClipStr ) -> $Line { 06:12
but this does not: for split( "\t", $ClipStr ) -> $Line { 06:13
or this for split( ord(9), $ClipStr ) -> $Line {
Zoffix What happens when it doesn't work? 06:14
06:16 mcmillhj left
todd The whole $ClipStr gets transfered into only one $Line 06:18
Zoffix m: my $ClipStr = "foo\tbar"; for split("\t", $ClipStr) -> $line { dd $line } 06:19
camelia Str $line = "foo"
Str $line = "bar"
Zoffix What's the actual code you're using?
todd I forgot the name of that clipboard routing I can copy it onto the web 06:20
paste something or other 06:21
Zoffix I'm guessing you aren't actually using split the way you showed above and instead you stored the return value into a variable first which containerized it. Either bind it ($x := split) or decont it (for $x<>) 06:22
huggable: decont
huggable Zoffix, Article on containers and decont: perl6advent.wordpress.com/2017/12/...oneandonly
06:24 AlexDaniel left
todd remembered: vpaste.net vpaste.net/VHsUU 06:24
Zoffix todd: use "\t" 06:25
m: dd ord 9
camelia 57
Zoffix That just gives you the ord for character "9"
todd \t did not work either 06:26
Zoffix It's just "\t" without any ord(). Is that what you used?
todd for split( "\t", $ClipStr ) -> $Line { do something } 06:28
It did not split the string
Zoffix Add `dd $ClipStr` before the loop. What does it print?
06:31 robertle joined
todd no. just one long line 06:31
Zoffix But what is it? 06:32
What's the output?
todd whatever I copyu into the secondary clipboard as one long line, unless I to a s:g/"\t"/|\n"/ on it change the tabs to new line and then split on new lines 06:35
06:35 Zoffix left, jmerelo joined
Geth doc: 70eb782934 | 陈梓立++ (committed using GitHub Web editor) | META6.json
Revert add IO::Socket::SSL

Misunderstand the error message from travis-ci.org/perl6/doc/jobs/372312669 .
06:35
todd I know it is a tab because of this proofing statement: for split( "", $ClipStr ) -> $Char { say "$Char = <", ord( $Char ), ">" }; 06:36
oh, you know what. I have othjer fish to fry. My ReadSecondardClipboard is removing the new line between lines, so I am go to forget about this for the moment 06:42
Geth perl6-lwp-simple: JJ self-assigned IO::Socket::SSL required for running tests github.com/perl6/perl6-lwp-simple/issues/9
ed0fd62843 | (JJ Merelo)++ | 2 files
06:47
perl6-lwp-simple: 5e3f100440 | (JJ Merelo)++ | 3 files
Refactos code with new URL refs #9
perl6-lwp-simple: 28f07586f3 | (JJ Merelo)++ | META6.json
Bumps up version closes #9
jmerelo I really don't know why we have to wait for 30 minutes for rakudo to compile in the "official" travis version. 06:56
06:56 mcmillhj joined 06:59 parv joined 07:01 mcmillhj left 07:04 domidumont joined
Geth doc: 5b9515d2af | (JJ Merelo)++ | META6.json
Bumps up dep version to avoid errors
07:04
doc: 53583e5ffd | (JJ Merelo)++ | META6.json
Fixes JSON error
07:09
07:11 domidumont left 07:12 domidumont joined 07:13 mcmillhj joined, kurahaupo joined 07:17 mcmillhj left 07:21 sena_kun joined 07:23 wamba joined 07:24 mcmillhj joined 07:28 todd left 07:29 mcmillhj left
buggable New CPAN upload: P5sleep-0.0.5.tar.gz by ELIZABETH modules.perl6.org/dist/P5sleep:cpan:ELIZABETH 07:36
07:36 mcmillhj joined, lizmat left 07:38 lizmat joined 07:40 Kaiepi left 07:41 mcmillhj left 07:43 troys left 07:47 mcmillhj joined 07:49 Kaiepi joined 07:51 mcmillhj left, Kaiepi left 07:52 Kaiepi joined 07:56 Guest43854 joined 07:58 kurahaupo left
Geth doc: f9ea5db422 | (JJ Merelo)++ | META6.json
Bumps up Pod::To::HTML version too
08:01
doc: 561cfd1afc | (JJ Merelo)++ | META6.json
Fixes JSON error
08:03 domidumont left
AlexDaniel` huggable: stars 08:15
huggable AlexDaniel`, perl6advent.wordpress.com/2017/12/...of-perl-6/
AlexDaniel` huggable: colons
huggable AlexDaniel`, thelackthereof.org/Perl6_Colons
08:17 espadrine_ left 08:20 rindolf joined 08:23 wamba left 08:26 mcmillhj joined
Geth doc: 5394d4248d | (JJ Merelo)++ | 4 files
Eliminates duplicate reference for 'is defined'

And along with it, probably the "Trait" category of the search part. Closes #1514
08:26
doc: cd254920e7 | (JJ Merelo)++ | doc/Type/Mu.pod6
Minor typographic changes but closes #1800
synopsebot Link: doc.perl6.org/type/Mu
jmerelo Thank to Zoffix closing cascade yesterday mainly, the number of open issues is below 270 for the first time since I remember... github.com/perl6/doc/issues 08:27
Do enjoy the moment for an instant before I insert another issue and crank it back to 270
lizmat jmerelo: on that thought: I just found out that we don't document which methods the Positional and Associative roles are providing 08:30
jmerelo lizmat: well, issue that. All moments of joy are ephemeral
08:31 mcmillhj left
lizmat hehe... will do 08:31
08:32 robertle left 08:35 andrzejk_ joined 08:40 mcmillhj joined 08:42 Todd joined
Todd Is there a way to remove the last character with the subsitute command s/ ? A replacement for $Clipboard = chop( $Clipboard ); 08:43
08:46 mcmillhj left
jmerelo Todd: does it have to be with s/? 08:46
Todd No. I wanted to put in my read me files as how to do it both ways 08:47
chop does word fine
work
jmerelo p6: say "last character is out þ".chop 08:48
camelia last character is out
jmerelo Todd: Can you please post it to to Stackoverflow?
Todd Stackoverflow?
`þ".chop` is still chop. I am looking for a perl6 -e 'my $x="a b c d "; $x ~~ s///; say "<$x>";' 08:50
jmerelo Todd: yep, I always ask people to also post the question to StackOverflow so that it can be searched afterwards, and also get more answers. 08:51
p6: my $x="a b c d "; $x ~~ s///; say "<$x>"; 08:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Null regex not allowed
at <tmp>:1
------> 3my $x="a b c d "; $x ~~ s/7⏏5//; say "<$x>";
jmerelo p6: my $x="a b c d "; $x ~~ s/ $//; say "<$x>";
camelia <a b c d >
jmerelo p6: my $x="a b c d "; $x ~~ s/\ $//; say "<$x>";
camelia 5===SORRY!5=== Error while compiling <tmp>
No unspace allowed in regex; if you meant to match the literal character, please enclose in single quotes (' ') or use a backslashed form like \x20
at <tmp>:1
------> 3my $x="a b c d "; $x ~~ s/\ …
jmerelo p6: my $x="a b c d "; $x ~~ s/' '$//; say "<$x>";
camelia <a b c d>
08:52 wamba joined
Todd $ perl6 -e 'my $x="a b c d "; $x ~~ s/" "$//; say "<$x>";' <a b c d> 08:53
Perfect! Thank you!
What does the $ do?
jmerelo Todd $ matches the end of the string 08:55
08:55 mcmillhj joined
jmerelo Todd: now please if you have a minute post it too in StackOverflow. The logs of this IRC channel are not search-engine friendly for people looking for answers. Thanks! 08:56
Geth doc: b8c697d31e | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlfunc.pod6
Added some more P5 -> P6 wisdom

  - got to sleep
08:58
doc: d779c58b7c | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlfunc.pod6
Some more Perl 5 -> 6 tweaks
synopsebot Link: doc.perl6.org/language/5to6-perlfunc
Todd I absolutely adore the folks over on [email@hidden.address] Is that list searchable?
Geth doc: 5a656e4f9c | (JJ Merelo)++ | doc/Language/operators.pod6
Adds ⁇ ‼ to the index

And rephrases a bit the doc. Basically I was checking to close #1851, and I don't like to close without an actual change. So...
synopsebot Link: doc.perl6.org/language/operators
jmerelo Todd: yep. It's a bit better than these logs for searching, but still worse than StackOverflow. Moreover, *everyone* searches SO first.
09:00 ufobat joined, mcmillhj left
Todd Actually it is searchable. I just found a bunch of stuff. I will put my notes over on [email@hidden.address] Any reason to duplicate on Stack Overflow? 09:00
09:03 mcmillhj joined
ufobat lizmat, i've started with sereal :) 09:03
lizmat ++ufobat # way cool!
lemme know when you have something in a repo :)
ufobat it's on github already. but i just started like 45min ago 09:05
github.com/ufobat/p6-Sereal
09:07 mcmillhj left
lizmat ufobat: cool, am about to be afk for most of the rest of the day, so will look at it later :-) 09:07
Todd Sorry on the Stackoverflow. They are too gosh awful nosey. I am not giving them my personal information 09:09
09:10 TEttinger left
Todd Got around the nosey questions. I will see if I can post 09:12
buggable New CPAN upload: P5built-ins-0.0.10.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/....10.tar.gz 09:16
09:16 FROGGS_ is now known as FROGGS
Todd stackoverflow.com/questions/500748...n-a-string 09:17
I posted a lot more over on the mailing list
09:17 Guest43854 left
jmerelo Todd: Thanks! 09:19
Todd: you can send those too, once you've signed. A bit of advice: post just the question, and leave some time for people to answer it. You can then answer it yourself if you want, and accept it. If you post question & answer it could be flagged as a not-question 09:21
09:23 pmurias joined
Todd I will probably get flagged 09:28
jmerelo Todd: you can still edit it. Say something like "This is the answer that was suggested. Is there some easier way of doing that?" 09:30
09:31 andrzejk_ left 09:33 w_richard_w left
lizmat commute& 09:35
09:35 lizmat left
Todd I did as you suggest 09:39
09:45 domidumont joined
jmerelo p6: my $x="a b c d "; say $x.chop 09:45
camelia a b c d
jmerelo Todd: done a bit of editing. SO people are rather picky with questions. 09:46
Todd: please note also that chop in Perl 5 returns the character that has been removed; it returns the string with the character removed in Perl 6. 09:47
09:47 lizmat joined
Todd interesting. I still have a few things in perl 5, but am transitioining over. 09:49
Calling it a night
09:49 Todd left 09:59 eliasr joined 10:05 andrzejk_ joined
buggable New CPAN upload: P5shift-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 10:06
10:11 andrzejk_ left
Geth doc: 4818aa3e7e | (Elizabeth Mattijsen)++ | doc/Language/5to6-perlfunc.pod6
Explain P5 -> P6 difference for shift/unshift better
10:15
synopsebot Link: doc.perl6.org/language/5to6-perlfunc
10:18 wamba left 10:22 espadrine_ joined 10:23 espadrine_ is now known as espadrine 10:24 markong joined
jmerelo Problems with compile-time exceptions, in StackOverflow stackoverflow.com/questions/500754...tion-types 10:28
lizmat masak: ^^^ 10:34
timotimo committable6: releases use experimental :macros; macro a { 'foo' }; say a; 10:39
committable6 timotimo, gist.github.com/2779b46a772f8d78b0...fa8488399a
timotimo AlexDaniel`: oh no, whateverable is very unhappy! 10:40
AlexDaniel`: maybe the filesystem had an oops? 10:41
10:41 Guest18 joined
timotimo or just filled up 10:43
10:45 parv left 10:51 Guest18 left 10:53 andrzejk_ joined, andrzejk_ left, andrzej__ joined 10:55 andrzejk_ joined, andrzej__ left, Guest18 joined
buggable New CPAN upload: P5shift-0.0.2.tar.gz by ELIZABETH modules.perl6.org/dist/P5shift:cpan:ELIZABETH 10:56
10:57 andrzej__ joined, andrzejk_ left 10:58 lasse_ joined, lizmat left 11:02 andrzej__ left
buggable New CPAN upload: P5push-0.0.2.tar.gz by ELIZABETH modules.perl6.org/dist/P5push:cpan:ELIZABETH 11:06
timotimo huh, i can "touch testfile" just fine 11:07
11:15 jmerelo left 11:40 stmuk_ joined 11:42 stmuk left
AlexDaniel` timotimo: the filesystem is fine actually 11:45
timotimo: it is intentionally read-only
c: releases chdir ‘sandbox’; run <perl6 -e>, 「use experimental :macros; macro a { 'foo' }; say a;」 11:46
let's try this…
it should start in sandbox/ by default, but atm it doesn't
committable6 AlexDaniel`, gist.github.com/950390469d33c76a49...b8fe7aea0c
AlexDaniel` what the… 11:47
6c: say 42
committable6 AlexDaniel`, ¦6c (29 commits): «42␤»
AlexDaniel` so why is it even trying to write there
c: releases chdir ‘sandbox’; run <perl6 -e>, 「use experimental :macros; macro a { 'foo' }; say a;」 11:48
committable6 AlexDaniel`, gist.github.com/354e79e4a4f49aec4b...6fae151e7a 11:49
AlexDaniel` c: releases run :cwd(‘sandbox/’), <perl6 -e>, 「use experimental :macros; macro a { 'foo' }; say a;」 11:50
committable6 AlexDaniel`, gist.github.com/30ca826007ae9c7e0f...a2b219f9e9
AlexDaniel` timotimo: I don't get it. I don't know why it attempts to write there 11:51
c: releases run :cwd(‘sandbox/’), <perl6 -e>, 「say 42」 11:53
committable6 AlexDaniel`, ¦releases (29 commits): «42␤» 11:54
12:04 titsuki joined 12:08 lizmat joined 12:09 kaare_ left
timotimo perhaps stracing will help, but it won't show you what part of the program is causing a given system call, just in what order they happen 12:22
Geth doc: 7bc35a6f3e | (Jan-Olof Hendig)++ | doc/Type/List.pod6
Fixed incorrect example output
12:36
synopsebot Link: doc.perl6.org/type/List
sena_kun m: say [-] 10; 12:37
camelia 10
sena_kun huh, is that a recent change? 2018.03 gives me `-10`. 12:38
12:38 timotimo left
dogbert17 sena_kun: github.com/rakudo/rakudo/commit/ed...a38c647171 12:38
12:38 timotimo joined
sena_kun dogbert17, thanks! 12:39
12:41 noganex left 12:43 DataLinkDroid left 12:44 vike left 12:46 vike joined
El_Che lo 12:47
13:09 MasterDuke joined
Geth doc: 80c1bc1ea5 | (Luca Ferrari)++ | doc/Type/IO/Socket/INET.pod6
C<> on host name and port.
13:15
doc: cf6d90476d | (Luca Ferrari)++ | doc/Type/IO/Socket/INET.pod6
Align server socket params to avoid long lines.
synopsebot Link: doc.perl6.org/type/IO::Socket::INET
doc: 2d484ca0ce | (Luca Ferrari)++ | doc/Type/IO/Socket/INET.pod6
Align parameters in socket client example, avoid long lines.
13:16 andrzejk_ joined
buggable New CPAN upload: P5push-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/P5push:cpan:ELIZABETH 13:16
13:16 andrzejk_ left
buggable New CPAN upload: P5shift-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/P5shift:cpan:ELIZABETH 13:16
13:16 andrzejk_ joined 13:18 wamba joined, andrzejk_ left 13:19 andrzejk_ joined 13:23 andrzejk_ left 13:24 Guest18 left 13:27 domidumont left 13:37 kurahaupo joined 13:43 rindolf left 13:44 rindolf joined
Geth doc: 917aff0957 | cfa++ | doc/Language/5to6-perlfunc.pod6
nbsp
13:53
synopsebot Link: doc.perl6.org/language/5to6-perlfunc
Geth doc: 733175d7e2 | cfa++ | 2 files
spelling
14:00
14:10 noganex joined
donpdonp c.pm6: use A::B::D; package A::B { class C is D {} }; d.pm6: package A::B { class D {}} 14:15
is there a way to say 'use D' in c.pm6, perhaps inside the package {}
to make the use line shorter...
ive tried a few things but havent found a way to use partial package paths... 14:16
El_Che is interested in the answer 14:22
14:25 robertle joined 14:29 comborico1611 joined
thowe I seem to recall a module or method to do exactly that in Perl5, but don't remember it. I've seen mst do it in code. 14:30
timotimo use always refers to compunits 14:31
i.e. "use FooBar" can give you a "BleepBloop" if that's what's in the file that has that name
El_Che you'll loose namespacing that way 14:38
you want to keep namespacing, you just want a short way to reference in the consuming class 14:39
timotimo i'm not sure i understand 14:40
Herby_ o/ 14:43
El_Che timotimo: import graphics.*; Circle myCircle = new Circle();
timotimo right 14:44
Geth doc: cee043457e | cfa++ | doc/Language/5to6-perlfunc.pod6
examples compilation
14:45
synopsebot Link: doc.perl6.org/language/5to6-perlfunc
El_Che or in go, that has a flat namespace: import "github.com/nxadm/ldifdiff" ... output, err = ldifdiff.DiffFromFiles(params.Source, params.Target, params.IgnoreAttr)
14:45 lizmat left 14:47 lizmat joined 14:56 khw joined 14:58 Zoffix joined
Zoffix nqp: use nqp; say(nqp::numify("42.42e0")) 14:58
camelia 42.42
Zoffix m: use nqp; say(nqp::numify("42.42e0"))
camelia ===SORRY!===
No registered operation handler for 'numify'
Zoffix How can I enable that op in HLL?
AlexDaniel` timotimo: oh, I know 14:59
Will fix once i'm back home
thowe so, I almost hate to ask, but there seemed to be some debate recently... Should I put "use v6.c;" at the top of my script? 15:00
timotimo you can also put v6.d.PREVIEW if you're using "await" a bunch
and you're okay with code migrating between threads
thowe SInce I don't grok what you just said, I won't. 15:01
Zoffix thowe: it depends on your needs. `use v6.c` says "I want language version 6.c". So when new language features come out—like the stuff timotimo mentioned—your program won't have them available. This may be what you want, since you wrote the program for that specific language version, but you may also wish to always use the latest language version (which is what lack of `use v...` would use). Some people 15:05
also put it in to get more helpful errors if you accidentally run your perl6 script with perl compiler, but IME I found little use in that advice.
Answer to my question: gist.github.com/zoffixznet/1dd32f5...7b04bbd014 15:07
yoleaux 15:06Z <pmurias> Zoffix: I'll look into it
15:07 Zoffix left 15:12 andrzejk_ joined 15:13 lizmat left 15:15 domidumont joined 15:18 zakharyas joined 15:20 zakharyas left 15:21 zakharyas joined 15:24 lasse_ left 15:27 lizmat joined 15:32 lizmat left, andrzejk_ left 15:38 Kaiepi left 15:41 Kaiepi joined 15:42 andrzej__ joined
ufobat m: use Test; lives-ok { X::NYI.new.throw(feature => 'foo')} 15:42
camelia not ok 1 -
# Failed test at <tmp> line 1
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in sub _diag at /home/camelia/rakudo-m-inst-1/shar…
15:43 andrze___ joined
ufobat m: use Test; lives-ok { X::NYI.new(feature => 'foo').new()} 15:43
camelia ok 1 -
ufobat i know that in my first example it was wrong, but the error is strange, isnt it?
m: use Test; lives-ok { X::NYI.new(feature => 'foo').throw()} 15:44
camelia not ok 1 -
# Failed test at <tmp> line 1
# foo not yet implemented. Sorry.
ufobat m: X::NYI.new.throw(feature => 'foo') 15:45
camelia not yet implemented. Sorry.
in block <unit> at <tmp> line 1
15:45 andrz____ joined 15:46 andrzej__ left 15:47 andrze___ left 15:50 AlexDaniel joined 15:53 rouking joined
rouking How do I pass a pair to a sub without it being interpreted as a named argument? 15:54
timotimo either put quotes around the key, or put parethesis around the pair
15:54 Zoffix joined, andrz____ left
Zoffix m: -> $x { dd $x }( :42foo.Pair } # another way 15:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3-> $x { dd $x }( :42foo.Pair 7⏏5} # another way
Zoffix m: -> $x { dd $x }( :42foo.Pair ) # another way
camelia Pair $x = :foo(42)
15:55 andrzejk_ joined
Zoffix ufobat: that's not an error, that's a warning 15:55
ufobat: the diagnostics of the failed test print the stringified exception, and since you never set the feature argument, it's stringifying an undefined value, resulting in a warning 15:56
rouking thanks
ufobat ah!
Zoffix m: { dd @_ }( :42foo.Pair, (:70bar), "meows" => 2, 4 R=> "key", Pair.new("some-key", 42) ) 15:58
camelia [:foo(42), :bar(70), :meows(2), :key(4), :some-key(42)]
timotimo so many ways
ufobat i am not sure, but i'd say thats wrong to not handle the undefined value manually. because in the end the warning about the stringification is not helpful
Zoffix ufobat: fix it: github.com/rakudo/rakudo/blob/mast...#L781-L785 15:59
15:59 pilne left
Zoffix just this even github.com/rakudo/rakudo/blob/mast...n.pm6#L785 16:00
16:00 andrzejk_ left
ufobat what about has $.feature is required? 16:00
Zoffix s/"$.feature not yet implemented. Sorry."/"{$.feature andthen "$_ not" orelse "Not"} yet implemented. Sorry."/
ufobat is going to dinner first ;-) 16:01
wine and g(r)eek food!
Zoffix To me, makes more sense to make it optional, where the message doesn't mention any features if none were provided.
16:01 committable6 left
ufobat if you dont fix it i'll send a PR tomorrow or monday 16:02
16:02 committable6 joined
AlexDaniel c: releases chdir ‘sandbox’; run <perl6 -e>, 「use experimental :macros; macro a { 'foo' }; say a;」 16:02
c: use experimental :macros; macro a { 'foo' }; say a;
c: releases use experimental :macros; macro a { 'foo' }; say a;
committable6 AlexDaniel, ¦use: «Cannot find this revision (did you mean “all”?)» 16:03
AlexDaniel, gist.github.com/b85f9b6475d21ff14e...c046f8ea03
AlexDaniel, ¦releases (29 commits): «===SORRY!===␤Too few positionals passed; expected 3 arguments but got 2␤ «exit code = 1»»
16:03 bisectable6 left, andrzejk_ joined, bisectable6 joined
AlexDaniel timotimo: ↑ there 16:04
fixed
thanks
Geth whateverable: 92c5c28f40 | (Aleks-Daniel Jakimenko-Aleksejev)++ | lib/Whateverable.pm6
Reset PERL6LIB when running snippets

Otherwise it attempts to write in read-only paths.
16:06
16:07 ufobat left 16:08 andrzejk_ left 16:10 jmerelo joined 16:12 andrzejk_ joined
jmerelo p6: say True ⁇ "Yay" ‼ "Nay" 16:12
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3say True7⏏5 ⁇ "Yay" ‼ "Nay"
expecting any of:
infix
infix stopper
postfix
statement end
statement modif…
comborico1611 does "say subroutine_name" just return the last value of the sub?
timotimo say always just returns True, but calling a sub will return the last value if there isn't a "return" statement or a return thing in the signature 16:13
Zoffix jmerelo: those existed briefly, but were eventually reverted
jmerelo Zoffix: I was stuck in that brief period, apparently. 16:14
comborico1611 Hmm.
AlexDaniel github.com/rakudo/rakudo/pull/1029 16:15
c: ed971df say True ⁇ "Yay" ‼ "Nay"
committable6 AlexDaniel, ¦ed971df: «Yay␤»
16:16 andrzejk_ left
Zoffix comborico1611: I notice you frequently confuse "return" and "output"/"print". A "return" is the 'result' of the sub. It's some value you can store in a variable, pass to another sub, discard, or print. To "print" or "output" is to (often) display that value on the screen. So in your code `say subroutine_name` there are two sub calls (one is calling `subroutine_name` and one is calling `say`). The return value 16:16
of `subroutine_name` is passed to the call of `say`. The `say` call outputs/prints that value to "standard output". Then the `say` call also returns a value; its return value is always `True` and in your case you discard that return value.
comborico1611 I see. 16:17
Thanks!
Geth doc: d5518b7283 | (JJ Merelo)++ | doc/Language/operators.pod6
Changes indexing to conditional operator

And closes #1851 for the third time. This must have been like the most closed issue, ever.
16:19
synopsebot Link: doc.perl6.org/language/operators
16:26 andrzejk_ joined, wamba left
jmerelo Luckily, after the last change by Zoffix, htmlify is kinda faster. Not a great deal, but before you could go, prepare tea, bake the scones, and come back and still see htmlify.p6 printing dots 16:33
16:35 andrzejk_ left, wamba joined 16:36 sauvin_ joined, sauvin left
Geth doc: 2adf40d13a | (JJ Merelo)++ | doc/Language/operators.pod6
Changes again indexing of ??!! operator

It's now indexed as `infix`. This would be the 4th time we close #1851. Will this be the last one? Who knows...
16:37
synopsebot Link: doc.perl6.org/language/operators
16:38 sauvin_ is now known as sauvin 16:40 andrzejk_ joined 16:44 andrzejk_ left
comborico1611 Zoffix: So what is going here? hastebin.com/eyomujorid.pl 16:50
say's return of 1 is it's output, not its return, correct?
timotimo with-optional(1) should return 1 even if there's no say in front 16:52
16:54 HaraldJoerg joined
Zoffix comborico1611: gist.github.com/zoffixznet/f1f8057...77dd277a9f 16:54
jmerelo comborico1611, Zoffix : you know what I'm gonna say, so... 16:56
Geth doc: 9fc190d17b | (Luca Ferrari)++ | doc/Type/IO/Socket/INET.pod6
Remove use v6.c from IO::Socket::INET examples.

Do we really need to include the version in such simple examples?
synopsebot Link: doc.perl6.org/type/IO::Socket::INET
Zoffix jmerelo: what?
16:57 andrzejk_ joined
jmerelo Zoffix: stackoverflow it! :-) 16:57
comborico1611 jmerelo: Ahh. Good idea! My first stackoverflow didn't go that well, so I'm reluctant to post more on there. 16:58
timotimo that's a weird thing to stackoverflow
comborico1611 Zoffix: Let's do this again on stackoverflow. I'll post link soon.
Zoffix comborico1611: I don't use stackoverflow. 16:59
comborico1611 timotimo: Some guy was like, "this isn't a overflow question" or somethign benign like that.
Zoffix: I see. Why?
jmerelo comborico1611: yep, I know about that one. Tried to save it, but... usually, "this is slow" questions are not well received.
comborico1611 (sorry if one of you guys is that guy. lol)
jmerelo comborico1611: you have to make questions feel like questions. Like "is there some way to speed up this? I really need it for this and that" 17:00
Or "I want to run this interpreter real fast. Is there some way to do that without compiling the whole thing?"
comborico1611 jmerelo: I see. The question is important because the topic is really "finished build" and building from scratch, which I'm sure has little coverage.
Zoffix comborico1611: I don't like its gamefication of human interactions. 17:01
timotimo if i remember correctly, there was barely any detail in the question text as well
i can't seem to find it any more
comborico1611 Zoffix: Fair enough. I'm very suspcious if the site myself, seeing that it has top SEO status, and in league with other powerful forums (ask ubuntu etc.)
17:02 andrzejk_ left
jmerelo comborico1611: it really is, but you need to be a bit careful on how you compose the question. 17:02
comborico1611 timotimo: Yeah, that's because I didn't understand what ws going on.
jmerelo comborico1611: askubuntu all belong to the same StackExchange network.
comborico1611 Yeah, I'm suspicous of powerful entities.
timotimo do you have a link to the question again?
comborico1611 I'll have to login and find it.
timotimo or what is your username? 17:03
jmerelo timotimo: here you go stackoverflow.com/questions/499486...to-install
timotimo thanks
comborico1611 timotimo: stackoverflow.com/questions/499486...to-install
Oop 17:04
timotimo the question doesn't look like a typical stackoverflow question, but that's to be expected from someone using stackoverflow for the first time
stmuk_ 17:05
timotimo for example, putting your name and date into the main text seems strange to me
comborico1611 I'm defy conventions.
I defy*
I hate things without dates. So I add my own to make sure.
timotimo OK, stackoverflow does have an edit log, too, though 17:06
comborico1611 stack will just need to get use to my style :)
(I'll consider not putting that on there)
stmuk_ comborico1611: is that on linux? 32 bit or 64 bit? How much physical memory or swap? Whats the CPU?
comborico1611 64, 2 gigs physical 2 swap, cpu.. hold on. 17:07
Correction 1.9 gigs of ram
dual-core 2.3 ghz 17:08
pentium
ubuntu 14
Zoffix comborico1611: but also, what's "so long"? 17:09
stmuk_ does it slow down at a particular point?
Geth doc: c8835e78aa | (JJ Merelo)++ | doc/Type/X/TypeCheck/Splice.pod6
Fixes description of exception

Closes #833
synopsebot Link: doc.perl6.org/type/X::TypeCheck::Splice
comborico1611 The whole system becomes to slow to use.
stmuk_ is it swapping? 17:10
17:10 HaraldJoerg1 joined
timotimo yeah, you're running out of ram most likely 17:10
er
yes
comborico1611 stmuk_: I don't know how to determine that.
jmerelo comborico1611: use top or htop
17:10 sena_kun left
timotimo or "free -m" 17:10
Zoffix (nm, I see " it takes about 25-30 minutes")
17:11 HaraldJoerg left
Zoffix comborico1611: are you running `make rakudo-test` or `make rakudo-spectest` as part of the installation process? 17:11
comborico1611 Zoffix: No, I learned from first installation that test is far too long
17:11 sena_kun joined
comborico1611 takes far too long* 17:11
jmerelo comborico1611: anyway, the point is that you should try and reformulate the StackOverflow question in several different ways. First, you could ask if there is a fast way of having it running, or compiling it so that it takes less, or finally ask if you can find out, via shell commands, what makes it so slow and so do something to fix it.
stmuk_ its not really a stackoverflow question .. it sounds like something specific to your system (probably just lack of RAM+swap) 17:12
Zoffix m: say 250/60 17:13
camelia 4.166667
stmuk_ you could try adding a temporary swap file while compiling
comborico1611 I thought stackoverflow was for asking general questions about computing. I didnt know there was a culture thing to it.
timotimo fwiw, we could totally check if "free" exists on the system, try to parse its output, and warn if available ram is quite tight
jmerelo We're 3 issues short of 1000 issues closed :-)
Zoffix FWIW on my 32-bit (so no jit) 2-core debian with 8GB RAM, installation takes ages, but not so long as 25-30. Maybe in 10-15 minutes tops
timotimo comborico1611: places and communities that call themselves "neutral" or "free of culture/bias/..." are usually the opposite of that
jmerelo comborico1611: there's a culture to everything. There's a culture to this IRC channel. There's a culture to perl6/doc issues. There's a culture to tests.
stmuk_ what does "swapon" say?
jmerelo there's a culture to culture.
comborico1611 Anyways, I'm off to lunch. I decided not to post the question on Stack. Too much drama. 17:14
timotimo sorry i'm being so negative :| 17:15
17:15 AlexDaniel left
comborico1611 Maybe in time I'll figure out what's stackable and what's not. 17:15
stmuk_ comborico1611: type "swapon"
jmerelo comborico1611: I would really appreciate if you did it. By doing so you will help other users.
comborico1611 timotimo: Not a big deal. I just dn't want to walk on egg shells trying to formulate a question that is suitable.
swapon :-) 17:16
stmuk_ actually the "free" command is more likely to exist 17:17
comborico1611 (I have it on my tab to look at later.)
-comborico 28 April 2018
stmuk_ what does the swap line in free say?
jmerelo comborico1611: just post it here as soon as you do it there, and we can help you improve it if it needs improvement. Anyway, you're bound to get it right sooner or later.
comborico1611 jmerelo: I'll consider it. 17:18
Zoffix (FWIW my earlier FWIW was for install of plain rakudo; dunno how long it takes star to install all the modules)
comborico1611 Thanks!
17:18 comborico1611 left
Zoffix AlexDaniel`! 17:18
:)
I fixed the numificator bug
stmuk_ Zoffix: its not that long 17:19
usually the delay is compiling interp (especially on old versions of clang) or compiling the setting (which warns about being slow before it does it) 17:20
Zoffix AlexDaniel`: oh, but it relies on that MoarVM fix. So I guess we'll need a MoarVM point release too 😬 17:21
stmuk_ this sounds like a specific environment issues (probably slow disk and swapping) to me 17:22
timotimo personally, i've had a good time with zram
stmuk_ I've found zram good on slow 2GB systems 17:23
timotimo i have a 4gb system that is so much more usable. actually, usable at all only because of it. though i haven't compared it with disk-based swap; there's only an ssd in there, too.
stmuk_ I'm quite liking manjaro on desktops (after years of debian/ubuntu) 17:25
Zoffix haha 17:26
timotimo i've been on fedora for a couple of years now
Zoffix Bodhi Linux FTW
timotimo i wanted to have a closer look at solus and elementary, but didn't get around to it yet
stmuk_ I always quite liked E17 17:27
timotimo is e17 in one of these mentioned distros?
stmuk_ I think bodhi uses it in some form? 17:28
17:28 sjoshi joined
Zoffix Yeah, it's called Moksha. Basically a fork of E17 after Bodhi's lead dev didn't like the direction E17 guys were going in 17:29
timotimo oh, their desktop system is a spiritual successor more or less
17:29 lizmat joined
timotimo the EFL always looked appealing to me from afar, i never actually did anything with any of their libraries 17:30
BBL
17:32 sjoshi left
jmerelo Zoffix: looks cool www.bodhilinux.com/ 17:44
El_Che debian upgrade went south on my 2gb 2008 ultra laptop, I may try one of the bsds :) 17:48
(I just use it a browser + termianl)
timotimo i use a bsd to hold my weechat and to this day i don't get the vertical or horizontal bars in chat windows :< 17:57
Kaiepi is it a good idea to put submodules in resources/ ? 18:15
18:15 Kaiepi left, Kaiepi joined
Kaiepi is it a good idea to put submodules in resources/ ? 18:16
timotimo hm, does git put a .git into the folder where a submodule is checked out, or does it live in the host's .git folder? 18:18
Kaiepi it makes a .git file instead of a folder 18:19
timotimo oh, cool
then it shouldn't be too bad
having a whole lot of files in there would have been bad for performance 18:20
if you really like pain, try using -I/home/your-home/ to see what i mean 18:21
Kaiepi er
there will be a lot of files, the submodule's rakduo
s/rakduo/rakudo/
timotimo oh! 18:22
Kaiepi what i'm really trying to do is make it possible to run the binary for the module anywhere i want, since i can't rely on relative paths 18:24
the only relative path i have is src/rakudo, which i chdir to 18:26
timotimo have you tried
m: say $*EXECUTABLE
camelia "./rakudo-m-inst/bin/perl6-m".IO
timotimo oh, that's relative, too
it's absolute on my system 18:27
Zoffix huggable: use FindBin
huggable Zoffix, nothing found
Zoffix huggable: FindBin
huggable Zoffix, use lib $*PROGRAM.sibling: '../lib'; # finds lib/ for scripts in bin/ or t/
Zoffix (so you'd adjust `../lib` to end up at the path you want that binary to load 18:28
)
Geth doc: 65c285c814 | (Luca Ferrari)++ | doc/Type/IO/Socket/INET.pod6
Place a try catch block in the socket example.

As for issue #1963 it seems that without the try-catch the loop can crash the server if the client does wait (sleep) or do something strange with the incoming data. Seems to me a flushing problem.
Tested on moar 2018.04.
synopsebot Link: doc.perl6.org/type/IO::Socket::INET
doc: 4ebcfc1501 | (Luca Ferrari)++ | doc/Type/X/TypeCheck/Splice.pod6
Merge branch 'master' of github.com:perl6/doc
synopsebot Link: doc.perl6.org/type/X::TypeCheck::Splice
18:28 zakharyas left
Kaiepi the bin file's in /home/morfent/.perl6/share/perl6/site/resources/EE3D9CE7067342F9D26B532AB9C8BD94E5ABAD8D 18:29
zef locate src/rakudo gives nothing
maybe there's something i can do at compile time 18:31
timotimo yeah, resources aren't a thing locate would find i don't think 18:32
Zoffix Ah, then yeah, you'd need to put it in resources. AFAIK you can't assume with installed modules that files are even files (they could all be installed as blobs in a database, for example)
it = the stuff you want the script to find
Kaiepi i'll give it a shot and see what happen 18:39
s
===> Install [FAIL] for RakudoBot:ver<0.0.1>: 'resources/rakudo' is a directory, cannot do '.open' on a directory 18:43
jmerelo These are perl6/doc issues by date, inclusing state → github.com/JJ/TPF-Grant/blob/maste...-state.png 18:47
18:48 AlexDaniel joined
jmerelo It's curious to see the gap at the beginning of 2016. And the huge number of issues in summer 2017 18:48
Month with the highest number of outstanding issues is February, but second one is that same summer '17 18:49
18:53 rindolf left 18:54 jmerelo left 18:55 rindolf joined
Kaiepi m: PROCESS::<RAKUDO_PATH> = '../src/rakudo'.IO; say $*RAKUDO_PATH 18:58
camelia Dynamic variable $*RAKUDO_PATH not found
in block <unit> at <tmp> line 1
18:59 darutoko left
Zoffix Missing sigil 18:59
m: PROCESS::<$RAKUDO_PATH> = '../src/rakudo'.IO; say $*RAKUDO_PATH
camelia "../src/rakudo".IO
Kaiepi oh
19:00 domidumont left
Kaiepi i think if i throw that in a BEGIN phaser that'll work 19:01
19:05 andrzejk_ joined 19:09 andrzejk_ left
Kaiepi ...nope, variable's undefined outside the block 19:09
19:11 dct joined 19:14 shlomif joined, andrzejk_ joined 19:15 rindolf left
Zoffix Kaiepi: "that'll work"... "that" is what? 19:16
19:17 HaraldJoerg joined
Kaiepi being able to chdir to the path from another module without having to run the package's binary from within its dir 19:17
19:17 HaraldJoerg1 left 19:18 shlomif is now known as rindolf, andrzejk_ left 19:19 khisanth__ left 19:22 andrzejk_ joined 19:25 siigl joined, siigl left 19:26 siigl joined, andrzejk_ left 19:27 TEttinger joined, siigl left 19:29 siigl joined, siigl left 19:30 andrzejk_ joined 19:31 siigl joined, siigl left 19:32 dct left 19:37 ryn1x joined, stmuk joined
ryn1x . 19:38
19:40 stmuk_ left
Kaiepi never mind, that won't work 19:42
19:43 pmurias left 19:44 dct joined
Zoffix Kaiepi: and the $*PROGRAM.sibling approach isn't suitable? 19:45
19:48 khisanth__ joined
Kaiepi nope 19:48
"/home/morfent/.perl6/share/perl6/site/bin/../src/rakudo".IO
19:48 andrzejk_ left
Zoffix too bad 19:50
19:52 andrzejk_ joined 19:59 zachk joined, zachk left, zachk joined 20:00 andrzejk_ left 20:05 andrzejk_ joined 20:11 Kaiepi left 20:14 andrzejk_ left 20:21 andrzejk_ joined 20:22 andrzej__ joined 20:24 andrzej__ left 20:26 andrzejk_ left 20:40 andrzejk_ joined 20:42 andrzejk_ left 20:47 andrzejk_ joined 20:48 ryn1x left 20:50 HaraldJoerg1 joined 20:51 HaraldJoerg left, andrzejk_ left 20:53 pilne joined, andrzejk_ joined 20:54 andrzejk_ left 21:01 andrzejk_ joined 21:10 wamba left 21:12 ryn1x joined 21:15 ryn1x left 21:20 rngoodn joined, rngoodn left 21:24 ryn1x joined 21:26 Kaiepi joined 21:28 andrzejk_ left 21:49 andrzejk_ joined 21:51 ryn1x left 21:53 Zoffix left 22:01 HaraldJoerg1 left 22:05 mr_ron joined
mr_ron Just commented on a facebook post in my news feed that might make some positive press for p6. Someone might want to post on Perl6 FB group. www.facebook.com/triplebyte/posts/...9753164267 22:10
timotimo i'm not sure it's a good look to post advertisements for companies on a public-seeming social media page of ours 22:11
then again, i never faced books, so i don't know what is normal over there 22:12
El_Che not readable without a facebook account, btw
timotimo oh, wait, i'm not seeing what they were talking about?
El_Che I only see a picture 22:13
then I huge joing the borg login screen 22:14
mr_ron m: say so (100+1.0/3)-100==1.0/3
camelia True
mr_ron It wouldn't hurt to like my comment ... just a thought. 22:17
s/comment/facebook comment about perl 6/
El_Che mr_ron: can not even read it ;) 22:20
MasterDuke mr_ron: done
22:24 dct left 22:26 sena_kun left
tobs The last two lines on this page seem broken: docs.perl6.org/syntax/our 22:35
(small stuff like that doesn't need an issue on github, right?)
lizmat tobs: please do :-) 22:39
tobs o7
22:41 Kaiepi left 22:44 Kaiepi joined 22:46 nooninm joined
buggable New CPAN upload: P5opendir-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 22:46
nooninm Hello. I do not understand why the second 'say' line below is not saying '1'.
The first line says 'ab' because we matched the word chars 'ab'.
To me, the second 'say' should say 1 because 'ab' is one element. 22:47
What am I missing?
> say ~$/ if "ab cd" ~~ /\w+/;
ab
> say ~$/.elems if "ab cd" ~~ /\w+/;
0
Thanks
lizmat m: dd $/ if "ab cd" ~~ /\w+/; 22:51
camelia Match $/ = Match.new(list => (), hash => Map.new(()), pos => 2, made => Any, from => 0, orig => "ab cd")
lizmat m: say $/ if "ab cd" ~~ /\w+/;
camelia 「ab」
lizmat m: say $/.elems if "ab cd" ~~ /\w+/;
camelia 0
lizmat hmmm 22:52
tobs m: say $/.elems if "ab cd" ~~ /(\w)+/
camelia 1
tobs the whole match doesn't count as a capture anymore, I think?
nooninm I did not use a capture
lizmat I'm wondering whether calling .elems on a Match object makes sense at all
tobs oh, I thought elems would count the captures 22:53
22:53 andrzejk_ left
nooninm This is an example from Think Perl 22:53
lizmat :-( # must have missed that then :-( 22:54
nooninm Page 115, 3/4 down the page
say "Word count = ", $/.elems if "I have a dream" ~~ m:g/ \w+/;
evalable6 Word count = 4
nooninm The above is the real line.
I wanted to know what wouldhappen if I took out the m:g 22:55
lizmat m: say "Word count = ", $/.elems if "I have a dream" ~~ m:g/ \w+/;
camelia Word count = 4
nooninm say "Word count = ", $/.elems if "I have a dream" ~~ / \w+/;
evalable6 Word count = 0
nooninm See, it puts out 0 instead of 1
22:55 dct joined
nooninm The 'I' should match, giving us one element. 22:57
lizmat .elems on a capture is defined as the number of positional captures 22:58
without the :g you don't have positional captures, just "the" capture
nooninm I don't know what a positional capture is.
The string "positional capture" does not appear in the book. 22:59
lizmat "foo" ~~ m/(o)/; dd $/.elems
evalable6 1
lizmat also known as $0 in this case
"foo" ~~ m/(o)/; dd $0
evalable6 Match.new(list => (), hash => Map.new(()), orig => "foo", from => 1, pos => 2, made => Any)
lizmat "foo" ~~ m/(o)/; dd ~$0 23:00
evalable6 "o"
23:00 Kaiepi left 23:01 Kaiepi joined
nooninm What is that 'dd'? 23:01
lizmat nooninm: (positional) captures as opposed to named captures
dd is the tiny data dumper, so small, it lost it t
it's a debugging tool in rakudo 23:02
nooninm The 'I' then is in the zeroeth position? Is that what it means?
lizmat it's basically "note foo.perl" with some bells and whistles
nooninm I mean, the captured 'I' is the zeroeth thing captured, if zeroeth is a word.
Is that what you mean? 23:03
lizmat yes, and they would be available as $0, $1, $2 and $3 as well
nooninm Okay, that makes sense.
thanks, guys
gals
lizmat m: say "Word count = ", (@$/).elems if "I have a dream" ~~ m:g/ \w+/; dd ~$0, ~$1, ~$2, ~$3
camelia Word count = 4
"I"
"have"
"a"
"dream"
lizmat m: say "Word count = ", (@$/).elems if "I have a dream" ~~ m/ \w+/; dd ~$0, ~$1, ~$2, ~$3 # without :g 23:04
camelia Word count = 0
Use of Nil in string context
in block <unit> at <tmp> line 1
Use of Nil in string context
in block <unit> at <tmp> line 1
Use of Nil in string context
in block <unit> at <tmp> line 1
Use of Nil in string context
lizmat nooninm: you're welcome 23:05
nooninm I tried it. It printed out a nil for each element matched
Bye
23:05 nooninm left 23:06 nooninm joined, nooninm left 23:18 rindolf left 23:21 dct left 23:28 comborico1611 joined 23:30 nooninm joined
nooninm I am going to put <crlf> at the end of each line. Hope it works. 23:30
This still is not making sense.<crlf> Page 115 of Think Perl, 3/4 down the page.<crlf> <crlf> say "Word count = ", $/.elems if "I have a dream" ~~ m:g/ \w+/;<crlf> Word count = 4<crlf> <crlf> The '4' is the number of elements. That is, the number of words.<crlf> So now if I merely take out the m:g, I should get just a single match,<crlf> that being for the word 'I', resulting in a total of 1 elements.<crlf> But I don't. I get a '0'
No, it did not. I'll have to paste each line, one at a time.
This still is not making sense. Page 115 of Think Perl, 3/4 down the page. 23:31
say "Word count = ", $/.elems if "I have a dream" ~~ m:g/ \w+/;
evalable6 Word count = 4
nooninm Word count = 4
Wait ... 8 more lines to paste
The '4' is the number of elements. That is, the number of words.
So now if I merely take out the m:g, I should get just a single match,
that being for the word 'I', resulting in a total of 1 elements. 23:32
But I don't. I get a '0' instead, as though nothing got matched.
Can someone explain this again?
say "Word count = ", $/.elems if "I have a dream" ~~ / \w+/;
evalable6 Word count = 0
nooninm Word count = 0
Okay, so there is my question.
Why is there not at least 1 match (and hence element) without the :g? 23:33
jnthn m: "I have a dream" ~~ m:g/ \w+/; say $/.WHAT
camelia (List)
jnthn m: "I have a dream" ~~ m/ \w+/; say $/.WHAT
camelia (Match)
jnthn With :g $/ is set to a List of Match objects, so .elems means "how many things are in that list" 23:34
Whereas without :g $/ is set to the one Match that happened. .elems on that is talking about the number of things captured within that Match.
nooninm But I am not capturing anything with the :g or without the :g. 23:35
So with the :g I get '4', with no capturing 23:36
There should still be 1 thing matched. \w+ should match the first I 23:38
jnthn Yes, the :g means that $/ contains a list of all the things matched, whereas without :g it contains the matched thing.
It did match it
m: "I have a dream" ~~ m/ \w+/; say $/.Str
camelia I
comborico1611 nooninm: Let me go upstairs and get my copy of the book. I was just reviewing this last week. 23:39
nooninm If it matched it, there is 1 element.
Okay
jnthn Without :g there is not a List, just the one thing that was matched
nooninm Are you saying that elems works only on a list, and that elems on something that is not a list will return 0? 23:40
jnthn I'm saying that elems on an individual Match means how many things it captured 23:42
m: "I have a dream" ~~ m:g/ (\w) \w+/; say $/[1]
camelia 「dream」
0 => 「d」
jnthn m: "I have a dream" ~~ m:g/ (\w) \w+/; say $/.elems; say $/[1].elems 23:43
camelia 2
1
jnthn And without the :g
m: "I have a dream" ~~ m/ (\w) \w+/; say $/.elems 23:44
camelia 1
jnthn m: "I have a dream" ~~ m/ (\w) \w+/; say $/[0]
camelia 「h」
jnthn Well, that's boring since it's just a one letter word
m: "We have a dream" ~~ m/ (\w) \w+/; say $/[0]
camelia 「W」
comborico1611 nooninm: What page? 115 didn't seem to be right.
(warning: I'm a massive newbie.) 23:45
nooninm I have 115
1st Edition, Version 0.5.0 May 2017
comborico1611 Same
p.115 3/4 down... my $fruit = "banana"; 23:46
nooninm Counting the first however many Roman Numeral pages, it is page 135 of 431
comborico1611 K
nooninm Your page 115 is my page 104
Try down 11 pages 23:47
Just before 7.7.8 Exercises on Regexes
comborico1611 I see it.
nooninm BTW: jnthn, you are cheating by having () doing the capturing 23:48
Read: smile
comborico1611 I have a note.
Elems used but not taught until p.156
23:48 markong left
nooninm Okay. I am taking up your time. I will hold off until I get that far. 23:48
comborico1611 I'm like you. I must understand each thign that enters the code. 23:49
Let me review what you've written to jnth and see if I can get you an answer.
MasterDuke jnthn: i see how that makes sense (Match.elems returning the number of captures), but it does sort of conflict with how almost anything else not Positional/Associative will just give 1 for .elems (e.g., Int.elems, IO::Path.elems) 23:50
nooninm I just found where the book says "The elems function or method returns the number of elements of an array". 23:51
Therefore it might not make sense for elems to be used at all with something that is not an array.
I just used it because when reading this kind of book I tend to make changes just to see what happens. 23:52
The book did not try to do it without the :g. I did. Just me.
comborico1611 nooninm: I have another note. "m", as in the m:, is called Regex Match Operator. 23:54
just fyi.
nooninm ok
comborico1611 I'm needing to review this because I'm not remember squat. lol
nooninm With the new elems knowledge I think I'll just sign off. I'll remember it is just for arrays. 23:55
comborico1611 Fair enough.
Hey!
Check out perl6intro.com
I am finding it VERY useful.
nooninm Okay. I can do that in parallel. I am retired, and this is how I am putzing 23:56
comborico1611 Very good! You're a smart one, I'm sure.
nooninm Thakns.. Bye
comborico1611 Bye now!
23:56 nooninm left