»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
ZoffixWin Yeah, but then you got stuff like size_t, which is its return value. Or "const struct tm *tm" and I don't even know what that struct looks like or how will calling my sub from Perl 6 will look like :P 00:01
I'm gonna first learn how to call strftime in pure C
00:02 zakharyas left
ZoffixWin found struct tm www.tutorialspoint.com/c_standard_l...rftime.htm 00:02
literal so is there no easy way to extend core types like Str/Hash/Num if I just want a subtype with an extra method (or just a different type name)? 00:04
ZoffixWin well... there's augment, but that modifies the core type throughout your entire program: perl6.party/post/20160427-Perl-6-Ex...ebedragons 00:06
literal yeah, that's a bit much 00:07
BenGoldberg I thought that only modules which 'use'd your code would see the augmented core type. 00:08
ZoffixWin BenGoldberg, nope
m: my $s = 'foobar' but role { method to-large-letters { self.uc } }; say $s.to-large-letters 00:09
camelia rakudo-moar ac36d2: OUTPUT«FOOBAR␤»
ZoffixWin literal, ^ there's also that
(also in that article)
literal the main thing is that I want a different type name
BenGoldberg m: my $s = 'foobar' but role { method to-large-letters { self.uc } }; say $s.WHAT 00:10
camelia rakudo-moar ac36d2: OUTPUT«(Str+{<anon|80752864>})␤»
literal it can just be a Str/Num/Hash in all other respects, to start with
ZoffixWin literal, what are you trying to accomplish?
BenGoldberg An object with a role mixed into it will have a different type name, as you can see above. "Str+{<anon|80752864>}" is the type in this example. 00:11
00:11 RabidGravy left
literal just trying to port some P5 code example of an interpreter to P6, where in P5 they'd made e.g. a String type by blessing a string, and I wanted a similar no-fuss solution 00:12
I suppose I can just use the native types, but that's not as nice if I need to add methods to them later 00:13
AlexDaniel mrsharpoblunto.github.io/foswig.js/ 00:14
literal BenGoldberg: yes, but that's not easy to match against
ZoffixWin AlexDaniel, "restrollo"
AlexDaniel ZoffixWin: “crapup”
literal when MyStringType { ... }
ugexe m: class Str2 { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; my $str = Str2("aaa"); say $str.WHAT; say $str; say $str.perl; say $str.foo 00:15
camelia rakudo-moar ac36d2: OUTPUT«(Str2)␤Str2.new(str => "aaa")␤Str2.new(str => "aaa")␤42␤»
ZoffixWin m: class Str2 is Str { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; my $str = Str2("aaa"); say $str.WHAT; say $str; say $str.perl; say $str.foo 00:16
camelia rakudo-moar ac36d2: OUTPUT«(Str2)␤␤""␤42␤»
literal ugexe: doesn't actually function as a string though :P
BenGoldberg : class Str2 { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; Str2("abc").substr(1, 1).say;
ZoffixWin He just forgot is Str
BenGoldberg m: class Str2 is Stringy { has $.str handles *; method CALL-ME($str) { self.new(str => $str); }; method foo { 42 }; }; Str2("abc").substr(1, 1).say;
camelia rakudo-moar ac36d2: OUTPUT«b␤»
ZoffixWin Oh, never mind 00:17
ugexe add a method Str { $.str} and method Stringy { $.str} 00:18
literal in the Ruby example the author just used native types and monkey-patched additional methods on those, I was hoping Perl 6 could do it more elegantly :P 00:19
grondilu did not know about 'handles *' 00:21
00:24 jjido joined
ugexe you can get most of the way there, but it stores the string inside a private $!value 00:25
m: class Str2 is Str does Stringy { method CALL-ME($str) { self.new(value => $str) }; method foo { 42 }; }; my $str2 = Str2("xxx"); say $str2.foo; say $str2 ~~ Str; say $str2 00:26
camelia rakudo-moar ac36d2: OUTPUT«42␤True␤xxx␤»
timotimo github.com/supernovus/perl6-datetime-format btw 00:28
literal nice. Also, looks like "does Stringy" is not needed there
ugexe does Stringy allows ~$var to work
literal I see
how come CALL-ME isn't inherited?
00:28 jjido left
timotimo it's not inherited or it's just not invoked when you call an instance of the derived class? 00:29
ugexe i think Str("xxx") is really a coercer, not a CALL-ME
literal timotimo: results in "Cannot find method 'Str2'" if it's not specified 00:30
00:30 BenGoldberg left
timotimo wait, how are you trying to invoke that? 00:30
literal see ugexe's last code paste
ugexe m: my $str = Str("xxx"); say $str 00:31
camelia rakudo-moar ac36d2: OUTPUT«xxx␤»
timotimo Str(123) does call Str
as in, it invokes the type object
00:31 BenGoldberg joined
literal also, why is "does Stringy" needed if Str does Stringy? 00:32
timotimo i don't think it should be needed 00:33
00:34 BenGoldberg left
ZoffixWin timotimo, thanks. Not sure what I was searching that I missed it :S 00:37
00:41 BenGoldberg joined
timotimo :) 00:45
00:47 telex left 00:48 telex joined, Ben_Goldberg joined, BenGoldberg left 00:50 Ben_Goldberg is now known as BenGoldberg
ZoffixWin m: require Test <&is>; say is 2, 2; try { EVAL "ok"; CATCH { default { say "caught" }}} 00:51
camelia rakudo-moar ac36d2: OUTPUT«ok 1 - ␤True␤caught␤»
ZoffixWin is there a way to make that compile-time require?
timotimo what, like need? 00:52
ZoffixWin thinks a BEGIN, but does that play nice with precomp, and is there no easier way to ask for specific symbols
timotimo, it doesn't take symbols
m: need Test <&is>;
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/D3nrCcD1oF␤Confused␤at /tmp/D3nrCcD1oF:1␤------> 3need Test7⏏5 <&is>;␤»
ZoffixWin And use only takes tags :S
m: BEGIN require Test <&is>; say is 2, 2; try { EVAL "ok"; CATCH { default { say "caught" }}} 00:57
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Cwc0zOAlTX␤An exception occurred while evaluating a BEGIN␤at /tmp/Cwc0zOAlTX:1␤Exception details:␤ 5===SORRY!5=== Error while compiling ␤ Lexical with name '&is' does not exist in this frame␤ …»
ZoffixWin m: BEGIN { require Test <&is> }; say is 2, 2; try { EVAL "ok"; CATCH { default { say "caught" }}}
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kpQN4eZC69␤Undeclared routine:␤ is used at line 1␤␤»
00:57 lostinfog left
ZoffixWin m: need Test; say Test::is( 2, 2 ); try { EVAL "ok"; CATCH { default { say "caught" }}} 00:58
camelia rakudo-moar ac36d2: OUTPUT«Could not find symbol '&is'␤ in block <unit> at /tmp/2qa4j_XN7W line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/2qa4j_XN7W line 1␤␤»
ZoffixWin flips desk
BenGoldberg m: need Test; 00:59
camelia ( no output )
timotimo ZoffixWin: right, need will only grab the module into your namespace, you'd have to import the symbols to have them as lexicals 01:01
so like $Foobar := Test::EXPORT::DEFAULT::is or whatever
bedtime 01:03
ZoffixWin m: need Test; my &is = &Test::EXPORT::DEFAULT::is; is 2, 2; try { EVAL "ok 42"; CATCH { default { say "caught" }}}
camelia rakudo-moar ac36d2: OUTPUT«ok 1 - ␤caught␤»
ZoffixWin That's LTA, but better than nothing. timotimo++
01:03 hotel|out is now known as hotel 01:04 colomon left
hotel :=? 01:05
heh that looks funny
01:06 BenGoldberg left 01:07 colomon joined 01:08 BenGoldberg joined 01:10 BenGoldberg left 01:12 BenGoldberg joined
hotel can someone explain promises to me? 01:12
ZoffixWin RFC for easier compile type specific symbol import: rt.perl.org/Ticket/Display.html?id=128090
hotel, try this [slightly dated] slideshow: jnthn.net/papers/2015-yapcasia-concurrency.pdf 01:13
hotel thanks
ugexe a simple way to think of it is as a mechanism to chain `start { }`s together 01:14
hotel needs to brush up on the idea of concurrency altogether 01:19
s/concurrency/asynchrony/ 01:20
ZoffixWin m: await ^4 .map: { start sleep 1 }; say now - INIT now 01:22
camelia rakudo-moar ac36d2: OUTPUT«1.00427241␤»
01:25 jjido joined, maybekoo2 left
ZoffixWin .ask ufobat is there no way at all to do async stuff with Bailador? Some of my requests can take up to 20 seconds and I looked through the code and see no user-space way to do async 01:26
yoleaux ZoffixWin: I'll pass your message to ufobat.
01:26 jjido left, jjido joined
hotel standards: use taps or use react blocks? 01:30
pmichaud ZoffixWin: (re RT #128090) S11 already says how to do compile-time import of symbols
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128090
pmichaud design.perl6.org/S11.html#Compile-t...mportation 01:31
01:31 jjido left
pmichaud Is that not what you are looking for? 01:31
hotel how do you set something equal to a promise? I get that it's a type, but what does it actually mean to set something equal to one? 01:38
ZoffixWin pmichaud, unsure. It seems to require *author* of the module to do "extra things" instead of just using `is export`: 01:40
m: use Test <&is>; say is 2, 2
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zm89zGOGgu␤Error while importing from 'Test':␤no EXPORT sub, but you provided positional argument in the 'use' statement␤at /tmp/zm89zGOGgu:1␤------> 3use Test <&is>7⏏5; say is 2, 2␤»
ZoffixWin pmichaud, so it's out of my control. And I don't know if it's maybe just something that needs to be added to `is export` implementation 01:41
01:42 kid51 left
hotel any takers? 3; 01:44
01:44 cpage_ joined 01:46 pierre_ joined
ZoffixWin hotel, what do you mean 'set equal to'? 01:48
hotel yeah I'm not really sure
ZoffixWin ...
hotel github.com/zostay/P6SGI#201-the-environment ==> p6w.ready 01:49
ZoffixWin hotel, it takes a Promise object. You can get a promise with `start {...}` among other things
hotel guess I set that later then 01:51
on another note, just watched what was probably the saddest scene in all of 24 01:53
m: my constant CRLF = "dummy"; say "hi $CRLF"; 01:58
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kiN9shpLiK␤Variable '$CRLF' is not declared. Did you mean 'CRLF'?␤at /tmp/kiN9shpLiK:1␤------> 3my constant CRLF = "dummy"; say "hi 7⏏5$CRLF";␤»
hotel m: my constant CRLF = "dummy"; say "hi CRLF";
camelia rakudo-moar ac36d2: OUTPUT«hi CRLF␤»
pmichaud ZoffixWin: yeah, I think it's just a NYI bug.
ZoffixWin m: sub foo (Promise:D $p) { say 'About to sit and wait for a Promise to complete'; await $p; say 'Done waiting ' ~ now - INIT now }; foo start sleep 1
camelia rakudo-moar ac36d2: OUTPUT«About to sit and wait for a Promise to complete␤Done waiting 1.0042692␤»
ugexe {CRLF}
pmichaud ZoffixWin: oh, I see what you mean. 01:59
01:59 mr-foobar left
ZoffixWin m: use Test; sub ok {} 02:00
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kJXCexGsFZ␤Redeclaration of routine ok␤at /tmp/kJXCexGsFZ:1␤------> 3use Test; sub ok {}7⏏5<EOL>␤»
02:00 mr-foobar joined
ZoffixWin Basically, I don't want a module update to introduce an error like this ^ into my code and then rake through a dozen of `use`d modules to find which one imported it 02:00
02:01 johnjohn101 joined
johnjohn101 hi perl6 02:01
02:01 molaf left
ZoffixWin (a module update where Joe Smith implements a new sub in their FooBarBer module that I use) 02:01
pmichaud Then I suspect the "use Test" ought to be more explicit about what is to be imported. 02:03
And yes, that looks like a NYI bug to me.
use Test <&is>; should import only &is and nothing else.
02:03 Khisanth left 02:05 pierre_ left 02:12 BenGoldberg left 02:13 BenGoldberg joined 02:14 molaf joined 02:15 noganex joined 02:16 Khisanth joined 02:18 noganex_ left 02:22 colomon left 02:25 colomon joined 02:27 jjido joined 02:32 jjido left, mr-foobar left 02:33 mr-foobar joined
ZoffixWin m: say Instant.new: 0 02:42
camelia rakudo-moar ac36d2: OUTPUT«Cannot make a Instant object using .new␤ in block <unit> at /tmp/9wfHQmdrfA line 1␤␤»
ZoffixWin
.oO( why the hell not... )
m: say now - now
camelia rakudo-moar ac36d2: OUTPUT«-0.00159147␤»
02:43 colomon left, crucialrhyme joined
ZoffixWin m: say DateTime.new(0).Instant 02:43
camelia rakudo-moar ac36d2: OUTPUT«Instant:10␤»
ZoffixWin
.oO( 10?? )
02:44 colomon joined 02:46 sufrostico left
hotel ugexe++ 02:49
02:49 uruwi joined
hotel can I initialise members of a class in the class body? 02:50
or does it have to be in BUILD
ZoffixWin use defaults
m: class Foo { has $.bar = 42; }; say Foo.new.bar
camelia rakudo-moar ac36d2: OUTPUT«42␤»
hotel yeah but these aren't given to the class when instantiating it 02:51
or at least they're not supposed to be
oh
02:51 hotel is now known as hotel|chagrin
ZoffixWin m: class Foo { has $!bar = 42; method bar { $!bar } }; say Foo.new(:72bar).bar 02:52
camelia rakudo-moar ac36d2: OUTPUT«42␤»
hotel|chagrin yeah thanks 02:53
02:53 Actualeyes left 02:56 itcharlie joined
hotel|chagrin so what's the real difference between declaring variables with my/has in a class? 02:57
02:58 crucialrhyme left
dalek c: b2f5a76 | (Zoffix Znet)++ | doc/Type/IO/Path.pod:
Toss non-more-readable "more readable" portion
02:59
ZoffixWin hotel|chagrin, my will create a class variable, has an instance attribute
hotel|chagrin but what's the functional difference? 03:00
ZoffixWin is typing an example
hotel|chagrin thanks
geekosaur class variable should be shared between all instances
hotel|chagrin so it's static
geekosaur in C++ parlance, es
yes 03:01
hotel|chagrin ah
that makes sense
ZoffixWin m: class Foo { my $.class = 'Original'; has $.instance = 'Original' }; my $first = Foo.new; my $second = Foo.new; $first.class = 'Modded'; $first.instance = 'Also modded'; say [ $first.class, $first.instance, $second.class, $second.instance ]
camelia rakudo-moar ac36d2: OUTPUT«Cannot modify an immutable Str␤ in block <unit> at /tmp/A334GyShlU line 1␤␤»
ZoffixWin m: class Foo { my $.class = 'Original' is rw; has $.instance = 'Original' is rw }; my $first = Foo.new; my $second = Foo.new; $first.class = 'Modded'; $first.instance = 'Also modded'; say [ $first.class, $first.instance, $second.class, $second.instance ]
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qfDMh426yq␤Two terms in a row␤at /tmp/qfDMh426yq:1␤------> 3class Foo { my $.class = 'Original'7⏏5 is rw; has $.instance = 'Original' is r␤ expecting any of:␤ infix␤ infix sto…»
ZoffixWin screw you then!
:P
hotel|chagrin lol
thanks to everyone for putting up with my learning 03:02
03:02 hotel|chagrin is now known as hotel
ZoffixWin hotel|chagrin, well, the output would be [ 'Modded', 'Also modded', 'Modded', 'Original' ]; So the $.class that I modified on $first got modified in $second too, because it's a class variable 03:02
03:02 crucialrhyme joined
geekosaur most of us old-time C-ers thought c++'s (and I think later java's) use of "static" for that was an abuse... 03:02
hotel makes a mean singleton :P 03:04
geekosaur (it's not actually an abuse, but old C types tend to think of lower level operations and it's not quite the same machine-level thing)
ZoffixWin m: class Foo { my $.class = 'Original'; has $.instance is rw = 'Original' }; my $first = Foo.new; my $second = Foo.new; $first.class = 'Modded'; $first.instance = 'Also modded'; say [ $first.class, $first.instance, $second.class, $second.instance ]
camelia rakudo-moar ac36d2: OUTPUT«[Modded Also modded Modded Original]␤»
ZoffixWin (is rw goes before the default) 03:05
03:05 |2701 left
ZoffixWin Curiously, the default accessor for the class var is rw, but isn't for attributes 03:06
hotel m: class X { method !p { say 'p' }; method u { !p }; }; X.new.u
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7xmlgZ7tUR␤Undeclared routine:␤ p used at line 1␤␤»
hotel m: class X { method !p { say 'p' }; method u { self!p }; }; X.new.u
camelia rakudo-moar ac36d2: OUTPUT«p␤»
03:13 cdg joined
ZoffixWin m: my %foo = foo => 'bar', meow => 'mer'; 03:14
camelia ( no output )
ZoffixWin m: constant %foo = foo => 'bar', meow => 'mer';
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/z2fl0Om7G5␤Type check failed in constant declaration of %foo; expected Associative but got List (List)␤at /tmp/z2fl0Om7G5:1␤------> 3stant %foo = foo => 'bar', meow => 'mer'7⏏5;␤ expecting any …»
ZoffixWin Bug?
Guess not 03:15
m: my foo = foo => 'bar', meow => 'mer';
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/qZfRTPr31D␤Malformed my (did you mean to declare a sigilless \foo or $foo?)␤at /tmp/qZfRTPr31D:1␤------> 3my foo7⏏5 = foo => 'bar', meow => 'mer';␤»
ZoffixWin oops
m: my \foo = foo => 'bar', meow => 'mer';
camelia ( no output )
ZoffixWin Oh. Well, binding := also doesn't work and I guess that's what `constant` is doing 03:16
BenGoldberg m: my \foo = foo => 'bar', meow => 'mer'; say foo; 03:18
camelia rakudo-moar ac36d2: OUTPUT«(foo => bar meow => mer)␤»
BenGoldberg m: constant %foo = Hash.new( foo => 'bar', meow => 'mer' ); say %foo< meow > 03:19
camelia rakudo-moar ac36d2: OUTPUT«(Any)␤»
BenGoldberg m: constant %foo = Hash.new( foo => 'bar', meow => 'mer' ); say %foo
camelia rakudo-moar ac36d2: OUTPUT«{}␤»
BenGoldberg m: constant %foo = ( foo => 'bar', meow => 'mer' ).hash; say %foo
camelia rakudo-moar ac36d2: OUTPUT«{foo => bar, meow => mer}␤»
BenGoldberg m: constant %foo = ( foo => 'bar', meow => 'mer' ).hash; say %foo< meow >
camelia rakudo-moar ac36d2: OUTPUT«mer␤»
ZoffixWin m: constant %foo = %( foo => 'bar', meow => 'mer' ); say %foo< meow > 03:25
camelia rakudo-moar ac36d2: OUTPUT«mer␤»
03:28 jjido joined 03:30 finanalyst joined, mr-foobar left 03:32 jjido left
hotel m: my $a, my $b; $a, $b = split " ", "hello world" 03:34
camelia ( no output )
hotel m: my $a, my $b; $a, $b = split " ", "hello world"; say $a; say $b 03:35
camelia rakudo-moar ac36d2: OUTPUT«(Any)␤(hello world)␤»
03:35 kurahaupo left
hotel is there a concise way to assign elements of an output list to different variables? 03:35
ZoffixWin m: my $a, my $b; ($a, $b) = split " ", "hello world"; say $a; say $b 03:36
camelia rakudo-moar ac36d2: OUTPUT«hello␤world␤»
hotel ah, the elusive parenthesis
03:36 pierre_ joined 03:39 pierre_ left 03:45 johnjohn101 left
ZoffixWin (╯°□°)╯︵ ┻━┻ 03:46
Thus ends my 4-hour attempt to make my Bailador return 304s correctly. 03:47
03:47 cpage_ left
hotel good work 03:47
ZoffixWin The table flip indicates I failed :P
Or rather, I just found out I'd have to make a response from scratch too and I don't wanna 03:48
hotel what's the deal with returning things from subs?
ZoffixWin deal? 03:49
hotel so far in all the pl6 things I've seen, I haven't seen any `return` keyword
hotel finds out it exists 03:51
geekosaur it's alwayts been a perl thing that the last value in a sub is what is returned 03:53
in fact the return keyword only came into existence in older perl relatively late (and had horrid performance for a long time)
hotel oh, so it's not usually necessary? 03:54
geekosaur correct
hotel so here gist.github.com/HotelCalifornia/ff...9afc8bed69 03:55
geekosaur it'd be sufficient to just say `%env' as the last line
hotel oh cool 03:56
thanks
geekosaur if you go look at some of the stuff sent to camelia in this channel, you'd have noticed that being done a lot
e.g. `method foo { 42 }` earlier 03:57
03:57 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
hotel yeah, I was wondering in terms of methods with more calculations in them 04:06
04:10 sortiz joined
sortiz \o #perl6 04:10
hotel what happens when you define a method with the & twigil? 04:24
grondilu m: my &talk = sub { say "hi" }; talk 04:25
camelia rakudo-moar ac36d2: OUTPUT«hi␤»
grondilu oh sorry you meant a method
hotel also jk 04:26
I misread it
grondilu I don't think it's possibl to define a method as variable.
hotel it was a sub in the end 04:27
04:29 jjido joined
sortiz m: my &foo = method () { self.say }; "Hi".&foo; 04:29
camelia rakudo-moar ac36d2: OUTPUT«Hi␤»
04:34 jjido left
hotel if you use callsame from an anonymous function, does it call the other anonymous functions with the same symbol? 04:35
s/symbol/signature/
ignore me 04:36
04:37 milwauke` left
sortiz hotel, a & sigiled variable can hold any Callable, and Method does Callable. 04:39
BenGoldberg m: my $f = sub ($x) { $x <= 1 ? 1 : $x * callsame($x-1) }; say $f.(4);
camelia rakudo-moar ac36d2: OUTPUT«5===SORRY!5=== Error while compiling /tmp/omOhBSW4hD␤Unsupported use of ? and : for the ternary conditional operator; in Perl 6 please use ?? and !!␤at /tmp/omOhBSW4hD:1␤------> 3my $f = sub ($x) { $x <= 1 ?7⏏5 1 : $x * callsame($x-1) }; say…»
BenGoldberg m: my $f = sub ($x) { $x <= 1 ?? 1 !! $x * callsame($x-1) }; say $f.(4);
camelia rakudo-moar ac36d2: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub at /tmp/QSAdNG5JqY line 1␤ in block <unit> at /tmp/QSAdNG5JqY line 1␤␤»
hotel yeah yeah, I was misreading that
I thought it said `method &foo`
but it really said `my &foo = ...` 04:40
04:40 BenGoldberg left, itcharlie left
hotel anyway, time for bed 04:41
night
04:41 hotel is now known as hotel|netteiru 04:42 kaare_ joined 04:56 Cabanossi left 04:58 Cabanossi joined
ugexe m: my $xxx = sub ($a) { $a < 5 ?? &?ROUTINE($a+1) !! $a; }; say $xxx.(1) 05:03
camelia rakudo-moar ac36d2: OUTPUT«5␤»
05:03 AlexDaniel left 05:21 verzit left 05:29 jjido joined, cdg left 05:32 verzit joined, cdg_ joined
sortiz ZoffixWin, ping. 05:33
05:34 jjido left 05:37 cdg_ left, jack_rabbit joined 05:42 CIAvash joined 05:48 TreyHarris left
dalek osystem: 54e7f0d | titsuki++ | META.list:
Add Term::Readsecret to ecosystem

See github.com/titsuki/p6-Term-Readsecret
05:52
osystem: ecb5339 | titsuki++ | META.list:
Merge pull request #204 from titsuki/add-readsecret

Add Term::Readsecret to ecosystem
05:57 wamba joined 06:00 cdg joined 06:02 vendethiel- joined 06:03 vendethiel left 06:05 cdg left 06:23 wamba left 06:29 TreyHarris joined
nadim Morning. Latest commit doesn't install nopaste.linux-dev.org/?1098673 any ideas? 06:48
06:50 hotel joined 06:51 skids left, hotel|netteiru left 07:03 mr-foobar joined 07:10 maybekoo2 joined 07:12 mr-foobar left 07:13 mr-foobar joined 07:14 yqt left 07:15 cpage_ joined 07:26 finanalyst left 07:36 cognominal left 07:45 molaf left 07:48 jjido joined 07:50 jjido_ joined 07:53 jjido left 07:54 domidumont joined 07:58 firstdayonthejob joined 07:59 domidumont left 08:00 domidumont joined 08:06 firstdayonthejob left 08:07 firstdayonthejob joined, jjido_ left, rindolf joined 08:08 jjido joined 08:15 darutoko joined 08:32 RabidGravy joined 08:41 domidumont left, domidumont joined, wamba joined 08:43 mr-foobar left 08:44 mr-foobar joined 08:46 domidumont left
masak good antenoon, #perl6 08:48
bazzar: fwiw, I've been toying with the idea of parsing out a postgres schema lately. 08:49
08:50 TEttinger left 09:00 araujo left 09:10 darutoko left
RabidGravy masak, but isn't it just query some stuff from information_schema 09:10
masak RabidGravy: ooh -- that's probably a lot better than parsing out text. 09:15
I haven't thought about this deeply yet -- thanks for the nudge in the right direction! :D
RabidGravy a *lot* easier
I don't think there's any of DBIx::Class::Schema::Loader that do it by parsing a DDL specification 09:16
masak right :)
so, here's my idea so far: query out the relevant details of the schema, then make sure they match some local JSON or YAML condensed version of that schema. 09:17
RabidGravy after all it is one of Ted Codds requirements for a relational database that the metadata be stored in the same way that the metadata is
masak that way, I can have tests that confirm that the database schema is what I think it is.
RabidGravy er s/metadata/normal data/ 09:18
masak .oO( Ted Codd requires that the tautology always be what the tautology is )
RabidGravy :)
not enough coffee has got tomy fingers yet
masak further, I can use the same JSON-YAML file to statically check all the queries made against the database.
all this in order to assert that app and database evolve together nicely. 09:19
09:19 jjido left
masak also, I ought to be able to use the info in the JSON-YAML file if/when I want to mock the database. 09:19
RabidGravy I'm actually wondering if making a module to abstract the above for the DBs that DBIish supports will be a kick in the right direction to a proper full schema abstraction thingy 09:22
(hedging on whether that may be an ORM or something else)
masak I'm not actively against such plans :) 09:23
but I'm going to start by unabstractedly solving my own use cases
RabidGravy oh sure 09:24
09:30 darutoko joined, titsuki joined
sortiz In DBI there are a few methods for schema introspection (table_info, column_info, et. al.), something like that can be added to DBIish. 09:32
masak that's not a bad idea 09:35
I have a DBIish dependency anyway
oh, and I could look into what it'd take to provide a mocked database as a driver to DBIish
literal </w 3 09:37
sortiz In fact there is DBDish::TestMock, just for that kind of stuff.
09:38 cpage_ left
masak oh wow 09:41
I should think out loud more often on this channel, clearly
09:41 cognominal joined
masak sortiz++ 09:42
um, though github.com/perl6/DBIish/blob/ca684...Handle.pm6 is probably not enough for my purposes... 09:43
sortiz I get bored for lack of open issues to be resolved in DBIish ;-)
masak duly noted
09:45 Ven joined
masak well, I could submit some issue about DBDish::TestMock being locked down to a particular schema... 09:48
but I'm not entirely sure yet what it is I want instead 09:49
RabidGravy I'm still unable to obtain a login from IBM to download the Informix client SDK so no DBDish::Informix this week
FreeTDS could fly if there is something I can test it against 09:54
sortiz RabidGravy, if you have Informix and its ODBC driver, may be that DBDish::ODBC already supports it. 09:55
RabidGravy would still have to download the client sdk to get the ODBC driver 09:56
:\
sortiz :/
RabidGravy plus the native driver is much more fun
sortiz Sure, say that to me ;-) 09:57
10:00 domidumont joined 10:02 mr-foobar left 10:05 kurahaupo joined 10:11 titsuki left, darutoko left
RabidGravy WAHAY! Finally managed to log in to the IBM site 10:13
awful, the company clearly knows nothing about computer software 10:14
10:14 maddingu1 is now known as maddingue 10:18 spider-mario joined
nadim Morning again, 10:28
Latest commit doesn't install nopaste.linux-dev.org/?1098673 any ideas? 10:29
10:35 Ven left
RabidGravy when was the last time you updated? That change went in weeks ago iirc 10:36
10:37 mr-foobar joined
sortiz nadim, I suspect that the problem is that the install attempt to install first NativeCall before the new required NativeCall::Types, so use for precomp an old (preinstalled) NC::Types and fails. 10:38
RabidGravy yeah that's what it looks like 10:39
why would "git remote" show nothing when pull and push are clearly working? 10:43
weird 10:47
anyhow just twatted it and re-cloned 10:48
10:48 firstdayonthejob left 10:52 Ven joined 10:57 domidumont left 11:04 mr-foobar left 11:05 mr-foobar joined 11:06 nowan_ joined 11:07 CIAvash left 11:08 nowan left 11:12 jack_rabbit left 11:16 mr-foobar left 11:18 mr-foobar joined 11:24 kid51 joined
ZoffixWin sortiz, pong 11:25
11:27 domidumont joined
ZoffixWin What was it? 11:28
11:29 sunnavy_ left, sunnavy_ joined 11:31 milwauke` joined 11:35 Emeric joined
sortiz ZoffixWin o/ 11:37
ZoffixWin \o
moritz \o\o
sortiz I found this for you: gist.github.com/salortiz/051c7a814...2377c02f70 11:38
moritz fights with a blank screen after apt-get upgrade and reboot :(
and the wiki interface on the old lapotp seems to be broken, with about 70% packet loss on an otherwise fine network 11:39
*wifi
ZoffixWin press ctrl+alt+F1 to see the log messages from trying to start X? 11:40
11:41 domidumont left
ZoffixWin sortiz, cool. Much different than the way I was going about it. 11:42
sortiz, you should submit it as a patch to modules.perl6.org/repo/POSIX
I went with this one at the end: github.com/supernovus/perl6-dateti...me-dt-lang
11:42 mr-foobar left 11:43 perlawhirl joined
ZoffixWin Well, actually, I abandoned that part of the code altogether by now lol :P 4 wasted hours 11:43
perlawhirl Zoffix: The other thing about the module is that strptime is NYI 11:44
ZoffixWin I noticed last night
ZoffixWin is also weary of supernovus's modules on account of the author saying on multiple occasions they aren't that involved with P6 anymore. 11:45
RabidGravy they accept patches though 11:47
11:53 |2701 joined
sortiz afk& 11:55
12:13 jjido joined 12:14 Ven left 12:16 Relsak joined
ZoffixWin Yey! Finally moved all my blog posts to perl6.party/ Didn't realize I had so many :o 12:18
m: say 14 / DateTime.today.week-number
camelia rakudo-moar cf199c: OUTPUT«Method 'today' not found for invocant of class 'DateTime'␤ in block <unit> at /tmp/rAFUpbHH95 line 1␤␤»
ZoffixWin m: say 14 / DateTime.new.today.week-number
camelia rakudo-moar cf199c: OUTPUT«Cannot make a DateTime object using .new␤ in block <unit> at /tmp/17y1cH5Zso line 1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp line 3055␤ in block <unit> at /tmp/17y1cH5Zso line 1␤␤»
ZoffixWin Well, that many per week lol :P
m: say 14 / DateTime.now.week-number 12:19
camelia rakudo-moar cf199c: OUTPUT«0.777778␤»
ZoffixWin And I forget who said they missed the dancing cats (Xliff_ ?), but I brought them back: perl6.party/about
12:21 aries_liuxueyang left
RabidGravy ZoffixWin, dancing cats! 12:22
stmuk I was a dancing cat fan 12:24
12:25 araujo joined 12:26 araujo left, araujo joined, araujo left, araujo joined 12:28 araujo left, araujo joined, araujo left, araujo joined 12:29 araujo left, aries_liuxueyang joined 12:36 vaisian_ joined 12:39 Ven joined 12:40 jjido left 12:43 aries_liuxueyang left 12:46 aries_liuxueyang joined 12:48 darutoko joined, darutoko left 12:54 aries_liuxueyang left 12:56 colomon left
RabidGravy there isn't anyway of capturing the application of a parameterised role is there? i.e. set an attribute without closing over the parameter in an accessor 12:56
psch doesn't quite grasp the question 12:59
RabidGravy lizmat, with PackUnpack is there some way I'm missing of getting the byte length of an indivdual directive from the template (e.g. 'N' -> 4) ? 13:00
psch, say I have "role Foo[Str $foo] { has Str $.foo; }" and want $.foo to be the parameter, and of course as I started typing it I released that I can just use it as a default initializer 13:02
me--
psch yay for rubber duck debugging \o/ 13:04
13:08 Ven left 13:09 finanalyst joined 13:10 Perl6IRC joined 13:11 Perl6IRC left, uruwi left 13:27 aries_liuxueyang joined 13:29 Actualeyes joined 13:30 mr-foobar joined 13:33 dogbert17 joined 13:36 Actualeyes left 13:40 wamba left
dalek c: 9d1a02e | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod:
Documented the yyyy-mm-dd method
13:40
13:41 _4d47 joined 13:42 mr-foobar left, Ven joined 13:43 mr-foobar joined 13:47 cdg joined 13:55 mr-foobar left 13:56 Actualeyes joined, mr-foobar joined 13:59 Relsak left 14:00 mr-foobar left 14:01 mr-foobar joined 14:11 vaisian_ left 14:20 ufobat joined
ufobat ola! 14:20
yoleaux 01:26Z <ZoffixWin> ufobat: is there no way at all to do async stuff with Bailador? Some of my requests can take up to 20 seconds and I looked through the code and see no user-space way to do async
ZoffixWin \o 14:21
14:22 TimToady left
ufobat ZoffixWin, :( no i am afraid not, according to my understanding you need to replay a supply as the content. but HTTP::Easy::PSGI is using the PSGI module 14:22
ZoffixWin :(
ufobat and the PSGI module waits until it is done :(
but!
HTTP::Server::Tiny is different.
and thats why I did the get-psgi-app, so it can easily run on other PSGI servers 14:23
14:23 TimToady joined
ufobat but i am not sure if this can handle supplys 14:24
ZoffixWin, github.com/tokuhirom/p6-HTTP-Serve...aa590dR445 14:25
ZoffixWin wouldn't that still block just the same, since .receive is blocking? 14:27
ufobat i dont know. i am too new to perl6. i haven't played with channels nor supplies. i assumed it would block just for the next "block" 14:30
14:30 colomon joined
ufobat github.com/tokuhirom/p6-HTTP-Serve...y.pm6#L323 14:30
this looks as if each block is sent as soon as possible 14:31
14:31 espadrine joined
ZoffixWin right, but my very first block would arrive after 30 seconds. 14:32
I wonder if anyone tried seeing if things explode when you shove each request in its own start {}. 14:33
Then on the framework end, you'd just write blocking code and it won't matter.
ufobat thats why a psgi app is supposed to return a promise, the webserver should not block in those 30 sec, it should be able to run other requests 14:34
so isnt that exactly what you're suggesting? 14:35
ah! there is a webserver implementation from zostay called smack, which is his p6sgi reference implementation 14:36
14:36 _4d47 left
ufobat i had not time to look at it so far, but its on my list :) 14:36
14:36 Ven left
ZoffixWin Not exactly. As a user of the framework, all I want to care about is my current request. I don't want to think whether I need to return a Promise or hunt down which route is slowing down my entire app. 14:38
ufobat github.com/zostay/Smack
ZoffixWin m: start { } for ^1000; say now - INIT now
camelia rakudo-moar cf199c: OUTPUT«Memory allocation failed; could not allocate 14840 bytes␤»
ZoffixWin :/
That runs in 0.17918281 14:39
on my box.
ufobat the promise is part of the psgi spec, so you will(or must) return a promise anyway. 14:40
but yeah async stuff is on my todo list as well ;) but first i need a file upload.
looking forward for PR on the http/psgi servers to follow the spec, so bailador could run everywhere. 14:41
ZoffixWin heh, that's a programmer-defined limitation. 14:42
And sri called that spec antiquated
ufobat the perl5 spec? 14:44
+psgi
i think zostay did a great job on making the p6sgi spec better :D 14:45
14:45 hotel_california joined 14:46 hotel left
ZoffixWin ufobat, no, on zostay's P6SGI spec. While there seems to be a mismatch between the nicks he used in response, reading around the conversation indicates that he indeed was talking about the link muraiki addressed him with: irclog.perlgeek.de/perl6/2016-01-05#i_11834621 14:46
I don't say we take everything sri says as mana, but he does have good amount of expertise and did point out the RoR example too. 14:47
*manna 14:49
ufobat a interesting discussion :D i think i read it from the beginning ,) 14:51
14:52 vaisian joined 14:54 hotel joined 14:55 hotel_california left
ZoffixWin Is increasing a variable like this not threadsafe? perl6 -e 'my $c = 0; await ^10000 .map: { start { $c++ } }; say now - INIT now; say $c' 14:58
On every run it's missing 6-50 increments
And once in a blue moon hangs indefinitely :/ 15:03
RabidGravy yeah, I'm seeing between 0-3 being missed 15:07
it would be interesting at what point it kicks in (i.e. how many iterations) 15:08
ZoffixWin is half-way through 6guts.wordpress.com/2014/04/17/rac...ess-leads/ 15:09
I see ++ is mentioned as not safe **in that example** but it's unclear whether it's *still* unsafe in P6 :P
I see one miss 50% of the time with ^100 starts 15:10
RabidGravy I would say there may be a very slight danger of a race condition on updating the value, protecting the update with a lock seems to make it okay
e.g. "my $l = Lock.new; my $c = 0; await ^10000 .map: { start { $l.protect({$c++}) } }; say $c"
ZoffixWin nods 15:16
ugexe cxreg: the bug you found yesterday is fixed now
ufobat ZoffixWin, i am neither a psgi nor a p6sgi expert, but my understanding of the P6SGI spec is that the server is responsible for parallel requests. If the server is doing to there is a `p6w.multithread` in the environment. and sri didnt metion why p6sgi is antiquated
and i know that sri is not psgi fan, because when you do async rendering in mojo with the psgi server backend you have some.. issues :/ 15:17
maybe, fyi: blogs.perl.org/users/sterling_hanen...p6sgi.html 15:18
15:20 CIAvash joined
ufobat zostay: hm your HTTP::Supply test is not aborting on my box.. 15:25
15:25 winger_ left
ugexe if this is what im thinking of, its not p6sgi that is antiquidated by psgi (implying a completely redesigned spec would be what they would do) 15:25
and by 'that is antiquidated' i mean was called antiquidated 15:26
15:26 winger_ joined
ufobat so i spent my time reading about psgi :D instead of implementing file uploads ;) *sigh* now its family time.. ttyl guys :) 15:28
ZoffixWin ufobat, I think it's more to do with locking yourself into some "spec" which makes it harder to react to future tech changes.
15:28 Ven joined
ugexe and designing the spec from the ground up around perl 6's strengths 15:29
s/the/a/
15:29 domidumont joined
ugexe still, by emulating what exists you are better learning the problem domain which may lead to such a new spec 15:30
ufobat aren't the difference between psgi and p6sgi are adressing the weaknesses of the psgi spec 15:32
15:33 ZoffixWin left
ufobat like the promise / supply thing 15:33
anyway :) i need to go now :)
ugexe thats trying to cram perl6 strengths into a spec that was designed around other things 15:35
15:37 titsuki joined 15:39 BenGoldberg joined
titsuki Hi. Sorry for veriy newbie-sh question. Does anyone know how to install panda from rakudo-star for windows( rakudo.org/downloads/star/rakudo-st...0(JIT).msi ) ? 15:40
*very
15:41 firstdayonthejob joined, ZoffixWin joined
ZoffixWin titsuki, it's already installed, but IIRC it's broken. See errata on perl6.org/downloads/ 15:42
titsuki, as an alternative, you can download and install zef: github.com/ugexe/zef
dogbert17 hello #perl6 15:43
titsuki Already installed ? But I cannot find panda in C:\rakudo\bin directory. 15:44
ZoffixWin \o
titsuki, panda is part of R* distro. Try running where panda in the command prompt
dogbert17 I was taking a look at ZoffixWin's report github.com/perl6/doc/issues/497 hoping that I could document it a bit, but alas I can't figure out the syntax for sending a formatter to Date.new
ZoffixWin dogbert17, have you tried :formatter({ some code; }) 15:45
dogbert17 I thinks so, hmm, let me try
ZoffixWin m: DateTime.new(0, formatter => { say 42; } ).Str.say 15:46
camelia rakudo-moar cf199c: OUTPUT«42␤True␤»
ZoffixWin works
dogbert17 Hmm, could it have something to do with the semicolon
ZoffixWin m: my $date = DateTime.new: 0; $date.formatter = { say 42; }; $date.Str 15:47
camelia rakudo-moar cf199c: OUTPUT«Cannot modify an immutable Callable␤ in block <unit> at /tmp/OGl8igpqlz line 1␤␤»
ZoffixWin m: DateTime.new(0, :formatter({ say 42; }) ).Str.say
camelia rakudo-moar cf199c: OUTPUT«42␤True␤»
ZoffixWin dogbert17, what's the error you're getting
nadim sortiz: thanks for the answer earlier. But what is the solution?
dogbert17 m: y $n = Date.new('2015-12-31', :&formatter({'test'}) ); # fail
camelia rakudo-moar cf199c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/dXm1uHjs6T␤Unsupported use of y///; in Perl 6 please use tr///␤at /tmp/dXm1uHjs6T:1␤------> 3y7⏏5 $n = Date.new('2015-12-31', :&formatter␤»
titsuki `where panda` returns none of lists ...
dogbert17 m: my $n = Date.new('2015-12-31', :&formatter({'test'}) ); # fail
camelia rakudo-moar cf199c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zZbR0IeKg_␤Undeclared routine:␤ formatter used at line 1␤␤» 15:48
ZoffixWin titsuki, just use zef
dogbert17, what's with '&'?
titsuki I see
I'll try zef
Thanks!
dogbert17 ok, it works now, but how do I specify the parameters, suppose I want a format like say yy/dd/mm 15:49
ZoffixWin dogbert17, it takes a callable.
ugexe you write the code to do that. thats what formatter is
ZoffixWin m: DateTime.new(0, formatter => { say $^a.year ; } ).Str.say 15:50
camelia rakudo-moar cf199c: OUTPUT«1970␤True␤»
ZoffixWin dogbert17, it takes one positional argument, the DateTime object
dogbert17 ugexe: yes, but how do I trick the date object to print it's year, month and day attributes?
ZoffixWin m: DateTime.new(0, formatter => sub ($self) { sprintf "%2d/%02d/%02d", .year.substr(2,2), .month, .day given $self ; } ).Str.say 15:52
camelia rakudo-moar cf199c: OUTPUT«70/01/01␤»
ZoffixWin Y2K!! :D
ugexe m: DateTime.new(0, formatter => { say $^a.attributes ; } ).Str.say
camelia rakudo-moar cf199c: OUTPUT«Method 'attributes' not found for invocant of class 'DateTime'␤ in block <unit> at /tmp/tBCskAIFYr line 1␤␤»
ugexe m: DateTime.new(0, formatter => { say $^a.^attributes ; } ).Str.say
camelia rakudo-moar cf199c: OUTPUT«(int $!hour int $!minute Mu $!second int $!timezone Int $!year Int $!month Int $!day Int $!daycount Callable &!formatter)␤True␤»
ugexe you are just accessing the object
ZoffixWin dogbert17, you don't "trick it." You get that object inside your formatter and you can call any methods your Dateish thing provides
dogbert17 ok, like Zoffix did then
ugexe m: DateTime.new(0, formatter => { say $^a.^methods; } ).Str.say 15:53
camelia rakudo-moar cf199c: OUTPUT«(new now clone Instant posix offset offset-in-minutes offset-in-hours later truncated-to whole-second in-timezone utc local Date daycount day-of-month IO day-of-week days-in-month earlier week week-number is-leap-year week-year weekday-of-month yyyy-mm-dd …»
dogbert17 ok, I think I get it, let me whips something together and create a PR
ZoffixWin++, ugexe++
15:53 Ben_Goldberg joined
ZoffixWin m: print DateTime.new(now, formatter => { $^a.yyyy-mm-dd } ) 15:54
camelia rakudo-moar cf199c: OUTPUT«2016-05-07»
15:54 BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
ZoffixWin m: print DateTime.new(now, formatter => *.yyyy-mm-dd ) 15:54
camelia rakudo-moar cf199c: OUTPUT«2016-05-07»
dogbert17 :) I should be able to do something with this
15:58 vaisian left
RabidGravy is it possible to bind an objects attributes to the elements of an array such that update the elements of the array updates the attributes and vice-versa 16:09
I thought it was but can't find the right incantation
dogbert17 m: my $n = Date.new('2015-12-31', formatter => sub ($self) { sprintf "%2d/%02d/%02d", .year.substr(2,2), .month, .day given $self; } ); say $n.later(:1day); # how do I keep the format? 16:14
camelia rakudo-moar cf199c: OUTPUT«2016-01-01␤»
dogbert17 as soon as I do some kind of operation o the Date I get a new instance with the default formatter 16:15
16:15 skink joined
dogbert17 how do I keep my shiny new one? 16:15
16:16 vaisian_ joined
ZoffixWin dogbert17, I don't think you can. You get a new DateTime object as a result of the operation 16:17
16:17 Actualeyes left
psch Date.later returns self.new, i.e. Date 16:18
but otherwise yes
ZoffixWin m: my $n = Date.new('2015-12-31'); say Date.new: $n.later(:1day), formatter => sub ($self) { sprintf "%2d/%02d/%02d", .year.substr(2,2), .month, .day given $self; }
camelia rakudo-moar cf199c: OUTPUT«16/01/01␤»
dogbert17 ah, so that's what you have to do then 16:19
BenGoldberg You could make a subclass of Date, which always passes it's formatter in when making new children... 16:21
dogbert17 BenGoldberg: thx, that might be a way, do you know if it's possible to change the formatter on an already created object? 16:23
psch m: my &formatter = sub { sprintf "%2d/%02d/%02d", .year, .month, .day given $^a }; my &new-date = Date.^can('new')[0].candidates[3].assuming(Date, *, :&formatter); my $n = Date.today; say &new-date($n.later(:1day)) 16:24
camelia rakudo-moar cf199c: OUTPUT«2016/05/08␤»
psch dogbert17: you can, but only with 'use nqp;' and nqp::bindattr
stmuk is GH slow or is it me?
psch dogbert17: depending on how internals-reliant you want to be that may or may not be a good idea :) 16:25
ZoffixWin works fine for me
dogbert17 psch: thanks, I'm just trying to wrap my head around how you're supposed to work with the formats. Suppose I have done some date related calcs during which I have received several Date instances and now, at the end of the calculation I want to write it out the U.S. way 16:27
chances are that I have lost the formatting routine along the way 16:28
dogbert17 or am I just being silly?
ugexe you can use .wrap, roles, inheritence, monkey-typing... many ways to do what you want
16:28 jjido joined
psch dogbert17: i do think it's somewhat inconvenient that the formatter isn't passed along, but then you'd probably not want to have modules force formatters onto you either 16:30
dogbert17: i'd just do all the calculation without worrying about the format and create a new Date object when it's time to print it
...and add the formatter then 16:31
ZoffixWin psch, you'd also have conflicts on how to decide which formatter to choose on operations of two dates
dogbert17, I think the primary purpose of the formatter is to return a Dateish that will look a specific way when printed(), yet still behave like a Dateish if manipulated.
dogbert17 thanks guys, my only goal was to write something i Dateish.pod but I guess I got carried away :) 16:33
16:33 itaipu joined
dogbert17 s/i/in/ 16:33
ZoffixWin like a superposition of Str and Dateish that collapses into one or the other the first time you try to see what it is
psch boggles slightly 16:34
ZoffixWin :)
The metaphor isn't exactly accurate (don't use it in the docs) 16:35
psch i mean, formatter is just how to represent the Dateish when .Str or .perl
16:35 wamba joined
psch err, .gist, not .perl 16:35
m: say Date.new(Date.today, :formatter(*.perl)); 16:36
camelia rakudo-moar cf199c: OUTPUT«Date.new(2016,5,7)␤»
16:37 ZoffixWin left
psch :/ 16:38
16:39 vaisian_ left 16:40 itaipu left 16:49 titsuki left
skink is trying to figure out how to get the rakudo-star msi working right in appveyor 16:53
timotimo it's windows, so you probably have to put in a "reboot" step after installing the .msi 16:58
17:03 ZoffixWin joined
dogbert17 ZoffixWin: how about gist.github.com/dogbert17/829e1adf...9eb1a2c72e 17:04
we at least get one formatter example in there 17:05
17:06 Ven left
ZoffixWin dogbert17, 'defined as' is wrong, it works on a Dateish. The rest looks fine to me 17:06
dogbert17 ZoffixWin: do you want method formatter(Dateish:D:) instead? 17:09
ZoffixWin dogbert17, yeah
It's provided by the Dateish role, which is composed into Date and DateTime and whatever else user wants to compose it into: github.com/rakudo/rakudo/blob/nom/...ish.pm#L40 17:10
moritz ok, laptop emergency solved by reinstalling the OS
ZoffixWin Rather this, I guess: github.com/rakudo/rakudo/blob/nom/...eish.pm#L6
moritz why does this feel like Windows, not Linux?
... and the Terminal doesn't do UTF-8 anymore :( 17:11
dogbert17 ok, I'll fix that :)
ZoffixWin finally finished rewritting huggable from scratch. 17:12
I even taught her to hug :P
dogbert17 ZoffixWin: gist updated.
ZoffixWin dogbert17, 👍 17:13
dalek c: b6fa110 | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod:
Updated docs for 'formatter'. ZoffixWin++, ugexe++, psch++
17:16
dogbert17 done 17:17
17:17 Ben_Goldberg joined
ZoffixWin dogbert17++ 17:17
17:17 BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
skink Weird 17:17
dogbert17 ZoffixWin: not really a fan of writing docs but it's a good way to learn stuff
17:17 araujo joined
skink When I install the Rakudo MSI in Wine, it automatically updates %PATH% 17:17
17:17 John[Lisbeth] joined
skink But does not do so in AppVeyor 17:17
17:18 araujo left 17:19 araujo joined, Ben_Goldberg joined
cxreg ugexe++ smls++ 17:19
17:19 BenGoldberg left, Ben_Goldberg is now known as BenGoldberg
ZoffixWin dogbert17, you can add 'Closes #333' in commit messages to automatically close issue 333. 17:19
Fixes #43432 works too, IIRC 17:20
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...l?id=43432
ZoffixWin synopsebot6, shush
dogbert17 ZoffixWin: didn't know that :)
17:22 finanalyst left 17:24 BenGoldberg left, cdg left 17:25 BenGoldberg joined 17:27 huggable joined
ZoffixWin huggable, hug me 17:27
huggable hugs ZoffixWin
ZoffixWin huggable, no bikeshedding please
huggable ZoffixWin, nothing found
ZoffixWin huggable, no bikeshedding
huggable ZoffixWin, nothing found
ZoffixWin :/
BenGoldberg huggable, huggable
huggable BenGoldberg, nothing found
BenGoldberg huggable, help
huggable BenGoldberg, nothing found
17:27 huggable left
BenGoldberg thinks this channel needs an infobot of some sort, not unlike perlbot on #perl. 17:28
ZoffixWin Isn't that what huggable does? 17:29
BenGoldberg Is that what he's for?
ZoffixWin She's for that yeah. 17:30
17:30 huggable joined
ZoffixWin huggable, no bikeshedding please 17:30
huggable ZoffixWin, 🚳
ZoffixWin huggable, hug BenGoldberg
huggable hugs BenGoldberg
BenGoldberg huggable, huggable
huggable BenGoldberg, See github.com/zoffixznet/huggable
BenGoldberg huggable, perl6 17:31
huggable BenGoldberg, nothing found
BenGoldberg huggable, perl6 is awesome.
huggable BenGoldberg, nothing found
ZoffixWin :is:
skink Agh, apparently the msi is silently failing
BenGoldberg huggable, perl6 :is: awesome.
huggable BenGoldberg, Added perl6 as awesome.
skink Anyone here familiar with using appveyor?
ZoffixWin .tell AlexDaniel huggable is back with 99% of its db restored :P 17:32
yoleaux ZoffixWin: I'll pass your message to AlexDaniel.
moritz somehow this question seems to come up here regularly in recent days
BenGoldberg sighs sadly. Google chrome got borked somehow when I hibernated my computer. It did not used to do that! 17:33
moritz maybe somebody should seek an appveyor-related IRC channel and gather some knowledge about it?
17:34 cdg joined
TimToady hotel: you can also use Z= if you don't like the parens 17:34
m: my $a, my $b; $a, $b Z= split " ", "hello world"; say $a; say $b
camelia rakudo-moar cf199c: OUTPUT«hello␤world␤»
17:34 vaisian joined
TimToady btw, split " ", "hello world" is usually better spelled "hello world".words or so 17:35
m: say words "hello world" 17:36
camelia rakudo-moar cf199c: OUTPUT«(hello world)␤»
TimToady or that
RabidGravy skink, the nearest I got to appveyor was azawawi sent me a PR to make one of modules compile with it 17:37
skink heh
ugexe are you installing the msi in app veyor? or installing rakudo some other way 17:39
17:40 vaisian left
skink Yeah, downloading and installing the msi per appveyor docs 17:41
Originally I was building it, which works, but took a looong time 17:42
ugexe, Current revision: github.com/skinkade/openssl/blob/W...pveyor.yml 17:43
fails on the dir command indicating it didn't actually install it 17:44
ufobat ZoffixWin, about the issue.. the 'use Bailador' approach has a Bailador::App inside. All exported subs from 'Bailador' modify or use this app. But this app only gets started if you invoke "baile". i am happy that you got your code working, but i dont see how you run into that issue. you're not 'baile'ing but running your app with a webserver. :-( we can track it down or i simply write more documentation.. ;-) 17:47
17:49 pierrot left
ZoffixWin ufobat, it's probably because of the use of some of the subroutines exported by Bailador 17:51
or maybe I was calling just return template() instead of self.template or whatever 17:52
ufobat ah yeah
thats it!
ugexe skink: first you probably want to remove the `/quiet`, as that might dump some debug output to stdout
17:52 huggable left
ufobat the sub template exported by Bailador uses the app inside Bailador, not your own app!!! 17:52
17:53 huggable joined
mst that isn't the same app? that sounds bizarre 17:53
ufobat not unless you set it
what you have when you do a 'use bailador' is like mojolicous::lite
mst so why isn't template() the same as self.template() ?
ZoffixWin it is 17:54
Well, self in self.template() is a different app.
mst right, which seems strange to me
surely the DSL is curried config methods for the app instance you're working with 17:55
ufobat it woudn't behave like that if you set your app inside bailador
there is a exported sub for this
mst why aren't the route handlers being invoked as methods on the same app, so you don't need the extra step? 17:56
ufobat it is a bit strange, it took to long to figure out what's going on
17:56 cdg left
mst Mojo handles this, Dancer2 handles this, not sure why perl6 is trying to be more clumsy than perl5 in a method invocation when half the fun of perl6 is method invocations being easier? 17:56
ufobat i am not perfectly sure what you suggest to be different. the handles are methods of the app. 17:58
it could probably be implemented better, but i dont know it better so far :-( 17:59
mst I don't understand how it ended up how it is
ufobat zoffix had 2 apps.
ZoffixWin mst, it just has a class variable that it sets to a default app unless you set one yourself by calling app() and DSL is just a bunch of subs that call Bailador::App methods on that class variable 18:00
ufobat there is a app when you use all the exported subs. and if you write your app by inheritng fomr bailador::App there is your real app
mst class variable? 18:01
wat
ZoffixWin yeah :}
mst why would there by a class variable involved at all?
ZoffixWin I dunno
Not everyone is a genius programmer.
ufobat that's how it was for quite a while :( 18:02
or is
mst ufobat: did you not look at mojo or dancer2 at all?
TimToady
.oO(Hang the genius programmers on the right peg...)
ufobat i did
i just didnt change it so far
mst both of them do this with closures rather than a magic global variable
ufobat PR are welcome :)
TimToady
.oO(Torment the early adopters on behalf of the late adopters...)
18:04
mst ... change it?
the idea of prior art is ... you look first ... to steal ideas before you start :) 18:05
TimToady More Fun™ the other way 18:06
ZoffixWin mst, change it because I don't think ufobat started Bailador, but inherited it
18:06 spider-mario left
mst aha 18:06
18:06 spider-mario joined
ufobat i think bailador::app used to be a singleton, when i started to add some stuff it was a "semi" singelton.. 18:06
mst ooooh, right 18:07
so it started off using the simpleton antipattern
and is slowly being rescued
mst wishes we could build something into the compiler so that every time a newbies attempts to implement a simpleton they got a gentle electric shock and a link to a page full of alternatives
(pretty sure this would've saved me some time back in the day too)
tadzik hides 18:08
to my defense, I wrote it on a napkin during my spanish classes
ZoffixWin :)
18:09 kaare_ left 18:10 milwauke` left
ufobat i am open for critique and stuff. so anything is welcome. 18:11
mst hard for me to be that helpful with it, given that entire style mostly makes me respond with 'wait, http method first? have you of you people even heard of REST? aaaaaaaaaaaaa *sob*'
18:12 araujo left
mst but "your delcarative-style mutative DSL should probably be exporting subs that curry method calls onto a builder object that itself then is attached to an app object it's building" seems like, albeit maybe a little bit of effort, well worth it 18:12
18:13 araujo joined 18:14 araujo left 18:15 araujo joined 18:16 AlexDaniel joined
AlexDaniel . 18:16
yoleaux 17:32Z <ZoffixWin> AlexDaniel: huggable is back with 99% of its db restored :P
AlexDaniel ZoffixWin: thank you!
ZoffixWin huggable, hug AlexDaniel
huggable hugs AlexDaniel
AlexDaniel oh
new feature?
ZoffixWin :P
18:16 cdg joined
ZoffixWin Yeah 18:17
can also do:
mst ufobat: does the above sentence make some sort of sense? I'm happy to discuss architecture bits, just not 100% sure I'm the right person for 'user facing API' when it's a style of user-facing-API I'm not 100% fond of :)
ZoffixWin huggable, hug me
huggable hugs ZoffixWin
timotimo huggable, hug huggable
huggable hugs huggable
timotimo huggable, hug it
huggable hugs it
ambs huggable: hug yourself. 18:18
huggable hugs yourself.
ambs ts sk sk
ufobat mst, well... i am still thinking about it.
i think i dont understand how such a code would look like 18:19
ilmari huggable: hug you
huggable hugs you
ilmari huggable: hug everyone
huggable hugs everyone
AlexDaniel huggable: hug 42
huggable hugs 4
2
ZoffixWin heh
huggable, hug 4QUIT 18:20
huggable hugs 4
QUIT
AlexDaniel who would have thought, right?
18:20 maybekoo2 left
AlexDaniel ZoffixWin: anyway, so what's the placeholder? 18:21
ufobat mst: why should the builder be attached to the app? why not just building the app just before you call 'baile'
ugexe i would use a adapter dependency inversion facade visitor aggregate pattern
AlexDaniel ZoffixWin: or how can I create similar actions?
ZoffixWin AlexDaniel, in where? Your own bot?
AlexDaniel ZoffixWin: no, in huggable 18:22
ZoffixWin: like foo :is: foo ?someone?! or what is it?
%s?
ZoffixWin AlexDaniel, oh, no placeholder. I just wrote a small Hug.pm6 plugin: github.com/zoffixznet/huggable/blo...in/Hug.pm6
AlexDaniel :(
18:22 grondilu left
ZoffixWin The :is: is part of the Factoid plugin 18:22
mst ufobat: eh? 18:23
AlexDaniel ZoffixWin: another thing I'd love to see is, uh, so that I could make huggable speak to somebody else
ZoffixWin: like
huggable: tell ZoffixWin dunno
huggable AlexDaniel, nothing found
AlexDaniel huggable: dunno
ufobat i misread you .(
huggable AlexDaniel, nothing found
AlexDaniel huh?
ZoffixWin AlexDaniel, oh, that one is missing. The "backup" I got had unicode mangled 18:24
18:24 grondilu joined
mst ufobat: oh, yeah, it should, but then you have to cram everything the builder knows how to do to the app into the app's new() method, which isn't always an advantage 18:24
ZoffixWin huggable, dunno :is: ¯\_(ツ)_/¯
huggable ZoffixWin, Added dunno as ¯\_(ツ)_/¯
mst ufobat: and if your DSL is currently global all the way, I'd bet that wouldn't be the easiest refactor to do first
ufobat: but, yeah, if I was designing it from scratch, and willing to take the time to get that to work, I'd do it the way you just suggested 18:25
ugexe good ol strategy pattern
mst ufobat: just it's probably more work than what I suggested and I was trying for "how would I end up not regarding this as a code smell in the fewest number of rectoring steps" :)
ugexe: eh?
skink ugexe, No output with or without additional flags, let alone /quiet 18:26
mst don't get all computer sciencey on me, I'm an easily confused ex-mathematician ;)
ufobat i am confused because i feel like i didnt suggest anything 18:27
mst 'why not just build the app' 18:28
18:28 zakharyas joined
ufobat ah sorry 18:28
lizmat RabidGravy: re irclog.perlgeek.de/perl6/2016-05-07#i_12447261 , PackUnpack is supposed to be close to P5's implementation
RabidGravy: how would you do that in P5 ?
18:29 jjido left
dalek c: e848c76 | (Jan-Olof Hendig)++ | doc/Type/IO/Handle.pod:
Documented the 'opened' method
18:29
RabidGravy lizmat, I wouldn't do what I'm trying to do in P5 ;-)
lizmat well, then you can't :-) 18:30
AlexDaniel huggable: hug me
huggable hugs AlexDaniel
AlexDaniel m: say “/me hugs %ENV<ME>”
camelia rakudo-moar cf199c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/3xPgNSF0Kv␤Variable '%ENV' is not declared␤at /tmp/3xPgNSF0Kv:1␤------> 3say “/me hugs 7⏏5%ENV<ME>”␤»
lizmat I really see PackUnpack as a drop in for pack/unpack in P6 and v5
AlexDaniel m: say “/me hugs %*ENV<ME>”
camelia rakudo-moar cf199c: OUTPUT«/me hugs AlexDaniel␤»
ugexe im probably off, but strategy pattern just encapsulates some interface in which you can use a multi method to processing individual arguments
mst^
lizmat RabidGravy: nothing more, nothing less 18:31
ZoffixWin :o
AlexDaniel, hax
m: say “/me hugs %*ENV<ME>”
camelia rakudo-moar cf199c: OUTPUT«/me hugs ZoffixWin␤»
ZoffixWin neat
AlexDaniel m: say [~] %*ENV<ME>.comb.pick: * 18:33
camelia rakudo-moar cf199c: OUTPUT«eAlDenxial␤»
AlexDaniel m: say [~] %*ENV<ME>.comb.pick: *
camelia rakudo-moar cf199c: OUTPUT«lnlAexaiDe␤»
AlexDaniel m: say ([~] %*ENV<ME>.comb.pick: *).tc
camelia rakudo-moar cf199c: OUTPUT«EAaixenllD␤»
AlexDaniel hmm
m: say ([~] %*ENV<ME>.comb.pick: *).lc.tc
camelia rakudo-moar cf199c: OUTPUT«Ialeaelndx␤»
mst ugexe: oh, I guess you could use that instead of what I was thinking, sure
I was just thinking 'curried method calls'
psch AlexDaniel: you can leave of the second . there
AlexDaniel m: say ([~] %*ENV<ME>.comb.pick: *).lctc
camelia rakudo-moar cf199c: OUTPUT«Method 'lctc' not found for invocant of class 'Str'␤ in block <unit> at /tmp/Tn9zHhaLRN line 1␤␤»
psch AlexDaniel: oh, no, sorry
AlexDaniel: gotta switch them around too :/
AlexDaniel m: say ([~] %*ENV<ME>.comb.pick: *).tclc
camelia rakudo-moar cf199c: OUTPUT«Leaalnxide␤»
AlexDaniel great 18:34
ufobat mst, so your suggestion with the builder object attached to the app, how would this end up... when does the app do something with the builder object?
mst eh? 18:35
the app ... doesn't
other way around
ufobat i am not getting the "attach the builder to the app" part 18:36
mst so 'get $path, $sub;' # as a sub call
ugexe something like $class.*method to curry the results along to the next argument instead of returning a set of results might be cool
mst does roughly $builder.get($path, $sub) 18:37
and then inside that, you're doing $!app.add_route('get', $path, $sub)
AlexDaniel m: print 8.chr x 27; say “/me hugs %*ENV<ME>”
camelia rakudo-moar cf199c: OUTPUT«/me hugs AlexDaniel␤»
mst the 'builder' thing is just somewhere to keep that logic that you can compose roles into etc. so plugins can extend the DSL
builder is entirely possibly the wrong name for it enterprise-pattern-wide 18:38
ufobat ahh, not it makes sense! thank you!
now
AlexDaniel ZoffixWin: I wonder if that ↑ works on some irc clients :)
mst ufobat: and then basically your 'default' case then becomes 18:39
AlexDaniel ZoffixWin: I mean, I don't expect it to actually /me, but the backspace thingy itself
mst ufobat: $builder.new(:app($global_class_app)).export();
(roughly, do excuse me half perl5 half perl6 pseudocoding)
ZoffixWin huggable hug foof 18:40
huggable, hug foof
huggable hugs foof
mst ur huggable is defective
ZoffixWin Why? 18:41
m: my $b = 8.chr x 27; say “/me hugs %*ENV<ME>$b”
camelia rakudo-moar cf199c: OUTPUT«/me hugs ZoffixWin␤»
psch apparently ilbot3 strips those weird thingies you do there at least
mst because it just hugged a nonexistant nick that wasn't even a valid IRC nick?
psch huggable: hug herself and sobs 18:42
huggable hugs herself and sobs
ZoffixWin mst, that's a feature not a bug! :D
mst psch++
ufobat mst but just for the thing zoffix did, having a $global_class_app and a own class inherting Bailador::App this woudn't help. because the builder has nothing to do with your class.. 18:43
18:44 BenGoldberg left
ugexe class Builder { has $.app handles /*/; }; ? 18:45
ZoffixWin ufobat, right, because you also have subs that you call inside route callables.
ufobat, have you seen Growing Guide that shows the process of converting a ::Lite mojo app into a full one? mojolicious.org/perldoc/Mojolicious...es/Growing
ufobat not yet, ZoffixWin
ugexe, ? 18:46
ZoffixWin ::Lite is basically for quit prototyping and you can continue using for small apps and convert to a full app when it grows. With Bailador, (currently) you just have a choice between using the sub interface or the class-y interface and you have to explode a lot of stuff if you want to get fancy.r 18:47
s/quit/quick/;
ugexe basically you provide a interface/contract for what some class needs to implement. then the 2 classes do not need to know anything about one another other than it does method XXX and method YYY 18:49
ZoffixWin m: class Builder { has $.app handles *; }; my $b = Builder.new: :app('meow'); say $b.uc; $b = Builder.new: :app(class { method frob { rand } }.new); $b.frob.say
camelia rakudo-moar cf199c: OUTPUT«MEOW␤0.994158023560217␤»
ufobat the 'use Bailador' thingy is the ::lite approach. and i think if there would be a $controller passed to the callable
18:50 ZoffixWin left
AlexDaniel “quit prototyping” :) 18:50
ufobat and the $c is capable of doing more, everything would be more easy. but this would break other web apps using the classical bailador approach 18:51
thats why i haven't thought much about it. i didnt want to break runnig code
mst ufobat: aye, fair enough
I'm ... blah, I'm convinced there's a way to square the circle but I'm not awake/alive enough today to quite figure it out 18:52
I'll have to try and think about this again later, sorry
ufobat thanks for the feedback :) mst, i appreciate it 18:54
mst if you look at the internals of Dancer2::Core::DSL you can see my last attempt at producing something sort of like this that I didn't dislike overly, though there's a few things about that that I think I got wrong 18:55
ufobat i assumed the approach through inherting from Bailador::App would result in a better interface and not breaking old code
but did i get you right, you like the "use exported subs" way better? 18:56
18:56 BenGoldberg joined
ufobat mst i 18:56
'll read it
mst I know some people find the exported subs approach more elegant and easy to write
I'm not actually fond of it myself, really, but since Dancer/Dancer2 has turned out to be more accessible to a lot of people 18:57
I've been thinking about the design problems in the vein of "how do I allow the exported subs approach for whipuptitude without interfering with manipulexity later"
ufobat: so, no, I don't like it better, but I want to be able to share an ecosystem with people who do :) 18:58
ugexe m: role Bar { method xxx($a is rw) { $a += 10; }; }; role Bar2 { method xxx($a is rw) { $a += 20 }; }; class Foo { }; my $foo = Foo.new; $foo does Bar; $foo does Bar2; my $work = 1; say $foo.*xxx($work)
camelia rakudo-moar cf199c: OUTPUT«(21 31)␤»
ufobat mst and it's not enoght doing a app $incance-of-my-class-hat-inhertied-from-bailador-app (a sub which is exported) and then everthing would work as expected 18:59
mst I refer you to my previous "I've concluded I'm not awake enough to be confident about trying to analyse the details", sorry
ufobat because this would be possible
:D
mst I'd rather refuse to answer than give answers I think are quite possibly bull excrement 19:00
also, I have to go meet somebody
but I'd love to discuss this again when I'm actually capable of being properly useful to you :D
&
ufobat mst++
tadzik wondews how much work would there be to turn rakudo-js into rakudo-webassembly 19:09
timotimo um, isn't that a very big difference? 19:15
like, rakudo-js is trying to emit javascript source code, webassembly is basically assembly code? 19:16
as in, it'd be almost easier to turn moarvm into a webassembly blob and run code that way? 19:17
masak timotimo: webasm is standardized starting from asm.js, which is a subset of JavaScript 19:21
19:22 domidumont left
skink MadcapJake, You around? 19:22
19:24 jjido joined
MadcapJake A little. I'm out shopping. 19:24
grondilu masak: you sure? wasm will have its own designed AST so it should be possible to generate it to target wasm without going through javascript. 19:25
tadzik turning moarvm into webassembly sounds even cooler :D 19:27
skink MadcapJake, Does that choco stuff for r* still work?
MadcapJake No its old, I haven't been on Windows in years. Use the rakudo star msi 19:28
masak grondilu: yes, that's still true.
19:29 hankache joined
hankache hello #perl6 19:29
masak grondilu: I'm just pointing out that the starting material is not all that different in spirit from asm.js -- though the format is
skink MadcapJake, That's the problem. I'm trying to get the msi to work in appveyor and I'm having a doozy of a time
MadcapJake Rakudo has an appveyor setup doesn't it? 19:30
lizmat hankache o/ 19:32
hankache hiya lizmat 19:33
19:34 hotel_california joined, hotel left 19:36 vaisian_ joined
skink Oh wow I actually got it working 19:38
Only took eight commits :D
grondilu in any case rakudo.js will certainly help targetting wasm 19:39
(just as asm.js helps implementing it I guess) 19:40
19:41 hotel joined 19:42 vaisian_ left 19:43 hotel_california left
skink ugexe, Any idea what this means?: github.com/sergot/openssl/issues/19 19:45
I'm getting the same error
19:46 hotel_california joined 19:48 hotel left 19:51 hotel joined, hotel_california left 19:55 CIAvash left
tailgate Is there an example of overriding gist() in your own class? I'm having trouble getting it right 19:56
psch m: class A { method gist { "my special own class" } }; say A.new
camelia rakudo-moar f9db92: OUTPUT«my special own class␤»
psch tailgate: the only thing i'd consider of note there is that you just return the gist, and don't try to &say it yourself in the method 19:57
tailgate: what exactly doesn't work for you?
tailgate I think the problem is I typed return $str; rather than just not having "str" 19:58
Basically it's say (Any) rather than what I return
psch m: class A { method gist { my $str = "my special own class"; return $str } }; say A.new 20:01
camelia rakudo-moar f9db92: OUTPUT«my special own class␤»
psch tailgate: i think actual code would help more to figure out what's wrong with your... actual code :)
masak m: class A { method gist { "my special own class" } }; say ~A.new 20:02
camelia rakudo-moar f9db92: OUTPUT«A<62383072>␤»
masak m: class A { method gist { "my special own class" }; method Str { self.gist } }; say ~A.new
camelia rakudo-moar f9db92: OUTPUT«my special own class␤»
20:03 yqt joined 20:05 pierrot joined 20:06 hankache left 20:21 zakharyas left 20:31 wamba left 20:33 BenGoldberg left
AlexDaniel .tell ZoffixWin this \o[001] issue is scary 20:48
yoleaux AlexDaniel: I'll pass your message to ZoffixWin.
20:50 dolmen joined, jjido left 20:51 jjido joined 21:08 TEttinger joined
rindolf AlexDaniel: why is it scary? 21:09
timotimo i don't even know what issue that is
AlexDaniel huggable: hug me 21:10
huggable hugs m
e
AlexDaniel huggable: hug me
huggable hugs AlexDaniel
AlexDaniel this one
actually, lots of things are breaking when you do that
for example, these messages are not logged: irclog.perlgeek.de/perl6/2016-05-07#i_12448510 21:11
lizmat yikes 21:12
AlexDaniel lizmat: yeah, awful. And scary.
I'm not sure if you can do something evil with that though, I'm not in the mood today 21:13
hm, actually there is probably no problem with that 21:17
lizmat the not being logged bit is something moritz should look at... 21:18
AlexDaniel lizmat: xkcd.com/1172/ 21:19
lizmat :-) 21:20
21:25 kaare_ joined 21:37 vaisian_ joined
timotimo MadcapJake: i finally found a bit of time to look at the shakespearean counter 21:37
21:38 mr-foobar left
timotimo MadcapJake: my multithreaded version is also slower than your naive version 21:38
um, no, i just read the time output wrong
21:39 mr-foobar joined
timotimo 171.21user 0.18system 0:43.72elapsed 391%CPU (0avgtext+0avgdata 210140maxresident)k 21:39
130.02user 0.09system 2:10.12elapsed 99%CPU (0avgtext+0avgdata 95280maxresident)k
m: say "multithreaded version took only { 43 / (2 * 60 + 10) }x as much time as naive"
camelia rakudo-moar e093cc: OUTPUT«multithreaded version took only 0.330769x as much time as naive␤»
timotimo compare 33% as much time with 391% cpu time 21:40
there's noticable overhead, but it ended up faster in the end
skink Speaking of speed, using the r* msi vs building saves 22min on appveyor 21:41
21:41 kaare_ left 21:43 vaisian_ left
timotimo MadcapJake: i commented my code into the gist 21:43
21:44 Emeric1 joined 21:45 Emeric left, Emeric1 is now known as Emeric 21:46 ZoffixWin joined
ZoffixWin AlexDaniel, yeah, it's actually exploitable by using something that can send \n 21:48
yoleaux 20:48Z <AlexDaniel> ZoffixWin: this \o[001] issue is scary
ZoffixWin I'm gonna blow up IRC::Client and re-design it from scratch. Current version sucks. I wrote it half drunk when I didn't know any Perl 6. 21:49
AlexDaniel ZoffixWin: huh? I don't think that you can send \n
ZoffixWin Hm. I guess you're right, since it'll go via the server.
Then why is that issue scary? :P
AlexDaniel ZoffixWin: irclog.perlgeek.de/perl6/2016-05-07#i_12448525 21:50
ZoffixWin Ah
AlexDaniel ZoffixWin: well, dunno. What happens if you send a really-really long string? 21:51
jnthn timotimo: Would be interested to know if you get slightly better results with moar/reframe on that concurrency thing, since one source of contention has been removed
AlexDaniel I have no idea how IRC works by the way 21:52
timotimo jnthn: then i'll first have to measure without jit, too
oh, and i didn't put "combine the numbers" back in
jnthn True :)
21:52 huggable left 21:53 huggable joined
AlexDaniel huggable: test 21:54
huggable AlexDaniel, foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooz
ZoffixWin AlexDaniel, it'll either disconnect or the response won't be sent, I forget (at least on Freenode) 21:55
That won't work lol. It can only happen with the 'Stored blah as blah', because everything else is shorter than *you* can send :)
21:55 AlexDaniel is now known as AlexDanielttttt
AlexDanielttttt huggable: test 21:56
huggable AlexDanielttttt, trooooloolollllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
AlexDanielttttt huggable: t
huggable AlexDanielttttt, fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooz
ugexe skink: its apparently because p6-find-bundled uses @*INC which hasn't existed for almost a year
AlexDanielttttt ZoffixWin: not when you add my nickname
21:56 AlexDanielttttt is now known as AlexDanieltttttt
ZoffixWin U gyess 21:56
21:57 huggable left 21:58 huggable joined
ZoffixWin huggable, hug trollolo 21:58
huggable hugs trollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotrollolotr
ugexe the fact the current %?RESOURCES implementation can't handle the openssl use case by allowing the author to somehow provide alternatives should suggest it needs to be redone
ZoffixWin lols
AlexDanieltttttt ZoffixWin: wait, didn't you write it just couple of months ago?
21:59 Emeric left
ZoffixWin Looks like it continues to shove data, so in some way it is exploitable, I guess :) gist.github.com/zoffixznet/f9469aa...712d5fe5b1 21:59
21:59 huggable left
skink ugexe, Well, that'd do it :) 22:00
ZoffixWin AlexDanieltttttt, no. My first Perl 6 code was App::NoPaste and the two supporting modules, and then I wrote IRC::Client and all its plugins and I did it in December so I could have a new Year IRC party bot.
ugexe it doesnt help that Find::Bundled has no tests so it merrily installs and makes openssl look like the culprit 22:01
AlexDanieltttttt oh geez my nickname
22:01 AlexDanieltttttt is now known as AlexDaniel
ZoffixWin Actually, after I wrote App::NoPaste I forgot Perl 6 (too much time went by), so IRC::Client can really count as my first Perl 6 project :P 22:01
22:01 colomon left
ZoffixWin hmmm.. looks like I broke it :/ 22:02
22:04 jnap_ left 22:05 jnap_ joined 22:06 unhuggable joined
ZoffixWin unhuggable, hug me 22:07
unhuggable hugs ZoffixWin
22:07 unhuggable left
ZoffixWin oooooh: "* huggable :Nickname is already in use." 22:08
tailgate I'm trying to overload the + operator with the following code. gist.github.com/ahalbert/b2714e33f...4ef6c1867d It gives a type error when I tried to use it. Could anyone clairfy what it means?
22:09 raiph joined
ZoffixWin tailgate, you overloaded with `Unit` but trying to call it with `Units::Unit` 22:09
22:09 grondilu left
ZoffixWin tailgate, and it's trying to convert it into .Numeric and fails 22:10
22:10 ZoffixWin is now known as huggable
AlexDaniel m: gist.github.com/AlexDaniel/429ed05...1c139258fe 22:10
camelia rakudo-moar e093cc: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bhidKciC4E␤Invalid typename 'Unit' in parameter declaration. Did you mean 'uint', 'Uni'?␤at /tmp/bhidKciC4E:1␤------> 3multi sub infix:<+>(Unit7⏏5 $x, Unit $y) {␤»
22:10 huggable is now known as ZoffixWin
tailgate Unit has a member of type Num 22:11
22:11 verzit left
ZoffixWin tailgate, what's in $a and $b? 22:11
tailgate Units::unit I should calirfy, the <+> is copied from the module Units 22:12
22:12 verzit joined
AlexDaniel tailgate: it would be cool if it was a runnable snippet :) 22:12
ugexe m: $*REPO.repo-chain.grep(*.files("libssl.so")).say
camelia rakudo-moar 626b5a: OUTPUT«Cannot unbox a type object␤ in block <unit> at /tmp/Jge8sCDuuw line 1␤␤»
tailgate the type is a Units::unit of $a and $b
ZoffixWin tailgate, Units::Unit is not a Unit
tailgate, you're trying to match apples to oranges
m: say Num ~~ Numeric
camelia rakudo-moar 626b5a: OUTPUT«True␤»
raiph m: subset literal of Str; my literal $foo = "abc"; say $foo; say $foo.WHAT # literal: "subtype with ... just a different type name" (a subset is, er, literally, a subset so you can't add a method; in this case the subset is semantically equal to the original type except with a different name) 22:14
camelia rakudo-moar 626b5a: OUTPUT«abc␤(Str)␤»
raiph er, nevermind :( :)
22:16 huggable joined, huggable left 22:17 huggable joined
ZoffixWin huggable, hug me 22:17
huggable hugs ZoffixWin
ZoffixWin There! Fixed forever
jnthn huggable, hug tree 22:18
huggable hugs tree
jnthn huggable++ # loves the environment
22:18 verzit left 22:19 verzit joined, verzit left, colomon joined 22:20 ufobat left 22:22 kurahaupo left 22:23 dolmen left, kurahaupo joined
skink ugexe, I switched it to use resources/libraries instead of Find::Bundled and... 22:23
It works! :D
Completely, somehow
ugexe it shouldnt 22:26
resources/libraries will mangle the name, and %?RESOURCES gives you no option to supply anything but a single name 22:27
(so first it would only work on EITHER windows or linux)
skink OpenSSL::NativeLib uses a sub which returns the bundled dll if $*DISTRO.is-win, else returns the native system lib 22:29
ugexe i.e. you cant mangle `ssl` into both libssl.so and ssleay32.dll
skink I only changed two lines to get it working. Not the cleanest fix, but all tests pass on both Linux and Windows 22:30
ugexe that doesnt install the lib. it sounds like you may just be hard coding an assumed location
resources/libraries would provide the library through %?RESOURCES<ssl> or %?RESOURCES<ssleay32> 22:31
the only real solution i can see unless %?RESOURCES gets reworked is to install both the .so and .dll on both OS 22:33
and NativeLib.pm6 still has exist to decide to use %?RESOURCES<ssl> or %?RESOURCES<ssleay32>
skink There is no .so being installed 22:34
ugexe ... i know
if you were on linux and needed it, then it would be
m: say $*VM.platform-library-name('ssl'.IO).Str
camelia rakudo-moar 626b5a: OUTPUT«libssl.so␤»
ugexe on windows that wont generate the correct name. so `resources/libraries` is useless 22:36
22:36 aries_liuxueyang left
ugexe the original s22 implementation was on the right track in this respect 22:37
22:38 aries_liuxueyang joined
ugexe if a leaf node is a hash, it represents build time stuff that is meant to be handled by some builder so that those type of name customizations can be made 22:38
skink .seen sergot 22:45
yoleaux I saw sergot 9 Feb 2016 15:52Z in #perl6: <sergot> stmuk_++: merged, thanks a lot! :)
22:49 vaisian joined 22:50 vaisian left 22:54 kurahaupo_ joined 22:56 kurahaupo left, mr-foobar left 22:57 mr-foobar joined 23:04 jjido left, cpage_ joined 23:07 cognominal left
sortiz q 23:09
ugexe on a positive note this hack removes dependencies on panda, Shell::Command, and File::Bundled 23:10
23:13 spider-mario left 23:14 kurahaupo joined 23:16 kurahaupo_ left
RabidGravy :) 23:17
skink ugexe, :) 23:18
ugexe the drawback is 2 windows dlls get copied to the file system on linux (but never used). an alterntive is to use Build.PM to delete them from the META.info file but that seems even less koscher 23:19
23:19 firstdayonthejob left
Xliff_ How can you get the current size of a file referenced by an IO::Handle? 23:21
23:21 kurahaupo left
Xliff_ Nevermind IO::Handle::s 23:22
skink hey Xliff_
Xliff_ I will have to write a test to see if a file opened as :w will return the proper size without a .flush/.close.
\o skink
ZoffixWin chuckles at AlexDaniel 23:23
skink ugexe, My original intent wasn't even to change any code. I just wanted to see if my cross-compiled libs worked. 23:24
ugexe did they?
skink Yes, thankfully
ZoffixWin i.imgur.com/NIuBvh7.png 😂😂😂 23:25
AlexDaniel yeah, I just wrote “hug me” to ZoffixWin… because for some weird reason he changed his nickname from “huggable” to “ZoffixWin”, and I had a private window opened… so I wrote a message to him thinking that I am talking to huggable
skink OpenSSL has a CROSS_COMPILE build setting so I expected them to, unlike my past attempts for other libs
ZoffixWin huggable, hug AlexDaniel
huggable hugs AlexDaniel
MadcapJake huggable: hug everyone 23:27
huggable hugs everyone
MadcapJake timotimo: cool! afk till tomorrow 23:28
TEttinger huggable, hug huggable 23:30
huggable hugs huggable
Xliff_ m: my %h = (); say "Y" if %y<y> == 'y'; 23:33
camelia rakudo-moar 626b5a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7HX92swxKr␤Variable '%y' is not declared␤at /tmp/7HX92swxKr:1␤------> 3my %h = (); say "Y" if 7⏏5%y<y> == 'y';␤»
Xliff_ m: my %h = (); say "Y" if %h<y> == 'y';
camelia rakudo-moar 626b5a: OUTPUT«Use of uninitialized value of type Any in numeric context in block <unit> at /tmp/NggOlN0OzO line 1␤Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5y' (indicated by ⏏)␤ in block <unit> at /tmp/NggOlN0…»
Xliff_ m: my %h = (); say "Y" if %h<y> eq 'y';
camelia rakudo-moar 626b5a: OUTPUT«Use of uninitialized value %h of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/pnidGaR4NL line 1␤»
Xliff_ Is there a way to make that test without a call to :exists first? 23:34
So... no streamlined version of this? 23:38
m: my %h = ( y => 1 ); say "Y" if %h<y>:exists && %h<y> eq 'y';
camelia ( no output )
AlexDaniel m: my %h; say ‘Y’ if (%h<y> // ‘’) eq ‘y’ # :-/ 23:40
camelia ( no output )
AlexDaniel m: my %h = ‘y’ => ‘y’; say ‘foo’ if %h<y>:v eq ‘y’ 23:42
camelia rakudo-moar 626b5a: OUTPUT«foo␤»
AlexDaniel m: my %h; say ‘foo’ if %h<y>:v eq ‘y’
camelia ( no output )
AlexDaniel Xliff_: ↑ that, I guess
23:42 rindolf left
AlexDaniel yeah, that 23:43
Xliff_ LOL! Thanks, AlexDaniel! 23:44
Now since you are hear... can you get a filename from an IO::Handle?
=)
ugexe skink: github.com/sergot/openssl/pull/25 i'll try and merge this later if it passes travis, and then i'll test your updated libs and merge those as well
AlexDaniel Somehow I don't think that IO::Handle has to have any associated filename 23:45
Xliff_ :s
23:45 grondilu joined
AlexDaniel it's just a handle! 23:45
Xliff_ Means I will have to capture output filename, somehow.
Thanks. 23:46
AlexDaniel I may be wroung though
ugexe you can set the file name anyway if you want
if you know what it will be and just want something to contain it while you pass around the IO::Handle
its just called :$path 23:47
m: IO::Handle.new(:path => $*CWD).path.say 23:49
camelia rakudo-moar 626b5a: OUTPUT«IO::Handle is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting line 1␤ in method new at src/RESTRICTED.setting line 32␤ in block <unit> at /tmp/zxPqGtJxMV line 1␤␤»
ugexe with no path .path will be '-'
skink ugexe, Yeah that's way better than my hack
AlexDaniel m: say $*IN.path
camelia rakudo-moar 626b5a: OUTPUT«IO::Special.new(what => "<STDIN>")␤»
AlexDaniel m: say ~$*IN.path 23:50
camelia rakudo-moar 626b5a: OUTPUT«<STDIN>␤»
AlexDaniel Xliff_: well… :)
23:51 kurahaupo joined
skink ugexe, This also means issue #19 can be closed 23:51
Also hold off on the libs, OpenSSL 1.0.2h just came out so I might as well build that 23:53
ugexe skink: want to redo your PR but change /native-lib to /resources, and attach your app veyor?
skink New PR with name change, update libs, and appveyor pointed at master? 23:54
Sound alright?
ugexe yeah 23:55
23:55 cdg left
skink Alright, give me just a bit 23:55
23:55 kurahaupo left, uruwi joined
Xliff_ Hrm. 23:56
ugexe you should probably bump the version again too
Xliff_ IO::Handle::path isn't documented, here
doc.perl6.org/type/IO::Handle
ugexe its an attribute, not a method
23:56 cdg_ joined
AlexDaniel ugexe: does it mean that we never document attributes? 23:57
ugexe i mean i guess that gives it a method by default but ye ah
AlexDaniel huggable: docs 23:58
huggable AlexDaniel, nothing found
AlexDaniel huggable: doc issue
huggable AlexDaniel, nothing found
AlexDaniel huggable: doc issue :is: github.com/perl6/doc/issues/new
huggable AlexDaniel, Added doc issue as github.com/perl6/doc/issues/new
ugexe not usually. they are typically described in the method parameters 23:59
Xliff_ Actually, it's an attribute AND a method!
IO::Handle::path returns $!path.
Which looks to be an IO::Path