Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-07-31

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 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);␤»
00:00 Sgeo_ m: sub foo(Bool $a) { say $a; } foo(True|False);
00:00 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…»
00:00 Sgeo_ m: sub foo(Bool $a) { say $a; }; foo(True|False);
00:00 camelia rakudo-moar 31a083: OUTPUT«True␤False␤»
00:01 Sgeo_ Sorry for spamminess
00:01 Sgeo_ So I guess being inside the call to foo doesn't count as a boolean context?
00:01 Sgeo_ 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:03 TimToady Bool is inside Any, so it'll autothread
00:03 TimToady it's only the lower-level boolean context that "observes" the superposition
00:04 TimToady (there has to be a lower level to break circularity)
00:09 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:10 Sgeo_ 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:12 Sgeo_ (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:14 Sgeo_ Typo I think: http://doc.perl6.org/language/grammars
00:14 Sgeo_ my $s = 'Tokens won't backtrack, which makes them fail quicker!';
00:14 Sgeo_ That ' in won't isn't escaped
00:14 TimToady yeah, that's bogus
00:15 ShimmerFairy joined #perl6
00:15 Sgeo_ Is there a thing I have to check compile with before contributing to docs?
00:16 Sgeo_ m: say 'Testing escap\'d quote mark'
00:16 camelia rakudo-moar 31a083: OUTPUT«Testing escap'd quote mark␤»
00:17 laouji joined #perl6
00:18 Sgeo_ Made a pull request
00:28 TimToady Sgeo_++
00:31 shinobi-cl joined #perl6
00:32 BenGoldberg joined #perl6
00:45 llfourn joined #perl6
00:46 laouji joined #perl6
00:49 tony-o m: say 'Hello'.index(':');
00:49 camelia rakudo-moar 31a083: OUTPUT«Nil␤»
00:49 tony-o should that return a number?
00:50 shinobi-cl Hi all!
00:50 Sgeo_ tony-o, what number would it be? There's no correct answer
00:50 ShimmerFairy tony-o: nope, and IIRC it never has in Perl 6 (before it would return a type object)
00:51 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.
00:51 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)
00:51 shinobi-cl something like this i guess:
00:52 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)
00:53 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…»
00:54 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;
00:54 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␤»
00:54 shinobi-cl ahh brb
00:54 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)
00:55 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␤»
00:56 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␤␤»
00:56 Sgeo_ :/
00:56 Sgeo_ m: my $x = die "die!"
00:56 camelia rakudo-moar 31a083: OUTPUT«die!␤  in block <unit> at /tmp/TrtS_lyVus:1␤␤»
00:57 Sgeo_ Slide 65 http://www.slideshare.net/O​vid/perl-6-for-mere-mortals made me think it wouldn't explode immediately
00:57 ShimmerFairy m: my $x = fail "die!"; say $x.WHAT
00:57 camelia rakudo-moar 31a083: ( no output )
00:57 ugexe m: sub foo { bar() }; sub bar { say &?CALLER::ROUTINE }; foo;
00:57 camelia rakudo-moar 31a083: OUTPUT«sub foo () { #`(Sub|49149160) ... }␤»
00:59 b2gills m: say my $ is default(42) = 'Hello'.index(':');
00:59 camelia rakudo-moar 31a083: OUTPUT«42␤»
00:59 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
01:00 Sgeo_ (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:01 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 TimToady joined #perl6
01:05 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:06 ugexe perl6 macros have lots of work left
01:06 ugexe i am unsure what they can actually do yet
01:07 shinobi-cl oh, i'll do this as a role then :) Thanks!
01:08 ugexe a good idea
01:11 dayangkun joined #perl6
01:11 raiph joined #perl6
01:14 tony-o Sgeo_: i'd expect -1, like most other languages
01:16 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]
01:16 tony-o the problem is it doesn't crash
01:17 tony-o instead of @a[Nil] ?
01:18 tony-o 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;␤»
01:18 ugexe its better than an error complaining about -1 as a range and to use *-1
01:18 tony-o error checking is part of writing code
01:18 tony-o returning Nil means error checking is checking types instead of numbers
01:19 tony-o 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␤»
01:20 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 ShimmerFairy m: say $_ for "foo".index("f"), "foo".index("f").WHAT, ?"foo".index("f")
01:20 camelia rakudo-moar 31a083: OUTPUT«0␤(Index)␤True␤»
01:21 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
01:21 ShimmerFairy m: for <foo bar bazf> { if $_.index("f") { say "FOUND!" } else { say "aw" } }
01:21 camelia rakudo-moar 31a083: OUTPUT«FOUND!␤aw␤FOUND!␤»
01:21 ShimmerFairy tony-o: ^ now you can do that in Perl 6
01:21 Sgeo_ ShimmerFairy, 0 is truthy in Perl 6?
01:21 Sgeo_ m: say so 0
01:21 camelia rakudo-moar 31a083: OUTPUT«False␤»
01:21 Sgeo_ ?
01:22 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 #perl6
01:22 ShimmerFairy m: say "42".index(":").WHAT # Sgeo_
01:22 camelia rakudo-moar 31a083: OUTPUT«Nil␤»
01:22 ShimmerFairy m: say "42".index("2").WHAT # Sgeo_
01:22 camelia rakudo-moar 31a083: OUTPUT«(Index)␤»
01:22 Sgeo_ Hmm, interesting. Why (Index) not Index?
01:22 ShimmerFairy That's how all type objects print
01:23 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;
01:23 camelia rakudo-moar 31a083: OUTPUT«(Int)␤(Str)␤»
01:23 Sgeo_ Also you can still forget to check for Nil since Index lets you use direct as a number apparently?
01:24 Sgeo_ 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
01:24 ShimmerFairy Sgeo_: literally,  my class Index is Int {  , so it acts like an Int except for the part where ?Index.new(0) is True.
01:24 tony-o m: Nil.Int.say;
01:24 camelia rakudo-moar 31a083: OUTPUT«Use of Nil in numeric context  in block <unit> at /tmp/70JlvNfo_d:1␤0␤»
01:24 tony-o if you assume it's an Index then you just get a bunch of errors unless you know you need two checks
01:25 tony-o s/errors/warnings/
01:25 Sgeo_ Someone's going to write buggy and insecure Python because of this
01:25 Sgeo_ Then again, software development is horrible anyway, and it's arguably Python's fault
01:25 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.
01:26 ShimmerFairy 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?
01:27 Sgeo_ Hmm what should Rubify<Bool> do?
01:27 ShimmerFairy We have parametric roles, at least.
01:28 Sgeo_ I don't see Index here http://doc.perl6.org/type.html
01:29 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:31 Sgeo_ state variables are basically like let over lambda?
01:34 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␤»
01:36 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:37 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 :)
01:38 ShimmerFairy 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 flussence joined #perl6
01:45 Sgeo_ Why are type objects considered to be of the type?
01:45 Sgeo_ Especially if it just results in everything putting defined restrictions on arguments
01:45 Sgeo_ 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␤␤»
01:48 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:49 TimToady basically, all the types default to Maybe types
01:49 * TimToady stopping by just for a minute or two...
01:50 ShimmerFairy Ooh, hadn't thought of it like that. TimToady++ :)  (Maybe? We'll do that without an extra type!)
01:51 TimToady afk &
01:51 Sgeo_ do_if_defined $foo -> $a_foo { ... }
01:52 ShimmerFairy m: for (42, Int) { if $_.defined { say "$_" } else { say "type obj" } }
01:52 camelia rakudo-moar 31a083: OUTPUT«42␤type obj␤»
01:53 ShimmerFairy m: for (42, Int) { say $_ // "type obj" } # shorter version of my previous eval
01:53 camelia rakudo-moar 31a083: OUTPUT«42␤type obj␤»
01:53 raiph Sgeo_: http://irclog.perlgeek.de/p​erl6/2015-07-24#i_10949513
01:53 Sgeo_ Defaulting to Maybe types hurts the reason for Maybe types existing
01:56 raiph Sgeo_: ??
01:57 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:58 Sgeo_ ifdef @foo.index(0).maybe { ... }
01:58 raiph Sgeo: sorry, I meant the "defaulting to Maybe types" comment; please elaborate
01:58 skids m: for "aaf","f","b" { if $_.index("f") -> $idx { $idx.say } }
01:58 camelia rakudo-moar 31a083: OUTPUT«2␤0␤»
01:59 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 llfourn joined #perl6
02:00 skids Sgeo_: I think any language that "fixed" that would die of unpopularity.
02:00 Sgeo_ Is Scala dead? Haskell?
02:01 ShimmerFairy You usually only need to check :D and :U for methods like ACCEPTS and gist on your own classes, I've found.
02:03 Sgeo_ Hmm, similar to Objective-C nil ignoring messages?
02:05 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:06 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 raiph at run time
02:06 skids m: class A { has $.a; method foo { $a.a + 1 } }; A.foo(); # like that.
02:06 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.␤»
02:07 skids oops.
02:07 skids m: class A { has $.a; method foo { $.a + 1 } }; A.foo(); # like that.
02:07 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␤␤»
02:09 Sgeo_ raiph, I don't really see how it's different from Java null
02:09 Sgeo_ The P6 way I mean
02:09 Sgeo_ But maybe I'm just in favor of being forced to write bomb disposal instructions
02:10 ShimmerFairy It's kinda similar to how NaN propagates throughout floating point operations, perhaps.
02:12 skids Sgeo_: Some compromizes have been made for rapid prototyping purposes, for sure.
02:14 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:15 raiph s/I don't think it was considered/considered it/
02:19 raiph Sgeo_: Presumably concrete examples would be best; got any classic very small Haskell Maybe examples?
02:20 Sgeo_ Looking around for stuff I can just pastie
02:20 Sgeo_ http://pastie.org/10321216
02:21 raiph Are Haskell Maybes an application of tagged unions?
02:21 Sgeo_ displayResult mx = maybe "There was no result" (("The result was " ++) . show) mx
02:21 Sgeo_ Well, a tagged union with a Nothing alternative and an alternative containing a value
02:22 Sgeo_ 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:23 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 #perl6
02:24 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 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:25 Sgeo_ 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:28 HoppingMadMan joined #perl6
02:28 ShimmerFairy m: say log(1000); say log(-1000);
02:28 camelia rakudo-moar 31a083: OUTPUT«6.90775527898214␤NaN␤»
02:29 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 skids joined #perl6
02:30 ShimmerFairy Ah, I see the plain 'log' in haskell returns NaN too.
02:31 raiph Aiui P6 doesn't have a single notion that corresponds to "no value"
02:32 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:33 Sgeo_ So better than Ruby but still as bad as Java (I might be slightly opinionated)
02:36 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:37 raiph Sgeo_: Thanks for your safelog example -- but I didn hasn't helped
02:37 HoppingMadMan joined #perl6
02:37 raiph (sigh, chromebook keyboard is small)
02:40 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 :)
02:41 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]?
02:42 Sgeo_ I guess another way I'm looking at it is culturally, as though maybe Int:D should be default and Int opt-in
02:43 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
02:44 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:46 Sgeo_ Trying to compile an... I do not know why this compiled, hmm
02:46 Sgeo_ http://ideone.com/WR1Awc compiles, let's try with a type annotation
02:47 Sgeo_ http://ideone.com/zqN7FJ
02:49 noganex_ joined #perl6
02:50 ShimmerFairy Huh, interesting.
02:52 Sgeo_ I guess Nothing is Maybe a, and so can be used with Maybe anything
02:52 Sgeo_ I think?
02:54 ShimmerFairy Perhaps. Looks like it could definitely be used for Very Clever Things™ (and I'd be surprised if nobody has, actually).
02:57 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 Sgeo_ I'd imagine someone could easily write their own, but a standard might be nice
02:59 ShimmerFairy the only non-Any-based types, afaik, are Mu and Junction, so I'm sure it's not that necessary. Interesting idea though.
03:02 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:03 skids It's the class
03:03 skids s responsibility to do that responsibly
03:03 ShimmerFairy unless you're talking about a class that inherits both roles, you can use a role as a type constraint on parameters
03:04 Sgeo_ I'm talking about a class that inherits both roles
03:04 Sgeo_ As shown http://doc.perl6.org/langua​ge/objects#Role_Application
03:11 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:12 skids (or if you had classes that worked well that way.)
03:12 skids *roles
03:12 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)?
03:13 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.
03:14 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:16 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
03:16 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.
03:16 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.
03:22 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␤»
03:22 ShimmerFairy ^ an example of handling both (sadly you can't differentiate with a multi in the class)
03:25 Sgeo_ Relies on being lucky that the type signatures were distinguishably different
03:27 ShimmerFairy Sure. Any class that inherits from multiple incompatible sources will have to deal with the task of reconciling them.
03:28 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␤␤»
03:33 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 Sgeo_ ala that C.R syntax
03:33 Sgeo_ Although that might be annoying to use
03:35 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 ShimmerFairy Or something like that.
03:35 Averna joined #perl6
03:35 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:36 skids The stub should be fulfilled by the other role I would expect.
03:37 azawawi joined #perl6
03:37 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.
03:38 skids 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:39 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:40 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:41 Sgeo_ 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 :)
03:43 ShimmerFairy 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 skids Roles don;t even do everything specced yet.  There's still a diamond problem.
03:44 skids 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 #perl6
03:45 ShimmerFairy ah, having not everything be implemented yet would possibly explain the fact that I see some discussions over roles :)
03:45 ShimmerFairy azawawi: I'm not sure, but it sounds like maybe you need some Linenoise module?
03:45 skids (And there's the semantic problem here: https://gist.github.com/sk​ids/d7dac1c5f6921f430f64)
03:46 azawawi ShimmerFairy: readline is installed
03:47 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:50 azawawi ShimmerFairy: panda install Linenoise  # fixed it, thanks... ShimmerFairy++
03:51 azawawi now let me understand why that was not done by rakudobrew or rakudo
03:52 azawawi ./.rakudobrew/moar-nom/nqp​/MoarVM/3rdparty/linenoise is already in rakudo
03:53 azawawi so that p6 module is only a nativecall to it
03:53 * azawawi wishes for a newbie friendly p6 distro
03:53 ShimmerFairy I wonder if Rakudo Star comes with the Linenoise module...
03:58 * azawawi takes a look
03:59 azawawi i do not see it here https://github.com/rakudo/star/tree/master/modules :(
03:59 Averna joined #perl6
04:00 llfourn joined #perl6
04:06 HoppingMadMan joined #perl6
04:25 aborazmeh joined #perl6
04:25 aborazmeh joined #perl6
04:25 RabidGravy joined #perl6
04:26 azawawi how do i test a result if it is a string/int or not?
04:28 HoppingMadMan joined #perl6
04:32 HoppingMadMan joined #perl6
04:32 ShimmerFairy joined #perl6
04:36 dalek doc: 412ee07 | Sgeo++ | lib/Language/grammars.pod:
04:36 dalek doc: Fix grammars.pod unescaped quote mark in string
04:36 dalek doc:
04:36 dalek doc: Escape single-quote in string in sample code
04:36 dalek doc: review: https://github.com/perl6/doc/commit/412ee07687
04:36 dalek doc: 4554a51 | RabidGravy++ | lib/Language/grammars.pod:
04:36 dalek doc: Merge pull request #110 from Sgeo/patch-1
04:36 dalek doc:
04:36 dalek doc: Fix grammars.pod unescaped quote mark in string
04:36 dalek doc: review: https://github.com/perl6/doc/commit/4554a51f40
04:37 Sgeo_ Ooh if is aif
04:40 tony-o azawawi: use ~~
04:40 tony-o m: say 'string' ~~ Str
04:40 camelia rakudo-moar 31a083: OUTPUT«True␤»
04:40 tony-o m: say 'string' ~~ Int
04:40 camelia rakudo-moar 31a083: OUTPUT«False␤»
04:42 Sgeo_ m: say Mu ~~ Mu
04:42 camelia rakudo-moar 31a083: OUTPUT«True␤»
04:42 Sgeo_ m: say Mu.WHAT
04:42 camelia rakudo-moar 31a083: OUTPUT«(Mu)␤»
04:42 Sgeo_ m: say Mu.HOW
04:42 camelia rakudo-moar 31a083: OUTPUT«Perl6::Metamodel::ClassHOW.new␤»
04:54 azawawi tony-o: thx
04:55 azawawi tony-o: please see https://github.com/azawawi/perl6-atom-el​ectron/blob/master/examples/bailador.p6 . I think  HTTP::Server::Async will be a better replacement than HTTP::Easy-based servers
04:56 skids joined #perl6
05:07 azawawi https://github.com/azawawi/perl6-atom​-electron/blob/master/t/06-process.t  # Atom::Electron::Process wrapped... :)
05:08 laouji joined #perl6
05:10 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:11 Sgeo_ Doesn't Perl6 stdlib already have an event thing?
05:11 Sgeo_ Supply
05:12 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␤␤»
05:12 azawawi i meant from a API point of view. ease of use vs generic
05:13 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:14 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:15 azawawi to make it easier that is
05:15 azawawi and more auto complete friendly in the future
05:17 Sgeo_ thingy.supply_suspect.tap ?
05:17 Sgeo_ oops thingy.supply_suspend.tap
05:17 Sgeo_ Hmm except users shouldn't be able to send spurious events to it, so a restricted form
05:25 azawawi Sgeo_: this is what i did https://github.com/azawawi/perl6-atom-electron/​blob/master/lib/Atom/Electron/PowerMonitor.pm6 to simplify things. I will investigate the Supply later. Thanks for the info :)
05:25 * azawawi breakfast &
05:29 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:30 rurban joined #perl6
05:32 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:34 ShimmerFairy 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:47 jdv79 i'd have to agree there
05:47 jdv79 man, spectessting without parallelizing takes forever
05:48 jdv79 forgot and wondering why its still not done
05:49 jdv79 can't make spectest default to spread over all processors?
05:52 jdv79 is t/spec/S32-io/IO-Socket-Async.t failing for anyone else?
05:53 ShimmerFairy I recall that being a failure whenever parallelizing the tests.
05:54 jdv79 it failed when not for me just now
05:54 jdv79 and on its own too
05:56 diana_olhovik joined #perl6
05:57 jdv79 so what is the new "index == 0"?
06:00 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 #perl6
06:01 HoppingMadMan joined #perl6
06:02 jdv79 starts-with is fine 
06:02 jdv79 but now i notice vim doesn't like - in autocomplete:(
06:02 jdv79 anyone remember where that is fixed?
06:04 jdv79 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)
06:04 ShimmerFairy m: for <onefoo twofoo three fourfoo> { say $_.index("f"), " ", $_.index("f").WHAT }
06:04 camelia rakudo-moar 31a083: OUTPUT«3 (Index)␤3 (Index)␤Nil Nil␤0 (Index)␤»
06:04 jdv79 i get that - it just makes some uses more unterse which in Perlland is a large offensse
06:05 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␤»
06:05 ShimmerFairy jdv79: I don't follow, could you explain?
06:07 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 jdv79 plus for such a simple op i can't imagine the increased complexity is great for perf
06:07 jdv79 but w/e
06:07 jdv79 an int comp is pretty lighweight
06:07 ShimmerFairy it's not that much more complex, it's just a class inheriting from Int that changes about three or four methods :)
06:08 ShimmerFairy And the only problem I see existing with  $s.index('a') == 0  is if it
06:08 ShimmerFairy 's a conditional tested after an  if $s.index('a')
06:09 ShimmerFairy (but why do an explicit numerical comp in one conditional and "cheating" Bool coercion in the other?)
06:10 jdv79 for such a low level op it just feels overly complex
06:11 jdv79 but i worked around it.  no big deal .
06:11 jdv79 except p6 makes one type more than p5 does in this case
06:11 Sgeo_ Without using a function that accepts Junction or Mu, is it possible to distinguish (1|2)|(3|4) from 1|2|3|4 ?
06:12 Sgeo_ Trying to understand if Junctions are the List monad (plus Bool coersion) or if there's something missing
06:21 Sgeo_ m: ["hello", 5]
06:21 camelia rakudo-moar 31a083: ( no output )
06:21 Sgeo_ m: say ["hello", 5]
06:21 camelia rakudo-moar 31a083: OUTPUT«hello 5␤»
06:21 Sgeo_ Why is Perl 6 wikibook saying arrays contain data all of the same type?
06:21 Sgeo_ https://en.wikibooks.org/wiki/Perl​_6_Programming/Variables_and_Data
06:22 Sgeo_ m: my @a; @a = 1, "hi", Mu; say @a;
06:22 camelia rakudo-moar 31a083: OUTPUT«1 hi (Mu)␤»
06:22 Sgeo_ m: my @a; @a = 1, "hi", (1|2); say @a;
06:22 camelia rakudo-moar 31a083: OUTPUT«1 hi any(1, 2)␤»
06:22 Sgeo_ Well that's a limitation
06:23 Sgeo_ 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 #perl6
06:24 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)␤»
06:24 Sgeo_ I guess the comma accepts Mu?
06:25 ShimmerFairy wouldn't be surprised, lots of things in the core explicitly specify Mu as the type constraint.
06:26 Sgeo_ m: say (1|2)|(3|4)
06:26 camelia rakudo-moar 31a083: OUTPUT«any(any(1, 2), any(3, 4))␤»
06:26 jdv79 m: my Int @a = 1, "foo";
06:26 camelia rakudo-moar 31a083: ( no output )
06:26 jdv79 shoulnd't that fail?
06:26 jdv79 m: my Int @a = 1, "foo"; say @a;
06:26 camelia rakudo-moar 31a083: OUTPUT«Type check failed in assignment to '@a'; expected 'Int' but got 'Str'␤  in block <unit> at /tmp/0WhKTqfeCq:1␤␤»
06:27 Sgeo_ If I treat it as autoflattening, is there some problem with doing so?
06:27 Sgeo_ That prevents me from expressing something
06:27 jdv79 is that just laziness?
06:28 Sgeo_ I know I've criticized autoflattening >>= when I've seen it in Clojure, but I don't remember why
06:29 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.
06:29 ShimmerFairy Sgeo_: it's certainly an interesting question, if Junctions ever act different flattened vs. not.
06:31 Sgeo_ Why doesn't if change $_? Everything else seems to?
06:32 ShimmerFairy In what context?
06:32 Sgeo_ if $foo { ... in here ... }
06:32 Sgeo_ I know if $foo -> $bar exists
06:33 Sgeo_ Hmm that exact example is useless, instead of $foo imagine a complicated expression
06:33 ChoHag joined #perl6
06:34 ShimmerFairy m: if 42 { say $_ }; for 42 { say $_ }
06:34 camelia rakudo-moar 31a083: OUTPUT«(Any)␤42␤»
06:34 ChoHag What variables are available inside a class (or role) block to refer to the Type being built?
06:35 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:36 Sgeo_ Seems inconsistent with other things though like for
06:36 Sgeo_ :/
06:36 jdv79 since when has a conditional had $_ set?
06:36 Sgeo_ I guess I'm not a native Perler
06:36 vendethiel joined #perl6
06:37 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
06:38 Sgeo_ 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 Sgeo_ Not really anaphoric
06:39 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?
06:40 Sgeo_ Maybe $_ is an iffy idea >.>
06:40 Sgeo_ I mean hi
06:40 ChoHag I can't count the number of times I've wanted access to the conditionals in the clauses.
06:40 Sgeo_ ChoHag,
06:40 ChoHag if (something) then do_thing_with(it);
06:40 Sgeo_ m: if 1+1 -> $result { say $result; }
06:40 camelia rakudo-moar 31a083: OUTPUT«2␤»
06:41 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.
06:41 ChoHag Ignoring issues of there already being a $_ which will be trampled on because I lack the context of this discussion.
06:42 Sgeo_ Maybe $_ should just be called a Perl5 wart... or is it one of the things people like about Perl?
06:42 baest joined #perl6
06:42 Sgeo_ m: $_ = 5; when Int { say "when works with $_"; }
06:42 camelia rakudo-moar 31a083: OUTPUT«when works with 5␤»
06:42 ChoHag $_ is perl for "it". It's the most useful word in English.
06:43 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␤»
06:43 ShimmerFairy A bit contrived, but still shows where not trampling $_ is useful. :)
06:43 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
06:43 ChoHag It is definitely an English wart, but English is mostly just warts anyway.
06:44 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 :)
06:44 ChoHag ShimmerFairy: And again like in English, where the term being referred to by 'it' becomes ambiguous, a more definitive term is required.
06:45 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:46 Sgeo_ ShimmerFairy, people use == in PHP
06:46 Sgeo_ Even if ~~ is saner than PHP's ==, it's still a thing to be careful with imo
06:46 Sgeo_ Saying this mostly from a perspective of it takes on different meanings depending on the right-hand side
06:47 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
06:48 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
06:49 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.
06:49 ChoHag So it *does* depend on what "is" is.
06:49 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.
06:50 ShimmerFairy (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 darutoko joined #perl6
06:51 Sgeo_ m: say "\x[1F4A9]\x[0327]"
06:51 camelia rakudo-moar 31a083: OUTPUT«💩̧␤»
06:51 jdv79 note eqv is "wrong" atm
06:51 moritz yes, it's too conservative for value types
06:51 yoleaux 30 Jul 2015 15:25Z <raiph> moritz: Did you mean `use Perl6::Grammar:from<NQP>` (ie no space before `:from`)?
06:51 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.
06:54 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)
06:54 Sgeo_ https://en.wikibooks.org/wiki/Perl​_6_Programming/Blocks_and_Closures
06:54 Sgeo_ Is this correct? I thought I saw elsewhere that it's lexigraphical?
06:54 Sgeo_ m: { say $^b; $^a; }(1,2);
06:54 camelia rakudo-moar 31a083: OUTPUT«2␤»
06:55 domidumont joined #perl6
06:56 ShimmerFairy m: say (1,2,3,4).map: {$^b, $^a}
06:56 camelia rakudo-moar 31a083: OUTPUT«2 1 4 3␤»
06:57 moritz ShimmerFairy: yes
06:57 * moritz not really awake yet
06:57 ShimmerFairy Sgeo_: I believe that statement is only correct when you've sorted your use of placeholders lexicographically :P
06:57 jdv79 i was going to say but got distracted
06:58 zakharyas joined #perl6
06:58 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
06:59 moritz ChoHag: which means that B's methods come later in the MRO than if it were composed as a role
07:00 FROGGS joined #perl6
07:01 domidumont joined #perl6
07:07 Sgeo_ m: say 1 ~~ (1|2)
07:07 camelia rakudo-moar 31a083: OUTPUT«True␤»
07:08 Sgeo_ So it boolified itself? :/ was hoping for (1~~1 | 1 ~~ 2)
07:09 Sgeo_ m: say 1 ~~ ((Str|Int)&1)
07:09 camelia rakudo-moar 31a083: OUTPUT«True␤»
07:10 moritz m: say 1 == (1|2)
07:10 camelia rakudo-moar 31a083: OUTPUT«any(True, False)␤»
07:10 Sgeo_ I mean, if I want a boolean, I could just say so
07:15 ShimmerFairy joined #perl6
07:16 jdv79 so where I once did >>.ast.hash i how have to do >>.ast.[0] after a change i made
07:16 jdv79 even though >>.ast.perl spits back the same thing in both cases
07:18 telex joined #perl6
07:20 domidumont joined #perl6
07:29 salva joined #perl6
07:30 abraxxa joined #perl6
07:31 virtualsue_ joined #perl6
07:32 espadrine joined #perl6
07:33 llfourn joined #perl6
07:42 FROGGS Sgeo_: smart match is supposed to be smart here
07:46 ShimmerFairy joined #perl6
07:47 jdv79 just for fun i tried to async >>. and kinda did but am stuck
07:47 jdv79 https://gist.github.com/ano​nymous/be8272afe09047875f16
07:47 jdv79 if anyone could help that'd be nice.  not that its feasible.  i just thought it was an interesting problem to play with.
07:50 jdv79 lunch and stuff &
07:51 inokenty joined #perl6
07:57 brrt joined #perl6
08:10 jinxter joined #perl6
08:11 vytas joined #perl6
08:12 jinxter left #perl6
08:34 jnthn morning, #perl6
08:39 FROGGS joined #perl6
08:43 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. https://github.com/rakudo/rakudo/commit/​26589f2b72534870a6a4a996ae10d5ccd9d9b801
08:43 lizmat .tell azawawi it was felt that it was good to unify socket and IO handle
08:43 yoleaux lizmat: I'll pass your message to azawawi.
08:44 [TuxCM] make[1]: Entering directory `/pro/3gl/CPAN/rakudobrew/moar-no​m/panda/.panda-work/1438332194_4'
08:44 [TuxCM] make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
08:44 [TuxCM] is that an OSX-ism?
08:44 lizmat [TuxCM] da bin ich überfragt
08:44 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
08:44 yoleaux moritz: I'll pass your message to azawawi.
08:45 lizmat moritz++
08:45 [TuxCM] Saw 1 occurrence of deprecated code.
08:45 [TuxCM] ========================================​========================================
08:45 [TuxCM] Method send (from IO::Socket) seen at:
08:45 [TuxCM] lib/Panda/Ecosystem.pm, line 81
08:45 [TuxCM] Deprecated since v2015.7, will be removed with release v2015.9!
08:45 [TuxCM] Please use print instead.
08:46 lizmat yeah, the deprecation cycle is a bit abrupt, I agree
08:46 [TuxCM] WARNINGS:
08:46 [TuxCM] Useless use of constant integer 1 in sink context (line 1636)
08:46 [TuxCM] that one I get a lot.
08:46 * [TuxCM] investigates
08:47 moritz [TuxCM]: I just merged https://github.com/tadzik/panda/pull/194 with which the deprecation warning above goes away
08:47 [TuxCM] moritz++
08:47 moritz [TuxCM]: re "Useless use of constant integer 1 in sink context" sounds like  1; at the end of a module/class file
08:47 moritz [TuxCM]: we didn't used to catch that; jnthn++ has fixed that
08:47 [TuxCM] correct
08:47 [TuxCM] just remove it?
08:47 moritz aye
08:48 moritz civilized people just throw exceptions when the inclusion of a module failed :-)
08:50 [TuxCM] test             50000    46.435    46.343
08:50 [TuxCM] test-t           50000    49.251    49.159
08:50 [TuxCM] OUCH!
08:51 [TuxCM] "next" is an exception. Is "goto" too?
08:55 [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:56 moritz then don't :-)
08:56 Ven joined #perl6
08:56 zakharyas joined #perl6
08:57 [TuxCM] branch already deleted
08:57 [TuxCM] but needing 49 seconds where 0.016 was my goal is really not motivational
09:00 jnthn [TuxCM]: When was the previous measurement made?
09:00 [TuxCM] yesterday
09:00 [TuxCM] I test every day when I am at home
09:01 [TuxCM] 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?
09:01 [TuxCM] have 5 minutes
09:01 hanekomu joined #perl6
09:01 [TuxCM] yesterday was 47 IIRC
09:02 [TuxCM] 30 freenode-#perl6.log:Jul 30 10:21:40 <[TuxCM]>        test             50000    47.312    47.217
09:02 [TuxCM] 30 freenode-#perl6.log:Jul 30 10:21:40 <[TuxCM]>        test-t           50000    47.420    47.325
09:08 jkva joined #perl6
09:11 [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…»
09:11 [TuxCM] test             50000    46.372    46.280
09:11 [TuxCM] test-t           50000    45.977    45.885
09:11 jnthn That's...now?
09:11 [TuxCM] so, those 3 seconds might have been caused by catching the trailing 1;
09:11 [TuxCM] that was now
09:12 jnthn wow
09:12 itz joined #perl6
09:12 jnthn But OK, good I don't have a performance regression to hunt.
09:12 jnthn Well, todays one :)
09:12 [TuxCM] :)
09:12 jnthn I'm currently looking into an earlier one
09:12 jnthn Caused by fixing &?ROUTINE
09:13 [TuxCM] I have 45 next's in my main loop. there is no fast/cheap alternative?
09:14 jnthn That *should* be the fast thing, it's just not as well optimized yet as it really should be.
09:18 espadrine joined #perl6
09:24 Woodi hallo #perl6 :)
09:26 Woodi I got impression that Monads are just { ....; return struct { Bool error, Int value-if-no-error } };  # (programming cafe)++
09:27 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 :)
09:28 * moritz idly wonders if pipelines want to be reactive, so more tied to Supply
09:29 Woodi moritz: but I know what Monads are ! thing are more complicated, etc, but whatever ;)
09:29 espadrine joined #perl6
09:29 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
09:31 moritz arnsholt: that's my understanding too
09:34 Ven joined #perl6
09:34 * Ven whispers "it's all about laws"
09:34 Ven o/, #perl6
09:35 Ven .tell Sgeo_ you might be interested in timo's https://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_.
09:36 Ven .oO( it's dangerous to go alone, take this ADT and this `eval` function )
09:38 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 Woodi ional programing... and from now ...
09:38 Woodi ... on Arrays are illegal and Lists are immutable...
09:39 jnthn Analisis sounds like a pain in the butt...
09:39 Woodi jnthn: if you rememer what "function" is then you can be good :)
09:40 arnsholt jnthn: *snort*
09:43 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:44 Woodi .btw we don't have anything like "hive" yet :)
09:45 * Woodi fighting wasps since 5:45 AM
09:51 laouji joined #perl6
09:56 zakharyas joined #perl6
10:02 Ven_ joined #perl6
10:02 dalek nqp: ccd7669 | jnthn++ | / (2 files):
10:02 dalek nqp: Get MoarVM with curcode op and map it.
10:02 dalek nqp: review: https://github.com/perl6/nqp/commit/ccd76691af
10:08 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␤»
10:09 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 #perl6
10:10 dalek nqp: 70f65eb | jnthn++ | src/vm/jvm/ (2 files):
10:10 dalek nqp: Implement nqp::ctxcode on JVM.
10:10 dalek nqp: review: https://github.com/perl6/nqp/commit/70f65eb790
10:11 masak joined #perl6
10:11 masak good evening, #perl6
10:11 moritz \o masak
10:12 vytas joined #perl6
10:12 jnthn .oO( You call it evening, I call it midday with Chinese characteristics :P )
10:12 masak 哈哈
10:14 * masak tries to backlog the past four days
10:15 jnthn Good luck with that :)
10:16 Ven_ o/, masask
10:17 Ven_ I mean. \o, masak
10:18 Ven_ 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 …»
10:18 Ven_ m: my role R { my class C {}; }
10:18 camelia rakudo-moar 31a083: ( no output )
10:20 Ven_ is that supposed to also help with lexpads issues?
10:21 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:22 jnthn 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
10:22 * Ven_ remembers trying to understand, say, why `role R[::T] { constant VAL = T.new }` didn't work and nods
10:23 jnthn masak: Yeah, but now you're frustrated at compile time :P
10:23 Ven_ .oO( -Ofrustration *g* )
10:23 moritz (early frustration)++
10:24 * lizmat needs to change 'perl6 -e 1' meme to 'perl6 -e ""'
10:24 masak jnthn: I *do* prefer frustration at compile time.
10:25 masak prefer frustration at author-time even more...
10:28 jnthn Yay, improving how we do &?ROUTINE takes a benchmark from 74s to 52s
10:28 arnsholt Nice!
10:30 dalek rakudo/nom: 19dfec1 | jnthn++ | src/Perl6/Actions.nqp:
10:30 dalek rakudo/nom: Avoid repeated calls to .name.
10:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/19dfec10d6
10:30 dalek rakudo/nom: 3a2931d | jnthn++ | tools/build/NQP_REVISION:
10:30 dalek rakudo/nom: Bump NQP_REVISION for ctxcode op.
10:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3a2931d892
10:30 Woodi http://www.welie.com/patterns/show​Pattern.php?patternID=list-builder  ;)
10:36 jnthn m: multi foo($n) { $n ?? $n * samewith($n - 1) !! 0 }; say foo(5)
10:36 camelia rakudo-moar 31a083: OUTPUT«0␤»
10:36 moritz m: multi foo($n) { $n ?? $n * samewith($n - 1) !! 1 }; say foo(5)
10:36 camelia rakudo-moar 31a083: OUTPUT«120␤»
10:36 jnthn m: multi foo($n) { { $n ?? $n * samewith($n - 1) !! 0 }() }; say foo(5)
10:36 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␤␤»
10:36 jnthn aha, that's the error I wanted
10:36 jnthn moritz: hah, yes ;)
10:36 moritz :-)
10:36 jnthn I just broke samewith with my &?ROUTINE changes, then after mxiing it was like...hmm, it probably never did work quite right :)
10:37 jnthn (In the nested scopes case)
10:37 jnthn also, fixing
10:39 ab6tract joined #perl6
10:41 dalek rakudo/nom: 87c0943 | jnthn++ | src/core/control.pm:
10:41 dalek rakudo/nom: Fix samewith.
10:41 dalek rakudo/nom:
10:41 dalek rakudo/nom: It did rely on &?ROUTINE really being in the lexpad, but further to
10:41 dalek rakudo/nom: that it failed to search hard enough for a routine, so you could not
10:41 dalek rakudo/nom: do samewith inside of a closure inside of the routine.
10:41 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/87c0943f1e
10:41 dalek roast: 933094d | jnthn++ | S02-magicals/sub.t:
10:41 dalek roast: Extra, missing, stress test for &?ROUTINE.
10:41 dalek roast: review: https://github.com/perl6/roast/commit/933094dd61
10:41 dalek roast: 1879617 | jnthn++ | S06-multi/redispatch.t:
10:41 dalek roast: Test samewith used within a closure.
10:41 dalek roast: review: https://github.com/perl6/roast/commit/1879617f7e
11:02 jnthn *lol*
11:02 jnthn ===SORRY!=== Error while compiling t\spec\S02-magicals\subname.t
11:02 jnthn Variable '&?ROUTINE' is not declared
11:02 jnthn at t\spec\S02-magicals\subname.t:26
11:02 jnthn ------>   "&?ROUTINE<HERE> not available outside of a routine";
11:02 jnthn &?ROUTINE interpolates in a double-quoted string :P
11:03 lizmat huh?  I guess, yess...
11:03 lizmat m: sub a { "foo" }; say "&a"
11:03 camelia rakudo-moar 3a2931: OUTPUT«&a␤»
11:03 lizmat huh?
11:04 jnthn Oh
11:04 jnthn Hmmm
11:04 jnthn I wonder...
11:04 lizmat m: sub a { "foo" }; say "&a()"
11:04 camelia rakudo-moar 3a2931: OUTPUT«foo␤»
11:04 lizmat m: sub a { "foo" }; say "&a[]"
11:04 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␤»
11:04 jnthn m: say "&?X"
11:04 camelia rakudo-moar 3a2931: OUTPUT«&?X␤»
11:04 jnthn Grr
11:04 jnthn So we need to defer that lookup after all
11:06 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
11:06 jnthn Nice
11:07 jnthn Hopefully we can get the size of the NFAs down a bit more again
11:08 xnrand joined #perl6
11:10 * jnthn crosses fingers, spectests the &?ROUTINE changes
11:10 * moritz also crosses jnthn's fingers
11:12 coffee` joined #perl6
11:17 * sjn crosses moritz' fingercrossing fingers
11:17 cognominal joined #perl6
11:18 dalek rakudo/nom: 56ae33e | jnthn++ | src/Perl6/ (2 files):
11:18 dalek rakudo/nom: Re-implement &?ROUTINE.
11:18 dalek rakudo/nom:
11:18 dalek rakudo/nom: This uses the same appraoch as &?BLOCK, meaning you only pay for the
11:18 dalek rakudo/nom: feature if you use it. This unbreaks MoarVM's ability to do a bunch of
11:18 dalek rakudo/nom: inlining, which has rather positive performance consequences.
11:18 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/56ae33ea0a
11:18 * moritz hopes this drives [TuxCM]++'s benchmark down again
11:19 jnthn Should help
11:24 gfldex joined #perl6
11:24 Ven joined #perl6
11:29 g4 joined #perl6
11:30 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:32 jnthn nine: Don't see any problem
11:33 nine They could still inherit from Any?
11:33 jnthn Sure, you get to define what type checking means in a meta-class
11:33 jnthn So you can just say "sure they're Any" :)
11:33 nine Then I'll better just try it and see if it improves things :)
11:33 brrt (:-o what if perl6 is actually going to work :-o)
11:35 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 jnthn m: package Foo { }; say Foo ~~ Any
11:35 camelia rakudo-moar 87c094: OUTPUT«True␤»
11:35 ab6tract o/ #perl6
11:36 nine jnthn: oh nice :)
11:36 ab6tract a question from the backlog, re-presented in a more active moment
11:36 ab6tract m: "ooo".succ.comb.reverse.join.say  # this works
11:36 camelia rakudo-moar 87c094: OUTPUT«poo␤»
11:36 ab6tract m: @(["ooo" xx 20])>>.succ>>.comb>>.reverse>>.join.say   # should I expect this to work?
11:36 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 #perl6
11:37 ab6tract if not, how can we determine under which conditions a hyper-chain of methods would differ from it's non-hyper behavior
11:38 jnthn I wonder if there's some over-flattening going on with regard to what .comb returns
11:40 RabidGravy joined #perl6
11:40 azawawi hi
11:40 yoleaux 08:43Z <lizmat> azawawi: it was felt that it was good to unify socket and IO handle
11:40 yoleaux 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
11:40 azawawi is panda install HTTP::Easy working with latest rakudo?
11:41 * sjn installed it a short while ago
11:41 sjn well, last week
11:42 * 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 :(
11:44 azawawi im getting this weird error with latest rakudo while trying to `panda install HTTP::Easy`
11:44 azawawi https://gist.github.com/az​awawi/36dae237215df68dba10
11:44 ab6tract which actually makes sense... both reverse and join are no-ops on single element lists
11:45 jnthn ab6tract: It's a curious way to write it though
11:45 jnthn m: ("ooo" xx 20).map(*.succ.flip).say
11:45 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␤»
11:46 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?
11:46 jnthn ab6tract: Not automatically
11:46 ab6tract ok
11:47 jnthn You have to factor in the whole "is nodal" side of it too, iirc
11:47 jnthn Which means you could probably construct a case where it didn't match but isn't wrong.
11:47 * azawawi builds 2015.7 to test it again
11:47 bloonix_ joined #perl6
11:50 jnthn lunch &
11:51 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 ab6tract I didn't know that .flip even existed
11:58 azawawi Cannot declare our-scoped constant inside of a role... is that a new error in latest rakudo?
11:58 moritz yes
11:59 moritz just declare it as 'my constant ...'
11:59 moritz it wasn't available to the outside in any case
12:00 azawawi so in the case of https://github.com/supernovus/perl6-http​-easy/blob/master/lib/HTTP/Easy.pm6#L20, supernovus wanted to declare that constant to be shared by other classes
12:03 azawawi moritz: but it was available to role do-ers :)
12:04 azawawi moritz: or does-ers lol
12:06 azawawi moritz: it is strange though to java programmers as interfaces (like roles) are used sometimes to declare constants
12:06 azawawi moritz: for example http://docs.oracle.com/javase/8/docs​/api/javax/swing/SwingConstants.html
12:12 jnthn No, constants aren't composed in any way
12:12 jnthn The only way it was made available outside of the role was "is export"
12:14 azawawi constant CRLF is export             = "\x0D\x0A";   #  which is the case
12:15 azawawi 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 …»
12:15 moritz just add a "my" in front"
12:15 jnthn Right, and so it continues to work with "my", like moritz++ said
12:16 azawawi got it... moritz++... fixing :)
12:17 smls joined #perl6
12:18 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:19 nine smls: that would sound strange
12:19 * azawawi must be something I ate in family $breakfast :)
12:19 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
12:19 arnsholt Gee, thanks Python, that's a real helpful error message: "TypeError: __init__() takes at least 5 arguments (5 given)" >.<
12:19 smls then when I run the same script again (with the same files), it works
12:19 smls only happens rarely
12:21 ab6tract smls: heisenbugs :(
12:21 smls yeah :(
12:24 ab6tract smls: if you add another check, like if $file.d { die "spooky action at a distance" unless $file.d; ... }
12:24 ab6tract I wonder if it could give some more hints
12:24 ab6tract either way, kinda gross :(
12:28 espadrine joined #perl6
12:30 moyamo joined #perl6
12:30 [TuxCM] moritz, jnthn, impressive:
12:30 [TuxCM] test             50000    44.579    44.487
12:30 [TuxCM] test-t           50000    44.144    44.052
12:30 nine m: class Foo:auth<Perl5> { our $foo = "Perl5!"; }; class Foo:auth<Perl6> { our $foo = "Perl6!"; }; say Foo:auth<Perl5>::$foo;
12:30 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…»
12:31 nine Does someone recognize what I'm trying to do there ^^^ and is able to tell me how it should be done?
12:31 zakharyas joined #perl6
12:32 lizmat nine: NYI
12:32 nine lizmat: ah, too bad. Thanks anyway
12:32 * lizmat will be offline most of the weekend
12:33 lizmat so catch you all next week!
12:33 lizmat &
12:38 nine :auth would have been a wonderful tool to keep namespaces for Perl 5 and Perl 6 classes separate.
12:44 ab6tract seems like a weird name for such a functionality
12:46 nine ab6tract: why?
12:47 ab6tract It was a long argument with TimToady about 'authority', iirc
12:48 ab6tract it just feels like it would do some kind of.... authentication...
12:49 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:50 ab6tract yeah, still don't like it. and especially the shortened form. ('subst' and 'substr', I'm glaring at you)
12:55 tony-o azawawi: as it happens, in rewriting http::server::async to fix a few issues and as a blog post
12:58 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
13:00 moritz how well does https://github.com/ugexe/zef/ work?
13:00 timotimo o/
13:01 tony-o moritz: it works pretty well so far  . working on hooks atm
13:01 timotimo jnthn: very glad to see &?ROUTINE get improved
13:01 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 :)
13:01 RabidGravy :)
13:02 azawawi tony-o++
13:02 ab6tract nine :D
13:02 azawawi https://github.com/azawawi/per​l6-atom-electron/tree/master/t is growing. I feel a lot safer with testing over Travis CI these days :)
13:03 timotimo yay :)
13:04 azawawi https://travis-ci.org/azawawi/pe​rl6-atom-electron/jobs/73551274 # job running lol
13:04 JimmyZ what is the difference between zef and panda?
13:05 jnthn [TuxCM]: Glad it's going in the right direction again :)
13:06 [TuxCM] nine will the HLL fail be fixed before YAPC::EU?
13:08 timotimo azawawi: farabi6 will become a desktop app at some point with the help of electron?
13:08 azawawi timotimo: 100% correct :)
13:08 azawawi timotimo: it is basically Padre for Perl 6 :)
13:10 timotimo mhm
13:11 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:12 azawawi timotimo: basically https://github.com/azawawi/perl6-atom-el​ectron/blob/master/examples/bailador.p6
13:12 FROGGS m: say do { last; CONTROL { default { say $_ } } }
13:12 camelia rakudo-moar 56ae33: OUTPUT«Died with CX::Last␤  in block <unit> at /tmp/0f2I3OeM9W:1␤␤Nil␤»
13:12 skids joined #perl6
13:12 FROGGS ohh, my local rakudo seems to be too old for that
13:13 jnthn :)
13:13 azawawi timotimo: plus native dialog api https://github.com/azawawi/perl6-ato​m-electron/blob/master/t/03-dialog.t for opening/saving/errors etc
13:13 FROGGS jnthn: I'm playing with leave exceptions again
13:14 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:17 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
13:17 timotimo i myself am partial to Qt
13:18 azawawi timotimo: plus wxwidgets is not actively developed as before...
13:19 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:20 timotimo 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
13:20 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)
13:20 tony-o azawawi: vim ?
13:21 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 :)
13:21 * azawawi dreams
13:22 jnthn FROGGS: OK. And I'm starting GLR guts sketching.
13:22 mr-foobar joined #perl6
13:23 raiph joined #perl6
13:23 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 #perl6
13:24 tony-o azawawi: i can add that in hiker, h:s:a isn't a great place for that
13:24 tony-o also, if you want to follow along on the rewrite: http://ugexe.com/refactoring-httpserverasync/
13:24 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
13:24 timotimo mhm
13:25 * jnthn wonders how the supply/whenever syntax will influence HTTP::Server::Async :)
13:25 tony-o jnthn: is it already in rakudo?
13:25 jnthn tony-o: No :)
13:25 jnthn tony-o: It's relatively high on my todo list.
13:26 tony-o ahh - is there a post i can read? :-)
13:26 tony-o or did the spec doc change?
13:26 jnthn No, there's a gist
13:26 jnthn Of the proposed changes
13:26 jnthn moment
13:26 tony-o roger
13:26 jnthn https://gist.github.com/jnthn/a56fd4a22e7c43080078
13:26 JimmyZ I think  I can use zef since panda doesn't work here sometimes ;)
13:27 jnthn Hm, and i should look at the comments there more closely :)
13:28 jdv79 jnthn: who besides you could help with this?:  http://irclog.perlgeek.de/p​erl6/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?
13:28 jdv79 glr > my thing so don't want to take up your time
13:29 * jnthn fixes one of the things mentioned in the gist comments
13:29 FROGGS ahh
13:29 jnthn jdv79: That kinda *is* part of the GLR stuff
13:30 jnthn jdv79: Though >> itself should really just do some kind of map and then do .hyper on it
13:30 jnthn FROGGS: Well, I have the things pmichaud came up with in the S07 GLR draft to go on
13:30 azawawi jnthn: The @awaitables. Cool name :)
13:31 jdv79 ok.  i was most interested in the cause of the current error
13:31 jnthn ;)
13:32 nine FROGGS: I golfed TuxCM's "Merging GLOBAL symbols failed: duplicate definition of symbol HLL" error down.
13:32 nine FROGGS: it boils down to: use Slang::Tuxic; use NativeCall;
13:32 [TuxCM] m: use Slang::Tuxic; use Inline::Perl5;
13:32 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 nine [TuxCM]: use Slang::Tuxic; use NativeCall;
13:33 [TuxCM] which is close
13:33 azawawi jnthn: The @awaitables is coming to PCs near you in December 2015 :)
13:33 dalek Inline-Perl5: 340c791 | (Stefan Seifert)++ | / (5 files):
13:33 dalek Inline-Perl5: Hide Perl5Parent from v6-inline users
13:33 dalek Inline-Perl5:
13:33 dalek Inline-Perl5: When using v6-inline to extend a Perl 5 package in Perl 6, one had to explicitly
13:33 dalek Inline-Perl5: also does Perl5Parent['Foo::Bar'];
13:33 dalek Inline-Perl5: and pass the Inline::Perl5 object to the constructor.
13:33 FROGGS m: use NQPHLL:from<NQP>; use NativeCall
13:33 dalek Inline-Perl5:
13:33 dalek Inline-Perl5: Both are now gone. Since we already assume that the user wants to create a
13:33 camelia rakudo-moar 56ae33: OUTPUT«===SORRY!===␤Merging GLOBAL symbols failed: duplicate definition of symbol HLL␤»
13:33 dalek Inline-Perl5: class of the same name as the Perl 5 package, we may as well assume that this
13:33 dalek Inline-Perl5: class should extend the Perl 5 package. Since they are both in the same file,
13:33 dalek Inline-Perl5: this  should be a fair assumption.
13:33 dalek Inline-Perl5:
13:33 dalek Inline-Perl5: In the place where we create the Perl 6 class, we also know exactly, which
13:33 dalek Inline-Perl5: Perl 5 interpreter the Perl 5 class is from, so we pass it as Role parameter
13:33 dalek Inline-Perl5: instead of requiring the user to pass it to the constructor.
13:33 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/340c791683
13:33 FROGGS nine: see above
13:33 nine FROGGS: so we're both innocent :)
13:33 FROGGS only kindof
13:34 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␤»
13:34 FROGGS I touched code that is responsible for global merging...
13:34 masak m: only kindof foo
13:34 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␤»
13:34 FROGGS (ages ago, mind)
13:34 jnthn jdv79: Well, it's a stab in the dark just from reading the code, but:
13:34 jnthn +                my Mu $r = nqp::if(nqp::istype($o, Iterable),
13:34 jnthn +                  $o.new(deepmap(op, $o)).item,
13:34 jnthn +                  op.($o));
13:34 jnthn Assigning to a Scalar there will itemize
13:34 jnthn And I'm not sure that's desirable
13:35 jnthn my \r = ... may do it
13:35 jdv79 oh, ok.  thanks.
13:36 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...
13:37 Woodi example: https://gist.github.com/sl​unski/7cfd2d8447e450d31544
13:40 Woodi 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:43 [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
13:43 FROGGS [TuxCM]: ohh, if there is no ticket yet, then please create one, yes
13:44 AlexDaniel joined #perl6
13:49 [TuxCM] https://rt.perl.org/Ticket/Display.html?id=125729
13:49 [TuxCM] feel free to alter
13:52 jdv79 jnthn: that did clear up some of the failures.  thanks.
13:54 azawawi /clear
13:54 azawawi oops :)
13:55 * 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
13:56 azawawi tony-o: i just sent you a pull request :)
13:59 tony-o azawawi: i just merged it
14:04 azawawi tony-o: thx
14:04 azawawi tony-o: https://github.com/azawawi/perl6-atom-electr​on/blob/master/examples/http_server_async.p6  # HTTP::Server::Async + Atom::Electron
14:07 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();
14:07 jdv79 I think I'll leave it alone at this point;)
14:08 nine smls: it does
14:08 smls nice
14:08 smls nine: Also, how would one call P5 function so that it believes it was called in scalar context?
14:09 nine smls: implemented that this Tuesday
14:09 jkva joined #perl6
14:09 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 [TuxCM] jdv:  8  [IO]        Cannot clear $*OUT.nl                               RT#12397
14:11 [TuxCM] (related)
14:12 tony-o azawawi: merged that one too :-)
14:12 [TuxCM] and maybe related:  7  [IO]        Cannot change input-line-separator                  RT#123888
14:12 tony-o azawawi: also, that's pretty awesome!
14:16 azawawi https://travis-ci.org/azawawi/per​l6-atom-electron/builds/73561310   # puzzled... sometimes Travis CI containers seems to be offline or something
14:16 azawawi s/seems/seem
14:16 hoelzro_ii joined #perl6
14:18 azawawi do we need to do a panda update && panda install Dep1 Dep2 in travis CI builds?
14:19 khw joined #perl6
14:20 lucasb joined #perl6
14:22 muraiki joined #perl6
14:23 xinming joined #perl6
14:23 psch joined #perl6
14:26 azawawi tony-o++ # thx
14:28 snmirre joined #perl6
14:34 hoelzro good morning, #perl6!
14:35 geekosaur joined #perl6
14:36 RabidGravy good something or other
14:36 jnthn o/ hoelzro
14:37 RabidGravy (anomalously I have been awake for 10.5 hours already, so I'm confused)
14:38 lucasb m: fail; say 'so quiet'
14:38 camelia rakudo-moar 56ae33: ( no output )
14:38 lucasb star: fail; say 'so quiet'
14:38 camelia star-m 2015.03: OUTPUT«Unhandled exception: ␤   at <unknown>:1  (/home/camelia/rakudo-star-2015.03/​install/languages/perl6/runtime/COR​E.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:15777  (/home/camelia/rakudo-star-2015.03/ins​tall/languages/perl6/runtime/CORE.se…»
14:38 hoelzro o/ jnthn
14:39 jkva joined #perl6
14:40 lucasb When does rakudo star gets updated in camelia/hack?
14:42 FROGGS $ perl6 -e 'say do { &?BLOCK.leave: 42, 3 }; say "alive"'
14:42 FROGGS ListIter.new
14:42 FROGGS alive
14:42 FROGGS \o/
14:42 FROGGS (that's a start)
14:44 FROGGS $ perl6 -e 'say my @ = do { &?BLOCK.leave: 42, 3 }; say "alive"'
14:44 FROGGS 42 3
14:44 FROGGS alive
14:46 Woodi FROGGS: you mean something like "encapapsulated" iterator ?
14:46 Woodi *letters...
14:46 nine Is there a way to run a role's code at object creation without interfering with the consuming class' BUILD?
14:47 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)
14:48 nine jnthn: not even some ugly workaround?
14:48 Woodi FROGGS: by I wonder what it is planned to do... example show creation...
14:48 tony-o JimmyZ: give it a shot and if you have any problems then let us know
14:49 skids nine: use attribute default value initialization
14:49 * skids digs for his ugly hack example.
14:50 FROGGS Woodi: http://design.perl6.org/S0​6.html#The_leave_function
14:50 nine jnthn: that's not even _that_ ugly :) Since I'm actually only initializing an attribute
14:51 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:52 nine jnthn: we'll it is a little more complex. But I may find a way on my own
14:55 nine I just hope that I'll get to hack a bit more on it on my way to the Rob Zombie concert
14:56 JimmyZ tony-o: It would be nice remove '.pl6' from /bin/zef.pl6 :P
14:58 JimmyZ PATH=$PATH:../MoarVM/install/bin ./bin/zef.pl6 install CSV::Parser
14:58 JimmyZ Use of Nil in string context  in sub gethome at /home/cloud/OpenSource/per​l6-zef/lib/Zef/Utils.pm:55
15:00 JimmyZ yeah, https://github.com/tony-o/perl6-zef/issues/1  the first issue
15:01 tony-o use the one from ugexe
15:01 skids nine: https://github.com/skids/perl6sum​/blob/master/lib/Sum/SHA.pm6#L97 # That's how I worked around it
15:01 tony-o mine is over 2 years old, sorry for the confusion - i need to delete that repo
15:01 tony-o a year *
15:02 JimmyZ o
15:02 JimmyZ no notice there :(
15:05 FROGGS[mobile] joined #perl6
15:05 virtualsue joined #perl6
15:07 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:08 tony-o JimmyZ: sorry man, updated the readme with a link to ugexe's and commented on the issue
15:09 skids nine: hmmm... and the attribute init happens before the constructor, right?
15:09 skids Or... no after.
15:11 nine But maybe I can simply wrap new instead of BUILD
15:16 JimmyZ zef looks good
15:42 ab5tract_ nine: going to Rob Zombie? cool :)
15:49 estrabd joined #perl6
15:50 telex joined #perl6
15:52 ingy what object/namespace contains functions like &say ?
15:53 ingy also what's a good doc to explain the overall scoping layout in p6?
15:56 jnthn ingy: They're in the SETTING, which is the outer lexical scope of your program.
15:57 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)␤»
15:57 nine ab5tract_: yeah, playing in Vienna tonight :)
15:58 nine Wrapping new makes it easy timing wise, but of course now I don't have a living object to initialize ;)
15:59 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 ChoHag 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
16:01 jnthn self.A::foo() should work
16:01 ChoHag A's foo is also inaccessible from class C does A
16:01 ingy jnthn: thanks. what's the doc that describes how a function (like `say`) is looked up when called?
16:02 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␤␤»
16:02 ingy ie the scope chaining for things
16:02 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
16:02 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…»
16:02 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
16:02 camelia rakudo-moar 56ae33: OUTPUT«C␤B␤A␤»
16:03 ShimmerFairy joined #perl6
16:04 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?
16:05 ab5tract_ should be able to find it by searching design.perl6.org for 'lexotic'
16:05 jnthn ChoHag: That looks like a bug.
16:05 ingy ok
16:05 ab5tract_ http://design.perl6.org/S04.html
16:05 jnthn ingy: It's just normal lexical lookup
16:06 ChoHag Oh good.
16:07 ChoHag Well not good per se.
16:08 hoelzro while look at talks for the Swiss Perl workshop, /me came across "Der Perlkoenig"
16:08 hoelzro this I have to see =)
16:09 ChoHag When's Rakudo 2015.08 due?
16:09 ChoHag (and .09, etc.)
16:09 ingy So SETTING contains all the keyword/bare-functions?
16:10 ingy Is there any scope between SETTING and my current lexical scope?
16:10 diana_olhovik joined #perl6
16:10 jnthn ingy: Should only be those you've introduced in your program
16:10 ingy like the scope in the REPL for instance
16:12 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:14 ab5tract_ nine++
16:14 zostay is there a way to say something like: my $c = 'abc'; my $r = rx/<[$c]>/; ?
16:15 renormalist p6: say 3;
16:15 camelia rakudo-moar 56ae33: OUTPUT«3␤»
16:15 tony-o m: my $c = 'abc'; say "hello abc" ~~ /"$c"/;
16:15 camelia rakudo-moar 56ae33: OUTPUT«「abc」␤»
16:16 jnthn I think zostay wanted it to work charclass like?
16:16 ingy I'm having trouble finding the doc for SETTING
16:16 jnthn m: my @chars = 'abc'.comb; say "hello abc" ~~ /@chars/; # if so
16:16 camelia rakudo-moar 56ae33: OUTPUT«「a」␤»
16:16 zostay m: my $class = 'abc'; my $r = rx/<[$class]>/;
16:16 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 #perl6
16:17 tony-o m: my $c = 'abc'; my $r = rx/["$c"]/;
16:17 camelia rakudo-moar 56ae33: ( no output )
16:17 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
16:18 tony-o m: my $class = 'abc'; my $r = rx/["$class"]/;
16:18 camelia rakudo-moar 56ae33: ( no output )
16:18 zostay it is essentiall an EVAL, what i'm aiming for anyway, i guess
16:18 TimToady how fast do you want it?
16:19 TimToady I suppose we could allow a <+@chars> construct
16:20 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? https://github.com/clojure/clojure/blob/41​af6b24dd5be8bd62dc2b463bc53b55e18cd1e5/src​/jvm/clojure/lang/DynamicClassLoader.java
16:20 yoleaux ab5tract_: I'll pass your message to psch.
16:20 TimToady I assume the set of chars varies from time to time?
16:20 tony-o a <-@chars> would be amazing, i have all kinds of things hacked together trying to make that work
16:21 TimToady how often does it vary?
16:21 lucasb m: my $s = '<[abc]>'; say 'a' ~~ rx/<$s>/
16:21 camelia rakudo-moar 56ae33: OUTPUT«「a」␤»
16:22 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.
16:22 tony-o my uses were up to the end user, so it was most likely a set and forget
16:22 TimToady lucasb: that's basically an assertion-level EVAL
16:22 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"
16:23 TimToady for a set-and-forget, EVAL is proably fine, as long as you just save the eval'd rx
16:23 TimToady unless you have security worries with the input
16:23 ab5tract_ jnthn: or maybe you know how the current LibraryLoader implementation took its current form
16:24 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:25 zostay this is a first implementation, so i'm only interest in acceptable speed, not optimization, so /@chars/ is fine for now
16:26 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 moritz ingy: for example .mbc, so that MoarVM can run it
16:27 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 #perl6
16:28 jnthn ab5tract_: Not really; others++ did pretty much all the work on Java interop
16:29 jdv79 ingy: maybe this is what you were looking for earlier - http://design.perl6.org/S02.html#Pseudo-packages
16:29 moritz ingy: https://github.com/MoarVM/MoarVM/b​lob/master/docs/bytecode.markdown
16:30 ingy moritz++ # thanks
16:30 mr-foobar joined #perl6
16:31 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:32 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:33 dalek Inline-Perl5: 29f2bea | (Stefan Seifert)++ | / (3 files):
16:33 dalek Inline-Perl5: No longer interfere with BUILD methods of P6 subclasses of P5 classes
16:33 dalek Inline-Perl5:
16:33 dalek Inline-Perl5: Since rakudo not yet runs BUILD methods of roles and their consumers,
16:33 dalek Inline-Perl5: use a replacement 'new' method to initialize the underlying Perl 5
16:33 dalek Inline-Perl5: object before running the Perl 6 class' BUILD method.
16:33 dalek Inline-Perl5: review: https://github.com/niner/Inl​ine-Perl5/commit/29f2bea1fc
16:33 nine jnthn: got it :) ^^^
16:33 Begi joined #perl6
16:34 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 # ?
16:40 moritz ingy: yes, should work
16:41 * ingy builds the latest star
16:43 moritz ingy: though in rakudo it's actually NQP that generates .mbc files
16:52 ssqq joined #perl6
16:56 captain-adequate joined #perl6
16:58 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:59 TimToady make them play Perl 6
17:00 moritz or play Mario with them :-)
17:00 ChoHag Well it might get rid of them I suppose.
17:00 ChoHag moritz: That's the problem!
17:01 ChoHag Whenever I find the entrance to t
17:01 ChoHag Whenever I find the entrance to The Zone: "You play!"
17:01 ChoHag I don't even get to get *in* the zone.
17:03 geekosaur t/spec/S32-io/IO-Socket-Async.rakudo.moar                   (Wstat: 65280 Tests: 5 Failed: 0)
17:04 ChoHag Are the files in gen and src/gen, as their name implies, generated during make from (the rest of) src?
17:06 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 awwaiid joined #perl6
17:07 nine Nice! I just extended a DBIx::Class Result class with Perl 6 using Inline::Perl6 and v6-inline :)
17:09 FROGGS[mobile] ugexe: yes, that can very well happen currently
17:10 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:16 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:17 skids .oO(make them out of soap?)
17:17 RabidGravy :)
17:21 ShimmerFairy joined #perl6
17:25 silug_ joined #perl6
17:26 RabidGravy I don't know what they make them out of now but I have to clean this MPK60 every week
17:29 ChoHag Keyboards get cleaned?
17:33 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.
17:33 ChoHag I didn't smoke it, mind.
17:34 RabidGravy :)
17:35 ChoHag Incidentally, finding illegal things in a country where you don't speak the language is incredibly difficult.
17:35 RabidGravy :-O
17:36 RabidGravy anyway reboot time (there's only so many kernel updates you can ignore.)
17:36 ChoHag Eugh. Another thing I don't want to think about.
17:36 ChoHag I customised my boot process too much and kernel upgrades are a PITA.
17:40 RabidGravy joined #perl6
17:42 dalek rakudo/nom: 5d9306d | TimToady++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
17:42 dalek rakudo/nom: tweak :D/:U errors to avoid a/an problems
17:42 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5d9306da2e
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:43 ChoHag It's not even particularly difficult, at that.
17:44 ChoHag 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 ChoHag But now even your kernel is running code which hasn't been tested from a cold start.
17:44 skids m: say -> $a { } # b2gills -- fixed now, thanks for noticing that.
17:44 camelia rakudo-moar 56ae33: OUTPUT«-> $a { #`(Block|62246960) ... }␤»
17:45 RabidGravy yeah this laptop goes months without getting rebooted sometimes, so it's kinder really
17:47 ChoHag m: role A { }; role B does A { }; B.new.^roles.say
17:47 camelia rakudo-moar 56ae33: OUTPUT«(B)␤»
17:47 ChoHag m: role A { }; class B does A { }; B.new.^roles.say
17:47 camelia rakudo-moar 56ae33: OUTPUT«(A)␤»
17:47 ChoHag m: role A { }; role B does A { }; class C does B { }; C.new.^roles.say
17:47 camelia rakudo-moar 56ae33: OUTPUT«(B)␤»
17:47 ChoHag m: role A { }; role B { }; class C does B does A { }; C.new.^roles.say
17:47 camelia rakudo-moar 56ae33: OUTPUT«(A) (B)␤»
17:48 ChoHag The methods in A are accessible regardless.
17:48 ChoHag Is that all how it should look?
17:48 ChoHag I feel like the first one at least is wrong.
17:49 skids I think the first one is wrong, too.
17:50 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:53 skids One could argue the third example should be "(A) (B)" or "(B::A) (B)" perhaps.  But it's debatable.
17:54 skids Depends how much mro ends up mattering in roles, which is a but up in the air.
17:54 skids *bit
17:54 skids heh.
17:55 RabidGravy joined #perl6
17:56 RabidGravy well that didn't go as well as I would have liked
17:56 ShimmerFairy joined #perl6
17:58 [Coke] I think the first is fine.
17:58 [Coke] ... er, they are not numbered, one sec.
17:58 [Coke] when you instantiate a role, you get a class that does that role, yes? so that seems legit.
17:59 [Coke] 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]/, '');
17:59 camelia rakudo-moar 56ae33: OUTPUT«сюда́␤»
17:59 skids Why report anything at all then?
17:59 [Coke] hoelzro: I don't think that can work on NFG strings.
17:59 hoelzro is there something I'm missing here?  Shouldn't the acute accent get stripped?
17:59 hoelzro =(
18:00 hoelzro I'm guessing something is mad that the combining character follows nothing
18:00 TimToady .u а́
18:00 yoleaux U+0301 COMBINING ACUTE ACCENT [Mn] (◌́)
18:00 yoleaux U+0430 CYRILLIC SMALL LETTER A [Ll] (а)
18:00 skids [Coke]: I mean for the first one.  Why have a ParmatericRoleHOW.roles if it just always reports itself and nothing else.
18:00 [Coke] m: my $s = 'сюда́'; say $s.NFC.subst(/\c[COMBINING ACUTE ACCENT]/,'');
18:00 camelia rakudo-moar 56ae33: OUTPUT«Method 'subst' not found for invocant of class 'NFC'␤  in block <unit> at /tmp/yvtslG0ZzH:1␤␤»
18:01 TimToady wel, you'd have to use NFD to separate them
18:01 * [Coke] shrugs his shoulders.
18:02 TimToady but we ought allow regexes on Uni types, I suspect
18:02 Hor|zon joined #perl6
18:02 hoelzro what would be the recommended way to strip out that combining accent character?
18:03 hoelzro both currently working and ideal but NYI =)
18:03 ChoHag Does unicode define a difference between a combining accent character and an accent character?
18:03 xinming joined #perl6
18:04 ChoHag Because if so, surely an uncombined combining accent character is invalid in some way, shape or form?
18:05 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)␤»
18:05 hoelzro I *could* $s.NFD.list.grep(* != 0x301), but then I don't know how I would make a Str from that
18:05 hoelzro ChoHag: afaik, there are only the combining accent characters and the pre composed characters with accents on them
18:06 hoelzro ok, got it:  Uni.new($s.NFD.list.grep(* != 0x301)).Str
18:06 * hoelzro .oO( what a mouthful )
18:08 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␤»
18:08 TimToady m: my $s = 'сюда́'; say $s.NFD.list.grep({ .uniname !~~ /^COMBINING/}).chrs  # more generally
18:08 camelia rakudo-moar 56ae33: OUTPUT«сюда␤»
18:08 araujo joined #perl6
18:08 hoelzro ah, neat
18:08 kaare_ joined #perl6
18:08 RabidGravy joined #perl6
18:09 TimToady but you probably want the proper uniprop, really
18:09 hoelzro I only need to worry about COMBINING ACUTE ACCENT at the moment
18:10 hoelzro thanks TimToady!
18:11 moritz .oO( you cannot write "COMBINING ACUTE ACCENT" without writing "CUTE" :-) )
18:11 * hoelzro .oO( it is a cute accent! )
18:14 ChoHag So does cyrillic even *have* cute accents?
18:14 ShimmerFairy joined #perl6
18:14 hoelzro not really; it's just often used to indicate where the stress falls on the word
18:14 hoelzro for people who are learning, like me
18:15 hoelzro hmm...are there other languages that use Cyrillic that *do* have predictable stress?
18:15 geekosaur depends on how you feel about й
18:15 hoelzro geekosaur: good point
18:15 ChoHag In Ukrainian that's a distinct letter from и.
18:15 ingy how do I get readline support in my new star build's repl?
18:16 hoelzro ingy: panda install Linenoise
18:16 ingy hoelzro: ta!
18:16 ChoHag And curiously on the opposite end of the keyboard.
18:16 Peter_R joined #perl6
18:16 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!
18:17 ChoHag Although I'm not sure I've seen a й without a и.
18:17 ingy +1
18:17 hoelzro ingy: no luck, or just didn't add readline support to the REPL?
18:17 hoelzro ChoHag: in ukrainian?
18:18 ChoHag Так.
18:18 ingy hoelzro: worked perfectly. +1 on your off-the-bat
18:18 hoelzro I don't see why the REPL couldn't also try to use Readline if it's available
18:18 domidumont joined #perl6
18:18 ingy hoelzro: yeah, evidently it does not
18:19 ingy in 2015.07.2
18:19 * hoelzro should revisit the REPL readliney stuff
18:19 ChoHag Because Stallman considers readline his crowning glory and guards its license like Gollum guards rings.
18:19 hoelzro add Readline support, and better tab completion options
18:19 hoelzro the tab completion right now is really overly simplistic
18:19 ingy hoelzro: can you tell me how to introspect SETTING?
18:20 ingy the W* methods are not helping me much
18:20 DrForr You have my attention :)
18:20 hoelzro m: .say for SETTING::.keys
18:20 camelia rakudo-moar 56ae33: OUTPUT«&pipe␤&symlink␤RESTRICTED-CLASS␤$=pod​␤$!␤$_␤EXPORT␤&rmdir␤&MAKE-DIR␤&SYMLINK-PATH​␤&UNLINK-PATH␤!UNIT_MARKER␤&chmod␤&CHANGE-DI​RECTORY␤PIO␤GLOBALish␤::?PACKAGE␤&link␤&rena​me␤&COPY-FILE␤NativeCall␤Proc␤@?INC␤$=fin…»
18:20 hoelzro ingy: ^ that should start you off =)
18:20 ingy hoelzro: many thanks
18:21 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:24 DrForr Gr. *off, *but
18:24 RabidGravy uints work now, there's no excuse
18:26 ingy fwiw, I started working on my Lola again while installing rakudo. Hopefully later today we can: (git clone git@github.com:ingydotnet/lola; . $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:28 ingy bbl
18:31 ab5tract_ hoelzro: fwiw, JVM readline-iness is non-existent in star 2015-07
18:31 ab5tract_ also: hey there, buddy :)
18:35 dwarring joined #perl6
18:41 RabidGravy joined #perl6
18:44 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␤␤»
18:48 hoelzro ab5tract_: howdy!
18:48 moritz "a type object of type object"?
18:48 moritz :-)
18:48 hoelzro yeah, for whatever reason, Linenoise doesn't work with the JVM =/
18:48 moritz I object!
18:48 lucasb I was just playing with the error message :)
18:55 RabidGravy joined #perl6
18:59 pmurias joined #perl6
19:00 [Coke] moritz: is that how you role?
19:05 moritz [Coke]: except when I role with class
19:11 [Coke] Whatever. it's not my bag, though.
19:13 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'?␤␤»
19:13 AlexDaniel umm, how can I pass a newline to camelia?
19:14 moritz AlexDaniel: with ␤
19:16 AlexDaniel m: say 1;␤say 2
19:16 camelia rakudo-moar 5d9306: OUTPUT«1␤2␤»
19:16 AlexDaniel ok
19:17 AlexDaniel 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:␤       …»
19:17 AlexDaniel so it treats all of these newlines as a part of the pre prefix
19:17 RabidGravy joined #perl6
19:17 AlexDaniel why?
19:18 AlexDaniel and not only newlines
19:18 AlexDaniel m: -␤␤# What the␤␤␤␤####
19:18 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␤»
19:20 AlexDaniel also “expecting any of: prefix”
19:21 pmurias anybody planning to share a room at yapc::eu?
19:21 AlexDaniel what would that mean.. two prefixes in a row?
19:21 moritz AlexDaniel: sure
19:21 moritz m: say -+2
19:21 camelia rakudo-moar 5d9306: OUTPUT«-2␤»
19:22 vendethiel joined #perl6
19:22 AlexDaniel moritz: it says “Prefix X requires an argument, but no valid term found”, then “expecting any of: prefix”
19:22 AlexDaniel moritz: to me this does not really make any sense
19:22 AlexDaniel it should make up its mind, whether it wants a term or a prefix, I think...
19:22 moritz AlexDaniel: yes, the "expecting any of" is a bit of a heuristic
19:23 moritz AlexDaniel: but wherever a term is expected, another prefix plus a term work too
19:23 oetiker joined #perl6
19:23 moritz it might be confusing, but it's still correct
19:23 AlexDaniel in other words LTA
19:23 moritz one could argue it should list "term" as one of the expected things
19:24 RabidGravy joined #perl6
19:24 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
19:24 AlexDaniel moritz: yeah, but do you agree that it should not be part of the error?
19:25 moritz AlexDaniel: I don't agree
19:25 AlexDaniel -␤␤# What the␤␤␤␤#### is not a prefix, right? :)
19:26 moritz it is, in the sense that it's valid text to come before a term
19:27 llfourn joined #perl6
19:28 AlexDani` joined #perl6
19:38 ChoHag G
19:39 ChoHag It seems I'm destined to try and do things with perl 6 which aren't possible yet.
19:40 ChoHag 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:45 FROGGS joined #perl6
19:46 ChoHag So can y'all hurry up and finish this thing?
19:47 nine ChoHag: we'd be faster with your help ;)
19:47 pierrot joined #perl6
19:48 pmurias roles are implemented aren't they?
19:48 raiph joined #perl6
19:49 Hor|zon joined #perl6
19:49 FROGGS ohh, they are pretty much implemented :o)
19:49 nine pmurias: I sure hope so. Considering how often I use them :)
19:49 jnthn Given I wrote several of them today, it sure seems like. ;) Implemented != 100% free of bugs.
19:50 * ChoHag is butting heads with the bugs.
19:50 ChoHag I had a look at rakudo to see if I could have a bash at bashing them.
19:51 ChoHag I didn't get very far.
19:52 geekosaur finding bugs helps get them fixed :)
19:52 AlexDani` s/finding/reporting
19:52 ChoHag See above.
19:53 AlexDaniel ChoHag: what do you mean by “See above”?
19:53 AlexDaniel maybe I missed something
19:53 ChoHag I found a bug or bug-like behaviouc.
19:53 ChoHag Reported/demonstrated it here.
19:54 AlexDaniel ChoHag: that's really good, actually
19:54 AlexDaniel ChoHag: but it would be much better if you wrote an email to rakudobug@perl.org
19:55 AlexDaniel ChoHag: feel free to attach IRC discussion to it
19:55 AlexDaniel ChoHag: one way to do that is to use this link: http://irclog.perlgeek.de/perl6/2015-07-31
19:55 santyno joined #perl6
19:55 AlexDaniel ChoHag: click on the timestamp to get a link to some message
19:56 AlexDaniel like this http://irclog.perlgeek.de/p​erl6/2015-07-31#i_10986035
19:56 AlexDaniel ChoHag: once you submit your email you'll find your bug report here: https://rt.perl.org/Public/
19:58 AlexDaniel 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.
19:58 ChoHag I was distracted.
19:58 AlexDaniel it's ok, maybe somebody else will find it useful :)
19:59 ChoHag Also I'm not sure if I actually have an email address which works.
19:59 ChoHag I grew tired of them.
19:59 AlexDaniel wow
20:00 jkva joined #perl6
20:01 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
20:01 ChoHag Raising chickens and crops instead.
20:01 ChoHag And perl code.
20:01 AlexDaniel this, right? http://irclog.perlgeek.de/p​erl6/2015-07-31#i_10985350
20:02 ChoHag That's the one.
20:02 ugexe you can use a throw away email http://mailinator.com
20:02 ugexe to register i meant
20:05 ChoHag So yet another site I'm a member of with yet another password?
20:05 ChoHag Yay!
20:06 ChoHag 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 ChoHag In the meantime I'm enjoying not fixing computers for idiots who don't pay me to warm their chairs.
20:07 ChoHag s/don't//
20:08 ChoHag <-- happily burnt-out sysadmin.
20:08 ab5tract_ to #perl6, with love - https://github.com/ab5tract/p6-playgro​und/blob/master/Temp-Fix/lol-prefix.p6
20:08 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
20:09 AlexDaniel ChoHag: https://rt.perl.org/Public/​Bug/Display.html?id=125731
20:09 ChoHag Thanks.
20:09 AlexDaniel the title might be wrong a bit, but I couldn't come up with something better
20:10 timotimo o/
20:10 AlexDaniel \o
20:13 diana_olhovik_ joined #perl6
20:13 TEttinger joined #perl6
20:14 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:15 timotimo not even with self.A::foo syntax?
20:15 ChoHag Nope.
20:16 ChoHag One sec...
20:17 timotimo damn
20:17 ChoHag No concretization found for A
20:17 timotimo hm, does A have parameters?
20:18 ChoHag None.
20:18 timotimo huh, that's weird
20:18 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
20:18 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␤␤»
20:18 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
20:18 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…»
20:20 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␤»
20:21 ChoHag Yeah that works.
20:21 ChoHag But so does C.bar if A contains a method bar.
20:23 timotimo ah "role B does A", that's interesting of course
20:24 AlexDaniel Hm, should I report this as well?
20:24 ChoHag Same bug I think.
20:25 ChoHag 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
20:25 timotimo m: role A { method foo { say "A" } }; role B does A { method foo { say "B"; self.A::foo } }; class C
20:25 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␤»
20:25 timotimo oops
20:25 timotimo 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
20:25 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…»
20:25 timotimo hmm
20:26 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
20:26 timotimo also, you can apply roles to instances of any class you have
20:27 ChoHag And a superclass/interface can't?
20:27 AlexDaniel timotimo: much like an interface in other languages, right?
20:27 ChoHag Implementiation detail IMO
20:27 llfourn joined #perl6
20:27 timotimo yes, interface
20:28 timotimo ChoHag: no, i don't think it can
20:28 timotimo and a role can have parameters, but a class can't
20:28 ChoHag Again that seems arbitrary to me.
20:30 * timotimo shrugs
20:31 raiph joined #perl6
20:31 ChoHag I think that sort of idea upsets the purists though.
20:32 tony-o is IO::Socket::Async being worked on?
20:37 esaym153 left #perl6
20:42 jnthn tony-o: I hunted/fixed quite a few instabilities with it in the last couple of months
20:42 jnthn tony-o: It'll likely get some more attention with upcoming Supply work
20:42 tony-o concurrency on http::server::async is looking strong with the refactoring: https://gist.github.com/to​ny-o/2b5840bd5bec4be6cbab
20:43 tony-o jnthn: awesome, i figured out i wasn't "await"ing for .writes to complete and was trying to .write after a .close
20:53 virtualsue joined #perl6
20:54 ShimmerFairy joined #perl6
20:54 smls ChoHag, timotimo: "a role can have parameters, but a class can't" does feel arbitrary.
20:55 smls ...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)?
20:55 timotimo well, a role can't be instantiated
20:56 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"
20:58 tony-o m: role a { has $.attr = 5; }; a.new.attr.say;
20:58 camelia rakudo-moar 5d9306: OUTPUT«5␤»
20:59 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?
20:59 timotimo i didn't say "instantiated"?
20:59 tony-o perhaps i misunderstood what you meant by punned and instantiated
20:59 tony-o ah
20:59 timotimo oh
21:00 timotimo i did actually say that
21:01 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 smls Feels a little weird, is all.
21:01 jnthn It won't be changing.
21:03 beastd joined #perl6
21:15 tony-o i like it for the interface purpose
21:50 Hor|zon joined #perl6
22:03 kaare_ joined #perl6
22:05 HoppingMadMan joined #perl6
22:18 jjido joined #perl6
22:19 leont joined #perl6
22:20 nine It would be sooo nice if Perl 5 had support for real named arguments
22:21 timotimo It won't be changing.
22:22 nine No, unfortunately not. Making it almost impossible to pass named parameters to Perl 6 methods
22:24 timotimo :S
22:25 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 skids joined #perl6
22:28 llfourn joined #perl6
22:30 timotimo argh
22:30 smls_ joined #perl6
22:31 nine Or maybe $some_p6object->do_something($pos1, $pos2, v6::named foo => 'bar', v6::named baz => 'qux');
22:32 jjido nine: the last one is not that bad.
22:35 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($$) { ... }?
22:36 TimToady yes, but that won't change the parser like ($) does
22:38 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.
22:39 skids 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');
22:40 leont Yeah, I was about to suggest what b2gills just said
22:41 nine b2gills: oh, of course!
22:41 nine 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:45 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:46 timotimo argh!
22:46 timotimo well, you can just pass positionals to &infix:<< => >>
22:48 timotimo does that help you?
22:49 timotimo nine: ^
22:49 timotimo before you implement that! quickly! look at my message! it'll possibly save you two minutes!
22:49 rjbs heh
22:49 nine Thanks. I added a pair method to my Perl6 callback. This can use => as is :)
22:50 timotimo okeh
22:51 nine And now I get a SEGV. Haven't seen one of those in quite a while
22:52 yqt joined #perl6
22:52 timotimo jnthn has been working so much on those internal problems
22:52 timotimo there's been great improvements
22:53 nine Oh I'm sure it's entirely my fault :)
23:06 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 telex joined #perl6
23:23 nine Good night #perl6 :)
23:25 vendethiel o/, nightfrog
23:25 vendethiel dammit. sorry nightfrog. I meant good night, nine.
23:26 cognominal joined #perl6
23:40 BenGoldberg joined #perl6
23:51 Hor|zon joined #perl6

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

Perl 6 | Reference Documentation | Rakudo