Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-23

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:03 sufrostico joined #perl6
00:05 dalek joined #perl6
00:21 aindilis joined #perl6
00:31 Actualeyes joined #perl6
00:49 pierre_ joined #perl6
00:50 aries_liuxueyang joined #perl6
00:53 cpage_ joined #perl6
00:56 lambd0x joined #perl6
00:56 lambd0x Hi everyone!
00:57 lambd0x m: say 'ye' if 'properly' ~~ m/ perl /;
00:57 camelia rakudo-moar 3af93c: OUTPUT«ye␤»
00:57 lambd0x m: say 'ye' if 'properly' ~~ /perl/;
00:57 camelia rakudo-moar 3af93c: OUTPUT«ye␤»
00:57 lambd0x for what m/ stands for?
00:59 skids m: given "properly" { m/(perl)/; $0.say }
00:59 camelia rakudo-moar 3af93c: OUTPUT«「perl」␤»
00:59 skids m: given "properly" { /(perl)/; $0.say }
00:59 camelia rakudo-moar 3af93c: OUTPUT«「perl」␤»
01:00 skids hrmf.
01:00 mcmillhj joined #perl6
01:01 lambd0x skids: interesting though.
01:01 cpage_ joined #perl6
01:06 cpage_ joined #perl6
01:11 skids Well, I guess at least it provides something to anchor adverbs that cannot be inside the //.  Like m:g//
01:11 skids m: ("foofoofoo" ~~ m:g/foo/).say
01:11 camelia rakudo-moar 3af93c: OUTPUT«(「foo」 「foo」 「foo」)␤»
01:11 skids m: ("foofoofoo" ~~ m/:g foo/).say
01:11 camelia rakudo-moar 3af93c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unrecognized regex modifier :g␤at <tmp>:1␤------> 3("foofoofoo" ~~ m/:7⏏5g foo/).say␤»
01:13 lambd0x skids: well, at least it's there, right? :P
01:13 BenGoldberg joined #perl6
01:20 mcmillhj joined #perl6
01:29 canopus joined #perl6
01:35 telex joined #perl6
01:43 Ben_Goldberg joined #perl6
01:45 mcmillhj joined #perl6
01:46 sili joined #perl6
02:02 sufrostico joined #perl6
02:03 pierre_ joined #perl6
02:04 pierre_ joined #perl6
02:08 noganex joined #perl6
02:14 NSGFK joined #perl6
02:15 NSGFK Can I compile perl6 to exe?
02:15 NSGFK :S
02:15 jdv79 not yet
02:16 NSGFK Any idea when
02:16 NSGFK Also will I require a .dll with it?
02:17 bioduds I have a perl6 that runs by shell another perl6, im trying to fetch the say result in a var
02:17 bioduds im getting this: Proc<62046800>
02:17 bioduds I dont understand
02:21 MasterDuke bioduds: sounds like you're getting the .perl of thing you're running (or maybe its default stringification), not its output
02:21 bioduds any ideas how should I proceed?
02:22 bioduds I basically want to run another perl6 script with shell and load the say result from it in my var
02:24 MasterDuke are you passing :out to shell?
02:24 geekosaur the result of shell is not the command output; use the :out adverb
02:24 Dunearhp joined #perl6
02:25 bioduds let me try the :out
02:26 geekosaur "The return value is of type Proc."
02:26 bioduds where should it go? shell "perl6 myperl.pl":out ?
02:27 geekosaur https://docs.perl6.org/type/Proc
02:28 geekosaur my $cmd = shell shell "perl6 myperl.pl", :out; my $res = $cmd.out.slurp-rest;
02:28 MasterDuke m: my $p = shell q|perl6 -e "say 5"|, :out; say $p.out.slurp-rest
02:28 camelia rakudo-moar 3af93c: OUTPUT«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␤␤»
02:29 bioduds worked
02:29 bioduds great
02:29 bioduds thanks
02:29 bioduds btw
02:29 bioduds i also got it with QX("perl6 myperl.pl")
02:30 bioduds though i don't know what QX is
02:30 MasterDuke welcome
02:30 bioduds steep curve Perl6 :)
02:31 MasterDuke https://docs.perl6.org/syntax/qx
02:31 MasterDuke slightly modified from Perl 5
02:33 wamba joined #perl6
02:33 mcmillhj joined #perl6
02:34 bioduds I was interested in the adverb term
02:35 MilkmanDan joined #perl6
02:35 MasterDuke which adverb term? of what?
02:37 jdv79 NSGFK: i have no idea.  in general i don't believe its a priority at all.
02:37 AndyBotwin joined #perl6
02:39 bioduds man, simple thing Im not being able to do, simple split into an array
02:40 bioduds wouldnt it be my @array = $val.split( " " );
02:43 bioduds ops, my bad
02:43 bioduds never mind that
02:48 dalek whateverable: 86f44b6 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (5 files):
02:48 dalek whateverable: Bye-bye Perl 5 bots
02:48 dalek whateverable:
02:48 dalek whateverable: We strive to increase the amount of dog food in our diet, so Perl 5 variants of
02:48 dalek whateverable: the bots have to go.
02:48 AlexDaniel dalek :P
02:49 dalek joined #perl6
02:49 mcmillhj joined #perl6
02:50 nicq20 joined #perl6
02:52 dj_goku joined #perl6
02:53 cpage_ joined #perl6
02:53 NSGFK /j #security
02:55 bioduds anyone knows how to create a set from a string?
02:56 bioduds i want my $set = set < $myString >;
02:58 bioduds $myString would be "one two three"
03:00 rkazak joined #perl6
03:00 _slade_ my $set = set($myString.words);
03:00 MasterDuke m: my $a = "a b c"; my $set = set <<$a>>; say $set
03:00 camelia rakudo-moar 3af93c: OUTPUT«set(a, c, b)␤»
03:02 dalek whateverable: 65c5f4a | (Aleks-Daniel Jakimenko-Aleksejev)++ | build.p6:
03:02 dalek whateverable: Misplaced comment
03:02 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/65c5f4a19c
03:02 dalek whateverable: d28bc62 | (Aleks-Daniel Jakimenko-Aleksejev)++ | build.p6:
03:02 dalek whateverable: build.p6 should probably have a license notice too
03:02 dalek whateverable:
03:02 dalek whateverable: Same license as the rest of the project. If you need this code to come under
03:02 dalek whateverable: something less restrictive, contact me and we will figure it out.
03:02 dalek whateverable: review: https://github.com/perl6/wha​teverable/commit/d28bc629ad
03:03 bioduds cool MasterDuke, you're The Man! thanks
03:03 mcmillhj joined #perl6
03:04 AlexDaniel m: my $x = ‘hello world’; dd «$x»
03:04 camelia rakudo-moar 3af93c: OUTPUT«slip("hello", "world")␤»
03:04 MasterDuke np, glad to help
03:04 AlexDaniel m: my $x = ‘hello world’; dd <$x>
03:04 camelia rakudo-moar 3af93c: OUTPUT«"\$x"␤»
03:04 AlexDaniel m: my $x = ‘hello world’; dd «"$x"»
03:04 camelia rakudo-moar 3af93c: OUTPUT«"hello world"␤»
03:04 AlexDaniel right
03:07 TEttinger joined #perl6
03:16 mcmillhj joined #perl6
03:22 pdcawley_ joined #perl6
03:22 pierre_ joined #perl6
03:40 harmil joined #perl6
03:41 harmil m: class A { multi method new($a) { say "positional" } }; class B is A { multi method new($a) { nextsame $a } }; say B.new(1)
03:41 camelia rakudo-moar 3af93c: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in method new at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
03:41 harmil Isn't that supposed to work?
03:45 AlexDaniel m: class A { multi method new($a) { say "positional" } }; class B is A { multi method new($a) { nextsame } }; say B.new(1)
03:45 camelia rakudo-moar 3af93c: OUTPUT«positional␤True␤»
03:45 AlexDaniel m: class A { multi method new($a) { say "positional" } }; class B is A { multi method new($a) { nextwith $a } }; say B.new(1)
03:45 camelia rakudo-moar 3af93c: OUTPUT«positional␤True␤»
03:47 harmil Ah, that makes more sense.
03:47 mcmillhj joined #perl6
03:55 cyphase joined #perl6
03:56 pierre_ joined #perl6
04:00 pierre_ joined #perl6
04:06 mcmillhj joined #perl6
04:14 tadzik joined #perl6
04:15 Cabanossi joined #perl6
04:17 woodruffw joined #perl6
04:18 woodruffw joined #perl6
04:18 woodruffw joined #perl6
04:19 woodruffw joined #perl6
04:20 ilbelkyr joined #perl6
04:29 cibs joined #perl6
04:39 cibs joined #perl6
04:41 nine Good morning #perl6!
04:42 * nine is on his way and very much looking forward to Cluj
04:51 dalek ecosystem: 332f7ba | (Sterling Hanenkamp)++ | META.list:
04:51 dalek ecosystem: Add DOM::Tiny to the ecosystem
04:51 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/332f7baf39
04:58 mcmillhj joined #perl6
05:07 Xliff \o nine
05:07 * Xliff is bored again.
05:07 Xliff .seen moritz
05:07 yoleaux I saw moritz 22 Aug 2016 18:12Z in #perl6: <moritz> just like .comb(regex) looks for matches of the regex
05:09 Xliff .seen FROGGS
05:09 yoleaux I saw FROGGS 31 Jul 2016 18:32Z in #perl6: <FROGGS> if you click on the Perl 6 caption you can look at other examples
05:09 faubi joined #perl6
05:19 M-Illandan joined #perl6
05:20 Matthew[m] joined #perl6
05:28 inokenty joined #perl6
05:29 mcmillhj joined #perl6
05:35 harmil Well, it's still VERY much a work in progress, and I don't have the panda metadata yet, but my numeric sequences module is now on github: https://github.com/ajs/perl6-Math-Sequences/b​lob/master/lib/Math/Sequences/Integer.pm#L136
05:37 harmil I have to admit that being able to say "@A000040 is export = lazy ℕ.grep: {.is-prime};" was pretty nifty.
05:45 harmil Well, I'm off to bed. Night all
05:46 mcmillhj joined #perl6
05:49 lizmat joined #perl6
05:51 * lizmat clickbaits https://p6weekly.wordpress.com/2016/0​8/22/2016-34-a-quick-botch-from-cluj/
05:54 * lizmat waves from http://act.yapc.eu/ye2016/training-jeff.html
06:06 ufobat joined #perl6
06:09 nadim_ joined #perl6
06:12 woolfy joined #perl6
06:30 firstdayonthejob joined #perl6
06:34 mcmillhj joined #perl6
06:36 neuron joined #perl6
06:37 neuron Hi
06:37 CIAvash joined #perl6
06:37 neuron p6: grammar X { rule TOP { <bit>* }; rule bit { . } }; say so X.parse('abc');
06:37 camelia rakudo-moar 3af93c: OUTPUT«False␤»
06:37 neuron hmmm
06:38 neuron p6: "grammar X { rule TOP { <bit>* }; rule bit { . } }; say so X.parse('abc');"
06:38 camelia rakudo-moar 3af93c: OUTPUT«Potential difficulties:␤    Useless declaration of a has-scoped method in mainline (did you mean 'my rule TOP'?)␤    at <tmp>:1␤    ------> 3"grammar X { rule 7⏏5TOP { <bit>* }; rule bit { . } }; say so␤    Useless declaration of a has-scoped…»
06:38 neuron Anyway, that says False and I can't find out why :)
06:38 neuron It has to be something stupid but I don't see it
06:39 neuron p6: grammar X { rule TOP { <bit>* }; rule bit { . } }; say so X.parse('abc');
06:39 camelia rakudo-moar 3af93c: OUTPUT«False␤»
06:39 lizmat m: grammar X { rule TOP { <bit>* }; rule bit { . } }; say X.parse('abc');
06:39 camelia rakudo-moar 3af93c: OUTPUT«Nil␤»
06:40 neuron If I use 'token bit { . }' it seems to work
06:40 lizmat then use that  :-)   seriously, I'm still not really up to speed with grammars yet  :-(
06:40 neuron The documentation says that difference between token and rule is the use of 'sigspace'
06:41 neuron no problems lizmat, you are not obliged to give me answer :)
06:46 CIAvash m: grammar X { rule TOP { <bit>* }; rule bit { .} }; say so X.parse('abc');
06:46 camelia rakudo-moar 3af93c: OUTPUT«True␤»
06:46 mcmillhj joined #perl6
06:47 CIAvash neuron: ↑ read this section https://docs.perl6.org/lang​uage/regexes.html#Sigspace
06:48 neuron Ah! There's space beyond the dot!
06:48 neuron That didn't occure to me, thanks!
06:49 neuron CIAvash++
06:49 domidumont joined #perl6
06:54 domidumont joined #perl6
06:57 lizmat TIL  CIAvash++
07:07 mcmillhj joined #perl6
07:08 CIAvash lizmat++ # weekly
07:15 darutoko joined #perl6
07:25 mcmillhj joined #perl6
07:27 rindolf joined #perl6
07:35 mcmillhj joined #perl6
07:39 sno joined #perl6
07:44 g4 joined #perl6
07:47 zakharyas joined #perl6
07:48 bob777 joined #perl6
07:56 smls joined #perl6
08:00 * smls tried a code golf: http://codegolf.stackexchange.com/a/90748/14880
08:00 smls a bit shorter than Python, but can't compete with the dedicated code golf languages... :)
08:00 moritz \o
08:01 smls hi moritz
08:01 bjz joined #perl6
08:07 mcmillhj joined #perl6
08:11 nadim_ ugexe: nice detective work
08:13 TheLemonMan joined #perl6
08:15 bob777 joined #perl6
08:22 mcmillhj joined #perl6
08:22 Xliff \o moritz
08:22 Xliff Think I have a working implementation of Bubble Plots for SVG::Plot
08:23 moritz \o/
08:23 Actualeyes joined #perl6
08:24 Xliff Yeah, so just glance over the PRs or I can just merge 'em. Wanted to make sure the code looked right before I started pushing to origin/master of someone else's repository. =)
08:25 moritz Xliff: please just push. Forgiveness > Permission, Working Code > Pretty Code :-)
08:34 ufobat hi moritz
08:36 moritz \o ufobat
08:37 auoeuau joined #perl6
08:37 nebuchadnezzar hello, back from holidays, I saw that rakudo 2016.07.1 does not build on arm64, I don't have direct access to this kind of machine, do you have any idea about “Makefile:502: recipe for target 'm-coretest5' failed” (https://buildd.debian.org/status/fetc​h.php?pkg=rakudo&amp;arch=arm64&amp;v​er=2016.07.1-1&amp;stamp=1469459065)
08:39 nebuchadnezzar domidumont: hello
08:49 st_iron joined #perl6
08:49 st_iron hey
08:52 sno left #perl6
08:52 moritz nebuchadnezzar: hm, it says E: Caught signal ‘Terminated’: terminating immediately
08:53 moritz no idea where that signal comes from
08:53 moritz the output from the tests looks fine
08:54 espadrine joined #perl6
08:55 mcmillhj joined #perl6
09:08 jonas1 joined #perl6
09:26 lizmat_ joined #perl6
09:26 Xliff moritz: I'll remember you said that. Remember: You are on record. Mu-ahahahahahahahahaha! ]8-)
09:26 dalek joined #perl6
09:27 pierre_ joined #perl6
09:28 timotimo Build killed with signal TERM after 150 minutes of inactivity
09:28 timotimo that seems to have caused that signal?
09:29 xdbr joined #perl6
09:32 bjz_ joined #perl6
09:34 mcmillhj joined #perl6
09:35 nebuchadnezzar ok, maybe some test are too long or a command is hanging, then the build process kill it after a timeout
09:35 timotimo probably
09:36 nebuchadnezzar thanks, I did not realize it
09:37 skrshn joined #perl6
09:38 skrshn Newbie here. I wrote one of my first perl6 code here (https://gist.github.com/skrisna/d​cd9ee962ff7f53cba2843a8704a7dfa). Am I following the right perl6 idioms?
09:39 timotimo your usage of "when" is a bit different from what the idiom would be
09:40 timotimo "when 1234" is more like "if $_ ~~ 1234"
09:40 timotimo so you're ending up testing $_ against True or False each time
09:40 timotimo that does work, because a smart match against True always succeeds and a smart match against False always fails
09:41 timotimo but it's strange in general
09:41 timotimo the solution would be to use $_ instead of $p, or to use if instead of when.
09:41 timotimo actually, i wouldn't recommend using $_ + when here at all, because you're checking $p[0] and $p[1] and such
09:41 skrshn But $p is an array
09:42 skrshn timotimo: thanks
09:42 timotimo oh, you could also write "for @hyp Z @ref -> ($left, $right) { ... } and use $left and $right instead of $p[0] and $p[1]
09:42 nebuchadnezzar timotimo: doesn't the “when” stop at first match?
09:43 timotimo that's right
09:43 timotimo there'd have to either be "elsif"s or "succeed" in the curlies
09:44 skrshn I like the ($left, $right) a lot.
09:45 * smls thinks using `when` is fine even with expressions that don't operate, if the short-circuiting behavior is what you want
09:45 smls *operate on $_
09:45 smls In fact, isn't that the whole reason why True always smart-matches positively?
09:45 skrshn In this case, I guess that was what I wanted
09:46 mcmillhj joined #perl6
09:46 timotimo smls: you're probably right
09:46 RabidGravy joined #perl6
09:47 smls What irks me more are the `.get()` instead of `.get`
09:47 smls ;)
09:47 timotimo to me, that's "maximum *shrug*" ;)
09:48 jnthn Alternatively, you might be able to do it like: for @hyp Z @ref { when ('*', Any) { }; when (Any, '*') { }; when [eq] .[0,1] { }; default { } }
09:48 jnthn or even [eq] .[] would work I guess :)
09:49 timotimo aye
09:49 skrshn I updated the script
09:50 timotimo the + on either side of the == between @hyp and @ref is redundant, but it can be helpful to show the reader what is meant
09:51 skrshn jnthn: I don't follow what you said
09:51 Xliff Good night #perl6.
09:51 Xliff o7
09:52 gregf_ >> say [eq] [1,3]
09:52 gregf_ m: say [eq] [1,3]
09:52 camelia rakudo-moar 2181f7: OUTPUT«False␤»
09:53 skrshn Xliff_zzz: In "for @hyp Z @ref { when ('*', Any) { };..." what does when('*',Any) do?
09:53 gregf_ m: @a = [1..4]; +@A.say
09:53 camelia rakudo-moar 2181f7: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5@a = [1..4]; +@A.say␤»
09:54 jnthn $_ will contain a 2-element array (something from @hyp, something from @ref). And it just pattern matches against the array
09:54 jnthn when ('*', Any) { } means "When the first element is a * and the second element is anything"
09:55 skrshn wow
09:55 skrshn got it. thanks
09:56 skrshn How would I interpret this: when [eq] .[0,1] ?
09:57 moritz when .[0] eq .[1]
09:57 gregf_ m: my @a = [4,4..10]; say [eq] .[0,1] #
09:57 camelia rakudo-moar 2181f7: OUTPUT«Use of uninitialized value $v of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.  in block <unit> at <tmp> line 1␤Use of uninitialized value $v of type Any in string context.␤Meth…»
09:57 skrshn I guess this is easier for me: when $_[0] eq $_[1]
09:57 skrshn Ok. thakns
09:57 moritz m: $_ = [4,4..10]; say [eq] .[0,1]
09:57 camelia rakudo-moar 2181f7: OUTPUT«False␤»
09:58 moritz m: $_ = [4,flat 4..10]; say [eq] .[0,1]
09:58 camelia rakudo-moar 2181f7: OUTPUT«False␤»
09:58 cibs joined #perl6
09:58 moritz m: $_ = [flat 4, 4..10]; say [eq] .[0,1]
09:58 camelia rakudo-moar 2181f7: OUTPUT«True␤»
09:58 skrshn Ok. Updated the script.
10:01 nebuchadnezzar Is this the good way to define “$_” in a sub or method: sub test(Str $_) { when "*" { say "match"; } } ?
10:01 skrshn thanks for all your help. I am happy with this script.
10:01 timotimo yeah, that's fine
10:01 timotimo skrshn: glad to hear it :)
10:02 jnthn nebuchadnezzar: You can do that, sure
10:02 timotimo you can put all variable definitions into the signature, give them a default value, and a constraint that makes them explode if the user of your sub supplies anything :D
10:10 gnull` joined #perl6
10:16 skrshn Q: Is "+@hyp == +@ref or die;" the best idiom or is there something comparable to "assert(+@hyp, +@ref)" ?
10:17 nadim_ joined #perl6
10:17 timotimo that's fine, though a message to go with the "die" would be helpful usually
10:17 skrshn yes. I would normally have one too.
10:17 skrshn tx
10:18 timotimo np
10:22 moritz skrshn: often enough you get around using such assertion by putting it as a type constraint in a routine you call
10:24 skrshn If I were to process @hyp and @ref out of the method/subroutine, how would I add this constraint?
10:24 moritz sub munge(@hyp, @ref where { @ref.elems == @hyp.elems }) { ... }
10:25 skrshn ok
10:25 CIAvash skrshn: You can probably replace the while loop with this: for 'data.txt'.IO.lines.grep(*.so) -> $id, $hyp, $ref { $acc.add($hyp, $ref); }
10:25 skrshn so the where is referring to @ref correct?
10:26 skrshn nice!
10:28 jonas1 joined #perl6
10:30 skrshn what does the grep(*.so) do ?
10:30 margeas joined #perl6
10:31 moritz exclude values that are False in boolean context
10:31 skrshn updated the script
10:31 moritz so, empty lines
10:31 skrshn oh.. I knew that!
10:32 skrshn I hadn't seen *.so getting used like this before
10:33 skrshn I am still wrapping my head around how *.so works. I saw in some talk that it effectively is like a method or something
10:34 moritz *.so is basically the same as { $_.so }
10:34 moritz so a code block that calls the "so" method on the argument you pass to it
10:34 skrshn moritz: tx
10:36 jnthn .grep(* ne '') may be more easy to understand than *.so
10:36 jnthn *easier
10:36 moritz or .grep(*.elems)
10:36 moritz erm, *.chars
10:37 moritz or *.chars > 0
10:46 literal .grep(?*)
10:47 moritz m: say ?*
10:47 camelia rakudo-moar 2181f7: OUTPUT«{ ... }␤»
10:47 literal m: say <foo 0 baz>.grep(?*)
10:47 camelia rakudo-moar 2181f7: OUTPUT«(foo baz)␤»
10:47 literal m: say <foo 0 baz>.grep(!*)
10:47 camelia rakudo-moar 2181f7: OUTPUT«(0)␤»
10:51 lambd0x joined #perl6
10:51 lambd0x Hello everyone!
10:51 timotimo greetings lambd0x
10:52 lambd0x timotimo: \o/. U don't sleep man haha
10:52 timotimo but i do
10:52 timotimo some would say i sleep too much :)
10:52 woolfy joined #perl6
10:53 lambd0x timotimo: 'nd I would say you don't, As much as I'm in #perl6 you're always there :P
10:53 timotimo i blame time zones
10:54 lambd0x timotimo: You're from Portugal. right?
10:54 timotimo nope, germany
10:54 lambd0x hm...
10:54 woolfy joined #perl6
10:54 lambd0x Then I agree with ya.
10:55 woolfy joined #perl6
10:55 woolfy left #perl6
10:58 pierre_ joined #perl6
10:58 lambd0x why seems that () have more meaning than {} for the ternary op.?
10:59 timotimo huh?
10:59 mephinet_ joined #perl6
11:00 lambd0x m: my a$ = 1, my $b = 2; $max != 0 ?? ($a += 1) !! ($b -= b);
11:00 camelia rakudo-moar 2181f7: OUTPUT«5===SORRY!5===␤Type 'a' is not declared␤at <tmp>:1␤------> 3my a7⏏5$ = 1, my $b = 2; $max != 0 ?? ($a += 1)␤Malformed my␤at <tmp>:1␤------> 3my7⏏5 a$ = 1, my $b = 2; $max != 0 ?? ($a += ␤␤»
11:00 lambd0x m: my a$ = 1, my $b = 2; $max != 0 ?? ($a += 1) !! ($b -= 1);
11:00 camelia rakudo-moar 2181f7: OUTPUT«5===SORRY!5===␤Type 'a' is not declared␤at <tmp>:1␤------> 3my a7⏏5$ = 1, my $b = 2; $max != 0 ?? ($a += 1)␤Malformed my␤at <tmp>:1␤------> 3my7⏏5 a$ = 1, my $b = 2; $max != 0 ?? ($a += ␤␤»
11:00 lambd0x m: my a$ = 1, my $b = 2; $a != 0 ?? ($a += 1) !! ($b -= 1);
11:00 camelia rakudo-moar 2181f7: OUTPUT«5===SORRY!5===␤Type 'a' is not declared␤at <tmp>:1␤------> 3my a7⏏5$ = 1, my $b = 2; $a != 0 ?? ($a += 1) !␤Malformed my␤at <tmp>:1␤------> 3my7⏏5 a$ = 1, my $b = 2; $a != 0 ?? ($a += 1)␤␤»
11:00 TimToady a$ ?
11:00 lambd0x hahah
11:00 TimToady BASIC
11:01 lambd0x m: my $a = 1, my $b = 2; $a != 0 ?? ($a += 1) !! ($b -= 1);
11:01 camelia rakudo-moar 2181f7: ( no output )
11:01 lambd0x any way...
11:01 lambd0x In my code I just used a ternary ope. with {} for each condition action and it rathered to have ()
11:02 TimToady well, a bare closure inside an expression doesn't run
11:02 lambd0x in fact, it didn't work in other way.
11:02 TimToady m: my $x = { say "doesn't run" }
11:02 camelia rakudo-moar 2181f7: ( no output )
11:03 lambd0x TimToady: timotimo's nick gets preference over your nick for the first three chars hahah
11:05 lambd0x TimToady: I just asked about it because usually if there's a conditional and for that condition you want more operations to be performed you would use {}
11:05 lambd0x It's nice to know though.
11:06 TimToady nap &
11:07 lambd0x ?
11:08 timotimo he says he's going to take a nap
11:09 lambd0x timotimo: I'm using IRC for 2 months now, so I'm still learning a ton of abrvs. :P
11:09 lambd0x thanks
11:10 timotimo no problem; the "something &" thing comes from unix shells, though
11:10 timotimo where you'd start something with an & at the end to "run it in the background"
11:12 lambd0x timotimo: nice
11:15 lambd0x multi declaration in front of a sub means it can have more than one scope depending whether its signature is matched for one or the other, if appliable?
11:17 lambd0x I was reading about optional args for subs and was thinking if apart from recursive subs, since there's the option to make optional a parameter and therefore matching different signs., the first would have other uses ...
11:19 lizmat_ m: multi a(Int $a) { say "Int" }; multi a(Str $a) { say "Str" }; a 42; a "foo"   # lambd0x: does this answer your question?
11:19 camelia rakudo-moar 2181f7: OUTPUT«Int␤Str␤»
11:21 lizmat $ RAKUDO_ERRORS_AS_JSON=1 6 'die "foo"'
11:21 lizmat {
11:21 lizmat "X::AdHoc" : {
11:21 lizmat "payload" : "foo"
11:21 lizmat }
11:21 lizmat }
11:21 lizmat El_Che: ^^^ is that what you wanted in errors as JSON ?
11:22 lambd0x lizmat: ye, thanks.
11:37 Actualeyes joined #perl6
11:39 mcmillhj joined #perl6
11:41 dalek doc: b9e4c2a | (Tom Browder)++ | / (3 files):
11:41 dalek doc: Changes to files:
11:41 dalek doc:
11:41 dalek doc: doc/Type/IO/Handle.pod6
11:41 dalek doc:   + add brief description of 'printf'; reference
11:41 dalek doc:     format details in 'doc/Type/Str.pod6'
11:41 dalek doc:
11:41 dalek doc: doc/Type/Str.pod6
11:41 dalek doc:   + move 'printf' format details to 'sprintf'
11:41 dalek doc:   + remove 'printf' function and move it to 'doc/Type/IO/Handle.pod6'
11:41 dalek doc:
11:41 dalek doc: xt/trailing-whitespace.t
11:41 dalek doc:   + add line number for the affected file
11:41 dalek doc: review: https://github.com/perl6/doc/commit/b9e4c2a5be
11:41 dalek doc: 44d7b22 | (Tom Browder)++ | / (3 files):
11:41 dalek doc: Merge pull request #855 from tbrowder/sprintf
11:41 dalek doc:
11:41 dalek doc: Changes to files:
11:41 dalek doc: review: https://github.com/perl6/doc/commit/44d7b228b9
11:42 pmurias joined #perl6
11:52 mcmillhj joined #perl6
11:58 nadim_ joined #perl6
12:00 Roamer` joined #perl6
12:00 prammer joined #perl6
12:01 cyphase joined #perl6
12:02 Roamer` hmm, is there some gather/take-related weirdness when you map() within a map() ?
12:02 Roamer` like this... a single-level map:
12:02 Roamer` m: use v6.c; my %data = :a(1), :b(2); my $res = gather { %data.keys.map(-> $k { take [$k, %data{$k}] }) }; dd $res;
12:02 camelia rakudo-moar 2181f7: OUTPUT«Seq $res = (["a", 1], ["b", 2]).Seq␤»
12:03 Roamer` two levels, but only one map:
12:03 Roamer` m: use v6.c; my %data = :foo({:a(1), :b(2)}); my $res = gather { for %data.keys -> $section { %data{$section}.keys.map(-> $k { take [$section, $k, %data{$section}{$k}] }) } }; dd $res;
12:03 camelia rakudo-moar 2181f7: OUTPUT«Seq $res = (["foo", "a", 1], ["foo", "b", 2]).Seq␤»
12:03 Roamer` and now for a two-level map... why does this not work?
12:03 Roamer` m: use v6.c; my %data = :foo({:a(1), :b(2)}); my $res = gather { %data.keys.map(-> $section { %data{$section}.keys.map(-> $k { take [$section, $k, %data{$section}{$k}] }) }) }; dd $res;
12:03 camelia rakudo-moar 2181f7: OUTPUT«Seq $res = ().Seq␤»
12:04 prammer left #perl6
12:05 jnthn The outer map is producing sequence of sequences, and sinking that won't magically evaluate the inner sequences
12:05 Roamer` (and yes, I know I can do this with just for and pointy blocks, and I can almost do it just with a nested map, but I wonder why it doesn't work this way)
12:05 grey-panther joined #perl6
12:05 Roamer` jnthn, ahhh, right.  That makes sense.
12:05 jnthn Whle a for at statement list level would enforce the sinking
12:05 jnthn *while
12:05 jnthn A well-placed eager should do it
12:07 Roamer` right, an eager before the inner map() does it
12:09 El_Che lizmat: wow
12:10 El_Che lizmat: if you have the info -> error: or warning: (or the like), line nr, column nr
12:10 El_Che the more the better
12:10 El_Che lizmat: I was looking how to use that info in a intellij plugin
12:11 El_Che lizmat: so far, hello world from the docs :)
12:11 El_Che lizmat: but the vim plugin could have 100% coverage like that indeed
12:12 prammer joined #perl6
12:12 El_Che lizmat: "if you have the info -> error: or warning: (or the like), line nr, column nr (or place to match regex)
12:12 lizmat looking at that, and also make it more general like Zoffix wanted
12:14 zhmylove joined #perl6
12:23 mcmillhj joined #perl6
12:25 * nine will be headed for http://indigorestaurant.ro/ soon
12:36 lizmat El_Che: it's in now: compilation errors have the right info inside the exception object already
12:36 lizmat El_Che: for reference: https://github.com/rakudo/rakudo/commit/aaf7c3c
12:37 lizmat runtime errors would need to get that info from the backtrace
12:37 lizmat looking at that now
12:38 mcmillhj joined #perl6
12:39 patrickz joined #perl6
12:39 Actualeyes joined #perl6
12:40 iH2O joined #perl6
12:40 patrickz moritz: s/smother/smoother/ in line 5 in CONTRIBUTING.md
12:40 grey-panther hi all
12:40 grey-panther I just submitted a PR with some basic documentation about Perl 6 for exercism.io: https://github.com/exercism/xperl6/pull/37 - happy to get any feedback since I'm a Perl 6 n00b.
12:41 grey-panther http://exercism.io/ is a "learn programming by solving small problems" site with the added twist that you can see other's solution and give/get feedback about your solution (besides just "it passes all the tests").
12:41 moritz patrickz: thanks, fixing
12:41 zakharyas joined #perl6
12:43 zakharyas1 joined #perl6
12:47 iH2O left #perl6
12:57 AlexDaniel joined #perl6
12:57 pierre_ joined #perl6
13:02 ptolemarch joined #perl6
13:04 Khisanth joined #perl6
13:07 pi____ joined #perl6
13:11 cdg joined #perl6
13:12 n1lp7r joined #perl6
13:13 pi____ philosophical question:  I'm past being a beginner programmer, and am looking for a language to really learn well.  I don't program professionally, but I have a job in tech and would like to make my own tools.  Should i work on mastering python for now, or should I learn Perl6 right away?
13:14 El_Che you should learn both
13:14 El_Che and go
13:14 El_Che and perl 5
13:14 El_Che and java
13:14 El_Che and ruby
13:14 moritz and Haskell, and Rust, and Javascript
13:14 AlexDaniel hold on hold on…
13:14 El_Che you'll meet them all
13:14 moritz :-)
13:14 moritz pi____: IMHO Perl 6 is the better language, but python has more documentation and books available
13:14 gregf_ and scala!
13:15 moritz and Brainfuck!
13:15 pi____ I have spent at least a few weeks on each, looking for the "perfect language"
13:15 pi____ well, not brainfuck, lol
13:15 gregf_ ooh.. and PHP!
13:15 El_Che pi____: there is often a practical reason to learn a language. An specific project or product. I learnt (some) Ruby specially for extending Puppet
13:15 moritz pi____: there is perfect language, just good enough languages for some purposes
13:15 El_Che (and Java pre-Moose because I disliked perl5 OO)
13:15 moritz *no perfect language
13:15 moritz not even "perfect"
13:16 pi____ what do you actually enjoy coding in though?
13:16 El_Che pi____: perl6 is a good addition as you can see it evolve and grow. It's very fresh
13:16 AlexDaniel pi____: I'd say start with perl 6, it will broaden your mind. But most likely you will have to use other tools sometimes (e.g. for performance reasons)
13:17 pi____ I was heavy into haskell for a while, but hit a wall when the entire language turned upside down dealing with state
13:17 pi____ actually .. i guess i hit a wall on every language i tried for .. reasons.
13:19 AlexDaniel pi____: it is a bit sad to say this, but the only language I actually enjoy now is perl 6. … sure, I enjoyed java and python and other stuff years ago, but once I really started using perl 6, other languages feel like they don't play well together with my brain…
13:20 moritz pi____: I guess then my main advise is to stick with a language you've already tried, and get past the hit-the-wall point
13:21 pi____ haha that's good advice, except every issue i had with every language I've tried is fixed in perl6 lol
13:21 El_Che pi____: then there you have your answer
13:22 El_Che pi____: but, beware
13:22 pi____ ...
13:22 El_Che pi____: there will be dragons :)
13:22 AlexDaniel El_Che: evolve? Well, I don't see it much these days (after Christmas). I mean, sure, lots of bug fixes and performance improvements, but that's maintanence, not evolution. Am I wrong?
13:22 El_Che (although I must say some of us are closer to dinosaurs than dragons :) )
13:22 rkazak joined #perl6
13:22 El_Che AlexDaniel: ecosystem
13:23 pi____ is there a project I can work on?  anyone looking for some extra help, such as it is?
13:23 El_Che brb
13:23 El_Che coffee
13:23 El_Che let's make that a coke
13:23 El_Che too damn hot
13:23 moritz pi____: what kind of projects are you looking for?
13:24 AlexDaniel pi____: you can help with Rakudo ;)
13:24 moritz pi____: there are lots of modules that could use contributors, the compiler needs more hands, docs need to be written
13:24 AlexDaniel pi____: it is mainly written in perl 6, so…
13:24 pi____ anything really, a game, web app, porting something from perl5 to 6...
13:25 AlexDaniel pi____: perhaps take a look at this: https://github.com/perl6/perl6-mo​st-wanted/tree/master/most-wanted
13:25 pi____ really i want to trade code for mentorship, if that's possible.
13:26 moritz isn't masak++ developing a web app game at the moment?
13:26 skids joined #perl6
13:26 moritz https://github.com/masak/nex/blob/master/README.md
13:27 moritz pi____: if I were you, that's where I'd start sending patches. masak is very thoughtful in his feedback, and also very kind
13:27 moritz (disclaimer: I'm biased, considering myself a friend of masak)
13:29 arnsholt Yeah, I think I got my first commitbit on a masak-repo
13:29 pi____ should I contact him first, or just jump right in?
13:30 moritz whatever you prefer
13:30 moritz he certainly accepts pull-requests without prior asking for permission
13:31 arnsholt Yeah, don't feel obliged to ask first
13:31 wamba joined #perl6
13:31 arnsholt Of course, asking about things that are weird or you don't understand isn't a problem either
13:32 pi____ thanks, this is great
13:33 pi____ if I asks later which one of you inflicted me on him, I won't name names, promise
13:33 pi____ *he
13:33 arnsholt \o/
13:33 AlexDaniel pi____: but also feel free to work on your own project. If you have any questions, you can ask them here.
13:34 moritz pi____: there public logs of this channel, you know :-)
13:34 pi____ damn
13:36 canopus joined #perl6
13:36 st_iron joined #perl6
13:38 ingy^ joined #perl6
13:47 leont joined #perl6
13:47 leont Can someone remind me how I could implement conditionals in a rule?
13:50 timotimo "conditionals" is what way?
13:50 timotimo you can have <{ some code that returns a true or false }>
13:50 timotimo or does it have to be <?{ ... }>?
13:52 woolfy joined #perl6
13:58 jnthn <?{...}> or <!{...}>
14:02 timotimo right, so <{ .. }> probably uses the result of the code block as a regex to be interpolated?
14:03 jnthn aye
14:04 MilkmanDan joined #perl6
14:04 cognominal joined #perl6
14:05 leont Yeah that could work
14:05 leont Though it feels like an overkill, it's really more A or B
14:06 timotimo well, then you do it like this: [ <?{ $condition }> "foo bar baz" || "bloop foop doop" ]
14:07 timotimo regex interpolation is sloooooooow
14:07 smls joined #perl6
14:09 smls b2gills: In http://codegolf.stackexchange.com/a/90617/14880 you can replace 1..$x with 1..* to save one character
14:09 woolfy left #perl6
14:09 smls Since it always stops anyway when it reaches $x
14:10 leont Ah, yeah, that looks like what I want
14:11 noreem joined #perl6
14:13 leont Also, have higher commits (:: ::: and <commit>) been invented in recent months?
14:16 TimToady nach nicht
14:32 canopus joined #perl6
14:38 noreem Hi guys! What tools do you use for developing Perl6 ?
14:39 tadzik vim :)
14:40 noreem No Emacs love?
14:40 noreem Joking aside whatś your typical workflow?
14:40 noreem Debugging, code navigation, etc.
14:41 [Coke] everyone does their own thing.
14:41 [Coke] we have mac/windows/linux people, each with their own preferred tools.
14:42 mspo https://www.youtube.com/watch?v=9u6O0dLuqhI  damian conway using vim with perl
14:43 mspo just getting perl -c into quickfix window is a biggie
14:43 El_Che noreem: https://nxadm.wordpress.com/201​6/08/21/vim-as-a-perl-6-editor/ (posted that a few days ago)
14:43 El_Che mspo: and for syntax checking https://nxadm.wordpress.com/2016/08​/20/please-test-first-release-of-sy​ntastic-perl6-a-vim-syntax-checker/
14:43 noreem Thanks for the link, that looks awesome
14:44 AlexDaniel perl6-mode in emacs also works just fine
14:44 El_Che now having a look at adding language support to IntelliJ, but that will take time (too busy atm)
14:45 mcmillhj joined #perl6
14:45 noreem I tried perl6-mode, but beyond simple syntax coloring
14:47 noreem I guess the tooling is in it's infancy
14:48 noreem I would love to help on that, though learning perl6 by developing tooling is a bit backwards
14:48 El_Che noreem: the vim plugin I wrote 'works for me now (TM/famous last words)' and I have some PR's to integrate from syntastic upstream. When liz integrates json error output, it will be a lot more future proof (JSON datastructures instead of error parsing)
14:48 El_Che noreem: that's the thing
14:48 El_Che vim plugin: vim-script
14:48 El_Che intellij: java
14:49 El_Che not much perl6 coding there :)
14:49 El_Che noreem: I have a cool perl6 project for you too relating to tooling AND in perl6
14:49 noreem Awesome, I would love to take a look at it
14:49 El_Che a client-server autocompleter
14:50 El_Che a rest server that answer request for an api to the vim/emacs/intellij client
14:50 dogbert17 joined #perl6
14:51 El_Che eg, https://valloric.github.io/YouCompleteMe/ uses this for go https://github.com/nsf/gocode
14:51 El_Che we need something like that for perl6
14:51 El_Che in the howto I posted we only have fuzzy matching autocomplete, not semantic yet, but that's the way to go
14:52 noreem Something like Omnisharp for C#
14:52 El_Che indeed
14:53 El_Che however, I don't know if we have a rock solid minimal and fast http implementation
14:53 El_Che (it must be fast)
14:53 noreem I agree that's nedeed
14:53 timotimo you know that autocomplete stuff (client-server like) is also part of Jupyter?
14:53 El_Che I had a look at the go code and it seems pretty ij
14:53 El_Che ok
14:53 noreem Maybe it's fast enough :)
14:54 noreem timotimo: Sorry?
14:55 timotimo jupyter is something else perl6 could get that - in my opinion - would be more beneficial than an autocompleter thingie
14:55 timotimo but it's quite a bit different
14:55 timotimo and the code for that is actually written in perl6
14:55 noreem Oh ok
14:55 timotimo i'll ... show myself out :)
14:56 noreem Jupyter integration would be nice
14:56 noreem I don't know exactly how the protocol works
14:56 noreem I think it used something like ZeroMQ for messaging
14:57 timotimo https://github.com/timo/iperl6kernel - we have a tiny bit of a head start
14:57 El_Che inokenty: I agree it's important, but isn't it more urgent to get basic tooling for perl6 programmers in the hope they will be then motivated to work on things like Jupyter?
14:58 pmurias joined #perl6
14:59 mspo what's jupyter?
14:59 El_Che (that question could be an aswer to my question :) )
15:00 noreem mspo: http://jupyter.org/ The "new" IPython notebook
15:01 noreem El_Che: I agree that basic functionality at the moment is nedeed more, at least I need it :)
15:03 timotimo i didn't mean to tell you what to do, i used the totally wrong tone :S
15:04 El_Che timotimo: I don't think you suggestion was badly received at all (at least I didn't read it in negative terms)
15:04 timotimo it didn't come out the way i had hoped, that's bad enough for me :)
15:10 noreem Guys, I have to get home. Later!
15:11 El_Che noreem: see you
15:13 MilkmanDan joined #perl6
15:17 mspo that jupyter thing looks like a fairly specific/small audience
15:20 timotimo huh, really?
15:21 mspo at least I have no use case for it :)
15:21 timotimo https://ipython.org/ipython-do​c/3/interactive/qtconsole.html - you also get this for free
15:21 mspo and as I represent everyone I know who would use perl6...
15:22 Dunearhp joined #perl6
15:22 mspo doesn't julia do all of that stuff?
15:23 timotimo yeah
15:23 mcmillhj joined #perl6
15:26 mspo so this is the web app/choose your own language julia
15:26 mspo probably bigger in the academic space
15:27 timotimo huh?
15:27 timotimo no, julia uses jupyter
15:27 timotimo at least in part
15:27 mspo oh okay
15:27 timotimo well, "julia uses" doesn't make much sense; you can run julia code completely without a REPL of course
15:27 * grondilu can't help but thinking "beer" when he reads this word
15:28 DmZDsfZoQv joined #perl6
15:28 [Coke] which one?
15:29 grondilu (which beer?  Jupyler of course)
15:33 [Coke] which word. but your answer handled that too, thanks. :)
15:35 moritz Juniper!
15:37 skids joined #perl6
15:38 grondilu (I got the spelling wrong, though.  The brand name is "Jupiler", not "Jupyler".
15:38 grondilu )
15:38 cinch joined #perl6
15:40 lambd0x joined #perl6
15:42 lostinfog joined #perl6
15:43 dsds joined #perl6
15:44 ssm joined #perl6
15:52 nadim_ joined #perl6
15:53 MilkmanDan joined #perl6
16:04 ufobat joined #perl6
16:04 nadim joined #perl6
16:05 nadim__ joined #perl6
16:10 domidumont joined #perl6
16:11 nadim joined #perl6
16:20 pi____ joined #perl6
16:20 heatsink joined #perl6
16:28 dalek doc: 5da5f71 | (Tom Browder)++ | doc/Language/variables.pod6:
16:28 dalek doc: add missing '>'
16:28 dalek doc: review: https://github.com/perl6/doc/commit/5da5f71507
16:28 dalek doc: 74abc4a | (Tom Browder)++ | doc/Type/Str.pod6:
16:28 dalek doc: add format details lifted (with some mods) from perl.org docs
16:28 dalek doc: review: https://github.com/perl6/doc/commit/74abc4a8c5
16:28 dalek doc: 6e413b8 | (Tom Browder)++ | doc/ (2 files):
16:28 dalek doc: Merge pull request #856 from tbrowder/sprintf-format
16:28 dalek doc:
16:28 dalek doc: Add more details of function sprintf formatting
16:28 dalek doc: review: https://github.com/perl6/doc/commit/6e413b8c34
16:29 tailgate If I have sub zip_longest($fillvalue=Nil, **@iterables), can I switch the order of the arguments? What's the difference between **@iterables and *@iterables?
16:30 skrshn joined #perl6
16:31 [Coke] unless your args are declared with :, they are positional and the order matters
16:31 moritz tailgate: you acn't have arguments after a slurpy
16:31 moritz tailgate: and the difference is that * flattens, and ** preserves structure
16:32 heatsink left #perl6
16:32 moritz m: sub f(*@a) { dd @a }; sub g(**@a) { dd @a }; f 1, (2, 3); g 1, (2, 3);
16:32 camelia rakudo-moar 998e2b: OUTPUT«[1, 2, 3]␤[1, (2, 3)]␤»
16:33 moritz tailgate: but it looks like you should make $fillvalue a named parameter
16:33 tailgate what's the syntax for that?
16:34 zengargoyle joined #perl6
16:34 moritz sub zip_longest(**@iterables, :$fillvalue = None) { ... }
16:35 tailgate thanks
16:35 moritz though named params are optional by default, so you don't need a default value
16:35 moritz and s/None/Nil/ of course # me too pythonic :-)
16:36 tailgate And you call it with zip_longest, ((,)...) :$fillvalue="0");
16:36 zacts_pi joined #perl6
16:36 dalek doc: cf9680d | (Tom Browder)++ | doc/Type/IO/Handle.pod6:
16:36 dalek doc: use correct funcs and methods
16:36 dalek doc: review: https://github.com/perl6/doc/commit/cf9680d0c8
16:36 dalek doc: e16e241 | (Tom Browder)++ | doc/Type/IO/Handle.pod6:
16:36 dalek doc: Merge pull request #857 from tbrowder/io-fix
16:36 dalek doc:
16:36 dalek doc: use correct funcs and methods
16:36 dalek doc: review: https://github.com/perl6/doc/commit/e16e241d17
16:36 tailgate rather zip_longest((,)...), :$fillvalue="0");
16:37 moritz no, with :fillvalue(0) or fillvalue => 0
16:37 patrickz left #perl6
16:37 tailgate ah
16:37 moritz though I'd call it fill or fillwith
16:37 zacts_pi joined #perl6
16:37 tailgate is fillvalue in the namespace already?
16:38 moritz no, but "value" is generally not useful as a parameter name
16:38 tailgate I'm imitating the python itertools library
16:38 moritz it adds zero information
16:38 moritz don't copy their crappy naming :-)
16:41 khw joined #perl6
16:43 rkazak joined #perl6
16:46 zacts joined #perl6
16:46 brrt joined #perl6
16:55 perlawhirl joined #perl6
16:56 mcmillhj joined #perl6
17:00 gregf_ joined #perl6
17:07 hobbs joined #perl6
17:08 dataangel joined #perl6
17:09 dataangel m: sub test() { say "Hello world!"; }; say &test.perl;
17:09 camelia rakudo-moar 998e2b: OUTPUT«sub test () { #`(Sub|63872768) ... }␤»
17:09 dataangel Damn I was hoping that it would give the source code
17:13 [Coke] I think that would be a nice to have. I don't think anyone has said "it's impossible" yet
17:13 firstdayonthejob joined #perl6
17:14 [Coke] I don't think there's an RT for it yet, though. (there is a similar one for Regex)
17:15 dataangel [Coke]: what I really want is the ability to check between runs if the code of the function is changed, which I could do with that feature, except I also want to know if any functions that that function calls have changed, which would be harder even with this feature...
17:16 dataangel [Coke]: I assume I would have to parse the result from .perl, find all the function calls, and recursively repeat the process. Since Perl six parses itself I assume it's theoretically possible I don't know how easy it is...
17:17 [Coke] while it would be nice to know that... why do you need to know that?
17:18 dataangel Making a build system where I want to rebuild if the recipe to build a target has changed. I want finer granularity than just detecting if the file is changed
17:18 [Coke] m: sub barf() {...}; sub barf() {...;}
17:18 camelia rakudo-moar 998e2b: ( no output )
17:18 dataangel ?
17:19 [Coke] m: sub barf() {3}; barf; sub barf() {4}; barf;
17:19 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Redeclaration of routine barf␤at <tmp>:1␤------> 3sub barf() {3}; barf; sub barf() {4}7⏏5; barf;␤    expecting any of:␤        horizontal whitespace␤        statement end␤        statement …»
17:19 [Coke] ^^
17:19 [Coke] you can't swap out a sub, at least.
17:20 dataangel [Coke]: this would be between runs, you run your build script using my library, then change your script source code, then run again
17:21 dataangel As it is I can workaround it by requiring users to put each recipe in a separate source file, but that's not quite as neat ;)
17:23 cognominal joined #perl6
17:24 domidumont1 joined #perl6
17:25 Deep_Thought joined #perl6
17:25 [Coke] if it's between runs, how do you compare against the old version? This sounds like a job for qx/diff/, maybe.
17:26 mcmillhj joined #perl6
17:26 [Coke] er, I assume you mean not between but "during a later run, compare against the old". if it's really between, just diff?
17:26 [Coke] (or keep track of sha1 versions of the source, etc.)
17:26 dataangel [Coke]: I'd save a hash to the side each run
17:26 dataangel Beat me to it ;)
17:30 TheLemonMan m: say Str(Any) ~~ Str
17:30 camelia rakudo-moar 998e2b: OUTPUT«False␤»
17:30 TheLemonMan that should be True, no ?
17:31 hoelzro m: say Str(Any)
17:31 camelia rakudo-moar 998e2b: OUTPUT«(Str(Any))␤»
17:32 hoelzro hmm
17:32 [Coke] m: say ~Str(Any)
17:32 camelia rakudo-moar 998e2b: OUTPUT«Use of uninitialized value of type Str(Any) in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.  in block <unit> at <tmp> line 1␤␤»
17:34 tony-o m: 1..5000..4;
17:34 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Operators '..' and '..' are non-associative and require parentheses␤at <tmp>:1␤------> 1..5000.7⏏5.4;␤»
17:34 tony-o m: (1..5000)..4;
17:34 camelia rakudo-moar 998e2b: OUTPUT«WARNINGS for <tmp>:␤Useless use of ".." in expression "(1..5000)..4" in sink context (line 1)␤Range objects are not valid endpoints for Ranges␤  in block <unit> at <tmp> line 1␤␤»
17:35 dalek ecosystem: 76bc571 | (Armand Halbert)++ | META.list:
17:35 dalek ecosystem: Added python::itertools to ecosystem
17:35 dalek ecosystem:
17:35 dalek ecosystem: See https://github.com/ahalbert/perl6-itertools
17:35 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/76bc571b97
17:35 dalek ecosystem: bec2a3e | (Zoffix Znet)++ | META.list:
17:35 dalek ecosystem: Merge pull request #240 from ahalbert/master
17:35 dalek ecosystem:
17:35 dalek ecosystem: Added python::itertools to ecosystem
17:35 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/bec2a3e714
17:35 tony-o m: m:
17:35 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Colons may not be used to delimit quoting constructs␤at <tmp>:1␤------> 3m:7⏏5<EOL>␤    expecting any of:␤        colon pair (restricted)␤»
17:36 tony-o m: <m:>;
17:36 camelia rakudo-moar 998e2b: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant value m: in sink context (line 1)␤»
17:36 tony-o m: <m::>;
17:36 camelia rakudo-moar 998e2b: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant value m:: in sink context (line 1)␤»
17:37 ugexe m: 1
17:37 camelia rakudo-moar 998e2b: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»
17:39 dalek doc: 08c1b36 | (Zoffix Znet)++ | doc/Language/concurrency.pod6:
17:39 dalek doc: Clarify that whenever uses .act, not .tap
17:39 dalek doc:
17:39 dalek doc: ...and so its block is executed just one at a time.
17:39 dalek doc:
17:39 dalek doc: smls++ for pointing that out.
17:39 dalek doc: review: https://github.com/perl6/doc/commit/08c1b362fe
17:40 tony-o m: return 1;
17:40 camelia rakudo-moar 998e2b: OUTPUT«Attempt to return outside of any Routine␤  in block <unit> at <tmp> line 1␤␤»
17:40 tony-o m: sub $barf {}; $barf;
17:40 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub7⏏5 $barf {}; $barf;␤    expecting any of:␤        new name to be defined␤»
17:40 tony-o m: sub \$barf {}; $barf;
17:40 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub7⏏5 \$barf {}; $barf;␤    expecting any of:␤        new name to be defined␤»
17:44 brrt joined #perl6
17:44 telex joined #perl6
17:49 TheLemonMan m: say Str(Any) ~~ Str(Int); say Any ~~ Int;
17:49 camelia rakudo-moar 998e2b: OUTPUT«False␤False␤»
17:49 TheLemonMan m: say Int ~~ Any;
17:49 camelia rakudo-moar 998e2b: OUTPUT«True␤»
17:50 TheLemonMan ~~ isn't commutative ?
17:50 timotimo definitely not
17:51 TheLemonMan huh, TIL
17:51 jnthn iirc, the earliest designs of ~~ were, and it didn't work out so well
17:51 timotimo m: say 1..10 ~~ 5; say 5 ~~ 1..10
17:51 camelia rakudo-moar 998e2b: OUTPUT«False␤True␤»
17:51 timotimo m: say "Hello" ~~ Str; say Str ~~ "Hello"
17:51 camelia rakudo-moar 998e2b: OUTPUT«True␤False␤»
17:54 brrt what's the mental model for ~~ anyway
17:54 brrt 'is kind of like'
17:54 brrt or 'contains'
17:54 espadrine joined #perl6
17:55 jnthn "can be considered like" perhaps
17:55 ugexe ACCEPTS
17:55 jnthn Right, it compiles into rhs.ACCEPTS(lhs)
17:55 jnthn So it's the rhs that does the considering
17:55 jnthn Or sets the rules
17:55 AlexDaniel "just compare it please” ? :)
17:55 jnthn So anything ~~ 3 will always try to do numeric comparison
17:57 timotimo "does it fit?"
17:57 AlexDaniel “I'm Feeling Lucky”
18:00 brrt lol
18:00 brrt but, seriously
18:01 brrt i'm kind of having the feeling that it is in there because "smart matching is cool"
18:01 brrt or that's the fear at least
18:01 smls m: multi f ($a) {};  say &f.count
18:01 camelia rakudo-moar 998e2b: OUTPUT«Inf␤»
18:01 smls ^^ Why does a multi with one parameter think its parameter count is Inf?
18:02 smls Prints one if I use sub instead of multi.
18:02 smls s/one/1/
18:02 brrt hmmm maybe because instead of the multi a disptaching prototype is installed, which is what you get if you take a reference to &f
18:02 AlexDaniel smls: what should it say then?
18:02 AlexDaniel I agree that Inf is weird, but I wonder what would be the right answer
18:03 timotimo yup, you'd have to give it a prototype to influence that number
18:03 brrt m: multi f($a) { 8437; }; say &f.WHAT;
18:03 camelia rakudo-moar 998e2b: OUTPUT«(Sub)␤»
18:03 timotimo because after you say that count, another multi candidate could be installed and the number could become wrong
18:03 smls timotimo: But at runtime it should know what candidates there are
18:03 brrt m: proto f($a) {....}; multi f($a) { 42; }; say f(10);
18:03 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3proto f($a) {....7⏏5}; multi f($a) { 42; }; say f(10);␤»
18:04 brrt and special case a one-variable, or find the largest number?
18:05 smls arity=smallest, count=largest, no?
18:05 timotimo smls: are you sure? :)
18:05 smls eh, other way around
18:05 smls or not :)
18:06 timotimo hm, well
18:06 timotimo candidates are also lexically scoped
18:06 timotimo so yeah, you're right indeed
18:06 timotimo but you're asking the proto about this information and the proto doesn't know what lexical scope you're in
18:06 timotimo ... perhaps?
18:07 smls In any case, I tried to have 2 multi candidates that both take one argument (for argument destructuring), and .count==Inf means I can't pass it as the transform callback to .sort
18:07 brrt wait, timo, wait
18:07 brrt m: proto foo(|) {....};
18:07 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3proto foo(|) {....7⏏5};␤»
18:07 brrt alright, how does one declare the default proto
18:07 ugexe {*}
18:09 brrt m: proto foo($a) {*}; multi foo($a) { $a * 2; }; say foo(4); say &foo.count;
18:09 camelia rakudo-moar 998e2b: OUTPUT«8␤1␤»
18:09 brrt thereyougo
18:09 canopus joined #perl6
18:09 smls ok
18:10 brrt m: proto foo($a) {*}; { multi foo($a) { $a * 2; }; say foo(5); }; multi foo($a) { $a + 7; }; say foo(5);
18:10 camelia rakudo-moar 998e2b: OUTPUT«10␤12␤»
18:10 brrt ow
18:10 brrt that has got to be painful for performance
18:13 timotimo nah, it's just a compile-time known thing, i believe
18:16 raoulvdberge joined #perl6
18:21 Actualeyes joined #perl6
18:28 [Coke] m: my token infix:sym<--\>> { "$^a -> $^b\n" }; [~] 'a' X[-->] <b c> # RT #126238
18:28 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=126238
18:28 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Prefix -- requires an argument, but no valid term found␤at <tmp>:1␤------> 3m<--\>> { "$^a -> $^b\n" }; [~] 'a' X[--7⏏5>] <b c> # RT #126238␤    expecting any of:␤        prefix␤»
18:28 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=126238
18:29 [Coke] synopsebot6: maybe you should not emit the same link within 10s of last emitting it.
18:30 [Coke] m: sub infix:sym<--\>> { "$^a -> $^b\n" }; [~] 'a' X[-->] <b c> # RT #126238
18:30 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=126238
18:30 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Prefix -- requires an argument, but no valid term found␤at <tmp>:1␤------> 3m<--\>> { "$^a -> $^b\n" }; [~] 'a' X[--7⏏5>] <b c> # RT #126238␤    expecting any of:␤        prefix␤»
18:30 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=126238
18:34 [Coke] m: callsframe
18:34 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    callsframe used at line 1. Did you mean 'callframe', 'callsame'?␤␤»
18:34 [Coke] m: callframe
18:34 camelia rakudo-moar 998e2b: ( no output )
18:34 [Coke] m: say callframe.file; say $?FILE
18:34 camelia rakudo-moar 998e2b: OUTPUT«<tmp>␤<tmp>␤»
18:39 domidumont joined #perl6
18:48 masak oh, nice discussion with pi____ earlier today
18:48 masak hi, #perl6
18:48 [Coke] hio
18:51 setty1 joined #perl6
18:56 _slade_ joined #perl6
18:59 juniofreitas joined #perl6
18:59 [Coke] m: constant B::b = 666; # RT 128610
18:59 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing initializer on constant declaration␤at <tmp>:1␤------> 3constant B:7⏏5:b = 666; # RT 128610␤»
19:01 firstdayonthejob joined #perl6
19:02 acrussell joined #perl6
19:04 zacts joined #perl6
19:08 ChoHag I ran bootstrap.pl in panda and it's put nothing in the directory it told me to add to PATH.
19:10 ChoHag I have version 3.30 of TAP::Harness on perl 5.20.1.
19:11 ugexe is there anything in $PATH/../resources ?
19:11 ChoHag Nope.
19:11 ChoHag I do have a .panda.work and moar.core in my panda source directory.
19:11 ugexe what about $PATH/../dist
19:11 ChoHag dist's empty too.
19:12 ugexe hmm, its either installing somewhere else or not at all
19:12 ChoHag bootstrap.pl exited with code 0 after Installing File::Find then the PATH.
19:12 ChoHag The core suggests maybe it didn't install but something swallowed the error.
19:13 ChoHag The core dump along with the empty directories.
19:14 ugexe you could try installing something with zef, and if that fails too it can be assumed its rakudo
19:14 Possum joined #perl6
19:14 ChoHag I don't have a zef.
19:15 ugexe `rakudobrew build zef` or `git clone https://github.com/ugexe/zef && cd zef && perl6 -Ilib bin/zef --debug install .`
19:21 noreem joined #perl6
19:26 noreem joined #perl6
19:31 zacts joined #perl6
19:34 RabidGravy joined #perl6
19:42 dalek ecosystem/MARTIMM-patch-1: 28da1d5 | (Marcel Timmerman)++ | META.list:
19:42 dalek ecosystem/MARTIMM-patch-1: Authentication methods using SCRAM
19:42 dalek ecosystem/MARTIMM-patch-1:
19:42 dalek ecosystem/MARTIMM-patch-1: Partly implemented (client side) Salted Challenge Response Authentication Mechanism
19:42 dalek ecosystem/MARTIMM-patch-1:  (SCRAM) according to rfc5802.
19:42 dalek ecosystem/MARTIMM-patch-1: review: https://github.com/perl6/e​cosystem/commit/28da1d559a
19:46 dalek ecosystem: 28da1d5 | (Marcel Timmerman)++ | META.list:
19:46 dalek ecosystem: Authentication methods using SCRAM
19:46 dalek ecosystem:
19:46 dalek ecosystem: Partly implemented (client side) Salted Challenge Response Authentication Mechanism
19:46 dalek ecosystem:  (SCRAM) according to rfc5802.
19:46 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/28da1d559a
19:46 dalek ecosystem: 4efb5e1 | Altai-man++ | META.list:
19:46 dalek ecosystem: Merge pull request #241 from perl6/MARTIMM-patch-1
19:46 dalek ecosystem:
19:46 dalek ecosystem: Authentication methods using SCRAM
19:46 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/4efb5e15e7
19:46 sjoshi joined #perl6
19:47 zacts_pi joined #perl6
19:50 zacts_ joined #perl6
19:52 kentnl joined #perl6
19:52 kentnl joined #perl6
19:53 zacts__ joined #perl6
19:55 zacts joined #perl6
20:14 Ven joined #perl6
20:15 cdg joined #perl6
20:15 bioduds joined #perl6
20:15 bioduds hey everyone
20:16 bioduds anyone working with NoSQL in Perl6? memcached? concurrency? I'm planning on building a NoSQL system with P6
20:17 zacts joined #perl6
20:20 cpage_ joined #perl6
20:21 cpage__ joined #perl6
20:22 kurahaupo joined #perl6
20:23 perlpilot bioduds: I /think/ I saw someone start on a MongoDB thing, but I'm not sure.
20:24 perlpilot bioduds: check modules.perl6.org
20:24 tony-o bioduds: a backend nosql ?
20:24 bioduds yep, there is actually a MongoDB module already there :)
20:24 tony-o or writing modules to use those nosqls
20:35 rindolf joined #perl6
20:35 TEttinger joined #perl6
20:36 MilkmanDan joined #perl6
20:37 ItayAlmog joined #perl6
20:41 bbkr joined #perl6
20:41 xnrand joined #perl6
20:43 cognominal joined #perl6
20:52 acrussell joined #perl6
21:00 TheLemonMan joined #perl6
21:03 nadim joined #perl6
21:10 bioduds what is the diff between use v6 and use v6.c ? :D tx in advance
21:12 geekosaur use v6 just catches you handing your script to perl 5 by mistake. v6.c specifies the language level (6.c being the first official release; the next one will be 6.d)
21:13 benji_ joined #perl6
21:14 mvorg joined #perl6
21:24 [Coke] you can do both if you want both the nice p5 warning and the p6 strictures.
21:24 [Coke] mst: any chance we could patch perl5 so that 'use v6.c' gave the same warning as 'use v6' ?
21:25 [Coke] (I assume it would be too painful and/or break something in 5)
21:26 lizmat joined #perl6
21:28 El_Che lizmat: wow, the error thing is looking good! thx
21:29 El_Che lizmat: that will make every syntax checker out there rock solid!
21:31 [Coke] El_Che: I would consider it experimental for a bit - we might want to change the format.
21:31 El_Che [Coke]: naturally
21:35 El_Che [Coke]: getting it right is indeed important
21:36 lizmat The number of lines added was quite small, to my amazement  :-)
21:36 El_Che lizmat being lizmat will it get at least 30% smaller :)
21:37 lizmat no, but maybe faster  :-)
21:37 El_Che hehe
21:38 lizmat well, actually most of the code I made faster, definitely did not become smaller :-)
21:43 El_Che lizmat: impressive work that speeding up by the way
21:44 acrussell joined #perl6
21:45 lizmat :-)
21:46 gnull joined #perl6
21:49 cognominal joined #perl6
21:51 gnull Hello everyone! What is the most perl6ish way to iterate an array infinitely? I want a loop to start from the beginning of the array when it reaches the end.
21:51 gnull m: .say for [1,2,3]
21:51 camelia rakudo-moar 998e2b: OUTPUT«1␤2␤3␤»
21:52 gnull I want it to run over 1,2,3,1,2,3,1,2...
21:54 avuserow_ m: my @a = 1, 2, 3; for |@a xx * -> $i {say $i} # <-- gnull
21:54 camelia rakudo-moar 998e2b: OUTPUT«(timeout)1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1​␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤​1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2…»
21:54 hobbs there we go. I had the xx *, but I was struggling to flatten it
21:55 lizmat m: my @a = |(1..3) xx *; say @a[^10]   # my solution :-)
21:55 camelia rakudo-moar 998e2b: OUTPUT«(1 2 3 1 2 3 1 2 3 1)␤»
21:56 lizmat good night, #prl6!
21:56 lizmat *perl6
21:56 lizmat :-)
21:57 El_Che bye liz!
21:57 avuserow_ o/
21:57 gnull lizmat: good night
22:00 woolfy joined #perl6
22:01 gnull hobbs: Hmm, what about performance of this solution? Will the perl6 free those elements of the infinite list that were already iterated? Is it legal for the compiler to do so?
22:01 hobbs I bet lizmat knows ;)
22:02 avuserow_ gnull: memory usage of that looked flat in my limited testing, so it seems to do the right thing
22:03 n1lp7r joined #perl6
22:04 gnull m: say (|[1,2,3] xx 3).WHAT
22:04 camelia rakudo-moar 998e2b: OUTPUT«(List)␤»
22:04 zacts joined #perl6
22:05 Actualeyes joined #perl6
22:05 gnull Thank you!
22:06 hobbs if it were to be a problem, this should work:
22:06 hobbs m: supply { loop { for 1, 2, 3 { emit($_) } } }.tap({ .say })
22:06 hobbs just plug in the list in place of 1, 2, 3
22:06 camelia rakudo-moar 998e2b: OUTPUT«(timeout)1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1​␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤​1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2…»
22:09 El_Che isn't avuserow_'s solution lazy, while liz stuffs everything in memory first?
22:11 gnull El_Che: don't think so. Infinite list is still lazy if saved to an array
22:12 hobbs yeah, infinite lists are lazy enough
22:12 Sgeo_ joined #perl6
22:12 hobbs the question was whether they have remember their past, when they don't need to :)
22:12 hobbs s/have //
22:13 avuserow_ lizmat's solution does seem to gradually use more memory over time though... not sure why that would be.
22:16 gnull firstly i do: rates over the elements of the invocant list, feeding each element in turn to the code reference, and assembling the return values from these invocations in a result list.
22:16 gnull sorry for that. wrong paste(
22:16 El_Che gnull: just tried it with 1 000 000 elements. 1ste solution keeps printing them, 2nd wait's until it fills the array
22:17 gnull m: my @a = |(1..3) xx *; for @a {say $_}
22:18 camelia rakudo-moar 998e2b: OUTPUT«(timeout)1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1​␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤​1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2␤3␤1␤2…»
22:22 gnull If I'm not mistaken the documentation states that lazy list evaluates each of its elements only once and stores it. And it isn't allowed to generate elements sequentialy like Seq, Supply or some kind of iterator, is it?
22:24 gnull so in my last example the compiler can't free those elements while iterating because it isn't sure that I will not use the @a after for
22:24 gnull those elements == already iterated elements
22:25 El_Che I see
22:25 hobbs I mean, it can be sure that you won't use the @a after for if it's clever enough
22:25 hobbs but that doesn't mean that it is :)
22:27 gnull Anyway, we could make an example where we explicitly use @a after the for loop. In this case it can't be sure
22:27 skids joined #perl6
22:28 gnull It is ok for the last example to consume memory infinitely
22:29 hobbs agreed
22:31 gnull It seems strange that avuserow_'s solution doesn't do the same.
22:32 gnull m: say (|@a xx *).WHAT
22:32 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3say (|7⏏5@a xx *).WHAT␤»
22:32 gnull m: @a = [1,2,3]; say (|@a xx *).WHAT
22:32 camelia rakudo-moar 998e2b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5@a = [1,2,3]; say (|@a xx *).WHAT␤»
22:32 gnull m: my @a = [1,2,3]; say (|@a xx *).WHAT
22:32 camelia rakudo-moar 998e2b: OUTPUT«(Seq)␤»
22:32 gnull OK, got it)
22:32 gnull it is Seq
22:33 gnull so it generates its elements one by one without storing them
22:34 benjikins does anyone have any idea about how to make a pseudo terminal
22:34 gnull m: my @a = |(1..3) xx *; say @a.WHAT
22:34 camelia rakudo-moar 998e2b: OUTPUT«(Array)␤»
22:34 benjikins so that I can record a terminal session
22:36 Sgeo joined #perl6
22:36 gnull benjikins: try the utility called `script`. it saves all the communications between user and terminal to a file
22:37 firstdayonthejob joined #perl6
22:37 gnull m: my $a = |(1..3) xx *; say $a.WHAT
22:37 camelia rakudo-moar 998e2b: OUTPUT«(Seq)␤»
22:37 Sgeo joined #perl6
22:38 gnull benjikins: no idea how to easily do this in perl6
22:38 benjikins I've seen where things like asciinema uses weird pseudoterminal stuff
22:39 benjikins I just have no idea about how to do it
22:41 benjikins I mean a recording that you can replay and actually see the time between commands
22:42 gnull At lower level there are syscalls provided to you by an operating system. These allow you to create your own pseudoterminals and interact with ones created by others.
22:46 zengargoyle joined #perl6
22:47 gnull Fox example you could create a new pty and spawn a shell for user in it. At the same time being connected to the original pty that you were started in. Then you can receive user input in pty that you've created and pass it unchanged to the original pty. In the same way pass too user the output that you get from your original pty.
22:48 benjikins any ideas about how I would accomplish this in perl6 though?
22:52 gnull http://rachid.koucha.free.f​r/tech_corner/pty_pdip.html <-- this tutorial may be helpful to understand how pty emulators can be implemented in C
22:52 gnull I haven't seen any perl6 modules doing that
22:54 gnull You can call C functions from perl6 using NativeCall module
22:54 benjikins alright, thanks a bunch
22:54 benjikins I'll look at this
23:00 gnull Good bye everyone.
23:02 benjikins bye
23:03 mst [Coke]: honestly, I see no reason why not off the top of my head
23:03 mst [Coke]: we should chase this up and see if it's because nobody ever asked ('we' meaning 'please harass me to help with this')
23:05 timotimo gnull: i'm not sure if somebody already explained it, but the Seq type we have (but haven't had for terribly long now) is the right thing for making sure elements don't stick around and clog up memory. your |(1, 2, 3) xx * should be fine.
23:06 rkazak joined #perl6
23:06 timotimo ah, looks like somebody did actually explain that
23:18 zengargoyle joined #perl6
23:19 aindilis joined #perl6
23:27 TimToady joined #perl6
23:40 tbrowder [Coke]: I have been checking--I see no failures on my side.
23:42 djbkd joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo