Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-09-28

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:09 mcmillhj joined #perl6
00:12 scott joined #perl6
00:12 scott when does || differ from //?
00:12 tushar joined #perl6
00:14 itaipu joined #perl6
00:19 avuserow_ m: say 0 // -1; say 0 || -1; say Int // -1; # scott: // prints the left side if it's defined, || requires it to be true
00:19 camelia rakudo-moar fc3160: OUTPUT«0␤-1␤-1␤»
00:19 avuserow_ Guest73996: ^^
00:26 mcmillhj joined #perl6
00:31 cbk_ joined #perl6
00:39 perlawhirl joined #perl6
00:41 mcmillhj joined #perl6
00:42 zoosha joined #perl6
00:45 jonadab joined #perl6
00:45 luis` joined #perl6
00:47 f3ew joined #perl6
00:47 ribasushi joined #perl6
00:48 canopus joined #perl6
00:48 pierre_ joined #perl6
00:50 cgfbee joined #perl6
00:51 cbk1090 joined #perl6
00:51 Guest73996 joined #perl6
00:51 Guest73996 joined #perl6
00:52 scott avuserow_: thanks!
00:53 scott my mistake was only checking cases where the LHS is undefined, not where it's defined but falsey
00:57 mcmillhj joined #perl6
01:03 canopus joined #perl6
01:15 mcmillhj joined #perl6
01:31 mcmillhj joined #perl6
01:35 _slade_ joined #perl6
01:46 Matthew[m] joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:47 mcmillhj joined #perl6
01:48 Matias[m] joined #perl6
01:55 ilmari[m] joined #perl6
01:58 mcmillhj joined #perl6
02:02 pierre_ joined #perl6
02:05 nbrown joined #perl6
02:07 noganex joined #perl6
02:15 mcmillhj joined #perl6
02:17 cdg joined #perl6
02:18 perlawhirl joined #perl6
02:21 cdg joined #perl6
02:24 cognominal joined #perl6
02:29 mcmillhj joined #perl6
02:42 mcmillhj joined #perl6
02:42 Joeperl joined #perl6
02:46 pierre_ joined #perl6
02:53 pierre_ joined #perl6
03:05 obfusk_ joined #perl6
03:08 mcmillhj joined #perl6
03:26 aries_liuxueyang joined #perl6
03:30 kurahaupo joined #perl6
03:35 cdg joined #perl6
03:36 kurahaupo_ joined #perl6
03:36 dayangkun joined #perl6
03:37 mcmillhj joined #perl6
03:37 dayangkun joined #perl6
03:37 kurahaupo` joined #perl6
03:41 dayangkun joined #perl6
03:58 cdg_ joined #perl6
04:09 nebuchadnezzar joined #perl6
04:18 ka joined #perl6
04:24 mcmillhj joined #perl6
04:27 pierre_ joined #perl6
04:27 zakharyas joined #perl6
04:32 holyghost joined #perl6
04:35 mcmillhj joined #perl6
04:52 cdg joined #perl6
04:55 labster joined #perl6
05:04 Cabanossi joined #perl6
05:07 mcmillhj joined #perl6
05:17 dayangkun joined #perl6
05:23 Khisanth joined #perl6
05:28 pierre_ joined #perl6
05:34 pierre_ joined #perl6
05:46 wamba joined #perl6
05:49 domidumont joined #perl6
05:52 cognominal joined #perl6
05:52 domidumont joined #perl6
06:06 vv joined #perl6
06:09 mcmillhj joined #perl6
06:22 bjz joined #perl6
06:29 darutoko joined #perl6
06:30 salva joined #perl6
06:33 mcmillhj joined #perl6
06:34 firstdayonthejob joined #perl6
06:36 RabidGravy joined #perl6
06:40 bjz joined #perl6
06:43 perlawhirl bisectable6: dd ((1,2,3),(4,5,6)).map(&join)
06:44 perlawhirl bisect: old=2015.10 ((1,2,3),(4,5,6)).map(&join).say
06:45 perlawhirl ok bisectable is not around
06:45 perlawhirl m: my @a = ((1,2,3),(4,5,6)); say @a.map(&join); say @a.map(*.join); # <-- is this a bug? &join should work, right?
06:45 camelia rakudo-moar fc3160: OUTPUT«( )␤(123 456)␤»
06:48 perlawhirl confirmed it's the same in 2015.09, so it's not a regression
06:49 mcmillhj joined #perl6
06:52 nadim joined #perl6
06:53 woolfy left #perl6
06:57 woolfy joined #perl6
06:57 TimToady not a bug, I think, since function join has a first arg saying what to join with, and that's all you're supplying
06:57 TimToady so it joins nothing together with '1 2 3'
07:01 xinming joined #perl6
07:04 mcmillhj joined #perl6
07:05 perlawhirl right, so only method form has a default $separator... got it
07:11 aries_liuxueyang joined #perl6
07:15 ka joined #perl6
07:16 dayangkun joined #perl6
07:31 labster joined #perl6
07:44 masak good morning, #perl6
07:44 RabidGravy marning
07:46 El_Che Hi Dr. Nick^W^Wmasak
07:46 arnsholt Good morning, from a SSH and bash on Windows (without cygwin \o/)
07:46 arnsholt The new WSL thingy is pretty neat
07:49 stmuk_ and it even tells Microsoft what you typed!
07:49 El_Che arnsholt: is the terminal emulator ok?
07:49 arnsholt El_Che: It renders text =)
07:49 arnsholt And it can be full-screened (unlike the old cmd one)
07:50 moritz does it support ANSI control sequences?
07:50 moritz curses programs?
07:50 arnsholt No problems with irssi AFAICT, nor vim
07:50 arnsholt I haven't tested either extensively yet, but so far so good
07:51 arnsholt Even renders the UTF-8 Camelia in the /topic fine
07:51 moritz that's all < 255 codepoints
07:51 moritz anyway, that does sound decent
07:52 mcmillhj joined #perl6
07:54 g4 joined #perl6
07:54 g4 joined #perl6
08:01 user9 joined #perl6
08:05 ocbtec joined #perl6
08:06 dakkar joined #perl6
08:08 mcmillhj joined #perl6
08:08 El_Che arnsholt: when on Windows and I don't have the time to install a LInux VM, I use ssh on cygwin. A lot better than it used to be
08:09 pierre_ joined #perl6
08:16 telex joined #perl6
08:16 arnsholt El_Che: Yeah, it's been a long time since I used cygwin TBH
08:17 arnsholt Except the occasional use with the git bash
08:17 ilmari[m] joined #perl6
08:26 CIAvash joined #perl6
08:27 dayangkun joined #perl6
08:43 mcmillhj joined #perl6
08:46 bjz joined #perl6
08:46 larion joined #perl6
08:46 larion joined #perl6
09:07 eliasr joined #perl6
09:11 cognominal joined #perl6
09:27 ilmari[m] joined #perl6
09:28 pierre_ joined #perl6
09:31 mcmillhj joined #perl6
09:34 pierre_ joined #perl6
09:39 rindolf joined #perl6
09:43 mcmillhj joined #perl6
09:46 gregf_ joined #perl6
09:49 bjz joined #perl6
10:00 zakharyas joined #perl6
10:30 llfourn joined #perl6
10:30 kaare_ joined #perl6
10:48 ka joined #perl6
11:05 obfusk joined #perl6
11:06 wamba joined #perl6
11:07 RabidGravy Oooh the HTTP header returned by github is longer than 2048 bytes, hence LWP::Simple crapping out when it tries to parse the response
11:09 mcmillhj joined #perl6
11:11 dalek doc: 3a2609a | (Tom Browder)++ | doc/Type/Signature.pod6:
11:11 dalek doc: fix typo
11:11 dalek doc: review: https://github.com/perl6/doc/commit/3a2609a38b
11:13 timotimo RabidGravy: ouch, bad idea to have such a hard limit in there
11:15 RabidGravy indeed, just looking at the best way to fix it
11:15 frankD2 joined #perl6
11:16 frankD2 left #perl6
11:16 timotimo turn it up to 4196, clearly! :) :)
11:17 arnsholt 4196 bytes should be anough for everyone! \o/
11:18 timotimo clearly with brötli compression that'll be much less of an issue!
11:37 RabidGravy eugh, just seen a PHP gig a mile away
11:37 RabidGravy anyway, just fixed that by getting more blob until there's some header
11:43 pierre_ joined #perl6
11:43 masak lol, I blogg'd! http://strangelyconsistent.org/blog/the-curious-case-of-the-disappearing-test
11:47 Dunearhp joined #perl6
11:50 cognominal joined #perl6
11:52 skids joined #perl6
11:55 mcmillhj joined #perl6
11:56 dalek ecosystem: 41f52c8 | (Kamil Kułaga)++ | META.list:
11:56 dalek ecosystem: removing lacuna-cookbook
11:56 dalek ecosystem:
11:56 dalek ecosystem: The library is useless since 1 October 2016 (the game Lacuna Expanse gets shutdown)
11:56 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/41f52c8ac6
12:02 Dunearhp How do I build rakudo so that moar has debugging symbols?
12:05 Dunearhp I'm trying to get a useful core dump backtrace for moar
12:05 hackedNODE Dunearhp: cd nqp/MoarVM; perl Configure.pl --debug=3 --prefix=../../install/bin/; make; make install; cd ../..
12:06 hackedNODE (that's from rakudo's checkout
12:06 hackedNODE The Configure.pl also takes --help that lists all of the options
12:06 kurahaupo joined #perl6
12:06 hackedNODE )
12:10 RabidGravy there appears to be something wrong with http://rakudo.org
12:11 RabidGravy oh, not anymore
12:12 RabidGravy it's hit in the tests of LWP::Simple and was taking a long time and then 500ing
12:16 Dunearhp thanks. forgot to set the prefix
12:22 hackedNODE m: $?TABSTOP
12:22 camelia rakudo-moar c01fc3: OUTPUT«WARNINGS for <tmp>:␤Useless use of $?TABSTOP in sink context (line 1)␤»
12:22 hackedNODE m: say $?TABSTOP
12:22 camelia rakudo-moar c01fc3: OUTPUT«8␤»
12:22 hackedNODE TIL that's a thing :P
12:22 hackedNODE "How many spaces is a tab in a heredoc or virtual margin"
12:22 hackedNODE Clearly that's a bug! It should be 4 :P
12:25 bioduds joined #perl6
12:25 bioduds hello all :)
12:26 hackedNODE \o
12:31 masak hackedNODE: 4 is the "new standard", what I see most Python programs etc be written in. 8 is the old convention, and what tabs do in terminal emulators etc.
12:31 masak tab characters, I mean.
12:32 * sjn thought for a second masak was talking about π
12:32 atacama joined #perl6
12:32 masak well, if π is 4 then you're either in a space with positive curvature, or in Indiana.
12:32 sjn fortunally, the next sentence fixed that impression. :)
12:33 hackedNODE m: say 2×π == τ
12:33 camelia rakudo-moar c01fc3: OUTPUT«True␤»
12:33 masak hackedNODE: generally not a good idea to use exact equality on floaty things, though.
12:33 hackedNODE m: say 2×π ≅ τ
12:33 camelia rakudo-moar c01fc3: OUTPUT«True␤»
12:34 hackedNODE m: say ୨×π ≅ τ
12:34 camelia rakudo-moar c01fc3: OUTPUT«True␤»
12:34 hackedNODE :D
12:34 ufobat joined #perl6
12:35 itaipu joined #perl6
12:37 * sjn thinks perl6 should have the option to warn when confusing homographs are used
12:38 * hackedNODE strongly disagrees
12:38 sjn rly?
12:38 sjn why?
12:38 bioduds I got the server calls to work! what was happening is that I was using asynchronous calls
12:38 hackedNODE Options to warn means extra processing and slower language. And what's the usefulness of that warning?
12:39 bioduds so they gave results before they were actually ready
12:39 bioduds :)
12:39 sjn m: say ୨ == 9;
12:39 camelia rakudo-moar c01fc3: OUTPUT«False␤»
12:39 bioduds now, I got a synchronous method and it is working greatly
12:39 moritz warnings are the worst of the both worlds; ideally either a construct is illegal, or legal
12:39 hackedNODE sjn: and? That's not a real program
12:40 moritz if, as the language designer, you can't decide which way it is, you neither generate a proper error, nor is the feature really usuable due to the warnings
12:40 * hackedNODE nods
12:41 sjn moritz: fair enough. I was more thinking of the optionality being important
12:42 sjn something one can turn on as get an answer to "is this sane in $some_certain_aspect?"
12:42 moritz use ascii;
12:42 sjn mm
12:43 user9 joined #perl6
12:44 sjn hackedNODE: maybe I'm a little paranoid these days, but I'm thinking that if someone wants to introduce horrible bugs that are really difficult to spot, then homonyms can be used for that
12:44 sjn m: say 2.1 + 0.୨
12:44 camelia rakudo-moar c01fc3: OUTPUT«2.3␤»
12:45 hackedNODE sjn: I'd say paranoid is right. I don't need homonyms to introduce bugs on purpose. I can just write shitty code.
12:45 hackedNODE Why would someone write the above on purpose?
12:45 * sjn has lately been working in the financial sector, where code reviews and such are mandatory
12:45 sjn hackedNODE: disgruntled employees?
12:45 sjn sadly, they exist
12:46 hackedNODE And that's the best they can think of? :)
12:46 * hackedNODE would go for http://perl6.party/post/Anguish--Invisible-Programming-Language-and-Invisible-Data-Theft
12:46 sjn hey, it's the tiny subtle bugs that can hurt a lot
12:46 sjn they still have to pass a code review, right?
12:47 hackedNODE If I ran a shop and found out a someone added that for no good reason, they'd be fired on the spot.
12:47 user9 joined #perl6
12:47 sjn hackedNODE: yeah, I agree
12:47 sjn still, the damage can happen
12:47 sjn and a well placed bug like that can cost a lot, especially in a financial setting
12:47 hackedNODE Seems an awfully hypothetical scenario to warrant an introduction of a warning. Especially since you have to look not just for ୨, but for its use in close proximity with other digits
12:48 sjn hackedNODE: nah, a "use ascii" test would be sufficient
12:48 sjn the warning idea I get is a bad idea
12:48 hackedNODE for English-centric countries that write programs with no intentions of internationalizing them... I guess
12:48 sjn but having the possibility to check for bugs like that, would still be interesting in some settings
12:49 hackedNODE I'm sure there's a grep incantation that can do it :P
12:49 * hackedNODE &'
12:49 sjn how would one programatically check for something like that?
12:49 perlpilot "Oh, here's a bit of code that looks like it does what I want; I'll just cut and paste ..."    Oops.  :-)
12:49 robertle joined #perl6
12:52 mcmillhj joined #perl6
12:57 melezhik Hi!
12:57 yoleaux 15 Sep 2016 00:09Z <Zoffix> melezhik: your attempt to gather captures may be hindered with what I think is a bug: http://irclog.perlgeek.de/perl6/2016-09-15#i_13212176
12:57 user9 joined #perl6
12:57 melezhik have not spoken here for awhile ))
12:58 hackedNODE that wasn't a bug actually.
12:58 melezhik yolexaus - I guess I have finished a complete working code, at least for me
12:59 melezhik it is here - https://github.com/melezhik/outhentix-dsl/blob/master/lib/Outhentix/DSL.pm6#L274-L282
13:00 melezhik this is exactly what I needed, thanks to Zoffix and others for help!
13:02 melezhik so as for me, I am completely satisfied with answers I got ... and I have my working code, I also gained some Perl6 / regex knowledges by the road ... yeah
13:03 domidumont joined #perl6
13:03 melezhik I have a different question concerning Perl6 objects and code eval ...
13:05 bjz joined #perl6
13:06 melezhik if it possible to eval a Perl6 code "in a context" of object;  let me provide a useful example first ...
13:08 melezhik class Foo { method !hello { say "hello" } }; my $foo = Foo.new;
13:08 melezhik and I want to eval "self!hello" for instance $foo;
13:09 melezhik I know such a things are possible in ruby
13:09 RabidGravy is there a way of getting the modules for a single author that I have missed?
13:10 melezhik so this is my question ... -  if it possible to eval a Perl6 code "in a context" of object;
13:10 cdg joined #perl6
13:10 RabidGravy melezhik, if I understand correctly, no
13:10 moritz melezhik: in Perl 6, you'd use the MOP for that
13:11 moritz melezhik: my $method = $foo.^privat_method_table(){'hello}; $method($foo)
13:11 moritz something along those lines
13:12 melezhik moritz: thanks, will try ... do you know any doc links on Perl6 MOP ?
13:12 RabidGravy or even "$foo.$method"
13:12 rgrinberg joined #perl6
13:12 RabidGravy $foo.$method() rather
13:12 moritz melezhik: https://docs.perl6.org/language/mop
13:13 moritz and in https://docs.perl6.org/type.html search for Metamodel
13:13 melezhik actually,  I need not only a private method invocation, it was just an example, I want to eval a piece of Perl6 code, given by string and eval it "as if it would executed inside obect's class'
13:13 canopus joined #perl6
13:13 moritz melezhik: why?
13:14 moritz that's a very ruby-ish approach, not a very perlish approach :-)
13:14 melezhik moritz: sure, this is why I said I saw it in ruby
13:15 melezhik "why" ... good question, let me think abit to answer you
13:16 moritz it might be possible with  augment class TheClass { EVAL "string here }, but using the MOP is likely cleaner and more robust
13:18 melezhik to answer on why - , let me try ... in simple words . Well  end user _interact _with some DSL  ( not Perl6 code ) which make it possible to eval some Perl6 code, but I want to eval this code  a "context" of some existed instance, not just a  main program
13:19 gfldex m: use MONKEY-SEE-NO-EVAL; class A { has $.a }; my $a = A.new: :a(42); ($a but role :: { method eval ($c) { EVAL $c } }).eval('say $a');
13:19 camelia rakudo-moar f6524e: OUTPUT«A.new(a => 42)␤»
13:19 gfldex melezhik: ^^^ there you go
13:19 melezhik gfldex: thanks ...
13:19 gfldex m: use MONKEY-SEE-NO-EVAL; class A { has $.a }; my $a = A.new: :a(42); ($a but role :: { method eval ($c) { EVAL $c; self } }).eval('say $a');
13:19 camelia rakudo-moar f6524e: OUTPUT«A.new(a => 42)␤»
13:20 gfldex maybe better to return self
13:20 gfldex not sure what happens if you mutate inside eval, but with a returned self you can assign back to $a
13:21 gfldex also Perl 6++
13:21 melezhik if your approach could be generalized on evaling ANY perl6 code?
13:22 gfldex ANY Perl 6 code is to bit a target for me to comprehend
13:22 RabidGravy what have I been doing with Perl 6 in the last year or so?
13:23 gfldex s/bit/big/
13:23 melezhik gfldex: probably I had my question wrong, sorry, I will take a look at your example ... thanks ...
13:24 carbonscott joined #perl6
13:25 wamba joined #perl6
13:29 perlawhirl joined #perl6
13:29 gfldex m: use MONKEY-SEE-NO-EVAL; class A { has $!a; method set-a($a){$!a = $a} }; my $a = A.new.set-a(42); ($a but role :: { method eval ($c) { EVAL $c; self } }).eval('say $!a');
13:29 camelia rakudo-moar f6524e: OUTPUT«P6opaque: no such attribute '$!a' in type Int+{<anon|72521424>} when trying to get a value␤  in block <unit> at EVAL_0 line 1␤  in method eval at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
13:30 tadzik joined #perl6
13:30 Matias[m] joined #perl6
13:30 M-Illandan joined #perl6
13:30 Guest80831 joined #perl6
13:30 Matthew[m] joined #perl6
13:39 melezhik gfldex: your way works for me, a quick question, does "($a but role :: { method eval ($c) { EVAL $c; self } })" redefine eval method for the _copy_ of $a instance? so that eval work "in context" of instance?
13:40 melezhik I have read this - https://docs.perl6.org/routine/but
13:43 psch m: my $a = 1; my $b = $a but "foo"; say $a.WHAT; say $b.WHAT
13:43 camelia rakudo-moar f6524e: OUTPUT«(Int)␤(Int+{<anon|67245152>})␤»
13:43 moritz it says it copies the object before modifying it, no?
13:45 melezhik moritz: if you ask me, I think so, I just say HOW I understand a gfldex: 's code so that I could understand it completely , not  just "copy and paste " it ...
13:46 skids joined #perl6
13:48 Actualeyes joined #perl6
13:48 psch melezhik: well, the example uses the $a with mixin as invocant of a method
13:49 psch m: sub f { "foo" }; say (&f()).substr(1) # essentially like this vOv
13:49 camelia rakudo-moar f6524e: OUTPUT«oo␤»
13:49 jkramer What's the most efficient way in P6 to read from one file descriptor and write to another (ie. read a file and write to a socket)? Is there support for sendfile(2) or something?
13:49 jkramer I particularly want to avoid a buffer in between
13:59 pmurias joined #perl6
14:00 hackedNODE shell 'cat foo > bar' XD
14:01 pmurias sjn: re "how would one programatically check for something like that", I would imagine 'use mandatory-company-coding-standard' should ban such things
14:01 hackedNODE jkramer: sendfile is standard C lib, right? Just use it via NativeCAll
14:02 RabidGravy $out.spurt: $in.slurp-rest;
14:03 hackedNODE RabidGravy: and that won't have a buffer in between?
14:04 pmurias sjn: I can't really imagine a good reason to use anything besides ascii 0-9 in number literals
14:04 RabidGravy I'm sure it has in there somewhere
14:04 hackedNODE m: use NativeCall; sub sendfile (int32, int32, size_t, size_t --> size_t) is native {};
14:04 camelia rakudo-moar f6524e: ( no output )
14:05 dj_goku joined #perl6
14:05 hackedNODE jkramer: ^ something or other. and you can use .native-descriptor on opened file handles to get the desc riptiors to give to the sub
14:16 sammers joined #perl6
14:22 acrussell joined #perl6
14:29 ka joined #perl6
14:32 khw joined #perl6
14:38 jkramer hackedNODE: The second arg should be a pointer. Will try with NativeCall, never used that before
14:41 hackedNODE jkramer, there's likely a way to do pointers too (/me isn't familiar with NativeCall). The docs are here: https://docs.perl6.org/language/nativecall
14:43 jkramer There's Pointer thing, but I don't really need that functionality. I guess I can just pass Nil and it'll translate it to NULL?
14:44 hackedNODE I think so
14:48 moritz if the signature of the nativecall sub has a type constraint, you can pass a type object of that type to generate a NULL pointer
14:48 moritz so if it's a sub foo(Str) is nativecall(...), calling it with foo(Str) (instead of foo("some string")) passes a NULL pointer
14:50 mcmillhj joined #perl6
14:54 tushar joined #perl6
14:55 jkramer Thanks, already got it working, just making it pretty now. You think there's an interest for IO::SendFile?
14:57 skids m: my $p = Promise.new; my $v = $p.vow; $v.WHAT.say; say so $v ~~ Promise::Vow;
14:57 camelia rakudo-moar 5f9103: OUTPUT«(Vow)␤Could not find symbol '&Vow'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
14:57 skids m: my $p = Promise.new; my $v = $p.vow; $v.WHAT.say;
14:57 camelia rakudo-moar 5f9103: OUTPUT«(Vow)␤»
14:58 skids m: my $p = Promise.new; my $v = $p.vow; $v.WHAT.say; say so $v ~~ Vow;
14:58 camelia rakudo-moar 5f9103: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    Vow used at line 1␤␤»
14:58 hackedNODE m: my $p = Promise.new; my $v = $p.vow; $v.^name.say
14:58 camelia rakudo-moar 5f9103: OUTPUT«Promise::Vow␤»
14:58 skids Yeah, that's what I did, but...
14:58 skids hmm.
14:59 hackedNODE Probably just not exported
14:59 hackedNODE s: Promise, 'vow'
14:59 skids m: my $p = Promise.new; my $v = $p.vow; my $p2 = Promise.new; my $v2 = $p2.vow;  say so $v ~~ $v2.WHAT;
14:59 camelia rakudo-moar 5f9103: OUTPUT«True␤»
14:59 skids \o/
14:59 skids Now at least it's not an "eq"
15:03 hackedNODE huh, found a weird bug
15:04 hackedNODE oh... s/weird//;
15:04 moritz s/bug/feature/; # :-)
15:04 hackedNODE nah, infinihang
15:04 hackedNODE m: my $p = Promise.new; my $v = $p.vow; say $p ~~ Planned
15:04 camelia rakudo-moar 5f9103: OUTPUT«(timeout)»
15:05 hackedNODE s: Planned, 'ACCEPTS'
15:05 jnthn Planned is just an enum member
15:05 hackedNODE I see the robots are on strike..
15:05 jnthn But it shouldn't time out
15:05 moritz you want $s.status or so, right?
15:05 hackedNODE Right
15:05 moritz m: say Promise.^methods(:local)
15:05 camelia rakudo-moar 5f9103: OUTPUT«(BUILD vow keep break result cause then start in at anyof allof Supply Str Numeric Bool scheduler status)␤»
15:05 jnthn Right, but why on earth would that hang?
15:06 moritz good question
15:06 jnthn m: my $p = Promise.new; say $p ~~ Planned
15:06 jnthn m: say Promise.new ~~ Planned
15:06 moritz m: say Promise ~~ Planned
15:06 * moritz predicts at least two timeouts
15:06 hackedNODE m: enum Foo <bar ber>; my $p = Promise.new; say $p ~~ ber
15:06 jnthn poor bot :)
15:07 hackedNODE :)
15:07 * hackedNODE & lunch
15:07 robertle joined #perl6
15:07 camelia rakudo-moar 5f9103: OUTPUT«(timeout)»
15:07 camelia rakudo-moar 5f9103: OUTPUT«(timeout)»
15:07 camelia rakudo-moar 5f9103: OUTPUT«Invocant requires an instance of type Promise, but a type object was passed.  Did you forget a .new?␤  in block <unit> at <tmp> line 1␤␤»
15:07 camelia rakudo-moar 5f9103: OUTPUT«(timeout)»
15:07 jnthn m: say Promise.new == Planned
15:07 jnthn m: say Promise.new == 42
15:08 camelia rakudo-moar 5f9103: OUTPUT«(timeout)»
15:08 camelia rakudo-moar 5f9103: OUTPUT«(timeout)»
15:08 jnthn m: say Supply.new == 42
15:08 camelia rakudo-moar 5f9103: OUTPUT«Cannot directly create a Supply. You might want:␤ - To use a Supplier in order to get a live supply␤ - To use Supply.on-demand to create an on-demand supply␤ - To create a Supply using a supply block␤  in block <unit> at <tmp> line 1␤␤»
15:08 jnthn m: say Supply.from-list(1..10) == 42
15:08 camelia rakudo-moar 5f9103: OUTPUT«Cannot resolve caller Numeric(Supply: ); none of these signatures match:␤    (Mu:U \v: *%_)␤  in block <unit> at <tmp> line 1␤␤»
15:08 jnthn Why on earth doesn't Promise say that when =='d?
15:09 RabidGravy boo
15:09 moritz method Numeric(Promise:D:) { self.result.Numeric }
15:09 moritz from class Promise
15:09 jnthn omfg
15:09 jnthn # experimental
15:09 jnthn method Str(Promise:D:)     { self.result.Str     }
15:09 jnthn method Numeric(Promise:D:) { self.result.Numeric }
15:09 jnthn Yeah, the experiment failed
15:09 moritz and I guess smart-matching against a numeric enum numifies?
15:10 jnthn Yup
15:10 jnthn *sigh*
15:10 jnthn Will spectest with them gone
15:10 jnthn And then toss them
15:10 jnthn Well, commit
15:10 jnthn Already tossed 'em locally :)
15:16 robertle is there something like FindBin in perl6?
15:17 ilmari m: say $*PROGRAM
15:17 camelia rakudo-moar 5f9103: OUTPUT«"<tmp>".IO␤»
15:17 ZoffixMobile joined #perl6
15:17 ZoffixMobile huggable, FindBin
15:17 huggable ZoffixMobile, use lib $*PROGRAM.dirname.IO.parent.child("lib").Str; # finds lib/ for scripts in bin/ or t/
15:18 ZoffixMobile robertle, ^
15:18 robertle awesome
15:18 robertle thanks
15:18 ugexe should should .parent instead of .dirname
15:18 ugexe otherwise you lose the volume on windows
15:18 ZoffixMobile oh
15:19 robertle windows my ass ;)
15:19 robertle but will do anyway!
15:19 nine VM::platform-library-name uses dirname
15:20 jnthn hackedNODE: Will you RT or add a "doesn't hang" test for those?
15:21 andrzejku joined #perl6
15:21 sammers joined #perl6
15:21 ZoffixMobile jnthn, I'm traveling for the next ~1 hour but can do that then :)
15:22 jnthn Cool :)
15:22 jnthn Will push provided it passes spectest
15:22 ugexe nine: i fixed that with some other stuff in an unmerged PR https://github.com/rakudo/rakudo/pull/730/files#diff-f8c7ea504081c5fcb5fd15d772eefc15L56
15:23 nine ugexe: oh, should have a look at it then
15:24 ugexe nine: the PR was not mergable because it changes VM.platform-library-name's interface to always return IO::Path instead of IO::path when given a relative path argument and Str when given an absolute path argument
15:26 ugexe which is all i really wanted to fix, but that meant changing stuff in lib/NativeCall.pm6:guess_library_name too which is a mess
15:27 nine oh yes, both are not prime examples of good engineering
15:27 jnthn ZoffixMobile: Pushed.
15:27 ZoffixMobile cool
15:33 ugexe `perl6 -MInline::Perl5 -e 'my $db = class :: { use DBIx::Class::Schema::Loader:from<Perl5>; also is DBIx::Class::Schema::Loader; }.connect("dbi:SQLite:dbname=db/development.db"); say $db.resultset("Sessions").first.id` # I like that I can do this without writing any Perl5 at all
15:33 darutoko- joined #perl6
15:34 timotimo you don't even have to -MInline::Perl5 for that
15:34 timotimo the :from<Perl5> pulls it in for you
15:34 ugexe ah cool
15:34 mcmillhj joined #perl6
15:37 darutoko joined #perl6
15:37 jkramer I made this: https://gist.github.com/jkramer/273e56bb24a07d1eb2a7be4d786dc306
15:40 ilmari ugexe: do you need the class :: { ... also is } dance? can't you just do: use DBICSL:from<Perl5>; DBICSL.connect(..)?
15:42 AlexDaniel joined #perl6
15:42 AlexDaniel m: say ‘????’.uniname
15:42 camelia rakudo-moar 2673ca: OUTPUT«BUTTERFLY␤»
15:42 AlexDaniel \o/
15:44 ugexe ilmari: correct - although im actually using additional sugar in there
15:44 nine ugexe: I always just do perl6 -e 'use DBIx::Class::Schema::Loader:from<Perl5>; DBIx::Class::Schema::Loader.connect("dbi:SQLite:dbname=db/development.db"); ...'
15:49 jkramer Is this a good idea or rather terrible? IO:D $input where *.can('native-descriptor')
15:49 timotimo it won't give a very good error message if it fails
15:49 timotimo but otherwise it's probably fine
15:50 jkramer Problem is I want to support IO::handle and IO::Socket and they don't inherit from a common class as it seems
15:50 timotimo ah
15:50 skids m: my $a = Channel.new; start react { whenever $a { $_.say; $_.poll.say } }; sleep 0.1; $a.send($_) for 1..10; sleep 0.3
15:50 camelia rakudo-moar 2673ca: OUTPUT«1␤2␤Unhandled exception in code scheduled on thread 4␤Access denied to keep/break this Promise; already vowed␤  in any  at /home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1␤  in block  at <tmp> line 1␤  in any  at /ho…»
15:52 jkramer Aaargh goddamn it, IO::Socket::Async doesn't have .native-descriptor as it seems :(
15:52 jkramer Hmm, although it does IO::Socket
15:52 jkramer Ok might still work :)
15:54 jnthn skids: I think the .poll there is the issue; $_ is a value sent on the channel, not the channel.
15:54 skids ergh.
15:54 jnthn skids: I think the concurrent failure in different threads is then causing it to try and .break the react Promise twice...
15:55 jnthn (There's an RT about a similar race)
15:55 skids And I thought I had golfedthat correctly.
15:55 skids oops.
15:55 skids Back to hole 4
15:56 jkramer According to the docs IO::Socket::Async does IO::Socket just like IO::Socket::INET, however IO::Socket::INET does have .native-descriptor from IO::Socket while *::Async doesn't
16:04 Ven_ joined #perl6
16:05 MilkmanDan joined #perl6
16:10 Ven_ joined #perl6
16:17 SourceBaby joined #perl6
16:18 Undercover joined #perl6
16:18 hackedNODE s: IO::Socket::Async, 'native-descriptor'
16:18 SourceBaby hackedNODE, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e line 6␤␤
16:18 hackedNODE s: IO::Socket::INET, 'native-descriptor'
16:18 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/blob/5f91031/src/core/IO/Socket.pm#L93
16:20 itaipu joined #perl6
16:23 dalek doc: 02bb8dd | (Zoffix Znet)++ | doc/Type/IO/Socket/Async.pod6:
16:23 dalek doc: IO::Socket::Async doesn't IO::Socket
16:23 dalek doc: review: https://github.com/perl6/doc/commit/02bb8dd110
16:24 hackedNODE jkramer: it never did. The docs were wrong.
16:25 dalek perl6.org: 82aaa1f | (Angelo Compagnucci)++ | source/index.html:
16:25 dalek perl6.org: move perl.org link on homepage
16:25 dalek perl6.org:
16:25 dalek perl6.org: Fixes #49
16:25 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/82aaa1f1a5
16:25 dalek perl6.org: 2ec6600 | (Zoffix Znet)++ | source/index.html:
16:25 dalek perl6.org: Merge pull request #54 from angeloc/master
16:25 dalek perl6.org:
16:25 dalek perl6.org: move perl.org link on homepage
16:25 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/2ec6600048
16:26 timotimo i imagine synopsebot6 could learn to recognize dalek .* repositoryname .* Fixes #\d+
16:27 hackedNODE and it could avoid giving a link to RT when the link is already present, when it was *just* mentioned, or when the same ticket is mentioned twice :)
16:27 hackedNODE #12345 #12345
16:27 timotimo *shrugs* :)
16:27 hackedNODE :)
16:27 timotimo you know, i can't actually program. i can just harass people who can into doing my bidding
16:31 jkramer hackedNODE: That's sad, is there a reason for that or was it just forgotten or something?
16:32 jkramer s: IO::Socket::Async
16:32 SourceBaby jkramer, Something's wrong: ␤ERR: Cannot resolve caller sourcery(IO::Socket::Async); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
16:32 jkramer Hmm, how does this work? I was looking for the IO::Socket::Async source earlier :)
16:33 jkramer Anyway found it
16:33 hackedNODE jkramer: I'm unsure. I see as opposed to the role,  it uses async nqp ops, so maybe there is a reason. But the very first commit for it did not have a `does` so the docs were wrong
16:34 hackedNODE Why are so many people ask how the bot works but never bother to ask the bot for help? :)
16:34 hackedNODE s/are/do/;
16:34 hackedNODE SourceBaby: help
16:34 SourceBaby hackedNODE, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See http://modules.perl6.org/dist/CoreHackers::Sourcery
16:35 jkramer s: IO::Socket::Async, 'new'
16:35 SourceBaby jkramer, Sauce is at https://github.com/rakudo/rakudo/blob/2673ca8/src/core/IO/Socket/Async.pm#L7
16:35 jkramer \o/
16:35 hackedNODE that will rarely work, as you'd usually get the Mu's new
16:36 hackedNODE In fact, it would've failed as recently as 24 hours ago :)
16:36 jkramer :D
16:37 araujo joined #perl6
16:39 itaipu joined #perl6
16:39 hackedNODE timotimo: so where's the sauce? I can do the bidding
16:40 geekosaur synopsebot6, help
16:40 geekosaur hmf
16:40 timotimo that could also be implemented ;)
16:41 timotimo it just lives on hack
16:41 geekosaur well, that was actually at least half a response to [28 16:34:11] <hackedNODE> Why are so many people ask how the bot works but never bother to ask the bot for help? :)
16:41 timotimo i think there's a git repository; it might not have some changes upstream that i made perhaps?
16:41 geekosaur :p
16:41 jkramer Hmm, I augmented .native-descriptor into IO::Socket::Async but it still doesn't match where *.can('native-descriptor')
16:42 hackedNODE geekosaur: I've tried help with it :P
16:42 timotimo https://github.com/tadzik/synopsebot - we're using synopsebot.p6 for synopsebot6
16:42 timotimo https://gist.github.com/timo/58996f10e6334fcab124f86b510b8fc2 - this is the local diff i have on top of that
16:43 hackedNODE jkramer: it's .^can
16:43 timotimo yes we .^can
16:43 hackedNODE hm... what's .can tho?
16:44 hackedNODE Actually both work
16:44 timotimo it cans things
16:44 hackedNODE m: use MONKEY-TYPING; augment class IO::Socket::Async { method native-descriptor {} }; say IO::Socket::Async.can('native-descriptor')
16:44 camelia rakudo-moar 2673ca: OUTPUT«(native-descriptor)␤»
16:44 hackedNODE m: use MONKEY-TYPING; augment class IO::Socket::Async { method native-descriptor {} }; say IO::Socket::Async^.can('native-descriptor')
16:44 camelia rakudo-moar 2673ca: OUTPUT«one((Async), ())␤»
16:44 hackedNODE heh
16:45 hackedNODE m: use MONKEY-TYPING; augment class IO::Socket::Async { method native-descriptor {} }; say IO::Socket::Async.^can('native-descriptor')
16:45 camelia rakudo-moar 2673ca: OUTPUT«(native-descriptor)␤»
16:45 timotimo hackedNODE: why does 9 x pi =~= tau? :(
16:46 timotimo tau is about 6 and 9 x pi is like 999
16:46 timotimo oh, that's not an x, it's a multiplication
16:47 hackedNODE timotimo: it's not 9; it's ୨
16:47 timotimo ok. and that is what now? :)
16:47 timotimo .u ୨
16:47 yoleaux U+0B68 ORIYA DIGIT TWO [Nd] (୨)
16:47 hackedNODE :)
16:47 timotimo oh for fucks sake :) :) :)
16:47 timotimo unicode screwed us over majorly there
16:48 timotimo i thought look-alikes were only for phishing
16:48 itaipu joined #perl6
16:49 CIAvash joined #perl6
16:49 sjn google "homograph attack" for some interesting reading
16:49 timotimo yeah :S
16:49 sjn and translate that to code o_O
16:50 timotimo m: say uniprop "½"
16:50 camelia rakudo-moar 2673ca: OUTPUT«No␤»
16:51 jkramer hackedNODE: Thanks for the pointer, gotta check it out tomorrow. I just broke everything and want to gome home :)
16:52 madosan joined #perl6
16:52 ilmari m: say ୨×π == τ
16:52 camelia rakudo-moar 2673ca: OUTPUT«True␤»
16:52 madosan I'm using bailador and using the template thing
16:53 madosan why doesn't " template 'template.tmpl',{ titles => @titles } " work?
16:56 sjn m: say $account = 10_000; say $account * 0.୨୨; # pay 1% transaction fee
16:56 camelia rakudo-moar 2673ca: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$account' is not declared␤at <tmp>:1␤------> 3say 7⏏5$account = 10_000; say $account * 0.୨୨; ␤»
16:56 sjn m: my $account = 10_000; say $account * 0.୨୨; # pay 1% transaction fee
16:56 camelia rakudo-moar 2673ca: OUTPUT«2200␤»
16:56 sjn there
16:56 psch uhm, .99 is 1%?
16:56 psch even assuming the misreading stands
16:57 sjn homograph attack
16:57 psch right but 50% is half, is .5
16:57 timotimo that calculates "the rest you guys have" i suppose
16:57 psch ohh
16:57 a3r0 joined #perl6
16:57 psch yeah, okay, that makes sense
16:58 psch "we turn the balance into 99% because deduce 1%"
16:58 sjn now that one would of course be noticed pretty quickly
16:58 psch .u ୨
16:58 yoleaux U+0B68 ORIYA DIGIT TWO [Nd] (୨)
16:58 bioduds P6DB is coming...
16:58 ilmari m: say 1୨3
16:58 camelia rakudo-moar 2673ca: OUTPUT«123␤»
16:58 timotimo the what now?
16:59 sufrostico joined #perl6
16:59 ilmari is it wise to allow mixing scripts in a single numeric literal?
16:59 sjn ilmari: good question :)
16:59 ufobat madosan, what do you mean with "it doesn't work?"
16:59 psch m: say ²1
16:59 camelia rakudo-moar 2673ca: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say ²7⏏1␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤        s…»
16:59 psch eh, superscript is extra weird
16:59 acrussell joined #perl6
16:59 ilmari m: say ¹²
16:59 madosan I try to iterate through the array after I pass it, and the values don't match
16:59 camelia rakudo-moar 2673ca: OUTPUT«1␤»
17:00 ilmari m: say ²³
17:00 camelia rakudo-moar 2673ca: OUTPUT«8␤»
17:00 sjn m: say ¹+²
17:00 camelia rakudo-moar 2673ca: OUTPUT«3␤»
17:00 ilmari .u ³
17:00 yoleaux U+00B3 SUPERSCRIPT THREE [No] (³)
17:01 ufobat madosan: Bailador just passed your things to Template::Mojo
17:01 madosan it now says "Method 'map' not found for invocant of class 'Mu'"
17:02 ufobat template() calls Bailador::App.template -> Bailador::Template.render which is probably Bailador::Template::Mojo -> https://github.com/ufobat/Bailador/blob/master/lib/Bailador/Template/Mojo.pm#L9
17:03 ufobat fyi: https://github.com/ufobat/Bailador#templates
17:04 bioduds wow, this works fine!!   return (10..100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000).pick.fmt( '%x' );
17:04 bioduds incredible
17:05 timotimo and that surprises you ... why? :)
17:05 timotimo we're not php, you know ;) ;)
17:05 bioduds ;)
17:05 bioduds correct!!!
17:06 sjn m: (10..100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000).pick.fmt( '%x' )
17:06 camelia rakudo-moar 2673ca: ( no output )
17:06 ufobat madosan, just a guess, maybe its becaue you pass a { key => @array} to the template and your first line in the template assumes just the @array, just a thought
17:06 sjn m: say (10..100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000).pick.fmt( '%x' )
17:06 camelia rakudo-moar 2673ca: OUTPUT«2a93a60b35fc72e125e4b028780c84e71451c0dc2b212bc57d891d77754f932ec000037a067374a6821751421518␤»
17:07 madosan I've fixed it now, thanks ufobat, I should have just done template 'template.tmpl', @array;
17:07 bioduds this here was an overflow:   return (10..10**1000**1000).pick.fmt( '%x' );
17:08 timotimo that's a big number :)
17:09 ufobat welcome :)
17:10 dalek doc: 5ac359a | (Tom Browder)++ | doc/Type/Signature.pod6:
17:10 dalek doc: add example of a trait with a where clause
17:10 dalek doc: review: https://github.com/perl6/doc/commit/5ac359a99c
17:10 dalek doc: 7de9973 | (Tom Browder)++ | doc/Type/Signature.pod6:
17:10 dalek doc: Merge pull request #920 from tbrowder/sig-example
17:10 dalek doc:
17:10 dalek doc: add example of a trait with a where clause
17:10 dalek doc: review: https://github.com/perl6/doc/commit/7de99735e8
17:10 bioduds yep
17:10 bioduds huuuuuuuuge
17:16 FROGGS joined #perl6
17:18 hackedNODE bioduds: that's not the impressive part of that code
17:18 hackedNODE m: say sum 10..10¹¹¹
17:18 camelia rakudo-moar 2673ca: OUTPUT«500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000499999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999955␤»
17:19 hackedNODE Try that in some other languages.... say Perl 5 :)
17:19 timotimo that's just because it's special-cased :P
17:19 hackedNODE sshhh! It's our corporate secret! :)
17:20 bioduds 10¹¹¹ this works? I thought only squared worked
17:20 bioduds cool
17:20 hackedNODE nah, all of them work
17:20 ilmari s: Range, 'sum'
17:20 SourceBaby ilmari, Sauce is at https://github.com/rakudo/rakudo/blob/2673ca8/src/core/Range.pm#L607
17:20 bioduds that is never happening in any other language
17:21 bioduds math done right is what they're saying and I can see the reason
17:21 timotimo matlab
17:21 bioduds 0.1 + 0.2 = 0.3 in matlab?
17:22 timotimo probably
17:22 * timotimo doesn't own a matlab
17:22 * timotimo bbl
17:23 bioduds how do I write this 10¹¹¹ in my IDE??
17:23 hackedNODE bioduds: I have it bound to a button on my Perl 6 keyboard at home and on this box, I can just use a compose sequence: Compose, ^1
17:23 timotimo https://docs.perl6.org/language/unicode_entry
17:24 vcv in vim, i type Ctrl+K, 1, 1 in insert mode
17:24 timotimo cool, i didn't notice we've got a webchat link on doc.perl6.org
17:24 timotimo that's good
17:27 TEttinger joined #perl6
17:34 domidumont joined #perl6
17:36 CIAvash joined #perl6
17:40 andrzejku joined #perl6
17:43 itaipu joined #perl6
17:43 gfldex bioduds: if you like oneliners this might help https://gfldex.wordpress.com/2016/08/31/one-line-of-unicode-at-you-fingertips/
17:53 eliasr joined #perl6
17:54 bioduds gfldex : love oneliners :) who doesn't?? thansk
17:59 spider-mario joined #perl6
18:01 Ven_ joined #perl6
18:03 Guest80831 joined #perl6
18:03 Guest80831 joined #perl6
18:07 saki joined #perl6
18:07 darutoko- joined #perl6
18:15 MilkmanDan joined #perl6
18:18 skids Ah.  Now this is interesting:
18:19 skids m: my $w = Channel.new; start react { whenever $w { $_.say; while $w.poll -> $f { "polled $f".say; }; } }; sleep 0.1; $w.send($_) for 42..50; sleep 0.4;
18:19 camelia rakudo-moar 2a1605: OUTPUT«42␤polled 43␤polled 44␤polled 45␤polled 46␤polled 47␤48␤polled 49␤polled 50␤»
18:19 skids m: my $w = Channel.new; start react { whenever $w { $_.say; while $w.poll -> $f { "polled $f".say; }; } }; $w.send($_) for 42..50; sleep 0.4;
18:19 camelia rakudo-moar 2a1605: OUTPUT«42␤43␤44␤45␤46␤47␤48␤49␤50␤»
18:19 skids If the channel is pushed before the thread starts, poll always returns Nil.
18:21 Ven_ joined #perl6
18:21 skids m: my $w = Channel.new; start react { whenever $w { $_.say; while $w.poll -> $f { "polled $f".say; }; } }; $w.send(41); sleep 0.1; $w.send($_) for 42..50; sleep 0.4;
18:21 camelia rakudo-moar 2a1605: OUTPUT«41␤42␤polled 43␤polled 44␤polled 45␤polled 46␤47␤48␤49␤polled 50␤»
18:22 skids Or, it does until somethingh sends on the channel post-thread-start.
18:24 labster joined #perl6
18:25 hackedNODE s: Channel.new, 'poll'
18:25 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/blob/2a16055/src/core/Channel.pm#L71
18:26 skids Yeah that'll go down to VM level no doubt.
18:26 jnthn A channel is just backed by a concurrent queue.
18:26 hackedNODE Looks fine to me, TBH.
18:27 hackedNODE You sleep, so .poll returns, but then you send a whole bunch of data, so the poll has a chance to fetch it
18:27 jnthn It's not much to do with poll and everything to do with Channel.Supply :)
18:28 skids m: my $w = Channel.new; start react { whenever $w { $_.say; while $w.poll -> $f { "polled $f".say; }; } }; $w.send($_) for 1..10; sleep 0.1; $w.send($_) for 42..50; sleep 0.4;
18:28 camelia rakudo-moar 2a1605: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤42␤polled 43␤polled 44␤polled 45␤46␤polled 47␤48␤49␤50␤»
18:28 skids The whenever is obviously seeing the data sent before it got run, but the poll does not.
18:29 hackedNODE It does.
18:29 jnthn Yeah, that's likely
18:29 kyclark http://lpaste.net/231540
18:29 kyclark I'm getting "Too many positionals passed; expected 1 argument but got 2000"
18:29 kyclark So I don't understand how to pass an array to a sub
18:30 kyclark I'm saying "writer(@seqs);"
18:30 hackedNODE You have a race condition there. When you receive a value in your channel, you attempt to immediately poll it for more data (which returns Nil if there's no data), so if you don't send more fast enough the .poll returns, and then it's up to the next whenever to trigger another poll
18:30 kyclark And my sub is "sub writer (@seqs)"
18:30 skids hackedNODE: That's the intended behavior, yes.
18:31 kyclark Hmm, I'm using @seqs two times -- maybe that's a problem?
18:31 psch kyclark: what's the full error message?
18:31 hackedNODE kyclark: what's the full error message?
18:31 jnthn Well, it's also a bit more sutble than that I think. whenever is push-based rather than pull-based. When there are existing values in the channel, then we queue them up for processing with the "whenever"
18:31 hackedNODE psch: you owe me a coke
18:31 kyclark Full error:
18:31 kyclark Too many positionals passed; expected 1 argument but got 2000
18:31 kyclark in sub writer at /home/u20/kyclark/bin/fasplit.pl6 line 16
18:31 gfldex m: my @a = 1,2,3; sub f($b){}; f $@a;
18:31 camelia rakudo-moar 2a1605: ( no output )
18:31 kyclark in sub MAIN at /home/u20/kyclark/bin/fasplit.pl6 line 23
18:31 kyclark in block <unit> at /home/u20/kyclark/bin/fasplit.pl6 line 3
18:31 psch hackedNODE: i'm first locally, sooo..?
18:31 hackedNODE heh
18:31 psch hackedNODE: i'm *also* first on the clog :)
18:32 psch kyclark: that's curious indeed, it does seem to point directly at your &writer
18:32 psch m: sub f(@a) { say "got @a[]" }; f [1,2,3]
18:32 camelia rakudo-moar 2a1605: OUTPUT«got 1 2 3␤»
18:33 hackedNODE kyclark: what's your perl6 -v ?
18:33 kyclark This is Rakudo version 2016.08.1 built on MoarVM version 2016.08
18:34 kyclark Changing the use of @seqs doesn't make a difference.  I also tried having "sub writer(*@seqs)" to be slurpy, but the same error
18:34 hackedNODE kyclark: I suspect you're running the wrong file or you forgot to save or something like that. I don't see a problem with that program.
18:34 skids jnthn: Maybe the whenever is "laying claim" to the values before poll can get at them?
18:35 hackedNODE :/
18:35 jnthn skids: Very likely, yes
18:36 kyclark Hmm, I realized that I wasn't opening my out file with :w, so I fixed that and now it runs.
18:36 psch that's a really weird error though
18:37 perlpilot kyclark: sure you don't have writer(|@seqs) somewhere?
18:37 kyclark Positive.
18:37 hackedNODE m: m: my $w = Channel.new; start react { sleep 1; whenever $w { say "IN"; .say; say "HERE"; while $w.poll -> $f { "polled $f".say; }; }; say "OUT" }; $w.send($_) for 1..10; sleep 0.1; $w.send($_) for 42..50; sleep 1.4;
18:37 camelia rakudo-moar 2a1605: OUTPUT«OUT␤IN␤1␤HERE␤IN␤2␤HERE␤IN␤3␤HERE␤IN␤4␤HERE␤IN␤5␤HERE␤IN␤6␤HERE␤IN␤7␤HERE␤IN␤8␤HERE␤IN␤9␤HERE␤IN␤10␤HERE␤IN␤42␤HERE␤IN␤43␤HERE␤IN␤44␤HERE␤IN␤45␤HERE␤IN␤46␤HERE␤IN…»
18:38 hackedNODE skids: ^ weird that it prints "OUT" which is at the end of a whenever, even though that same block has two other prints in it :S
18:38 hackedNODE kyclark: can you rakudobug that?
18:38 kyclark New version that works: http://lpaste.net/231540
18:38 hackedNODE huggable: rakudobug
18:38 huggable hackedNODE, rakudobug@perl.org or use perl6 query on http://rt.perl.org ; see https://github.com/rakudo/rakudo/#reporting-bugs
18:39 kyclark hackedNODE, sure, but what do I say?
18:40 jnthn hackedNODE: You put it after the whenever block. And a whenever is non-blocking
18:40 hackedNODE jnthn: oh damn :) I meant to put it after the while {}
18:40 jnthn :-)
18:41 Ven_ joined #perl6
18:41 hackedNODE kyclark: that you got a weird error. If the issue was that the handle wasn't in :w mode, then it sould complain about that and not say you have 2000 arguments wrong
18:41 hackedNODE kyclark: preferable with a small test case that reproduces the issue. So we can fix this
18:41 kyclark Roger that.
18:46 jnthn $ ./perl6-m -e "open('foo').print([1,2,3])"
18:46 jnthn Too many positionals passed; expected 1 argument but got 2
18:46 acrussell joined #perl6
18:46 psch yeah, that's what i thought
18:47 jnthn And fine with :w
18:47 psch .print on a non-w handle can't deal with more than the invocant
18:47 hackedNODE But the code shown is "$out.print(@seqs.join("\n"));"
18:47 * hackedNODE knew that was a lie!
18:47 timotimo that's kind of LTA :)
18:47 psch because MMD or something vOv
18:47 jnthn Oh, no
18:47 jnthn Because failure
18:47 jnthn *Failure
18:47 jnthn the open returns a Failure
18:47 psch ohh
18:48 jnthn And we inherit a print
18:48 timotimo yeah
18:48 hackedNODE heh
18:48 jnthn m: print Failure.new
18:48 camelia rakudo-moar 2a1605: OUTPUT«Failed␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:48 timotimo that's pretty problematic in general
18:48 jnthn m: Failure.new.print
18:48 camelia rakudo-moar 2a1605: OUTPUT«Failed␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
18:48 jnthn m: Failure.new.print(1)
18:48 camelia rakudo-moar 2a1605: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
18:48 timotimo i hear it was speculated that any method on Failure was supposed to just pass on the same Failure
18:48 hackedNODE m: sub { fail }.print: 1
18:48 camelia rakudo-moar 2a1605: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
18:48 hackedNODE m: class LOL {}.print: 1
18:48 camelia rakudo-moar 2a1605: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
18:49 psch well that's different
18:49 psch ...i think?
18:49 FROGGS we need a FALLBACK?
18:49 psch maybe not, actually
18:50 girafe joined #perl6
18:54 jnthn I think .print on any old class just being a call that expects no args is fine
18:54 jnthn But on Failure, rather less so
18:54 jnthn Similar for .say
18:55 jnthn The best bet is probably to just implement print/say in Failure and have 'em blow up
18:55 hackedNODE Well, it's kinda anything, really.
18:55 hackedNODE m: Failure.new.native-descriptor
18:55 camelia rakudo-moar 2a1605: OUTPUT«Failed␤␤Actually thrown at:␤  in any  at gen/moar/m-Metamodel.nqp line 3090␤  in block <unit> at <tmp> line 1␤␤»
18:55 hackedNODE Oh, it has to be one of the inherited ones
18:55 jnthn No, that one is fine 'cus we hit FALLBACK
18:55 jnthn Right
18:55 jnthn And some of the inerited ones are just fine
18:56 jnthn .can is sensible enough, for example
18:56 hackedNODE Is there a difference between .can and .^can?
18:56 hackedNODE m: Any, 'can'
18:56 camelia rakudo-moar 2a1605: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "can" in sink context (lines 1, 1)␤»
18:56 hackedNODE s: Any, 'can'
18:56 SourceBaby hackedNODE, Sauce is at https://github.com/rakudo/rakudo/blob/2a16055/src/core/Mu.pm#L607
18:56 hackedNODE s: Any, '^can'
18:56 SourceBaby hackedNODE, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e line 6␤␤
18:57 hackedNODE s: Any.HOW, 'can'
18:57 SourceBaby hackedNODE, Something's wrong: ␤ERR: X::Multi::NoMatch exception produced no message␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e line 6␤␤
18:57 hackedNODE :(
18:57 hackedNODE Ah, OK. No difference: https://github.com/rakudo/rakudo/blob/2a16055/src/core/Mu.pm#L608
18:58 itaipu_ joined #perl6
19:01 Ven_ joined #perl6
19:14 maybekoo2 joined #perl6
19:21 Ven_ joined #perl6
19:31 andrzejku joined #perl6
19:32 patrickz joined #perl6
19:41 Ven_ joined #perl6
19:41 dalek perl6.org: 80c5081 | (Angelo Compagnucci)++ | source/index.html:
19:41 dalek perl6.org: Spurious Horizontal Scroll on Mobile
19:41 dalek perl6.org:
19:41 dalek perl6.org: * Header and main rows should be into a container fluid
19:41 dalek perl6.org:
19:41 dalek perl6.org: Fixes: #51
19:41 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/80c5081cb2
19:41 dalek perl6.org: 3794cdf | (Angelo Compagnucci)++ | source/index.html:
19:41 dalek perl6.org: Spurious Horizontal Scroll on Mobile
19:41 dalek perl6.org:
19:41 dalek perl6.org: * Fix indentation
19:41 dalek perl6.org:
19:41 dalek perl6.org: Fixes: #51
19:41 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/3794cdf827
19:41 dalek perl6.org: c41b70b | (Zoffix Znet)++ | source/index.html:
19:41 dalek perl6.org: Merge pull request #55 from angeloc/master
19:41 dalek perl6.org:
19:41 dalek perl6.org: Spurious Horizontal Scroll on Mobile
19:41 dalek perl6.org: review: https://github.com/perl6/perl6.org/commit/c41b70b753
19:57 andrzejku joined #perl6
19:58 andrzejku hello :)
20:00 Ven_ joined #perl6
20:15 harmil_wk Heya andrzejku
20:21 Ven_ joined #perl6
20:40 Ven_ joined #perl6
20:44 cdg joined #perl6
20:48 cdg joined #perl6
20:55 infina left #perl6
20:56 Ven_ joined #perl6
21:23 ccakes joined #perl6
21:28 go|dfish joined #perl6
22:01 labster joined #perl6
22:15 mcmillhj joined #perl6
22:35 cyphase joined #perl6
22:36 cyphase joined #perl6
22:38 ccakes joined #perl6
22:40 cyphase joined #perl6
22:40 cyphase joined #perl6
22:54 skids joined #perl6
22:54 johnjohn101 joined #perl6
22:55 johnjohn101 hi perl6
22:55 gfldex m: say "ohai johnjohn101!"
22:55 camelia rakudo-moar ed0ced: OUTPUT«ohai johnjohn101!␤»
22:56 johnjohn101 what ever happened to perl 6 on .net? did that project die?
22:56 gfldex the fellow who made it happen lost the spare time to continue
22:56 johnjohn101 oh
22:58 johnjohn101 maybe someone will pick it up one day
23:01 johnjohn101 i still need to mess with native calls. seems very interesting
23:01 bjz joined #perl6
23:02 ccakes joined #perl6
23:03 mcmillhj joined #perl6
23:05 BenGoldberg joined #perl6
23:27 dalek doc: 1f30c68 | gfldex++ | doc/Type/Signature.pod6:
23:27 dalek doc: clarify what arguments are defined in what where-clause
23:27 dalek doc: review: https://github.com/perl6/doc/commit/1f30c682a8
23:29 mcmillhj joined #perl6
23:29 _slade_ joined #perl6
23:31 cyphase joined #perl6
23:36 tushar joined #perl6
23:40 dalek doc: f80d7e5 | gfldex++ | doc/Type/Callable.pod6:
23:40 dalek doc: doc CALL-ME
23:40 dalek doc: review: https://github.com/perl6/doc/commit/f80d7e5a59
23:41 tushar How can I specify a type of an array which I pass as signature to a method? How can I do "method (Int :@array!) { code.. }"?
23:41 tushar Is it even possible?
23:42 tushar I tried it but experienced an error.
23:42 gfldex m: sub f(Int @a){ dd @a }; my Int @b = Array[Int].new(1,2,3); f @b;
23:42 camelia rakudo-moar ed0ced: OUTPUT«Array[Int] @b = Array[Int].new(1, 2, 3)␤»
23:42 tushar m: class abc { method xyz (Int :@a!) { @a.say; }}; my $new = abc.new(); $new.xyz(a => [1..5]);
23:42 camelia rakudo-moar ed0ced: OUTPUT«Type check failed in binding to @a; expected Positional[Int] but got Array ($[1, 2, 3, 4, 5])␤  in method xyz at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
23:42 gfldex ^^^ tushar
23:43 gfldex the type constraint is on the @-sigiled argument (container) not on the elements of that container
23:43 gfldex m: sub f(Int @a){ dd @a }; my Int @b = Array[Int].new(1,2,3); @b.push(4); f @b;
23:43 camelia rakudo-moar ed0ced: OUTPUT«Array[Int] @b = Array[Int].new(1, 2, 3, 4)␤»
23:43 gfldex m: sub f(Int @a){ dd @a }; my Int @b = Array[Int].new(1,2,3); @b.push(4.4); f @b;
23:43 camelia rakudo-moar ed0ced: OUTPUT«Type check failed in assignment to @b; expected Int but got Rat (4.4)␤  in block <unit> at <tmp> line 1␤␤»
23:44 tushar gfldex: thanks.
23:44 gfldex any .push/.append etc is type checked against .of tho
23:44 gfldex m: sub f(Int @a){ dd @a }; my Int @b = Array[Int].new(1,2,3); say @b.of
23:44 camelia rakudo-moar ed0ced: OUTPUT«(Int)␤»
23:44 mcmillhj joined #perl6
23:45 gfldex tushar: the type constraint is not what you want in many cases
23:45 tushar hmmm..
23:45 gfldex m: sub f(+@a where { .all ~~ Int}){}; f(1,2,3)
23:45 camelia rakudo-moar ed0ced: ( no output )
23:45 gfldex m: sub f(+@a where { .all ~~ Int}){}; f(1,2,3,4.4)
23:45 camelia rakudo-moar ed0ced: OUTPUT«Constraint type check failed for parameter '@a'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
23:46 gfldex the type constraint on the container may speed things up in the future
23:48 tushar gfldex: thanks for the explanation.
23:53 cyphase joined #perl6
23:55 gfldex m: sub f(Array[Int](Array)){}
23:55 camelia rakudo-moar ed0ced: ( no output )
23:56 gfldex m: sub f(Array[Int](Array)){}; f [1,2,3]
23:56 camelia rakudo-moar ed0ced: OUTPUT«No such method 'Array[Int]' for invocant of type 'Array'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
23:56 mcmillhj joined #perl6
23:56 gfldex m: class C { method Array[Int] {} }
23:56 camelia rakudo-moar ed0ced: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3class C { method Array7⏏5[Int] {} }␤»
23:58 krakan joined #perl6

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

Perl 6 | Reference Documentation | Rakudo