»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
Sgeo_ m: sub foo($a Bool) { say $a; } foo(True|False); 00:00
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HQdai1UNiE␤Missing block␤at /tmp/HQdai1UNiE:1␤------> 3sub foo($a 7⏏5Bool) { say $a; } foo(True|False);␤»
Sgeo_ m: sub foo(Bool $a) { say $a; } foo(True|False);
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8RHWhjlkSh␤Strange text after block (missing semicolon or comma?)␤at /tmp/8RHWhjlkSh:1␤------> 3sub foo(Bool $a) { say $a; }7⏏5 foo(True|False);␤ expecting any of:␤ infix␤ inf…»
Sgeo_ m: sub foo(Bool $a) { say $a; }; foo(True|False);
camelia rakudo-moar 31a083: OUTPUT«True␤False␤»
Sgeo_ Sorry for spamminess 00:01
So I guess being inside the call to foo doesn't count as a boolean context?
Although I guess that makes sense, trying to guess an arbitrary function's argument context (what is this called?) would be tricky and thus error-prone
00:02 ShimmerFairy left
TimToady Bool is inside Any, so it'll autothread 00:03
it's only the lower-level boolean context that "observes" the superposition
(there has to be a lower level to break circularity) 00:04
Sgeo_ "As mentioned before, not all operators and syntactic constructs curry * (or Whatever-stars) to WhateverCode. In the following cases, * will remain a Whatever object." 00:09
I'm sure no one will ever make a macro that places * into various syntax positions which then slips up when it unexpected is placed into a context that doesn't produce a WhateverCode 00:10
(Sorry for sarcasm, I just wonder at the combination of macros and the existence of edge cases that might need to be checked for) 00:12
Typo I think: doc.perl6.org/language/grammars 00:14
my $s = 'Tokens won't backtrack, which makes them fail quicker!';
That ' in won't isn't escaped
TimToady yeah, that's bogus
00:15 ShimmerFairy joined
Sgeo_ Is there a thing I have to check compile with before contributing to docs? 00:15
m: say 'Testing escap\'d quote mark' 00:16
camelia rakudo-moar 31a083: OUTPUT«Testing escap'd quote mark␤»
00:17 laouji joined
Sgeo_ Made a pull request 00:18
00:20 captain-adequate left
TimToady Sgeo_++ 00:28
00:31 shinobi-cl joined 00:32 BenGoldberg joined 00:39 laouji left 00:45 llfourn joined 00:46 laouji joined 00:49 llfourn left
tony-o m: say 'Hello'.index(':'); 00:49
camelia rakudo-moar 31a083: OUTPUT«Nil␤»
tony-o should that return a number?
shinobi-cl Hi all! 00:50
Sgeo_ tony-o, what number would it be? There's no correct answer
ShimmerFairy tony-o: nope, and IIRC it never has in Perl 6 (before it would return a type object)
shinobi-cl i want to have a logging method that knows who called it. Can i do this with a macro? 00:51
ShimmerFairy Returning "Nil" is new, and was decided as better than a type object.
Sgeo_ Although I'm a Perl 6 newbie, I'm happy that it's not a number but sad that it's not Nothing (and correct answers Just whatever)
shinobi-cl something like this i guess:
Sgeo_ I might have mostly a Haskell sense of sensibilities 00:52
ShimmerFairy Sgeo_: funny enough, I suggested the possibility of a Maybe type when this came up a few days ago :) (I've only got a passing familiarity with Haskell however)
shinobi-cl rakudo: sub LOGS{say {{{ self.^name }}} }; class ThingA { method A {say "hey!"} }; my $T = new ThingA; $T.A; 00:53
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5===␤'self' used where no object is available␤at /tmp/tmpfile:1␤------> 3sub LOGS{say {{{7⏏5 self.^name }}} }; class ThingA { method␤Unsupported use of C++ constructor syntax; in Perl 6 please use method call syntax␤at /tmp/t…»
Sgeo_ ShimmerFairy, :) what was the reaction? 00:54
shinobi-cl rakudo: sub LOGS{say {{{ self.^name }}} }; class ThingA { method A {say "hey!"} }; my $T = ThingA.new; $T.A;
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile␤'self' used where no object is available␤at /tmp/tmpfile:1␤------> 3sub LOGS{say {{{7⏏5 self.^name }}} }; class ThingA { method␤ expecting any of:␤ term␤»
shinobi-cl ahh brb
ShimmerFairy Sgeo_: I recall a suggestion to try implementing it in a branch and see how it turns out :) (didn't take that up however, at least not yet)
shinobi-cl rakudo: sub LOGS{say "print here that LOGS was called from a ThingA object" }; class ThingA { method A { LOGS; } }; my $T = ThingA.new; $T.A; 00:55
camelia rakudo-moar 31a083: OUTPUT«print here that LOGS was called from a ThingA object␤»
Sgeo_ m: my $x = die "die!"; say $x.WHAT 00:56
camelia rakudo-moar 31a083: OUTPUT«die!␤ in block <unit> at /tmp/RH_M5usql0:1␤␤»
Sgeo_ :/
m: my $x = die "die!"
camelia rakudo-moar 31a083: OUTPUT«die!␤ in block <unit> at /tmp/TrtS_lyVus:1␤␤»
Sgeo_ Slide 65 www.slideshare.net/Ovid/perl-6-for-mere-mortals made me think it wouldn't explode immediately 00:57
ShimmerFairy m: my $x = fail "die!"; say $x.WHAT
camelia ( no output )
ugexe m: sub foo { bar() }; sub bar { say &?CALLER::ROUTINE }; foo;
camelia rakudo-moar 31a083: OUTPUT«sub foo () { #`(Sub|49149160) ... }␤»
b2gills m: say my $ is default(42) = 'Hello'.index(':'); 00:59
camelia rakudo-moar 31a083: OUTPUT«42␤»
00:59 TimToady left
Sgeo_ ~~ is backwards compared to Ruby's ===, which has the smarter object on the left to fit with === as a method on the smarter object 00:59
(Where ranges are smarter than numbers, for example, since it's the range that needs to know that there's a range vs. number check) 01:00
ShimmerFairy Sgeo_: I'm not sure that's supposed to work with "die", at least (not 100% on that). If you want that specific example to work (requiring class attributes), then the "is required" trait is what you want. 01:01
01:01 leont left, TimToady joined
shinobi-cl mm i see, thanks ugexe but i thought (and i am a total newbie on this) that maybe a macro could do that? 01:05
ugexe perl6 macros have lots of work left 01:06
i am unsure what they can actually do yet
shinobi-cl oh, i'll do this as a role then :) Thanks! 01:07
ugexe a good idea 01:08
01:11 dayangkun joined, raiph joined
tony-o Sgeo_: i'd expect -1, like most other languages 01:14
Sgeo_ But that's a number, if you're not thinking of that possibility you'll just end up doing the wrong thing, unlike with Nil (where you'll crash), a dynamically typed Maybe (where you'd crash on any result if you forgot about it), and a statically typed Maybe (where it won't compile unless you at least acknowledge the possibility of failure) 01:16
ugexe -1 would give problems with @a[$x.index('asdf')] i.e. @a[-1]
tony-o the problem is it doesn't crash
instead of @a[Nil] ? 01:17
m: my @a = 1,2,3; say @a[-1]; 01:18
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TSVDHB88uN␤Unsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1␤at /tmp/TSVDHB88uN:1␤------> 3my @a = 1,2,3; say @a[-1]7⏏5;␤»
ugexe its better than an error complaining about -1 as a range and to use *-1
tony-o error checking is part of writing code
returning Nil means error checking is checking types instead of numbers
m: if "hello".index(':') > -1 { "here".say; } 01:19
camelia rakudo-moar 31a083: OUTPUT«Use of Nil in numeric context in block <unit> at /tmp/bdqizADRM6:1␤here␤»
ShimmerFairy tony-o: we've never had it return -1, afaik, and just recently we 1) changed from using a type object for "not found" and went with a more natural "Nil", and 2) made a new Index type so you can test if something was found even when the index is 0 01:20
m: say $_ for "foo".index("f"), "foo".index("f").WHAT, ?"foo".index("f")
camelia rakudo-moar 31a083: OUTPUT«0␤(Index)␤True␤»
tony-o checking the type and then the actual index seems less clean than just checking to see if it's a positive number .. 01:21
Sgeo_ How about a maybe function, that takes a result from index() and a closure that accepts a result and is run if something is there
ShimmerFairy m: for <foo bar bazf> { if $_.index("f") { say "FOUND!" } else { say "aw" } }
camelia rakudo-moar 31a083: OUTPUT«FOUND!␤aw␤FOUND!␤»
ShimmerFairy tony-o: ^ now you can do that in Perl 6
Sgeo_ ShimmerFairy, 0 is truthy in Perl 6?
m: say so 0
camelia rakudo-moar 31a083: OUTPUT«False␤»
Sgeo_ ?
tony-o it looks like ecmascript where you end up writing if(obj.a && obj.a.b && obj.a.b.c && obj.a.b.c.d ... && obj... === "some string") 01:22
ShimmerFairy Sgeo_: nope, we have an Index type that's true even for 0
01:22 rmgk_ joined, rmgk left, rmgk_ is now known as rmgk
ShimmerFairy m: say "42".index(":").WHAT # Sgeo_ 01:22
camelia rakudo-moar 31a083: OUTPUT«Nil␤»
ShimmerFairy m: say "42".index("2").WHAT # Sgeo_
camelia rakudo-moar 31a083: OUTPUT«(Index)␤»
Sgeo_ Hmm, interesting. Why (Index) not Index?
ShimmerFairy That's how all type objects print
tony-o that's really great but it still forces two checks in not so fringe cases 01:23
ShimmerFairy m: say Int; say Str;
camelia rakudo-moar 31a083: OUTPUT«(Int)␤(Str)␤»
Sgeo_ Also you can still forget to check for Nil since Index lets you use direct as a number apparently?
Also this will break people into getting use to this almost-sanity and forgetting that other languages will still break on 0 index if you try to pull this in them 01:24
tony-o the converse isn't true
ShimmerFairy Sgeo_: literally, my class Index is Int { , so it acts like an Int except for the part where ?Index.new(0) is True.
tony-o m: Nil.Int.say;
camelia rakudo-moar 31a083: OUTPUT«Use of Nil in numeric context in block <unit> at /tmp/70JlvNfo_d:1␤0␤»
tony-o if you assume it's an Index then you just get a bunch of errors unless you know you need two checks
s/errors/warnings/ 01:25
Sgeo_ Someone's going to write buggy and insecure Python because of this
Then again, software development is horrible anyway, and it's arguably Python's fault
ShimmerFairy tony-o: since Nil boolifies to False, you just need to check the truth of the returned value from .index and such; if it's True you can use it as a valid index (and is an Index object), otherwise it's False and thus a Nil.
Also, Perl 6 hasn't returned -1 on not-found results for a long time (possibly since it was created), so being different from other langs on this is nothing new :) 01:26
Sgeo_ Does Perl6 have generics? Like a Rubify type that Index is basically Rubify<Int> and is basically always truthy?
Hmm what should Rubify<Bool> do? 01:27
ShimmerFairy We have parametric roles, at least.
Sgeo_ I don't see Index here doc.perl6.org/type.html 01:28
ShimmerFairy Sgeo_: it's a fairly recent addition; within the past few days. I'm not sure if there are even tests for it yet. (Might be by now though.) 01:29
Sgeo_ state variables are basically like let over lambda? 01:31
ShimmerFairy m: for ^5 { state $a = 0; my $b = 0; $a += $_; $b += $_; say "STATE: $a MY: $b" } # demo of state variables vs. non-state 01:34
camelia rakudo-moar 31a083: OUTPUT«STATE: 0 MY: 0␤STATE: 1 MY: 1␤STATE: 3 MY: 2␤STATE: 6 MY: 3␤STATE: 10 MY: 4␤»
ShimmerFairy Sgeo_: btw, if you don't know much about the history of Perl 6, you might be interested in learning that the first big implementation of Perl 6 was done in Haskell (called "Pugs"). And from what I've heard Haskell actually influenced some parts of Perl 6 when Pugs was big. 01:36
Sgeo_ Cool, especially at Haskell having some influence 01:37
ShimmerFairy I couldn't tell you anything specific, I'd have to research it too :)
Sgeo_: and I suspect that's why my Maybe suggestion wasn't rejected outright; wouldn't be the first time something from Haskell influenced Perl 6 :P 01:38
01:38 flussence left, flussence joined
Sgeo_ Why are type objects considered to be of the type? 01:43
Especially if it just results in everything putting defined restrictions on arguments 01:44
m: sub what(Int:D $x?) { say $x; }; what; 01:45
camelia rakudo-moar 31a083: OUTPUT«Parameter '$x' requires a 'Int' instance, but a type object was passed. Did you forget a .new?␤ in sub what at /tmp/eHJf9kgRI3:1␤ in block <unit> at /tmp/eHJf9kgRI3:1␤␤»
ShimmerFairy I couldn't tell you, but I would guess my $a; would account for one reason. (I can imagine it being painful if you had my Foo $a; and that _had_ to construct a new value, but there's no 0-arg new() method) 01:48
TimToady basically, all the types default to Maybe types 01:49
TimToady stopping by just for a minute or two...
ShimmerFairy Ooh, hadn't thought of it like that. TimToady++ :) (Maybe? We'll do that without an extra type!) 01:50
TimToady afk & 01:51
Sgeo_ do_if_defined $foo -> $a_foo { ... }
ShimmerFairy m: for (42, Int) { if $_.defined { say "$_" } else { say "type obj" } } 01:52
camelia rakudo-moar 31a083: OUTPUT«42␤type obj␤»
ShimmerFairy m: for (42, Int) { say $_ // "type obj" } # shorter version of my previous eval 01:53
camelia rakudo-moar 31a083: OUTPUT«42␤type obj␤»
raiph Sgeo_: irclog.perlgeek.de/perl6/2015-07-24#i_10949513
Sgeo_ Defaulting to Maybe types hurts the reason for Maybe types existing
01:55 cognominal__ left
raiph Sgeo_: ?? 01:56
Sgeo_ raiph, as in, restricting that to only when it's useful (and requiring some acknowledgement that something might be undefined) makes it more likely that programmers will not skip checking for definedness, and will only need to check when needed 01:57
ifdef @foo.index(0).maybe { ... } 01:58
raiph Sgeo: sorry, I meant the "defaulting to Maybe types" comment; please elaborate
skids m: for "aaf","f","b" { if $_.index("f") -> $idx { $idx.say } }
camelia rakudo-moar 31a083: OUTPUT«2␤0␤»
Sgeo_ If everything is a Maybe, people might get complacent and fail to ensure definedness, the way that Java programmers don't check every single variable for null even though anything can be null 01:59
01:59 llfourn joined
skids Sgeo_: I think any language that "fixed" that would die of unpopularity. 02:00
Sgeo_ Is Scala dead? Haskell?
ShimmerFairy You usually only need to check :D and :U for methods like ACCEPTS and gist on your own classes, I've found. 02:01
Sgeo_ Hmm, similar to Objective-C nil ignoring messages? 02:03
02:04 llfourn left
ShimmerFairy Well, when it comes to providing methods on your classes to "hook into" standard Perl 6 stuff, I've encountered trouble not specifying :D for the invocant, so I make sure to do that nowadays. 02:05
raiph Sgeo: Aiui: values that end up as Nothing (like) are unexploded bombs; Haskell forces one to write bomb disposal instructions; the P6 way is that, unless you first defuse it, any attempt to use it will result in an error message that accurately describes your problem 02:06
at run time
skids m: class A { has $.a; method foo { $a.a + 1 } }; A.foo(); # like that.
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5=== Error while compiling /tmp/jJyade_AXF␤Variable '$a' is not declared. Did you mean '$!a'?␤at /tmp/jJyade_AXF:1␤------> 3class A { has $.a; method foo { 7⏏5$a.a + 1 } }; A.foo(); # like that.␤»
skids oops. 02:07
m: class A { has $.a; method foo { $.a + 1 } }; A.foo(); # like that.
camelia rakudo-moar 31a083: OUTPUT«Invocant requires a 'A' instance, but a type object was passed. Did you forget a .new?␤ in method foo at /tmp/GijZ_NcL5g:1␤ in block <unit> at /tmp/GijZ_NcL5g:1␤␤»
Sgeo_ raiph, I don't really see how it's different from Java null 02:09
The P6 way I mean
But maybe I'm just in favor of being forced to write bomb disposal instructions
ShimmerFairy It's kinda similar to how NaN propagates throughout floating point operations, perhaps. 02:10
skids Sgeo_: Some compromizes have been made for rapid prototyping purposes, for sure. 02:12
raiph Sgeo_: I may be wrong about my analogy; I'm pretty sure the many Haskellers that were around when the P6 twist on Maybe was developed and I don't think it was considered the same as Java's null 02:14
s/I don't think it was considered/considered it/ 02:15
Sgeo_: Presumably concrete examples would be best; got any classic very small Haskell Maybe examples? 02:19
Sgeo_ Looking around for stuff I can just pastie 02:20
pastie.org/10321216
raiph Are Haskell Maybes an application of tagged unions? 02:21
Sgeo_ displayResult mx = maybe "There was no result" (("The result was " ++) . show) mx
Well, a tagged union with a Nothing alternative and an alternative containing a value
In the above line, a function displayResult is defined, which takes an argument mx, which is a Maybe Int. (I didn't copy the type signature). The maybe function takes a default, a function, and the Maybe value 02:22
raiph Aiui, a P6 value is effectively a tagged union of a Nothing alternative that's given its own name and an alternative containing a value 02:23
Sgeo_ raiph, but Haskell culturally does not make everything a Maybe, only some things are this tagged union. In P6, aiui, everything is this tagged union
02:23 HoppingMadMan joined
Sgeo_ In Haskell, you need to do work to acknowledge the possibility of no value. In P6, you can ignore it and hope for the best without even indicating that that's what you intend to do 02:24
02:24 skids left
Sgeo_ (Haskell does have an ability to indicate that you're just hoping for the best, but you have to do so explicitly. The fromJust function, or fromMaybe with (error "Whatever") 02:24
I think the Java comparison is appropriate. In Java, an Integer is a tagged union with possibilities: no value (aka null), and a boxed integer value 02:25
02:27 HoppingMadMan left 02:28 HoppingMadMan joined
ShimmerFairy m: say log(1000); say log(-1000); 02:28
camelia rakudo-moar 31a083: OUTPUT«6.90775527898214␤NaN␤»
02:28 rindolf left
ShimmerFairy Perl 6 returns NaN for that example, which is arguably the better choice (depending on your preferences concerning the floating point standard) 02:29
02:29 skids joined
ShimmerFairy Ah, I see the plain 'log' in haskell returns NaN too. 02:30
raiph Aiui P6 doesn't have a single notion that corresponds to "no value" 02:31
ShimmerFairy Yes, Perl 6 explicitly avoids Perl 5's singular "undefined" (or whatever it's called there, I don't know P5 :P) 02:32
tony-o the transition from undef is a bit jarring
02:32 yqt left
Sgeo_ So better than Ruby but still as bad as Java (I might be slightly opinionated) 02:33
ShimmerFairy It's certainly fine to prefer writing the "bomb handling instructions", as it's been put, and Perl 6 of course lets you do that :) . P6's handling of the Maybe concept just lets you pass off the undefinedness check to someone who really cares if you don't (kinda like exception handling, when put like that) 02:36
02:36 HoppingMadMan left
raiph Sgeo_: Thanks for your safelog example -- but I didn hasn't helped 02:37
02:37 HoppingMadMan joined
raiph (sigh, chromebook keyboard is small) 02:37
ShimmerFairy I think the advantages of Perl 6's solution are that 1) It doesn't require extra types (Maybe, Just, and Nothing, though probably at least one of those could be roles), and 2) Your "Nothing"s have more information 02:40
raiph Gotta go; I'm looking forward to reading TimToady's pithy single line comment that explains all this... Nothing. Maybe. goodnight :)
ShimmerFairy e.g. multi sub foo(Just[Int] $a) and multi sub foo(Nothing $a) would catch a Nothing from anything, while Int:U and Int:D instead keep it within just the Int type. 02:41
Sgeo_ Nothing[Int]?
I guess another way I'm looking at it is culturally, as though maybe Int:D should be default and Int opt-in 02:42
ShimmerFairy That could certainly be a possibility, I'm just going off the fact that Haskell's Nothing choice isn't typed. 02:43
Sgeo_ It actually is, Nothing :: Maybe Int is not the same type as Nothing :: Maybe Bool
ShimmerFairy Ah, OK. I vaguely recall the definition being Maybe t = Just t | Nothing , so I presumed that the "Nothing" was detachable in a way that loses which kind of Maybe it came from 02:44
Sgeo_ Trying to compile an... I do not know why this compiled, hmm 02:46
ideone.com/WR1Awc compiles, let's try with a type annotation
ideone.com/zqN7FJ 02:47
02:50 noganex_ joined
ShimmerFairy Huh, interesting. 02:50
02:50 BenGoldberg left
Sgeo_ I guess Nothing is Maybe a, and so can be used with Maybe anything 02:52
I think?
02:52 noganex left
ShimmerFairy Perhaps. Looks like it could definitely be used for Very Clever Things™ (and I'd be surprised if nobody has, actually). 02:54
02:55 gfldex left
Sgeo_ Off-topic (mostly), is there a MuWrapper class or similar, that stores a value of type Mu but is itself Any? So you can basically pass non-Any things around without stuff breaking? 02:57
I'd imagine someone could easily write their own, but a standard might be nice
ShimmerFairy the only non-Any-based types, afaik, are Mu and Junction, so I'm sure it's not that necessary. Interesting idea though. 02:59
Sgeo_ If two roles define a same-named method (e.g. Bull-like and Steerable defining steer), the implementing class is expected to define it. The example defines it to call Steerable's steer. So what happens if I then pass an instance to something expecting Bull-Like? It might call steer expecting one thing to happen but a different thing will happen 03:02
skids It's the class 03:03
s responsibility to do that responsibly
ShimmerFairy unless you're talking about a class that inherits both roles, you can use a role as a type constraint on parameters
Sgeo_ I'm talking about a class that inherits both roles 03:04
As shown doc.perl6.org/language/objects#Role_Application
skids Sgeo_: Methods expecting a Bull handed a Taurus would get confused, yes. The example is really showing you how to do something abusive which you'd only do in a pinch. 03:11
(or if you had classes that worked well that way.) 03:12
*roles
Sgeo_ It's abusive for two different Roles to have same method names? Or it's abusive to try to deal with that scenario in that way (in which case, the proper way should be shown)?
ShimmerFairy Sgeo_: ideally that example would handle both cases (having a "Bull-Like::steer" in there somewhere too); the example in the doc seems to demonstrate a class just asking for trouble. 03:13
skids It's abusive to mix two roles with different semantics for the same method name into the same class.
Sgeo_ So two components that work sensibly on their own cannot be combined? :/ seems not very compositional (am I using that term properly?). Not sure how you could handle both cases properly? If it's possible, docs should show how 03:14
ShimmerFairy In a case like role R { method A() { } }; role S { method A() { }; } , where the signatures are the same, I don't think there's a reliable way to handle that. With different type signatures it would be possible to handle. 03:16
Sgeo_ Going to watch some TV
ShimmerFairy The example features two methods with _effectively_ the same signature (since the one with a parameter has it as optional), that falls into the "can't do reliably" case for me.
skids Sgeo_: of course they can be combined, but one should not combine them in a way that's confusing to users of the separate components.
ShimmerFairy m: role R { method A($z) { say $z + 42 } }; role S { method A { say "nothing" } }; class C does R does S { method A($a?) { $a.defined ?? self.R::A($a) !! self.S::A } }; C.A; C.A(42) 03:22
camelia rakudo-moar 31a083: OUTPUT«nothing␤84␤»
ShimmerFairy ^ an example of handling both (sadly you can't differentiate with a multi in the class)
03:23 mattp__ is now known as mattp- 03:25 raiph left
Sgeo_ Relies on being lucky that the type signatures were distinguishably different 03:25
ShimmerFairy Sure. Any class that inherits from multiple incompatible sources will have to deal with the task of reconciling them. 03:27
skids m: m: role R { method A($z) { say $z + 42 } }; role S { method A { say "nothing" } }; class C does R does S { method A($a?) { fail "Your class does not handle things that do both R and S" } }; C.R::A(42); C.S::A(); C.A() 03:28
camelia rakudo-moar 31a083: OUTPUT«84␤nothing␤Your class does not handle things that do both R and S␤ in method A at /tmp/0FUq7ijcyP:1␤ in block <unit> at /tmp/0FUq7ijcyP:1␤␤Actually thrown at:␤ in block <unit> at /tmp/0FUq7ijcyP:1␤␤»
Sgeo_ Rust and C# handle this by knowing what trait/interface's method is being called. Maybe in a dynamically typed system you could mandate the use of the role name 03:33
ala that C.R syntax
Although that might be annoying to use
ShimmerFairy Sgeo_: hmmm, maybe it would be better if, instead of insisting on resolving the issue (unless one or both roles have stubs, in which case eek!), Perl 6 warned "Potential difficulties: class C has unresolved method A from multiple sources; calls to A must be disambiguated" and went on its way. 03:35
Or something like that.
03:35 Averna joined
ShimmerFairy If both roles have the method stubbed, then you'll still have to provide the method. If only some roles have a stub, then I have no idea what would/should happen there. 03:35
skids The stub should be fulfilled by the other role I would expect. 03:36
03:37 azawawi joined
azawawi hi 03:37
skids Basically if you are using a role's interface and taking any type that does that role, you are duck-typing and should use the qualified method names.
If you're basing the assumption that a role is present on a type, then the typecheck should prevent you from doing stupid things. 03:38
ShimmerFairy skids: yeah, I imagine you could see things as $c.A for when you trust the class to do the right thing, and $c.R::A for when you can't afford to trust potentially bad classes. 03:39
Sgeo_ Would the author of the user of a roll necessarily necessarily see that error? The author of the class might be using a library that makes the assumption. 03:40
ShimmerFairy, that makes sense but sounds like a cultural thing, which needs to be put into everyone's minds the sooner the better 03:41
ShimmerFairy Sgeo_: agreed. It feels like one of the things that would be helped with a much greater pool of docs/tutorials/etc. than we currently have :)
Sgeo_: from glancing at various discussions of using multiple roles, I get the feeling that it generally doesn't work out as well as we would like. If that feeling is true, I wouldn't be surprised if roles got some not-insignificant changes in future version of Perl 6. 03:43
skids The existing example would be better to show something like a add-.magnitude-to-Int role miin with an Int-tolerant-Complex-role.
03:43 Averna left
skids Roles don;t even do everything specced yet. There's still a diamond problem. 03:43
And there's still the BUILD problem, which would be a spec change. 03:44
azawawi perl6 REPL autocompletion is not working here along with up/down (lubuntu vm). what do i need to install again to make it work?
03:44 davido__ joined
ShimmerFairy ah, having not everything be implemented yet would possibly explain the fact that I see some discussions over roles :) 03:45
azawawi: I'm not sure, but it sounds like maybe you need some Linenoise module?
skids (And there's the semantic problem here: gist.github.com/skids/d7dac1c5f6921f430f64)
azawawi ShimmerFairy: readline is installed 03:46
ShimmerFairy azawawi: I don't know anything about the REPL's fancier features, I just know I heard someone talk about a Linenoise module needed for some fancier things :) 03:47
azawawi ShimmerFairy: panda install Linenoise # fixed it, thanks... ShimmerFairy++ 03:50
now let me understand why that was not done by rakudobrew or rakudo 03:51
./.rakudobrew/moar-nom/nqp/MoarVM/3rdparty/linenoise is already in rakudo 03:52
so that p6 module is only a nativecall to it 03:53
azawawi wishes for a newbie friendly p6 distro
ShimmerFairy I wonder if Rakudo Star comes with the Linenoise module...
azawawi takes a look 03:58
i do not see it here github.com/rakudo/star/tree/master/modules :( 03:59
03:59 Averna joined 04:00 llfourn joined 04:05 llfourn left, HoppingMadMan left 04:06 HoppingMadMan joined 04:09 HoppingMadMan left 04:20 ShimmerFairy left 04:22 Averna left 04:25 aborazmeh joined, aborazmeh left, aborazmeh joined, RabidGravy joined
azawawi how do i test a result if it is a string/int or not? 04:26
04:28 HoppingMadMan joined 04:31 HoppingMadMan left 04:32 skids left, HoppingMadMan joined, ShimmerFairy joined 04:36 HoppingMadMan left
dalek c: 412ee07 | Sgeo++ | lib/Language/grammars.pod:
Fix grammars.pod unescaped quote mark in string

Escape single-quote in string in sample code
04:36
c: 4554a51 | RabidGravy++ | lib/Language/grammars.pod:
Merge pull request #110 from Sgeo/patch-1

Fix grammars.pod unescaped quote mark in string
Sgeo_ Ooh if is aif 04:37
04:38 khw left
tony-o azawawi: use ~~ 04:40
m: say 'string' ~~ Str
camelia rakudo-moar 31a083: OUTPUT«True␤»
tony-o m: say 'string' ~~ Int
camelia rakudo-moar 31a083: OUTPUT«False␤»
Sgeo_ m: say Mu ~~ Mu 04:42
camelia rakudo-moar 31a083: OUTPUT«True␤»
Sgeo_ m: say Mu.WHAT
camelia rakudo-moar 31a083: OUTPUT«(Mu)␤»
Sgeo_ m: say Mu.HOW
camelia rakudo-moar 31a083: OUTPUT«Perl6::Metamodel::ClassHOW.new␤»
04:51 laouji left
azawawi tony-o: thx 04:54
tony-o: please see github.com/azawawi/perl6-atom-elec...ailador.p6 . I think HTTP::Server::Async will be a better replacement than HTTP::Easy-based servers 04:55
04:56 skids joined
azawawi github.com/azawawi/perl6-atom-elec...-process.t # Atom::Electron::Process wrapped... :) 05:07
05:08 laouji joined
azawawi what do you think is better for event handling, on('event_name', listener) or wrap on_event_name($listener) for ease of use 05:10
Sgeo_ Doesn't Perl6 stdlib already have an event thing? 05:11
Supply
skids m: class A { method f (|c (:$a)) { }}; A.new.f(:b); # Cleaner way to no-implicit-*%_ than a "where clause" for those that think it is a good idea. 05:12
camelia rakudo-moar 31a083: OUTPUT«Unexpected named argument 'b' passed in sub-signature of parameter c␤ in method f at /tmp/8pBo5I0aez:1␤ in block <unit> at /tmp/8pBo5I0aez:1␤␤»
azawawi i meant from a API point of view. ease of use vs generic
skids (Arguably still uglier than the flip side of requiring people who want it to , add " ,*%_", but not by much, so now we can base arguments on which behavior should be encouraged rather than syntax) 05:13
azawawi if the library you're wrapping provides a generic on(Str, sub { }). Isnt it better to provide on_event_name (e.g. on_suspend, on_battery_mode, on_ac_mode, on_sleep, ...etc) 05:14
to make it easier that is 05:15
and more auto complete friendly in the future
05:16 skids left
Sgeo_ thingy.supply_suspect.tap ? 05:17
oops thingy.supply_suspend.tap
Hmm except users shouldn't be able to send spurious events to it, so a restricted form
05:20 RabidGravy left
azawawi Sgeo_: this is what i did github.com/azawawi/perl6-atom-elec...onitor.pm6 to simplify things. I will investigate the Supply later. Thanks for the info :) 05:25
azawawi breakfast &
ShimmerFairy skids: I'd say the problem with |c (:$a) is that 1) the error message talks about sub-signatures when that's not really the point in this specific case, and it also highlights the fact that 2) the use of a sub-sig there just feels wrong. 05:29
05:30 azawawi left, rurban joined
ShimmerFairy An opt-out with |c (:$a) requires knowledge about the relatively uncommon captures and sub-signatures, and results in a noisier method signature. An opt-in with *%_ only requires knowing about the relatively common named params and slurpy params, and is just an added term (as opposed to an added pair of parens) :) 05:32
Not to mention that |c (:$a) does nothing to say what it is doing (getting rid of implicit *%_), whereas *%_ says exactly what it is doing. 05:34
05:44 dolmen left
jdv79 i'd have to agree there 05:47
man, spectessting without parallelizing takes forever
forgot and wondering why its still not done 05:48
can't make spectest default to spread over all processors? 05:49
05:49 aborazmeh left
jdv79 is t/spec/S32-io/IO-Socket-Async.t failing for anyone else? 05:52
ShimmerFairy I recall that being a failure whenever parallelizing the tests. 05:53
jdv79 it failed when not for me just now 05:54
and on its own too
05:56 diana_olhovik joined
jdv79 so what is the new "index == 0"? 05:57
ShimmerFairy m: for <onefoo twofoo three fourfoo> { $_.index("f") ?? say "found" !! say "not found" } 06:00
camelia rakudo-moar 31a083: OUTPUT«found␤found␤not found␤found␤»
06:01 llfourn joined, HoppingMadMan joined
jdv79 starts-with is fine ^H 06:02
but now i notice vim doesn't like - in autocomplete:(
anyone remember where that is fixed?
ShimmerFairy: what? your code indicates existance without position 06:04
ShimmerFairy The new Index type more correctly implements the concept of a valid position (by having the 0th position be considered just as True as the rest of 'em)
m: for <onefoo twofoo three fourfoo> { say $_.index("f"), " ", $_.index("f").WHAT }
camelia rakudo-moar 31a083: OUTPUT«3 (Index)␤3 (Index)␤Nil Nil␤0 (Index)␤»
jdv79 i get that - it just makes some uses more unterse which in Perlland is a large offensse
ShimmerFairy m: for <onefoo twofoo three fourfoo> { say $_.index("f"), " ", $_.index("f").WHAT, " ", ?$_.index("f") } 06:05
camelia rakudo-moar 31a083: OUTPUT«3 (Index) True␤3 (Index) True␤Nil Nil False␤0 (Index) True␤»
ShimmerFairy jdv79: I don't follow, could you explain?
06:05 llfourn left
jdv79 if i have a line that's close to wrapping and its got a '$s.index('a') == 0' in it now it has to be changed/wrap 06:07
plus for such a simple op i can't imagine the increased complexity is great for perf
but w/e
an int comp is pretty lighweight
ShimmerFairy it's not that much more complex, it's just a class inheriting from Int that changes about three or four methods :)
And the only problem I see existing with $s.index('a') == 0 is if it 06:08
's a conditional tested after an if $s.index('a') 06:09
(but why do an explicit numerical comp in one conditional and "cheating" Bool coercion in the other?)
jdv79 for such a low level op it just feels overly complex 06:10
but i worked around it. no big deal . 06:11
except p6 makes one type more than p5 does in this case
Sgeo_ Without using a function that accepts Junction or Mu, is it possible to distinguish (1|2)|(3|4) from 1|2|3|4 ?
Trying to understand if Junctions are the List monad (plus Bool coersion) or if there's something missing 06:12
m: ["hello", 5] 06:21
camelia ( no output )
06:21 mr-foobar left
Sgeo_ m: say ["hello", 5] 06:21
camelia rakudo-moar 31a083: OUTPUT«hello 5␤»
Sgeo_ Why is Perl 6 wikibook saying arrays contain data all of the same type?
en.wikibooks.org/wiki/Perl_6_Progr...s_and_Data
m: my @a; @a = 1, "hi", Mu; say @a; 06:22
camelia rakudo-moar 31a083: OUTPUT«1 hi (Mu)␤»
Sgeo_ m: my @a; @a = 1, "hi", (1|2); say @a;
camelia rakudo-moar 31a083: OUTPUT«1 hi any(1, 2)␤»
Sgeo_ Well that's a limitation
m: sub foo($in) {my @a = 1, $in; say @a;}; foo(5|6); 06:23
camelia rakudo-moar 31a083: OUTPUT«1 5␤1 6␤»
06:23 mr-foobar joined
Sgeo_ m: sub foo(Mu $in) {my @a = 1, $in; say @a;}; foo(5|6); 06:24
camelia rakudo-moar 31a083: OUTPUT«1 any(5, 6)␤»
Sgeo_ I guess the comma accepts Mu?
ShimmerFairy wouldn't be surprised, lots of things in the core explicitly specify Mu as the type constraint. 06:25
Sgeo_ m: say (1|2)|(3|4) 06:26
camelia rakudo-moar 31a083: OUTPUT«any(any(1, 2), any(3, 4))␤»
jdv79 m: my Int @a = 1, "foo";
camelia ( no output )
jdv79 shoulnd't that fail?
m: my Int @a = 1, "foo"; say @a;
camelia rakudo-moar 31a083: OUTPUT«Type check failed in assignment to '@a'; expected 'Int' but got 'Str'␤ in block <unit> at /tmp/0WhKTqfeCq:1␤␤»
Sgeo_ If I treat it as autoflattening, is there some problem with doing so? 06:27
That prevents me from expressing something
jdv79 is that just laziness?
Sgeo_ I know I've criticized autoflattening >>= when I've seen it in Clojure, but I don't remember why 06:28
TEttinger clojure's tidbit on flatten: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with. 06:29
ShimmerFairy Sgeo_: I'm not sure. I think Junctions are currently too stubborn to be played with much at all, so I'm not sure how you can flatten or unflatten them.
Sgeo_: it's certainly an interesting question, if Junctions ever act different flattened vs. not.
Sgeo_ Why doesn't if change $_? Everything else seems to? 06:31
ShimmerFairy In what context? 06:32
Sgeo_ if $foo { ... in here ... }
I know if $foo -> $bar exists
Hmm that exact example is useless, instead of $foo imagine a complicated expression 06:33
06:33 ChoHag joined
ShimmerFairy m: if 42 { say $_ }; for 42 { say $_ } 06:34
camelia rakudo-moar 31a083: OUTPUT«(Any)␤42␤»
ChoHag What variables are available inside a class (or role) block to refer to the Type being built?
ShimmerFairy Sgeo_: my guess would be because you wouldn't be able to use the current $_ otherwise (and you're much more likely to need the existing $_ than want the conditional without using ->) 06:35
Sgeo_ Seems inconsistent with other things though like for 06:36
:/
I guess I'm not a native Perler
jdv79 since when has a conditional had $_ set?
06:36 vendethiel joined
ShimmerFairy Sgeo_: I agree that, when approaching from this angle, it seems inconsistent. Took me a minute to realize the "keep current $_" possibility :) 06:37
Sgeo_ Still, having aif is always cool
Hmm maybe if-let is a better name since it's not binding to a consistent arbitrary name, but to a given name 06:38
Not really anaphoric
ShimmerFairy I imagine most people don't expect the inside of an if to be enough of a scope that it gets to set its own $_. 06:39
ChoHag Why not?
Sgeo_ Maybe $_ is an iffy idea >.> 06:40
I mean hi
ChoHag I can't count the number of times I've wanted access to the conditionals in the clauses.
Sgeo_ ChoHag,
ChoHag if (something) then do_thing_with(it);
Sgeo_ m: if 1+1 -> $result { say $result; }
camelia rakudo-moar 31a083: OUTPUT«2␤»
ChoHag So why not an implicit -> $_? 06:41
ShimmerFairy Most times you don't care about what the conditional actually is, so overriding a potentially helpful $_ on the chance that you maybe want the conditional isn't worth it.
ChoHag Ignoring issues of there already being a $_ which will be trampled on because I lack the context of this discussion.
Sgeo_ Maybe $_ should just be called a Perl5 wart... or is it one of the things people like about Perl? 06:42
06:42 baest joined
Sgeo_ m: $_ = 5; when Int { say "when works with $_"; } 06:42
camelia rakudo-moar 31a083: OUTPUT«when works with 5␤»
ChoHag $_ is perl for "it". It's the most useful word in English.
ShimmerFairy m: my @a = 0..5; for ^10 { if +@a < 10 { @a.push($_) } }; say @a; 06:43
camelia rakudo-moar 31a083: OUTPUT«0 1 2 3 4 5 0 1 2 3␤»
ShimmerFairy A bit contrived, but still shows where not trampling $_ is useful. :)
Sgeo_ I'm going to guess that $foo ~~ $blah is a bad idea (the matching against unknown part), maybe we should make that clear to people
ChoHag It is definitely an English wart, but English is mostly just warts anyway.
Sgeo_ Because I'm sure someone will do it, and stuff will unexpected breakl 06:44
ShimmerFairy Sgeo_: it's safe to say that $_ is not going away any time soon, if ever :)
ChoHag ShimmerFairy: And again like in English, where the term being referred to by 'it' becomes ambiguous, a more definitive term is required.
ShimmerFairy Sgeo_: To me at least, ~~ is the most liberal (most "human", if you will) equality test Perl 6 provides. It's certainly worth pointing that out, though the consequences of lazily using ~~ all the time are then the user's fault 06:45
Sgeo_ ShimmerFairy, people use == in PHP 06:46
Even if ~~ is saner than PHP's ==, it's still a thing to be careful with imo
Saying this mostly from a perspective of it takes on different meanings depending on the right-hand side
ChoHag ~~ is "is" 06:47
ShimmerFairy If you have no clue what's on the RHS of your ~~ , then you should perhaps reconsider your code :P
ChoHag Again back to English, you can't have "if term_a is term_b" without there being an at least implied (adjective? adverb? whatever) between "is" and "term_b" 06:48
Sgeo_ ShimmerFairy, yes, but I'm sure people will do it anyway
ShimmerFairy Sgeo_: of course, which is why I'm fine with being clear about the liberal nature of ~~ :) 06:49
ChoHag So the definition of is changes depending on its RHS.
So it *does* depend on what "is" is.
ShimmerFairy Sgeo_: actually, I think the hardest thing about P6's equality ops is learning that == is just for numeric comparison. For some reason it took me a long time to internalize that, and understand what all the different equality ops are for.
(before I would use either == or just fall back on ~~ , but nowadays I've learned to use eq for string comparison, eqv for checking the "canonical equivalence" of things, etc.) 06:50
06:50 darutoko joined
Sgeo_ m: say "\x[1F4A9]\x[0327]" 06:51
camelia rakudo-moar 31a083: OUTPUT«💩̧␤»
jdv79 note eqv is "wrong" atm
moritz yes, it's too conservative for value types
yoleaux 30 Jul 2015 15:25Z <raiph> moritz: Did you mean `use Perl6::Grammar:from<NQP>` (ie no space before `:from`)?
ChoHag Sgeo_: A language's job isn't to stop people doing stupid things. Nature's response to fool-proofing is to make a better fool.
Sgeo_ "These values are filled from the parameters that are passed in the order that the placeholders first appear." 06:54
ShimmerFairy moritz: don't you mean object types? (Since eqv falls back on === , and === is quite strict about object types)
Sgeo_ en.wikibooks.org/wiki/Perl_6_Progr...d_Closures
Is this correct? I thought I saw elsewhere that it's lexigraphical?
m: { say $^b; $^a; }(1,2);
camelia rakudo-moar 31a083: OUTPUT«2␤»
06:55 domidumont joined
ShimmerFairy m: say (1,2,3,4).map: {$^b, $^a} 06:56
camelia rakudo-moar 31a083: OUTPUT«2 1 4 3␤»
moritz ShimmerFairy: yes 06:57
moritz not really awake yet
ShimmerFairy Sgeo_: I believe that statement is only correct when you've sorted your use of placeholders lexicographically :P
jdv79 i was going to say but got distracted
06:58 zakharyas joined
ChoHag What's the difference between role A does role B and role A is role B? 06:58
moritz ChoHag: the latter creates class from role B, and adds it as a parent class
ChoHag: which means that B's methods come later in the MRO than if it were composed as a role 06:59
07:00 domidumont left, FROGGS joined 07:01 domidumont joined, rurban left 07:02 ShimmerFairy left 07:04 HoppingMadMan left
Sgeo_ m: say 1 ~~ (1|2) 07:07
camelia rakudo-moar 31a083: OUTPUT«True␤»
Sgeo_ So it boolified itself? :/ was hoping for (1~~1 | 1 ~~ 2) 07:08
m: say 1 ~~ ((Str|Int)&1) 07:09
camelia rakudo-moar 31a083: OUTPUT«True␤»
moritz m: say 1 == (1|2) 07:10
camelia rakudo-moar 31a083: OUTPUT«any(True, False)␤»
Sgeo_ I mean, if I want a boolean, I could just say so
07:13 domidumont left 07:15 ShimmerFairy joined
jdv79 so where I once did >>.ast.hash i how have to do >>.ast.[0] after a change i made 07:16
even though >>.ast.perl spits back the same thing in both cases
07:17 telex left 07:18 telex joined 07:20 domidumont joined 07:29 salva joined 07:30 abraxxa joined 07:31 virtualsue_ joined 07:32 espadrine joined 07:33 llfourn joined, virtualsue_ is now known as virtualsue, TEttinger left, ShimmerFairy left
FROGGS Sgeo_: smart match is supposed to be smart here 07:42
07:46 ShimmerFairy joined
jdv79 just for fun i tried to async >>. and kinda did but am stuck 07:47
gist.github.com/anonymous/be8272afe09047875f16
if anyone could help that'd be nice. not that its feasible. i just thought it was an interesting problem to play with.
lunch and stuff & 07:50
07:51 inokenty joined 07:53 dayangkun left 07:57 brrt joined 08:10 jinxter joined 08:11 vytas joined 08:12 jinxter left 08:26 FROGGS left
jnthn morning, #perl6 08:34
08:39 FROGGS joined
lizmat jnthn o/ 08:43
yoleaux 30 Jul 2015 08:04Z <azawawi> lizmat: why is .send deprecated? Any reason behind that? Thanks for all your hard work. github.com/rakudo/rakudo/commit/26...ccd9d9b801
lizmat .tell azawawi it was felt that it was good to unify socket and IO handle
yoleaux lizmat: I'll pass your message to azawawi.
[TuxCM] make[1]: Entering directory `/pro/3gl/CPAN/rakudobrew/moar-nom/panda/.panda-work/1438332194_4' 08:44
make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
is that an OSX-ism?
lizmat [TuxCM] da bin ich überfragt
moritz .tell azawawi the send() system call as specific semantics that our $socket.send doesn't follow, so it's better to not name our thing .send
yoleaux moritz: I'll pass your message to azawawi.
08:45 domidumont left
lizmat moritz++ 08:45
[TuxCM] Saw 1 occurrence of deprecated code.
================================================================================
Method send (from IO::Socket) seen at:
lib/Panda/Ecosystem.pm, line 81
Deprecated since v2015.7, will be removed with release v2015.9!
Please use print instead.
lizmat yeah, the deprecation cycle is a bit abrupt, I agree 08:46
[TuxCM] WARNINGS:
Useless use of constant integer 1 in sink context (line 1636)
that one I get a lot.
[TuxCM] investigates
moritz [TuxCM]: I just merged github.com/tadzik/panda/pull/194 with which the deprecation warning above goes away 08:47
[TuxCM] moritz++
moritz [TuxCM]: re "Useless use of constant integer 1 in sink context" sounds like 1; at the end of a module/class file
[TuxCM]: we didn't used to catch that; jnthn++ has fixed that
[TuxCM] correct
just remove it?
moritz aye
civilized people just throw exceptions when the inclusion of a module failed :-) 08:48
[TuxCM] test 50000 46.435 46.343 08:50
test-t 50000 49.251 49.159
OUCH!
"next" is an exception. Is "goto" too? 08:51
08:54 zakharyas left, espadrine left
[TuxCM] I tried to get rid of all my "next"s as lizmat stated they'd be slow, but it turns the code into unmaintainable spaghetti 08:55
moritz then don't :-) 08:56
08:56 Ven joined, zakharyas joined
[TuxCM] branch already deleted 08:57
but needing 49 seconds where 0.016 was my goal is really not motivational
08:58 virtualsue left
jnthn [TuxCM]: When was the previous measurement made? 09:00
[TuxCM] yesterday
I test every day when I am at home
I'l run a second time, - from scratch 09:01
jnthn So, some patch within the last 24 hours should be to blame for the 3s slow-down?
[TuxCM] have 5 minutes
09:01 hanekomu joined
[TuxCM] yesterday was 47 IIRC 09:01
30 freenode-#perl6.log:Jul 30 10:21:40 <[TuxCM]> test 50000 47.312 47.217 09:02
30 freenode-#perl6.log:Jul 30 10:21:40 <[TuxCM]> test-t 50000 47.420 47.325
09:08 jkva joined
[TuxCM] m: use Slang::Tuxic; use Inline::Perl5; 09:11
camelia rakudo-moar 31a083: OUTPUT«===SORRY!===␤Could not find Slang::Tuxic in any of:␤ file#/home/camelia/.perl6/2015.07.1-45-g31a083f/lib␤ inst#/home/camelia/.perl6/2015.07.1-45-g31a083f␤ file#/home/camelia/rakudo-inst-2/share/perl6/lib␤ file#/home/camelia/rakudo-inst-2/shar…»
[TuxCM] test 50000 46.372 46.280
test-t 50000 45.977 45.885
jnthn That's...now?
[TuxCM] so, those 3 seconds might have been caused by catching the trailing 1;
that was now
jnthn wow 09:12
09:12 itz joined
jnthn But OK, good I don't have a performance regression to hunt. 09:12
Well, todays one :)
[TuxCM] :)
jnthn I'm currently looking into an earlier one
Caused by fixing &?ROUTINE
[TuxCM] I have 45 next's in my main loop. there is no fast/cheap alternative? 09:13
09:13 vytas left, itz__ left
jnthn That *should* be the fast thing, it's just not as well optimized yet as it really should be. 09:14
09:18 espadrine joined, Ven left
Woodi hallo #perl6 :) 09:24
I got impression that Monads are just { ....; return struct { Bool error, Int value-if-no-error } }; # (programming cafe)++ 09:26
moritz Woodi: that's just the Maybe monad 09:27
Woodi if we have lazy pipelines than pipelines-with-many-parallel-pipe are nice too. and then we need Acumulators :)
moritz idly wonders if pipelines want to be reactive, so more tied to Supply 09:28
Woodi moritz: but I know what Monads are ! thing are more complicated, etc, but whatever ;) 09:29
09:29 espadrine left, espadrine joined
arnsholt My understanding of monads is that it's basically a way to generalize different conceptions of composition. For functions it's just function composition, for IO it's a sequencing of operations, etc. 09:29
Woodi moritz: but Lists and arrays have similiarities
moritz arnsholt: that's my understanding too 09:31
09:34 Ven joined
Ven whispers "it's all about laws" 09:34
o/, #perl6
.tell Sgeo_ you might be interested in timo's github.com/timo/adt , btw. The only thing missing is the ability to do multi dispatch based on that 09:35
yoleaux Ven: I'll pass your message to Sgeo_.
Ven
.oO( it's dangerous to go alone, take this ADT and this `eval` function )
09:36
Woodi but let's look on poor 1-year IT student on university in the 80s or 90s... he/she learns C and Turbo Pascal, build some programs useing Arrays as universal data structure: sequence of items, queue, stack using custom shifts and pops and direct item access via a[x]... later he have Algebra and Analisis (I and II) courses. somewhere around 3rd year he leveled to Universal Algebra or Logic courses and met funct 09:38
ional programing... and from now ...
... on Arrays are illegal and Lists are immutable...
jnthn Analisis sounds like a pain in the butt... 09:39
Woodi jnthn: if you rememer what "function" is then you can be good :)
arnsholt jnthn: *snort* 09:40
Woodi .map().map() whit separate maps on same procesor is probably like stage in data flow programing. and some stages can work concurently on coming data. then "colectors" are needed... 09:43
.btw we don't have anything like "hive" yet :) 09:44
Woodi fighting wasps since 5:45 AM 09:45
09:46 zakharyas left 09:51 laouji left, laouji joined 09:56 zakharyas joined 10:02 Ven_ joined
dalek p: ccd7669 | jnthn++ | / (2 files):
Get MoarVM with curcode op and map it.
10:02
10:04 Ven left
nine m: use lib:from<nonexisting-language>; 10:09
camelia rakudo-moar 31a083: OUTPUT«===SORRY!===␤Do not know how to load code from nonexisting-language␤»
nine timotimo: ^^^ I fixed that already on nom a couple of weeks ago. Just hasn't made it into * yet.
10:09 spider-mario joined
dalek p: 70f65eb | jnthn++ | src/vm/jvm/ (2 files):
Implement nqp::ctxcode on JVM.
10:10
10:11 masak joined
masak good evening, #perl6 10:11
moritz \o masak
10:12 vytas joined
jnthn
.oO( You call it evening, I call it midday with Chinese characteristics :P )
10:12
masak 哈哈
masak tries to backlog the past four days 10:14
jnthn Good luck with that :) 10:15
Ven_ o/, masask 10:16
I mean. \o, masak 10:17
m: my role R { class C {}; } 10:18
camelia rakudo-moar 31a083: OUTPUT«5===SORRY!5=== Error while compiling /tmp/i7lxjsgDcP␤Cannot declare our-scoped class inside of a role␤(the scope inside of a role is generic, so there is no unambiguous␤package to install the symbol in)␤at /tmp/i7lxjsgDcP:1␤------> 3my role …»
Ven_ m: my role R { my class C {}; }
camelia ( no output )
Ven_ is that supposed to also help with lexpads issues? 10:20
jnthn Well, it's mostly to help with people writing the first thing you did and expecting to address the thing as R::C 10:21
And then getting frustrated when it doesn't work out - which will happen, 'cus you need to understand roles relatively well to see why it won't. 10:22
masak I understand roles relatively well, and I'm still frustrated! :P
Ven_ remembers trying to understand, say, why `role R[::T] { constant VAL = T.new }` didn't work and nods
jnthn masak: Yeah, but now you're frustrated at compile time :P 10:23
moritz (early frustration)++
Ven_
.oO( -Ofrustration *g* )
10:23 Ven_ left
lizmat needs to change 'perl6 -e 1' meme to 'perl6 -e ""' 10:24
masak jnthn: I *do* prefer frustration at compile time.
prefer frustration at author-time even more... 10:25
jnthn Yay, improving how we do &?ROUTINE takes a benchmark from 74s to 52s 10:28
arnsholt Nice!
dalek kudo/nom: 19dfec1 | jnthn++ | src/Perl6/Actions.nqp:
Avoid repeated calls to .name.
10:30
kudo/nom: 3a2931d | jnthn++ | tools/build/NQP_REVISION:
Bump NQP_REVISION for ctxcode op.
Woodi www.welie.com/patterns/showPattern....st-builder ;)
10:34 sunwenjie left
jnthn m: multi foo($n) { $n ?? $n * samewith($n - 1) !! 0 }; say foo(5) 10:36
camelia rakudo-moar 31a083: OUTPUT«0␤»
moritz m: multi foo($n) { $n ?? $n * samewith($n - 1) !! 1 }; say foo(5)
camelia rakudo-moar 31a083: OUTPUT«120␤»
jnthn m: multi foo($n) { { $n ?? $n * samewith($n - 1) !! 0 }() }; say foo(5)
camelia rakudo-moar 31a083: OUTPUT«Method 'dispatcher' not found for invocant of class 'Any'␤ in sub foo at /tmp/p0DA570_lE:1␤ in block <unit> at /tmp/p0DA570_lE:1␤␤»
jnthn aha, that's the error I wanted
moritz: hah, yes ;)
moritz :-)
jnthn I just broke samewith with my &?ROUTINE changes, then after mxiing it was like...hmm, it probably never did work quite right :)
(In the nested scopes case) 10:37
also, fixing
10:39 ab6tract joined
dalek kudo/nom: 87c0943 | jnthn++ | src/core/control.pm:
Fix samewith.

It did rely on &?ROUTINE really being in the lexpad, but further to that it failed to search hard enough for a routine, so you could not do samewith inside of a closure inside of the routine.
10:41
ast: 933094d | jnthn++ | S02-magicals/sub.t:
Extra, missing, stress test for &?ROUTINE.
ast: 1879617 | jnthn++ | S06-multi/redispatch.t:
Test samewith used within a closure.
jnthn *lol* 11:02
===SORRY!=== Error while compiling t\spec\S02-magicals\subname.t
Variable '&?ROUTINE' is not declared
at t\spec\S02-magicals\subname.t:26
------> "&?ROUTINE<HERE> not available outside of a routine";
&?ROUTINE interpolates in a double-quoted string :P
lizmat huh? I guess, yess... 11:03
m: sub a { "foo" }; say "&a"
camelia rakudo-moar 3a2931: OUTPUT«&a␤»
lizmat huh?
jnthn Oh 11:04
Hmmm
I wonder...
lizmat m: sub a { "foo" }; say "&a()"
camelia rakudo-moar 3a2931: OUTPUT«foo␤»
lizmat m: sub a { "foo" }; say "&a[]"
camelia rakudo-moar 3a2931: OUTPUT«Sub object coerced to string (please use .gist or .perl to do that) in block <unit> at /tmp/pX56WHp1M0:1␤a␤»
jnthn m: say "&?X"
camelia rakudo-moar 3a2931: OUTPUT«&?X␤»
jnthn Grr
So we need to defer that lookup after all
lizmat fwiw, I'm seeing bare startup time below 0.11 for the first time in a long time 11:06
jnthn is kinda amused to generate a QAST node just so something can get upset over it later
Nice
Hopefully we can get the size of the NFAs down a bit more again 11:07
11:08 vendethiel left, xnrand joined
jnthn crosses fingers, spectests the &?ROUTINE changes 11:10
moritz also crosses jnthn's fingers
11:12 coffee` joined
sjn crosses moritz' fingercrossing fingers 11:17
11:17 cognominal joined
dalek kudo/nom: 56ae33e | jnthn++ | src/Perl6/ (2 files):
Re-implement &?ROUTINE.

This uses the same appraoch as &?BLOCK, meaning you only pay for the feature if you use it. This unbreaks MoarVM's ability to do a bunch of inlining, which has rather positive performance consequences.
11:18
moritz hopes this drives [TuxCM]++'s benchmark down again
jnthn Should help 11:19
11:24 gfldex joined, Ven joined 11:29 g4 joined
nine jnthn: I'm thinking about trying a custom meta class for Perl 5 objects, but wonder, how this would play together with so many methods and functions defaulting to Any parameters. 11:30
jnthn nine: Don't see any problem 11:32
nine They could still inherit from Any? 11:33
jnthn Sure, you get to define what type checking means in a meta-class
So you can just say "sure they're Any" :)
nine Then I'll better just try it and see if it improves things :)
brrt (:-o what if perl6 is actually going to work :-o)
11:34 mr-foobar left
jnthn nine: There's even a TypePretense role in Perl6::Metamodel to support doing this, for things like PackageHOW and ModuleHOW that don't really have any kind of type-related capabilities in terms of role composition or inheritance, but that do need to assure we can pass package and module type objects around as normal values. 11:35
m: package Foo { }; say Foo ~~ Any
camelia rakudo-moar 87c094: OUTPUT«True␤»
ab6tract o/ #perl6
nine jnthn: oh nice :) 11:36
ab6tract a question from the backlog, re-presented in a more active moment
m: "ooo".succ.comb.reverse.join.say # this works
camelia rakudo-moar 87c094: OUTPUT«poo␤»
ab6tract m: @(["ooo" xx 20])>>.succ>>.comb>>.reverse>>.join.say # should I expect this to work?
camelia rakudo-moar 87c094: OUTPUT«o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p o o p␤»
11:36 azawawi joined
ab6tract if not, how can we determine under which conditions a hyper-chain of methods would differ from it's non-hyper behavior 11:37
jnthn I wonder if there's some over-flattening going on with regard to what .comb returns 11:38
11:40 RabidGravy joined
azawawi hi 11:40
yoleaux 08:43Z <lizmat> azawawi: it was felt that it was good to unify socket and IO handle
08:44Z <moritz> azawawi: the send() system call as specific semantics that our $socket.send doesn't follow, so it's better to not name our thing .send
azawawi is panda install HTTP::Easy working with latest rakudo?
sjn installed it a short while ago 11:41
well, last week
sjn tries again 11:42
ab6tract jnthn: it seems to be, yeah... they remain as individual elements though, even after the join. and the reverse doesn't even seem to do anything either :(
azawawi im getting this weird error with latest rakudo while trying to `panda install HTTP::Easy` 11:44
gist.github.com/azawawi/36dae237215df68dba10
ab6tract which actually makes sense... both reverse and join are no-ops on single element lists
jnthn ab6tract: It's a curious way to write it though 11:45
m: ("ooo" xx 20).map(*.succ.flip).say
camelia rakudo-moar 87c094: OUTPUT«poo poo poo poo poo poo poo poo poo poo poo poo poo poo poo poo poo poo poo poo␤»
jnthn That way is so much clearer :P 11:46
ab6tract jnthn: well, it's just a "hyper-ification" of the non hyper chain... so in cases where that doesn't match, it can be considered a bug?
jnthn ab6tract: Not automatically
ab6tract ok
jnthn You have to factor in the whole "is nodal" side of it too, iirc 11:47
Which means you could probably construct a case where it didn't match but isn't wrong.
azawawi builds 2015.7 to test it again
11:47 bloonix_ joined
jnthn lunch & 11:50
ab6tract jnthn: re: clearer ways of writing it, it was an extension of a clearer way of writing a "run a method on every element in a LoL" that I shared with ugexe last night :) 11:51
I didn't know that .flip even existed
azawawi Cannot declare our-scoped constant inside of a role... is that a new error in latest rakudo? 11:58
moritz yes
just declare it as 'my constant ...' 11:59
it wasn't available to the outside in any case
azawawi so in the case of github.com/supernovus/perl6-http-e...y.pm6#L20, supernovus wanted to declare that constant to be shared by other classes 12:00
moritz: but it was available to role do-ers :) 12:03
moritz: or does-ers lol 12:04
12:05 espadrine left 12:06 Peter_R left
azawawi moritz: it is strange though to java programmers as interfaces (like roles) are used sometimes to declare constants 12:06
moritz: for example docs.oracle.com/javase/8/docs/api/j...tants.html
jnthn No, constants aren't composed in any way 12:12
The only way it was made available outside of the role was "is export"
azawawi constant CRLF is export = "\x0D\x0A"; # which is the case 12:14
m: role foo { constant A is export = 1; }; 12:15
camelia rakudo-moar 56ae33: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Znggi2AwNR␤Cannot declare our-scoped constant inside of a role␤(the scope inside of a role is generic, so there is no unambiguous␤package to install the symbol in)␤at /tmp/Znggi2AwNR:1␤------> 3role …»
moritz just add a "my" in front"
jnthn Right, and so it continues to work with "my", like moritz++ said
azawawi got it... moritz++... fixing :) 12:16
12:17 smls joined
smls Is it possible that $path.IO.resolve.d sometimes returns false positives (i.e. identifying a file as directory even though it isn't)? 12:18
nine smls: that would sound strange 12:19
azawawi must be something I ate in family $breakfast :)
smls Haven't managed to golf it, but one of my larger Perl 6 script seems top sometimes appears to enter the wrong branch of an if/else with that .d condition
arnsholt Gee, thanks Python, that's a real helpful error message: "TypeError: __init__() takes at least 5 arguments (5 given)" >.<
smls then when I run the same script again (with the same files), it works
only happens rarely
ab6tract smls: heisenbugs :( 12:21
smls yeah :(
ab6tract smls: if you add another check, like if $file.d { die "spooky action at a distance" unless $file.d; ... } 12:24
I wonder if it could give some more hints
either way, kinda gross :(
12:28 espadrine joined 12:30 moyamo joined
[TuxCM] moritz, jnthn, impressive: 12:30
test 50000 44.579 44.487
test-t 50000 44.144 44.052
nine m: class Foo:auth<Perl5> { our $foo = "Perl5!"; }; class Foo:auth<Perl6> { our $foo = "Perl6!"; }; say Foo:auth<Perl5>::$foo;
camelia rakudo-moar 56ae33: OUTPUT«5===SORRY!5=== Error while compiling /tmp/z4jblEZBcE␤Redeclaration of symbol Foo␤at /tmp/z4jblEZBcE:1␤------> 3foo = "Perl5!"; }; class Foo:auth<Perl6>7⏏5 { our $foo = "Perl6!"; }; say Foo:auth<␤ expecting any of:␤ generic rol…»
nine Does someone recognize what I'm trying to do there ^^^ and is able to tell me how it should be done? 12:31
12:31 zakharyas left, zakharyas joined
lizmat nine: NYI 12:32
nine lizmat: ah, too bad. Thanks anyway
lizmat will be offline most of the weekend
so catch you all next week! 12:33
&
nine :auth would have been a wonderful tool to keep namespaces for Perl 5 and Perl 6 classes separate. 12:38
12:42 brrt left 12:43 Hor|zon left
ab6tract seems like a weird name for such a functionality 12:44
nine ab6tract: why? 12:46
ab6tract It was a long argument with TimToady about 'authority', iirc 12:47
it just feels like it would do some kind of.... authentication... 12:48
nine I guess it really depends on where you're coming from. When I did more sysadminy stuff, I'd have thought authentication as well. Nowadays I read it as "author" before I correct myself. But "authority" really is a good word here. 12:49
ab6tract yeah, still don't like it. and especially the shortened form. ('subst' and 'substr', I'm glaring at you) 12:50
tony-o azawawi: as it happens, in rewriting http::server::async to fix a few issues and as a blog post 12:55
12:55 moyamo left
tony-o azawawi: also, bailador looks pretty great! i also have perl6-hiker repo which might be a little help tovorganizing the client end of the projects 12:58
moritz how well does github.com/ugexe/zef/ work? 13:00
timotimo o/
tony-o moritz: it works pretty well so far . working on hooks atm 13:01
timotimo jnthn: very glad to see &?ROUTINE get improved
nine I think the think that's most awesome about writing Inline::Perl5 is, that I've really reached the perfect API, when there's no more API left and everything looks just like plain normal Perl 6 :)
RabidGravy :)
azawawi tony-o++ 13:02
ab6tract nine :D
azawawi github.com/azawawi/perl6-atom-elec...e/master/t is growing. I feel a lot safer with testing over Travis CI these days :)
timotimo yay :) 13:03
azawawi travis-ci.org/azawawi/perl6-atom-e...s/73551274 # job running lol 13:04
JimmyZ what is the difference between zef and panda?
jnthn [TuxCM]: Glad it's going in the right direction again :) 13:05
[TuxCM] nine will the HLL fail be fixed before YAPC::EU? 13:06
timotimo azawawi: farabi6 will become a desktop app at some point with the help of electron? 13:08
azawawi timotimo: 100% correct :)
timotimo: it is basically Padre for Perl 6 :)
timotimo mhm 13:10
azawawi timotimo: that's why im creating a test suite so we can reliably use it as a platform. Semantic UI 2.0 on the front end and Bailador or HTTP::Server::Async on the backend and electron launches processes. If one crashes, we will restart them :) 13:11
timotimo: basically github.com/azawawi/perl6-atom-elec...ailador.p6 13:12
FROGGS m: say do { last; CONTROL { default { say $_ } } }
camelia rakudo-moar 56ae33: OUTPUT«Died with CX::Last␤ in block <unit> at /tmp/0f2I3OeM9W:1␤␤Nil␤»
13:12 skids joined
FROGGS ohh, my local rakudo seems to be too old for that 13:12
jnthn :) 13:13
azawawi timotimo: plus native dialog api github.com/azawawi/perl6-atom-elec...3-dialog.t for opening/saving/errors etc
FROGGS jnthn: I'm playing with leave exceptions again
nine [TuxCM]: I guess that depends on if we find out in time who's actually responsible for the problem. It started with a change in Slang::Tuxic which I really don't know much about. 13:14
13:15 awwaiid left
azawawi timotimo: while working with wxwidget, we hit some brick walls in Padre that we could not overcome. Relying on wxwidgets and wx::scintilla (i.e. native C++ dlls) with different platform implementations can result in weird clipboard errors. Also layout is not something wxwidgets is known for. 13:17
timotimo mhm
i myself am partial to Qt
azawawi timotimo: plus wxwidgets is not actively developed as before... 13:18
timotimo is it already the case that Proxy has to be returned from a method marked "is rw" or otherwise it won't work? 13:19
i'd expect it to give an exception otherwise, but here i just see the symptom that it doesn't have the desired effect to set a value (it goes through a native function, so that could be broken instead) 13:20
azawawi timotimo: if we want to push Perl 6 to newbies, we need a user friendly editor with near perfect integration with our toolchain
tony-o JimmyZ: zef is getting a whole web back end built for it, aims to have zero depends (right now it needs IO::Socket::SSL), it's also a little more strict about the spec & meta (though it still respects build.pl)
azawawi: vim ?
timotimo tony-o: vim is "user friendly"? 13:21
azawawi timotimo: an editor/IDE that simply says Perl 6 can build big stuff reliably with no maintenance worries :)
azawawi dreams
13:22 abraxxa left
jnthn FROGGS: OK. And I'm starting GLR guts sketching. 13:22
13:22 mr-foobar joined 13:23 raiph joined
tony-o azawawi: please don't say eclipse 13:23
azawawi tony-o: one more thing to think of in the rewrite, please add start/stop mechanism .on('/products', sub { ... }); .off('/products')...
13:24 Hor|zon joined
tony-o azawawi: i can add that in hiker, h:s:a isn't a great place for that 13:24
also, if you want to follow along on the rewrite: ugexe.com/refactoring-httpserverasync/
jnthn timotimo: I don't think we enforce the "is rw" thing well enough to make you *have* to put it for Proxy yet, but you will need to eventually
timotimo mhm
jnthn wonders how the supply/whenever syntax will influence HTTP::Server::Async :) 13:25
tony-o jnthn: is it already in rakudo?
jnthn tony-o: No :)
tony-o: It's relatively high on my todo list.
tony-o ahh - is there a post i can read? :-) 13:26
or did the spec doc change?
jnthn No, there's a gist
Of the proposed changes
moment
tony-o roger
jnthn gist.github.com/jnthn/a56fd4a22e7c43080078
JimmyZ I think I can use zef since panda doesn't work here sometimes ;)
jnthn Hm, and i should look at the comments there more closely :) 13:27
jdv79 jnthn: who besides you could help with this?: irclog.perlgeek.de/perl6/2015-07-31#i_10982975 13:28
FROGGS jnthn: so, you are working on the GLR on your own now or did pmichaud provide some design details?
jdv79 glr > my thing so don't want to take up your time
jnthn fixes one of the things mentioned in the gist comments 13:29
FROGGS ahh
jnthn jdv79: That kinda *is* part of the GLR stuff
jdv79: Though >> itself should really just do some kind of map and then do .hyper on it 13:30
FROGGS: Well, I have the things pmichaud came up with in the S07 GLR draft to go on
azawawi jnthn: The @awaitables. Cool name :)
jdv79 ok. i was most interested in the cause of the current error 13:31
jnthn ;)
nine FROGGS: I golfed TuxCM's "Merging GLOBAL symbols failed: duplicate definition of symbol HLL" error down. 13:32
FROGGS: it boils down to: use Slang::Tuxic; use NativeCall;
[TuxCM] m: use Slang::Tuxic; use Inline::Perl5;
camelia rakudo-moar 56ae33: OUTPUT«===SORRY!===␤Could not find Slang::Tuxic in any of:␤ file#/home/camelia/.perl6/2015.07.1-49-g56ae33e/lib␤ inst#/home/camelia/.perl6/2015.07.1-49-g56ae33e␤ file#/home/camelia/rakudo-inst-2/share/perl6/lib␤ file#/home/camelia/rakudo-inst-2/shar…»
13:32 xinming left
nine [TuxCM]: use Slang::Tuxic; use NativeCall; 13:32
[TuxCM] which is close 13:33
azawawi jnthn: The @awaitables is coming to PCs near you in December 2015 :)
dalek line-Perl5: 340c791 | (Stefan Seifert)++ | / (5 files):
Hide Perl5Parent from v6-inline users

When using v6-inline to extend a Perl 5 package in Perl 6, one had to explicitly also does Perl5Parent['Foo::Bar']; and pass the Inline::Perl5 object to the constructor.
Both are now gone. Since we already assume that the user wants to create a class of the same name as the Perl 5 package, we may as well assume that this class should extend the Perl 5 package. Since they are both in the same file, this should be a fair assumption.
In the place where we create the Perl 6 class, we also know exactly, which Perl 5 interpreter the Perl 5 class is from, so we pass it as Role parameter instead of requiring the user to pass it to the constructor.
FROGGS m: use NQPHLL:from<NQP>; use NativeCall
camelia rakudo-moar 56ae33: OUTPUT«===SORRY!===␤Merging GLOBAL symbols failed: duplicate definition of symbol HLL␤»
FROGGS nine: see above
nine FROGGS: so we're both innocent :)
FROGGS only kindof
masak m: only kindof 13:34
camelia rakudo-moar 56ae33: OUTPUT«5===SORRY!5=== Error while compiling /tmp/a7ucmacm_g␤Missing block␤at /tmp/a7ucmacm_g:1␤------> 3only kindof7⏏5<EOL>␤ expecting any of:␤ new name to be defined␤»
FROGGS I touched code that is responsible for global merging...
masak m: only kindof foo
camelia rakudo-moar 56ae33: OUTPUT«5===SORRY!5=== Error while compiling /tmp/h_3nI5Zj8n␤Missing block␤at /tmp/h_3nI5Zj8n:1␤------> 3only kindof7⏏5 foo␤ expecting any of:␤ new name to be defined␤»
FROGGS (ages ago, mind)
jnthn jdv79: Well, it's a stab in the dark just from reading the code, but:
+ my Mu $r = nqp::if(nqp::istype($o, Iterable),
+ $o.new(deepmap(op, $o)).item,
+ op.($o));
Assigning to a Scalar there will itemize
And I'm not sure that's desirable
my \r = ... may do it 13:35
jdv79 oh, ok. thanks.
jnthn (May not be that, it's just the first potential problem that matched the kind of symptom you have) 13:36
Woodi there is Visitor pattern that could absorb some user cases from lists... canonical example is walking AST, every node know how to be good host to visitor, and visitor know how to deal with node types: int, +, call, etc. so each nod do not need to implement prettyPrint, statistics, ... but List elements like Ints and Str probably do not want to do: does Walkable...
example: gist.github.com/slunski/7cfd2d8447e450d31544 13:37
so iterator know how to deal with list "memorization". or maybe it should be decided during list creation: eg. .slurp makes big list, .lines creates lazy view... 13:40
13:40 Ven left
[TuxCM] nine, FROGGS, if neither of you to can be held responsible, shall I create a ticket for that? 13:43
Woodi btw. when reading TimToady++ mentioned "negotiators" I got: *DING* There is Mediator pattern ! What it was doing ?? Looks it is like controler in MVC, it have observers for "childs" and manage interactions betwin them
FROGGS [TuxCM]: ohh, if there is no ticket yet, then please create one, yes
13:44 AlexDaniel joined
[TuxCM] rt.perl.org/Ticket/Display.html?id=125729 13:49
feel free to alter
13:51 jkva left
jdv79 jnthn: that did clear up some of the failures. thanks. 13:52
13:52 inokenty left
azawawi /clear 13:54
oops :)
azawawi starts playing with HTTP::Server::Async and Atom::Electron 13:55
tony-o azawawi: if you want something a little more stable, check out HTTP::Server::Threaded
azawawi tony-o: i just sent you a pull request :) 13:56
tony-o azawawi: i just merged it 13:59
14:02 salva left
azawawi tony-o: thx 14:04
tony-o: github.com/azawawi/perl6-atom-elec...r_async.p6 # HTTP::Server::Async + Atom::Electron
jdv79 oh, a redefined $*OUT breaks another hyper test 14:07
smls nine: "Inline::Perl5 is, that I've really reached the perfect API" -- does that mean that this now works: use Foo:from<Perl5> <bar baz>; bar(); baz();
jdv79 I think I'll leave it alone at this point;)
nine smls: it does 14:08
smls nice
nine: Also, how would one call P5 function so that it believes it was called in scalar context?
nine smls: implemented that this Tuesday 14:09
14:09 jkva joined
nine smls: that's what I don't know yet :/ Since this is a concept that's foreign to Perl 6, I'll have to design an API for that. And as my goal is to have as little API as possible, that's kinda hard. 14:10
smls yeah
14:11 bloonix_ left
[TuxCM] jdv: 8 [IO] Cannot clear $*OUT.nl RT#12397 14:11
(related)
tony-o azawawi: merged that one too :-) 14:12
[TuxCM] and maybe related: 7 [IO] Cannot change input-line-separator RT#123888
tony-o azawawi: also, that's pretty awesome!
azawawi travis-ci.org/azawawi/perl6-atom-e...s/73561310 # puzzled... sometimes Travis CI containers seems to be offline or something 14:16
s/seems/seem
14:16 hoelzro_ii joined 14:18 ab6tract left
azawawi do we need to do a panda update && panda install Dep1 Dep2 in travis CI builds? 14:18
14:19 jkva left, khw joined 14:20 lucasb joined 14:22 muraiki joined 14:23 xinming joined, psch joined
azawawi tony-o++ # thx 14:26
14:28 snmirre joined 14:29 snmirre left, geekosaur left 14:30 laouji left
hoelzro good morning, #perl6! 14:34
14:35 geekosaur joined
RabidGravy good something or other 14:36
jnthn o/ hoelzro
RabidGravy (anomalously I have been awake for 10.5 hours already, so I'm confused) 14:37
lucasb m: fail; say 'so quiet' 14:38
camelia ( no output )
lucasb star: fail; say 'so quiet'
camelia star-m 2015.03: OUTPUT«Unhandled exception: ␤ at <unknown>:1 (/home/camelia/rakudo-star-2015.03/install/languages/perl6/runtime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:15777 (/home/camelia/rakudo-star-2015.03/install/languages/perl6/runtime/CORE.se…»
hoelzro o/ jnthn
14:39 jkva joined
lucasb When does rakudo star gets updated in camelia/hack? 14:40
FROGGS $ perl6 -e 'say do { &?BLOCK.leave: 42, 3 }; say "alive"' 14:42
ListIter.new
alive
\o/
(that's a start)
$ perl6 -e 'say my @ = do { &?BLOCK.leave: 42, 3 }; say "alive"' 14:44
42 3
alive
Woodi FROGGS: you mean something like "encapapsulated" iterator ? 14:46
*letters...
nine Is there a way to run a role's code at object creation without interfering with the consuming class' BUILD?
jnthn nine: Not at the moment; the current thinking is that when you compose submethods, you get all of them run. 14:47
FROGGS Woodi: I think I mean that my patch is not perfect yet :o)
nine jnthn: not even some ugly workaround? 14:48
Woodi FROGGS: by I wonder what it is planned to do... example show creation...
tony-o JimmyZ: give it a shot and if you have any problems then let us know
skids nine: use attribute default value initialization 14:49
skids digs for his ugly hack example.
14:50 coffee` left
FROGGS Woodi: design.perl6.org/S06.html#The_leave_function 14:50
nine jnthn: that's not even _that_ ugly :) Since I'm actually only initializing an attribute
jnthn nine: Oh, *that* you can do, I thought you needed something more complex than that or you'd not have been asking about BUILD ;) 14:51
14:52 jkva left
nine jnthn: we'll it is a little more complex. But I may find a way on my own 14:52
I just hope that I'll get to hack a bit more on it on my way to the Rob Zombie concert 14:55
JimmyZ tony-o: It would be nice remove '.pl6' from /bin/zef.pl6 :P 14:56
PATH=$PATH:../MoarVM/install/bin ./bin/zef.pl6 install CSV::Parser 14:58
Use of Nil in string context in sub gethome at /home/cloud/OpenSource/perl6-zef/lib/Zef/Utils.pm:55
yeah, github.com/tony-o/perl6-zef/issues/1 the first issue 15:00
tony-o use the one from ugexe 15:01
skids nine: github.com/skids/perl6sum/blob/mas...HA.pm6#L97 # That's how I worked around it
tony-o mine is over 2 years old, sorry for the confusion - i need to delete that repo
a year *
JimmyZ o 15:02
no notice there :(
15:03 zakharyas left 15:04 azawawi left 15:05 FROGGS[mobile] joined, FROGGS left, virtualsue joined
nine Darn....I forgot that I need to access the constructor's arguments. I have to pass them along to the Perl 5 class' constructor after all. 15:07
tony-o JimmyZ: sorry man, updated the readme with a link to ugexe's and commented on the issue 15:08
skids nine: hmmm... and the attribute init happens before the constructor, right? 15:09
Or... no after.
nine But maybe I can simply wrap new instead of BUILD 15:11
JimmyZ zef looks good 15:16
15:22 diana_olhovik left 15:33 g4 left
ab5tract_ nine: going to Rob Zombie? cool :) 15:42
15:49 telex left, estrabd joined, ShimmerFairy left 15:50 telex joined
ingy what object/namespace contains functions like &say ? 15:52
also what's a good doc to explain the overall scoping layout in p6? 15:53
jnthn ingy: They're in the SETTING, which is the outer lexical scope of your program. 15:56
tony-o m: my Buf $a .=new(1,2,3); my Buf $b .=new(4,5,6); $a ~= $b.subbuf(0,2); $a.perl.say; 15:57
camelia rakudo-moar 56ae33: OUTPUT«Buf.new(1, 2, 3, 4, 5)␤»
nine ab5tract_: yeah, playing in Vienna tonight :)
Wrapping new makes it easy timing wise, but of course now I don't have a living object to initialize ;) 15:58
ChoHag If role A has method foo, and role B does A and has method foo, how can role B execute role A's foo? 15:59
It works if B is a class according to the castrated bull example on doc.perl6.org, but not for a role - No concretization found for A
jnthn self.A::foo() should work 16:01
ChoHag A's foo is also inaccessible from class C does A
ingy jnthn: thanks. what's the doc that describes how a function (like `say`) is looked up when called?
ChoHag m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo() } }; B.new.foo 16:02
camelia rakudo-moar 56ae33: OUTPUT«B␤No concretization found for A␤ in any concretization at src/gen/m-Metamodel.nqp:2928␤ in any find_method_qualified at src/gen/m-Metamodel.nqp:1071␤ in method foo at /tmp/2q8v25A4KM:1␤ in block <unit> at /tmp/2q8v25A4KM:1␤␤»
ingy ie the scope chaining for things
ChoHag m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo() } }; class C does B { method foo { say "C"; self.B::foo() } }; C.new.foo
camelia rakudo-moar 56ae33: OUTPUT«C␤B␤No concretization found for A␤ in any concretization at src/gen/m-Metamodel.nqp:2928␤ in any find_method_qualified at src/gen/m-Metamodel.nqp:1071␤ in method foo at /tmp/83fv9SDmkq:1␤ in method foo at /tmp/83fv9SDmkq:1␤ in block <uni…»
ChoHag m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo() } }; class C does B does A { method foo { say "C"; self.B::foo() } }; C.new.foo
camelia rakudo-moar 56ae33: OUTPUT«C␤B␤A␤»
16:03 ShimmerFairy joined
ab5tract_ ingy: I'm not sure if it's directly relevant to your investigation, but I found the documentation on 'lexotics' like return/next/last to be an interesting read on scopes 16:04
ingy ab5tract_: url?
ab5tract_ should be able to find it by searching design.perl6.org for 'lexotic' 16:05
jnthn ChoHag: That looks like a bug.
ingy ok
ab5tract_ design.perl6.org/S04.html
jnthn ingy: It's just normal lexical lookup
ChoHag Oh good. 16:06
Well not good per se. 16:07
hoelzro while look at talks for the Swiss Perl workshop, /me came across "Der Perlkoenig" 16:08
this I have to see =)
ChoHag When's Rakudo 2015.08 due? 16:09
(and .09, etc.)
ingy So SETTING contains all the keyword/bare-functions?
Is there any scope between SETTING and my current lexical scope? 16:10
16:10 diana_olhovik joined
jnthn ingy: Should only be those you've introduced in your program 16:10
ingy like the scope in the REPL for instance
tony-o sweet, got a project outside of my current employer finally, ~20k 16:11
oops
nine Oh I hate those moments where I completely understand why what I'm trying is not yet working while having no clue why the old version has ever worked. 16:12
ab5tract_ nine++ 16:14
zostay is there a way to say something like: my $c = 'abc'; my $r = rx/<[$c]>/; ?
renormalist p6: say 3; 16:15
camelia rakudo-moar 56ae33: OUTPUT«3␤»
tony-o m: my $c = 'abc'; say "hello abc" ~~ /"$c"/;
camelia rakudo-moar 56ae33: OUTPUT«「abc」␤»
jnthn I think zostay wanted it to work charclass like? 16:16
ingy I'm having trouble finding the doc for SETTING
jnthn m: my @chars = 'abc'.comb; say "hello abc" ~~ /@chars/; # if so
camelia rakudo-moar 56ae33: OUTPUT«「a」␤»
zostay m: my $class = 'abc'; my $r = rx/<[$class]>/;
camelia rakudo-moar 56ae33: OUTPUT«Potential difficulties:␤ Repeated character (s) unexpectedly found in character class␤ at /tmp/nEwrYPrCuV:1␤ ------> 3my $class = 'abc'; my $r = rx/<7⏏5[$class]>/;␤»
16:17 rindolf joined
tony-o m: my $c = 'abc'; my $r = rx/["$c"]/; 16:17
camelia ( no output )
zostay jnthn: that's the only thing i'd come up with was list interp or maybe an EVAL if i really wanted a character class
tony-o m: my $class = 'abc'; my $r = rx/["$class"]/; 16:18
camelia ( no output )
zostay it is essentiall an EVAL, what i'm aiming for anyway, i guess
16:18 dwarring left
TimToady how fast do you want it? 16:18
I suppose we could allow a <+@chars> construct 16:19
tony-o i want it fast, cheap, and without bugs 16:20
ab5tract_ .ask psch what do you think of this approach to class loading? github.com/clojure/clojure/blob/41...oader.java
yoleaux ab5tract_: I'll pass your message to psch.
TimToady I assume the set of chars varies from time to time?
tony-o a <-@chars> would be amazing, i have all kinds of things hacked together trying to make that work
TimToady how often does it vary? 16:21
lucasb m: my $s = '<[abc]>'; say 'a' ~~ rx/<$s>/
camelia rakudo-moar 56ae33: OUTPUT«「a」␤»
ab5tract_ .tell psch I'm quite keen to help, but want to make sure there isn't some other consideration that made you eschew ClassLoader stuff entirely 16:22
yoleaux ab5tract_: I'll pass your message to psch.
tony-o my uses were up to the end user, so it was most likely a set and forget
TimToady lucasb: that's basically an assertion-level EVAL
zostay yeah, that'd probably neat... i'm basically building a translator from glob to regex, so i just need [abc].txt to become something like <[abc]> ".txt"
TimToady for a set-and-forget, EVAL is proably fine, as long as you just save the eval'd rx 16:23
unless you have security worries with the input
ab5tract_ jnthn: or maybe you know how the current LibraryLoader implementation took its current form
TimToady but currently, if you have to process to an intermediate form, you might as well just use / @chars / if it's fast enough 16:24
zostay this is a first implementation, so i'm only interest in acceptable speed, not optimization, so /@chars/ is fine for now 16:25
ingy If I wanted to write a (tiny subset) Perl6 compiler, what format would/could/should I save the result to such that it could be runnable by some perl6 runtime? 16:26
flussence
.oO( a regex MOP would be neat )
16:26 rindolf left
moritz ingy: for example .mbc, so that MoarVM can run it 16:26
zostay however, if <+@chars> and <-@chars> exists someday, that'd be sweet, also implementign [!abc] in globs won't require something as ugly 16:27
ingy moritz: doc url?
16:28 rindolf joined
jnthn ab5tract_: Not really; others++ did pretty much all the work on Java interop 16:28
jdv79 ingy: maybe this is what you were looking for earlier - design.perl6.org/S02.html#Pseudo-packages 16:29
moritz ingy: github.com/MoarVM/MoarVM/blob/mast...e.markdown
ingy moritz++ # thanks 16:30
16:30 mr-foobar left, mr-foobar joined
ugexe FROGGS[mobile]: if i have 2 separate perl6 instances each running CURLI::install on the same dir (and thus MANIFEST) am I right to assume the MANIFEST could (currently) become clobbered? i.e. the method body for install is protected, but that doesn't matter between separate p6 instances right? 16:31
ingy moritz: I suppose I could use rakudo to compile to .mbc and then I would have an /expect/ dataset for my own compiler? 16:32
dalek line-Perl5: 29f2bea | (Stefan Seifert)++ | / (3 files):
No longer interfere with BUILD methods of P6 subclasses of P5 classes

Since rakudo not yet runs BUILD methods of roles and their consumers, use a replacement 'new' method to initialize the underlying Perl 5 object before running the Perl 6 class' BUILD method.
16:33
nine jnthn: got it :) ^^^
16:33 Begi joined
nine Just took a while to find out that CREATE.BUILDALL(...) is not only short and neat but also the only way to write the code and avoid bootstrapping problems 16:34
ingy perl6 --target=mbc --output=test1.mbc test1.pm # ?
moritz ingy: yes, should work 16:40
ingy builds the latest star 16:41
moritz ingy: though in rakudo it's actually NQP that generates .mbc files 16:43
16:46 vytas left 16:52 ssqq joined 16:56 captain-adequate joined
ChoHag I don't even know where to begin diagnosing this and I'm surrounded by children making me play Mario, which doesn't help concentration much. 16:58
TimToady make them play Perl 6 16:59
moritz or play Mario with them :-) 17:00
ChoHag Well it might get rid of them I suppose.
moritz: That's the problem!
Whenever I find the entrance to t 17:01
Whenever I find the entrance to The Zone: "You play!"
I don't even get to get *in* the zone.
17:02 ssqq left
geekosaur t/spec/S32-io/IO-Socket-Async.rakudo.moar (Wstat: 65280 Tests: 5 Failed: 0) 17:03
ChoHag Are the files in gen and src/gen, as their name implies, generated during make from (the rest of) src? 17:04
skids m: class A { method f (|c (:$a)) { }}; A.new.f(:b); # moritz, in case you hadn't already figured that out WRT implicit *%_. 17:06
camelia rakudo-moar 56ae33: OUTPUT«Unexpected named argument 'b' passed in sub-signature of parameter c␤ in method f at /tmp/CcaMPaMSjW:1␤ in block <unit> at /tmp/CcaMPaMSjW:1␤␤»
17:06 Hor|zon left, awwaiid joined
nine Nice! I just extended a DBIx::Class Result class with Perl 6 using Inline::Perl6 and v6-inline :) 17:07
17:07 ShimmerFairy left
FROGGS[mobile] ugexe: yes, that can very well happen currently 17:09
ab5tract_ o O ( where do jvm compunit '.serialized' files live? ) 17:10
ChoHag And while I'm at it, what's the quickest way to test out changes poked into src/Perl6?
17:15 espadrine left
RabidGravy I think I am going to jack in this programming malarkey and devote the rest of my life to developing a material for the white keys on controller keyboards that doesn't attract all the crap 17:16
skids
.oO(make them out of soap?)
17:17
RabidGravy :)
17:21 ShimmerFairy joined 17:25 silug_ joined
RabidGravy I don't know what they make them out of now but I have to clean this MPK60 every week 17:26
ChoHag Keyboards get cleaned? 17:29
17:30 diana_olhovik left 17:31 llfourn left
RabidGravy yeah it's really horrible to play on when the keys are sticky with whatever crap it's sucked out the atmosphere 17:33
ChoHag I once pulled an entire joint out of mine.
I didn't smoke it, mind.
RabidGravy :) 17:34
ChoHag Incidentally, finding illegal things in a country where you don't speak the language is incredibly difficult. 17:35
RabidGravy :-O
anyway reboot time (there's only so many kernel updates you can ignore.) 17:36
17:36 RabidGravy left
ChoHag Eugh. Another thing I don't want to think about. 17:36
I customised my boot process too much and kernel upgrades are a PITA.
17:40 RabidGravy joined
dalek kudo/nom: 5d9306d | TimToady++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
tweak :D/:U errors to avoid a/an problems
17:42
b2gills I know there was code out there that swapped out the Linux kernel without rebooting, which while difficult, is not a lot more difficult than writing one in the first place.
17:42 ShimmerFairy left
ChoHag It's not even particularly difficult, at that. 17:43
It just compares sources to see what's changed, compiles the new functions and changes the first opcode of the existing ones to JMPs. 17:44
But now even your kernel is running code which hasn't been tested from a cold start.
skids m: say -> $a { } # b2gills -- fixed now, thanks for noticing that.
camelia rakudo-moar 56ae33: OUTPUT«-> $a { #`(Block|62246960) ... }␤»
RabidGravy yeah this laptop goes months without getting rebooted sometimes, so it's kinder really 17:45
ChoHag m: role A { }; role B does A { }; B.new.^roles.say 17:47
camelia rakudo-moar 56ae33: OUTPUT«(B)␤»
ChoHag m: role A { }; class B does A { }; B.new.^roles.say
camelia rakudo-moar 56ae33: OUTPUT«(A)␤»
ChoHag m: role A { }; role B does A { }; class C does B { }; C.new.^roles.say
camelia rakudo-moar 56ae33: OUTPUT«(B)␤»
ChoHag m: role A { }; role B { }; class C does B does A { }; C.new.^roles.say
camelia rakudo-moar 56ae33: OUTPUT«(A) (B)␤»
ChoHag The methods in A are accessible regardless. 17:48
Is that all how it should look?
I feel like the first one at least is wrong.
skids I think the first one is wrong, too. 17:49
b2gills RabidGravy: The only time my desktop computer is off is when it is rebooting, or during a power outage ( which is exceedingly rare in my hometown since we have enough spare capacity within city limits to power the town, and most of the power lines are underground ) 17:50
17:52 RabidGravy left
skids One could argue the third example should be "(A) (B)" or "(B::A) (B)" perhaps. But it's debatable. 17:53
Depends how much mro ends up mattering in roles, which is a but up in the air. 17:54
*bit
heh.
17:54 Begi left 17:55 RabidGravy joined, araujo left
RabidGravy well that didn't go as well as I would have liked 17:56
17:56 ShimmerFairy joined
[Coke] I think the first is fine. 17:58
... er, they are not numbered, one sec.
when you instantiate a role, you get a class that does that role, yes? so that seems legit.
and I think it makes sense to only report the roles you do directly for ^roles. 17:59
hoelzro m: my $s = 'сюда́'; say $s.subst(/\c[COMBINING ACUTE ACCENT]/, '');
camelia rakudo-moar 56ae33: OUTPUT«сюда́␤»
skids Why report anything at all then?
[Coke] hoelzro: I don't think that can work on NFG strings.
hoelzro is there something I'm missing here? Shouldn't the acute accent get stripped?
=(
I'm guessing something is mad that the combining character follows nothing 18:00
18:00 ShimmerFairy left
TimToady .u а́ 18:00
yoleaux U+0301 COMBINING ACUTE ACCENT [Mn] (◌́)
U+0430 CYRILLIC SMALL LETTER A [Ll] (а)
skids [Coke]: I mean for the first one. Why have a ParmatericRoleHOW.roles if it just always reports itself and nothing else.
[Coke] m: my $s = 'сюда́'; say $s.NFC.subst(/\c[COMBINING ACUTE ACCENT]/,'');
camelia rakudo-moar 56ae33: OUTPUT«Method 'subst' not found for invocant of class 'NFC'␤ in block <unit> at /tmp/yvtslG0ZzH:1␤␤»
TimToady wel, you'd have to use NFD to separate them 18:01
[Coke] shrugs his shoulders.
TimToady but we ought allow regexes on Uni types, I suspect 18:02
18:02 Hor|zon joined
hoelzro what would be the recommended way to strip out that combining accent character? 18:02
both currently working and ideal but NYI =) 18:03
18:03 xinming left
ChoHag Does unicode define a difference between a combining accent character and an accent character? 18:03
18:03 xinming joined
ChoHag Because if so, surely an uncombined combining accent character is invalid in some way, shape or form? 18:04
lucasb m: role A { method foo {} }; role B does A {}; class C does A does B {} 18:05
camelia rakudo-moar 56ae33: OUTPUT«===SORRY!===␤Method 'foo' must be resolved by class C because it exists in multiple roles (B, A)␤»
hoelzro I *could* $s.NFD.list.grep(* != 0x301), but then I don't know how I would make a Str from that
ChoHag: afaik, there are only the combining accent characters and the pre composed characters with accents on them
18:06 kaare_ left
hoelzro ok, got it: Uni.new($s.NFD.list.grep(* != 0x301)).Str 18:06
hoelzro .oO( what a mouthful )
18:07 RabidGravy left, Hor|zon left
TimToady m: my $s = 'сюда́'; say $s.NFD.list.grep({ .uniname !~~ /^COMBINING/}).Str # more generally 18:08
camelia rakudo-moar 56ae33: OUTPUT«1089 1102 1076 1072␤»
TimToady m: my $s = 'сюда́'; say $s.NFD.list.grep({ .uniname !~~ /^COMBINING/}).chrs # more generally
camelia rakudo-moar 56ae33: OUTPUT«сюда␤»
18:08 araujo joined
hoelzro ah, neat 18:08
18:08 kaare_ joined, RabidGravy joined
TimToady but you probably want the proper uniprop, really 18:09
hoelzro I only need to worry about COMBINING ACUTE ACCENT at the moment
thanks TimToady! 18:10
moritz
.oO( you cannot write "COMBINING ACUTE ACCENT" without writing "CUTE" :-) )
18:11
hoelzro .oO( it is a cute accent! ) 18:12
ChoHag So does cyrillic even *have* cute accents? 18:14
18:14 ShimmerFairy joined
hoelzro not really; it's just often used to indicate where the stress falls on the word 18:14
for people who are learning, like me
hmm...are there other languages that use Cyrillic that *do* have predictable stress? 18:15
geekosaur depends on how you feel about й
hoelzro geekosaur: good point
ChoHag In Ukrainian that's a distinct letter from и.
ingy how do I get readline support in my new star build's repl? 18:16
hoelzro ingy: panda install Linenoise
ingy hoelzro: ta!
ChoHag And curiously on the opposite end of the keyboard.
18:16 Peter_R joined
ingy I had tried panda install Readline 18:16
hoelzro speaking of which...could a Windows user do me a favor and check to see if Linenoise works on Windows? If so, we can roll it into Star and have readline-like support off the bat!
ChoHag Although I'm not sure I've seen a й without a и. 18:17
ingy +1
hoelzro ingy: no luck, or just didn't add readline support to the REPL?
ChoHag: in ukrainian?
ChoHag Так. 18:18
ingy hoelzro: worked perfectly. +1 on your off-the-bat
hoelzro I don't see why the REPL couldn't also try to use Readline if it's available
18:18 domidumont joined
ingy hoelzro: yeah, evidently it does not 18:18
in 2015.07.2 18:19
hoelzro should revisit the REPL readliney stuff
ChoHag Because Stallman considers readline his crowning glory and guards its license like Gollum guards rings.
hoelzro add Readline support, and better tab completion options
the tab completion right now is really overly simplistic
ingy hoelzro: can you tell me how to introspect SETTING?
the W* methods are not helping me much 18:20
DrForr You have my attention :)
hoelzro m: .say for SETTING::.keys
camelia rakudo-moar 56ae33: OUTPUT«&pipe␤&symlink␤RESTRICTED-CLASS␤$=pod␤$!␤$_␤EXPORT␤&rmdir␤&MAKE-DIR␤&SYMLINK-PATH␤&UNLINK-PATH␤!UNIT_MARKER␤&chmod␤&CHANGE-DIRECTORY␤PIO␤GLOBALish␤::?PACKAGE␤&link␤&rename␤&COPY-FILE␤NativeCall␤Proc␤@?INC␤$=fin…»
hoelzro ingy: ^ that should start you off =)
ingy hoelzro: many thanks
hoelzro DrForr: I remember looking at Readline for REPL support when you were working on it; I don't know why that fell off my radar 18:21
DrForr Eeh, no worries, sort of fell of mine too bu that was mainly because I could't do unsigneds yet.
18:23 domidumont left
DrForr Gr. *off, *but 18:24
RabidGravy uints work now, there's no excuse
ingy fwiw, I started working on my Lola again while installing rakudo. Hopefully later today we can: (git clone [email@hidden.address] . $PWD/lola/init; LANG=p6; VERSION=2015.07.2; lola $LANG install $VERSION; lola switch $VERSION) # ie a generic install interface for many many languages 18:26
bbl 18:28
ab5tract_ hoelzro: fwiw, JVM readline-iness is non-existent in star 2015-07 18:31
also: hey there, buddy :)
18:35 dwarring joined 18:37 RabidGravy left 18:41 RabidGravy joined
lucasb m: class object {}; sub f(object:U) {}; f(object.new) 18:44
camelia rakudo-moar 5d9306: OUTPUT«Parameter '<anon>' requires a type object of type object, but an object instance was passed␤ in sub f at /tmp/tGtDy9LbjE:1␤ in block <unit> at /tmp/tGtDy9LbjE:1␤␤»
hoelzro ab5tract_: howdy! 18:48
moritz "a type object of type object"?
:-)
hoelzro yeah, for whatever reason, Linenoise doesn't work with the JVM =/
moritz I object!
lucasb I was just playing with the error message :)
18:52 RabidGravy left 18:55 RabidGravy joined 18:59 pmurias joined
[Coke] moritz: is that how you role? 19:00
moritz [Coke]: except when I role with class 19:05
[Coke] Whatever. it's not my bag, though. 19:11
AlexDaniel m: say 1;\nsay 2 19:13
camelia rakudo-moar 5d9306: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iKZ24CJhWj␤Undeclared routine:␤ nsay used at line 1. Did you mean 'say'?␤␤»
AlexDaniel umm, how can I pass a newline to camelia?
moritz AlexDaniel: with ␤ 19:14
19:16 RabidGravy left
AlexDaniel m: say 1;␤say 2 19:16
camelia rakudo-moar 5d9306: OUTPUT«1␤2␤»
AlexDaniel ok
m: -␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤ 19:17
camelia rakudo-moar 5d9306: OUTPUT«5===SORRY!5=== Error while compiling /tmp/A8udJv0Q8k␤Prefix -␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤ requires an argument, but no valid term found␤at /tmp/A8udJv0Q8k:19␤------> 3<BOL>7⏏5<EOL>␤ expecting any of:␤ …»
AlexDaniel so it treats all of these newlines as a part of the pre prefix
19:17 RabidGravy joined
AlexDaniel why? 19:17
and not only newlines 19:18
m: -␤␤# What the␤␤␤␤####
camelia rakudo-moar 5d9306: OUTPUT«5===SORRY!5=== Error while compiling /tmp/wYYXb3yiUF␤Prefix -␤␤# What the␤␤␤␤#### requires an argument, but no valid term found␤at /tmp/wYYXb3yiUF:7␤------> 3####7⏏5<EOL>␤ expecting any of:␤ prefix␤»
AlexDaniel also “expecting any of: prefix” 19:20
pmurias anybody planning to share a room at yapc::eu? 19:21
AlexDaniel what would that mean.. two prefixes in a row?
moritz AlexDaniel: sure
m: say -+2
camelia rakudo-moar 5d9306: OUTPUT«-2␤»
19:22 vendethiel joined
AlexDaniel moritz: it says “Prefix X requires an argument, but no valid term found”, then “expecting any of: prefix” 19:22
moritz: to me this does not really make any sense
it should make up its mind, whether it wants a term or a prefix, I think...
moritz AlexDaniel: yes, the "expecting any of" is a bit of a heuristic
19:22 RabidGravy left
moritz AlexDaniel: but wherever a term is expected, another prefix plus a term work too 19:23
19:23 oetiker joined
moritz it might be confusing, but it's still correct 19:23
AlexDaniel in other words LTA
moritz one could argue it should list "term" as one of the expected things
19:24 RabidGravy joined
AlexDaniel moritz: but I'm more interested in knowing why does it eat up anything after the prefix 19:24
moritz AlexDaniel: because it must, on its search for a term
AlexDaniel moritz: yeah, but do you agree that it should not be part of the error?
moritz AlexDaniel: I don't agree 19:25
AlexDaniel -␤␤# What the␤␤␤␤#### is not a prefix, right? :)
moritz it is, in the sense that it's valid text to come before a term 19:26
19:27 llfourn joined 19:28 AlexDani` joined 19:30 AlexDaniel left 19:32 llfourn left
ChoHag G 19:39
It seems I'm destined to try and do things with perl 6 which aren't possible yet.
Last year I thought I'd play with concurrency only to find out it was still being written. Now I want to see how I can break roles. 19:40
19:43 pierrot left 19:44 raiph left 19:45 FROGGS joined, FROGGS[mobile] left
ChoHag So can y'all hurry up and finish this thing? 19:46
nine ChoHag: we'd be faster with your help ;) 19:47
19:47 pierrot joined
pmurias roles are implemented aren't they? 19:48
19:48 raiph joined 19:49 Hor|zon joined
FROGGS ohh, they are pretty much implemented :o) 19:49
nine pmurias: I sure hope so. Considering how often I use them :)
jnthn Given I wrote several of them today, it sure seems like. ;) Implemented != 100% free of bugs.
ChoHag is butting heads with the bugs. 19:50
I had a look at rakudo to see if I could have a bash at bashing them.
I didn't get very far. 19:51
geekosaur finding bugs helps get them fixed :) 19:52
AlexDani` s/finding/reporting
19:52 AlexDani` is now known as AlexDaniel
ChoHag See above. 19:52
AlexDaniel ChoHag: what do you mean by “See above”? 19:53
maybe I missed something
ChoHag I found a bug or bug-like behaviouc.
Reported/demonstrated it here.
AlexDaniel ChoHag: that's really good, actually 19:54
19:54 Hor|zon left
AlexDaniel ChoHag: but it would be much better if you wrote an email to [email@hidden.address] 19:54
ChoHag: feel free to attach IRC discussion to it 19:55
19:55 santyno joined
AlexDaniel ChoHag: one way to do that is to use this link: irclog.perlgeek.de/perl6/2015-07-31 19:55
19:55 santyno left
AlexDaniel ChoHag: click on the timestamp to get a link to some message 19:55
like this irclog.perlgeek.de/perl6/2015-07-31#i_10986035 19:56
ChoHag: once you submit your email you'll find your bug report here: rt.perl.org/Public/
ChoHag: also, once your bug is fixed or just commented on you'll get an email notification 19:58
ChoHag Sorry I didn't mean to let you go on - I know this.
I was distracted.
AlexDaniel it's ok, maybe somebody else will find it useful :)
ChoHag Also I'm not sure if I actually have an email address which works. 19:59
I grew tired of them.
AlexDaniel wow
20:00 jkva joined
ChoHag I'm generally distancing myself from the bullshit trappings of modern life. 20:01
AlexDaniel ChoHag: well, I can report it for you! If you can help me to indentify the right message though
ChoHag Raising chickens and crops instead.
And perl code.
AlexDaniel this, right? irclog.perlgeek.de/perl6/2015-07-31#i_10985350
ChoHag That's the one. 20:02
ugexe you can use a throw away email mailinator.com
20:02 rindolf left
ugexe to register i meant 20:02
ChoHag So yet another site I'm a member of with yet another password? 20:05
Yay!
If I find I'm finding bugs with enough frequency and import, or want to poke at Rakudo's source more thoroughly I'll do whatever I need to get myself plugged back in, though as minimally as I can get away with. 20:06
In the meantime I'm enjoying not fixing computers for idiots who don't pay me to warm their chairs.
20:06 jkva left
ChoHag s/don't// 20:07
<-- happily burnt-out sysadmin. 20:08
ab5tract_ to #perl6, with love - github.com/ab5tract/p6-playground/...-prefix.p6
ugexe its a throw away email, you are not indebted to saving your password beyond your initial login and you are free to make another should you feel like it
AlexDaniel ChoHag: rt.perl.org/Public/Bug/Display.html?id=125731 20:09
ChoHag Thanks.
AlexDaniel the title might be wrong a bit, but I couldn't come up with something better
timotimo o/ 20:10
20:10 muraiki left
AlexDaniel \o 20:10
20:10 darutoko left 20:13 diana_olhovik_ joined, TEttinger joined
ChoHag The bug I was actually investigating is that in the linked class/role arrangement, if each has a method foo, A's foo is uncallable from B. 20:14
timotimo not even with self.A::foo syntax? 20:15
ChoHag Nope.
One sec... 20:16
timotimo damn 20:17
ChoHag No concretization found for A
timotimo hm, does A have parameters?
ChoHag None. 20:18
timotimo huh, that's weird
ChoHag m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo } }; class C does B { method foo { say "C"; self.b::foo } }; C.new.foo
camelia rakudo-moar 5d9306: OUTPUT«C␤Cannot dispatch to method foo on Failure because it is not inherited or done by C␤ in method foo at /tmp/P9L0j8waaV:1␤ in block <unit> at /tmp/P9L0j8waaV:1␤␤»
ChoHag m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo } }; class C does B { method foo { say "C"; self.B::foo } }; C.new.foo
camelia rakudo-moar 5d9306: OUTPUT«C␤B␤No concretization found for A␤ in any concretization at src/gen/m-Metamodel.nqp:2928␤ in any find_method_qualified at src/gen/m-Metamodel.nqp:1071␤ in method foo at /tmp/nxkG5Vu_Iq:1␤ in method foo at /tmp/nxkG5Vu_Iq:1␤ in block <uni…»
FROGGS m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo } }; class C does A does B { method foo { say "C"; self.B::foo } }; C.new.foo 20:20
camelia rakudo-moar 5d9306: OUTPUT«C␤B␤A␤»
ChoHag Yeah that works. 20:21
But so does C.bar if A contains a method bar.
20:22 raiph left
timotimo ah "role B does A", that's interesting of course 20:23
AlexDaniel Hm, should I report this as well? 20:24
ChoHag Same bug I think.
Actually I've no idea. That's a complete guess. 20:25
timotimo i don't know if the design says you should "does" all roles that "does" each other
m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo } }; class C
camelia rakudo-moar 5d9306: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1pqvRR9nYr␤Unable to parse class definition␤at /tmp/1pqvRR9nYr:1␤------> 3 foo { say "B"; self.A::foo } }; class C7⏏5<EOL>␤ expecting any of:␤ generic role␤»
timotimo oops
m: role A { method foo { say "A" } }; role B is A { method foo { say "B"; self.A::foo } }; class C does B { method foo { say "C"; self.B::foo } }; C.new.foo
camelia rakudo-moar 5d9306: OUTPUT«C␤B␤No concretization found for A␤ in any concretization at src/gen/m-Metamodel.nqp:2928␤ in any find_method_qualified at src/gen/m-Metamodel.nqp:1071␤ in method foo at /tmp/cWxApDomNf:1␤ in method foo at /tmp/cWxApDomNf:1␤ in block <uni…»
timotimo hmm
ChoHag Frankly I have trouble seeing much practical difference between classes and roles. 20:26
timotimo a role can force a "does"er of it to implement some methods
also, you can apply roles to instances of any class you have
ChoHag And a superclass/interface can't? 20:27
AlexDaniel timotimo: much like an interface in other languages, right?
ChoHag Implementiation detail IMO
20:27 llfourn joined
timotimo yes, interface 20:27
ChoHag: no, i don't think it can 20:28
and a role can have parameters, but a class can't
ChoHag Again that seems arbitrary to me.
timotimo shrugs 20:30
20:30 diana_olhovik_ left 20:31 raiph joined
ChoHag I think that sort of idea upsets the purists though. 20:31
tony-o is IO::Socket::Async being worked on? 20:32
20:32 llfourn left 20:36 Foxcool left 20:37 esaym153 left 20:39 ShimmerFairy left
jnthn tony-o: I hunted/fixed quite a few instabilities with it in the last couple of months 20:42
tony-o: It'll likely get some more attention with upcoming Supply work
tony-o concurrency on http::server::async is looking strong with the refactoring: gist.github.com/tony-o/2b5840bd5bec4be6cbab
jnthn: awesome, i figured out i wasn't "await"ing for .writes to complete and was trying to .write after a .close 20:43
20:47 ChoHag left, virtualsue left 20:51 khw left 20:53 virtualsue joined 20:54 skids left, ShimmerFairy joined
smls ChoHag, timotimo: "a role can have parameters, but a class can't" does feel arbitrary. 20:54
...and leads to things being made a role even though a class would be more natural. 20:55
raiph a role is abstract (hence parameterizable), a class concrete (hence, not)?
timotimo well, a role can't be instantiated
smls (looking at you, Buf) 20:56
timotimo a role will always be punned or has to be mixed into a class or instance to "become something"
tony-o m: role a { has $.attr = 5; }; a.new.attr.say; 20:58
camelia rakudo-moar 5d9306: OUTPUT«5␤»
timotimo that's an example of punning right there 20:59
smls that difference between "instantiated" and "punned" is kinda semantic though, isn't it?
timotimo i didn't say "instantiated"?
tony-o perhaps i misunderstood what you meant by punned and instantiated
ah
timotimo oh
i did actually say that 21:00
smls A Buf seems like a perfectly appropriate type to instantiate (and possibly even subclass), thus would naturally be a class. But is a role in Perl 6, because it has to be in order to be parameterizable. 21:01
Feels a little weird, is all.
jnthn It won't be changing.
21:02 FROGGS left 21:03 beastd joined
tony-o i like it for the interface purpose 21:15
21:19 lucasb left 21:44 hoelzro_ii left 21:50 Hor|zon joined 21:55 Hor|zon left 22:00 RabidGravy left 22:03 kaare_ left, kaare_ joined 22:05 HoppingMadMan joined 22:08 kaare_ left 22:18 jjido joined 22:19 leont joined
nine It would be sooo nice if Perl 5 had support for real named arguments 22:20
timotimo It won't be changing. 22:21
nine No, unfortunately not. Making it almost impossible to pass named parameters to Perl 6 methods 22:22
timotimo :S 22:24
nine Well, only almost impossible. But it won't ever be pretty. More like: $some_p6object->do_something(v6::args [$pos1, $pos2], {foo => 'bar'}); 22:25
22:25 skids joined 22:27 virtualsue left 22:28 llfourn joined
timotimo argh 22:30
22:30 smls_ joined 22:31 smls left
nine Or maybe $some_p6object->do_something($pos1, $pos2, v6::named foo => 'bar', v6::named baz => 'qux'); 22:31
jjido nine: the last one is not that bad. 22:32
22:32 llfourn left
TimToady there's no prototype that eats exactly two arguments, as a listop v6::args will eat all the rest of the args 22:35
nine TimToady: can't I do sub named($$) { ... }?
TimToady yes, but that won't change the parser like ($) does 22:36
nine Too bad. I don't think anyone would really like vg::named(foo => 'bar') 22:38
skids has about the same attitude towards email as CoHag. Have a work account and a barely operational personal account just to cope with non-web-enabled interfaces.
like RT, unless the permissions gods smile on you :-/ 22:39
b2gills You could just make them put it last: $some_p6object->do_something($pos1, $pos2, v6::named foo => 'bar', baz => 'qux');
leont Yeah, I was about to suggest what b2gills just said 22:40
nine b2gills: oh, of course! 22:41
To my defense: it is well past midnight here and I'm in a car on my way home from the Rob Zombie concert :)
22:42 cognominal left
nine Oh the irony! To create a proper Perl 6 Pair from Perl 5, I'd have to pass named arguments to the Pair constructor... 22:45
timotimo argh! 22:46
well, you can just pass positionals to &infix:<< => >>
does that help you? 22:48
nine: ^ 22:49
before you implement that! quickly! look at my message! it'll possibly save you two minutes!
rjbs heh
nine Thanks. I added a pair method to my Perl6 callback. This can use => as is :) 22:50
timotimo okeh
22:51 spider-mario left
nine And now I get a SEGV. Haven't seen one of those in quite a while 22:51
22:52 yqt joined
timotimo jnthn has been working so much on those internal problems 22:52
there's been great improvements
nine Oh I'm sure it's entirely my fault :) 22:53
22:55 smls_ left 22:57 HoppingMadMan left 23:05 telex left
nine A segfault when decrementing the refcnt of some Perl 5 object that is provoked by adding code that's not even run. I fear that will have to wait for a better rested version of me. 23:06
23:06 telex joined 23:19 pmurias left
nine Good night #perl6 :) 23:23
vendethiel o/, nightfrog 23:25
dammit. sorry nightfrog. I meant good night, nine.
23:26 cognominal joined 23:39 jjido left 23:40 BenGoldberg joined 23:46 mr-foobar left 23:51 Hor|zon joined 23:56 Hor|zon left