Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-07-27

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:21 timotimo a rakudo built with mast_localref_3 (which i just rebased onto latest nqp) spectests fine
00:21 timotimo i mean ... why wouldn't it
00:21 timotimo but i'm still checking to be sure
00:24 timotimo something's wrong ... "perl6" doesn't start any more .. ?!
00:25 timotimo perhaps i need to Configure.pl a few times again
00:27 timotimo indeed, that was it
00:31 dalek nqp: d125c71 | timotimo++ | / (2 files):
00:31 dalek nqp: initial implementation of localref X local access
00:31 dalek nqp:
00:31 dalek nqp: as well as three simple failing tests
00:31 dalek nqp: review: https://github.com/perl6/nqp/commit/d125c71ba2
00:31 Averna joined #perl6
00:31 timotimo poor dalek
00:32 dalek joined #perl6
00:45 cognominal joined #perl6
01:08 dalek rakudo/optimizer_lexicalref_lowering: cbe2eca | timotimo++ | src/Perl6/Optimizer.nqp:
01:08 dalek rakudo/optimizer_lexicalref_lowering: the first obvious changes towards lowering lexicalref
01:08 dalek rakudo/optimizer_lexicalref_lowering: review: https://github.com/rakudo/rakudo/commit/cbe2ecaf65
01:09 timotimo jnthn: ^- this branch currently gives me Stage mast       : Cannot take a reference to non-native local __lowered_lex_723
01:09 timotimo (the name of the local gets output in the exception via a local patch)
01:09 timotimo maybe you remember what obvious part i've missed that'd cause references to obj primspec'd locals be emitted
01:10 timotimo .o( and also: shouldn't we actually be able to handle obj registers be localref'd? )
01:10 timotimo i'll try to get some good rest now
01:11 rangerprice joined #perl6
01:19 ggoebel joined #perl6
01:19 rmgk_ joined #perl6
01:30 TEttinger joined #perl6
01:45 BenGoldberg_ joined #perl6
01:46 dalek joined #perl6
01:47 JimmyZ joined #perl6
01:47 avuserow joined #perl6
01:48 Mouq joined #perl6
01:48 Util joined #perl6
01:48 [Coke] joined #perl6
01:48 sergot joined #perl6
01:48 masak joined #perl6
01:48 PerlJam joined #perl6
01:48 pmichaud joined #perl6
01:48 psch joined #perl6
02:03 chenryn joined #perl6
02:08 chenryn joined #perl6
02:11 colomon joined #perl6
02:13 amurf joined #perl6
02:14 colomon_ joined #perl6
02:19 colomon_ joined #perl6
02:25 colomon_ joined #perl6
02:29 laouji joined #perl6
02:30 colomon_ joined #perl6
02:34 colomon_ joined #perl6
02:37 colomon joined #perl6
02:42 colomon joined #perl6
02:45 colomon_ joined #perl6
02:54 noganex joined #perl6
03:02 yeahnoob joined #perl6
03:27 cibs joined #perl6
03:30 census why did cognominal leave?
03:43 TEttinger census: cognominal has quit (Quit: This computer has gone to sleep)
03:48 atroxaper joined #perl6
03:52 laouji_ joined #perl6
03:54 dayangkun joined #perl6
04:10 schmooster joined #perl6
04:43 chenryn joined #perl6
04:59 sftp_ joined #perl6
05:07 sftp joined #perl6
05:16 atroxaper joined #perl6
05:33 laouji joined #perl6
05:40 cognominal joined #perl6
05:42 chenryn joined #perl6
05:43 atroxaper joined #perl6
05:43 laouji joined #perl6
05:48 diana_olhovik_ joined #perl6
06:01 atroxape_ joined #perl6
06:04 atroxaper joined #perl6
06:13 jkva joined #perl6
06:17 [Sno] joined #perl6
06:31 atroxaper joined #perl6
06:47 atroxaper joined #perl6
06:52 Woodi joined #perl6
06:53 FROGGS joined #perl6
06:53 FROGGS o/
06:55 nwc10 \o
06:56 zakharyas joined #perl6
07:02 rurban joined #perl6
07:04 kaare_ joined #perl6
07:08 darutoko joined #perl6
07:13 espadrine_ joined #perl6
07:14 Guest11116 morning, #perl6
07:17 FROGGS morning masak_grrr
07:17 FROGGS :o)
07:18 masak :)
07:18 masak apparently I missed the _grrr part this time.
07:19 jkva I think most of us are _grrr on mondays :)
07:19 nwc10 good Monday, #perl6 :-)
07:20 lizmat good *, #perl6!
07:20 lizmat FROGGS nwc10 masak jkva o/
07:20 telex joined #perl6
07:21 mr-foobar joined #perl6
07:24 atroxaper joined #perl6
07:26 xinming joined #perl6
07:29 atroxaper joined #perl6
07:31 lizmat PSA: it appears I'll be doing the P6W again tonight
07:32 masak ++lizmat
07:35 jkva lizmat: P6W?
07:35 lizmat Perl 6 Weekly: https://p6weekly.wordpress.com
07:36 jkva lizmat: Thanks
07:36 nwc10 lizmat: I thought that http://irclog.perlgeek.de/perl6/2015-07-23#i_10942545 was cool enough to get a P6W mention
07:36 [Tux] joined #perl6
07:36 lizmat yeah, that one was cute  :-)
07:37 masak :)
07:38 bjz joined #perl6
07:41 pdcawley joined #perl6
07:43 dalek rakudo/nom: 9ed640c | lizmat++ | src/core/ (2 files):
07:43 dalek rakudo/nom: Implement .Pos <-> .Int coercing
07:43 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/9ed640c043
07:43 lizmat b2gills: my experiences with branches in rakudo has not been the best
07:43 lizmat reverting multiple commits is easy
07:44 RabidGravy joined #perl6
07:44 lizmat re. using a hypothetical "ifdef" statement in stead of having Pos
07:44 lizmat so you could say something like:
07:44 lizmat ifdef "foo".index("f") -> $pos { }
07:45 lizmat is nice and useful in and of itself, but will not help ternaries
07:45 lizmat anyway, I'm holding off writing tests for Pos until we have reached consensus
07:46 lizmat meanwhile, this patch gives:
07:46 lizmat $ 6 'say ?0.Pos'
07:46 lizmat True
07:46 lizmat jnthn: regarding batching of method calls using >>.foo
07:47 lizmat I don't think we can do anything but .cue a job for each method call
07:47 lizmat as we can have no idea what that method call will do
07:47 lizmat for example, if you have a list of URL's that you want to scrape
07:47 lizmat @urls>>.scrape
07:48 lizmat each scrape could take several seconds\
07:48 lizmat you're using >>. for its parallelization
07:48 lizmat you don't expect them to be batched
07:50 lizmat perhaps we could have a method attribute "is batched(100)"
07:50 masak lizmat: "but will not help ternaries" -- that part was not clear to me. could you please clarify?
07:50 lizmat say "foo".index("f") ?? "found" !! "did not find"
07:52 masak my $found = "foo".index("f") != -1;
07:52 lizmat re "is batched": that would indicate how you would like to have that method batched in  >>. situations
07:52 masak say $found ?? "found" !! "did not find"
07:52 masak sometimes I think we're a little bit too eager to reduce those final keystrokes ;)
07:53 lizmat masak: that still doesn't solve the issue if $found is an Int and 0
07:53 masak it doesn't solve the semipredicate problem, no
07:53 lizmat m: say 0 ?? "found" !! "not found"
07:53 camelia rakudo-moar ed945e: OUTPUT«not found␤»
07:53 lizmat m: say 0.Pos ?? "found" !! "not found"
07:53 camelia rakudo-moar ed945e: OUTPUT«Method 'Pos' not found for invocant of class 'Int'␤  in block <unit> at /tmp/3T2ONNdPBM:1␤␤»
07:54 masak you have to make *some* value exceptional to mean "not found" -- unless you go all-out with option types
07:54 lizmat $ 6 'say 0.Pos ?? "found" !! "not found"'
07:54 lizmat found
07:54 masak that value for .index is -1
07:54 masak the API user is expected to know this
07:54 lizmat m: say "foo".index("bar")
07:54 camelia rakudo-moar ed945e: OUTPUT«(Pos)␤»
07:55 lizmat it's *not* -1
07:55 lizmat and hasn't been for a *long* time
07:55 lizmat it's undefined, either from being a Failure or from being a Type object
07:55 masak oh, right.
07:55 lizmat .index and .rindex actually differed in that, I harmonized that
07:57 azawawi joined #perl6
07:57 masak yeah, sorry about that. I'm being confused.
07:57 azawawi hi
07:57 azawawi master of confusion is here :)
07:58 masak lizmat: I agree with you that there's a risk of confusion, since 0 and undefined values are both falsly, and that can trip people up.
07:58 masak lizmat: I'm not too sold on the solution of overloading ints with bools.
07:58 masak lizmat: partly because we've been down that road design-wise before with other things, and it hasn't worked out so well
07:59 lizmat such as ?
07:59 lizmat was that from the time that "0" was still true ?
07:59 masak no.
07:59 masak it was return values from processes, the prototypical example of `0 but True`
08:00 ShimmerFairy masak: Well, ideally Pos can be used for strings too (the idea was that StrPos could be useful to more than just strings)
08:00 masak it ended up with TimToady saying "I never spec'd that" :)
08:00 mrf joined #perl6
08:00 masak ShimmerFairy: I'm wary of premature generality, too.
08:01 lizmat masak: well, it's not mixing in any roles into instances, it is minimally subclassing Int
08:01 masak ("let's abstract into positions of all the things!")
08:01 dakkar joined #perl6
08:01 ShimmerFairy I'll have to look at the GLR draft again and see what Pos can help in there.
08:02 masak solution looking for a problem.
08:02 dakkar joined #perl6
08:02 lizmat masak: the reason I did this, was a discussion on #perl6 last week
08:02 lizmat it is *not* a solution looking for a problem
08:03 masak lizmat: sorry, was unclear.
08:03 masak ShimmerFairy leafing through GLR in order to motivate it being a general positions-of-things solution, that's a solution looking for a problem.
08:03 ShimmerFairy masak: And the problem with finding more uses for something is...?
08:04 Fleurety joined #perl6
08:04 lizmat masak: "let's not think outside the box, please" ?
08:04 masak lizmat: my primary worry is still that the cure (overloading ints with bools) will be perceived as a bigger wart than the problem it solves (semipredicate problem for .index)
08:04 masak lizmat: I'm all for innovative thinking. I just want to end up with solutions that don't come back and bite us.
08:05 masak lizmat: it *is* confusing to have a 0 that boolifies to True.
08:05 masak that's what we learned from the return codes thing.
08:05 azawawi 0 => True... what ?
08:05 lizmat azawawi: 0.Pos => True
08:05 masak ShimmerFairy: the problem with finding more uses for something is you've already *decided* that this solution needs to be general enough to support more uses, before you've seen those other uses.
08:06 masak ShimmerFairy: that's what "premature generalization" means.
08:06 ShimmerFairy masak: How else shall I see other uses if not with the hope that I can generalize something? :)
08:07 ShimmerFairy I disagree with the notion that "solution looking for a problem" is _always_ a bad way to figure things out.
08:07 masak ShimmerFairy: that's usually not how you arrive at a solid design. you're supposed to notice a number of uses that can be unified, and *then* generalize. doing it the other way triggers warning bells.
08:08 * lizmat needs to be afk for a few hours, will backlog later
08:08 masak lizmat: \o
08:09 ShimmerFairy masak: IIRC I initially agreed with the suggestion to reintroduce StrPos by saying it could even be useful for lists and such.
08:10 * azawawi confused
08:11 masak ShimmerFairy: granted, .first-index and such have the same semipredicate problem.
08:12 masak (but that's still assuming that the proposed Pos solution is something we should adopt)
08:12 masak I think another part of my worry is that Pos intentionally mixes up two concepts: boolean truth, and definedness.
08:12 masak all in the name of trying to make it easier for the user.
08:13 masak in my experience, it's easier when those concepts are not mixed up.
08:13 Hor|zon joined #perl6
08:19 ShimmerFairy masak: One difference between return types and this, is that this is a separate type (and not just a "0 but Bool" being returned). I think you'd be expected to know  Pos.new(0) == True  in the same way you'd be expected to know index() returns Int:U in its Pos-less version.
08:20 masak well, neither the old nor the new solution is hard to use if you know what you're expected to know. :P
08:20 masak so the only interesting cases to discuss are the failure modes that happen when the user does not have full knowledge of the API
08:21 masak and in that case, an *undefined* value will warn and make noise in various ways
08:21 masak a truthy 0.Pos will just silently be accepted everywhere
08:23 ShimmerFairy masak: Now knowing what "semipredicate problem" means, that's something I try to avoid all the time (and I hate whenever it has to happen). Haskell's "Maybe" type comes to mind as a possible, if unlikely by now, solution to that issue :)
08:23 masak yes, that's why I mentioned option types above
08:24 ShimmerFairy I must have missed that.
08:26 masak the semipredicate problem runs deep. any language that has IEEE 754 floating-point values also has NaN, which gets in *everywhere*.
08:26 ShimmerFairy I imagine something like    if "foo".index(bar) -> $a { my Int $idx = $a.just; ... }    potentially
08:27 masak maybe try it out in a fork of rakudo
08:27 ShimmerFairy Maybe I will :)
08:27 * vendethiel thinks this is the wrong solution to the wrong problem
08:27 nwc10 masak: sorry for being slow/unable to read scrollback, but why does NaN end up as causing semipredicate problems? (I'm aware that NaN != NaN etc, and it's pretty much like NULL in SQL, rather than Perl's undef)
08:28 ShimmerFairy (Wouldn't be the first time we were inspired by Haskell :P)
08:28 vendethiel The solution should be 1-indexing, that's obvious *g*
08:28 masak nwc10: NaN is not on the real number line. it's a floating-point value with the semantics "I am not a floating-point value".
08:28 nwc10 masak: aha yes. That's a lovely way to look at it.
08:29 masak it's undefined, but for floats
08:29 nwc10 it's not even on the complex plane.
08:29 nwc10 (which is the image in my head when you say "real number line")
08:29 * vendethiel doesn't know why NaN exists
08:29 masak you won't find it among the hypercomplex numbers, either
08:29 masak nwc10: also, NaN + NaN\i is a lovely thing to ponder.
08:29 masak nwc10: it's undefined in two dimensions!
08:30 atroxaper joined #perl6
08:30 masak vendethiel: IEEE 754 is full of sensible compromises. I'd rage against NaN too, but we live in the real world, which often (rightly) prefers "practical" to "pure".
08:31 * vendethiel is tired of hearing that line as well :)
08:31 vendethiel especially about something designed in '85
08:31 masak sorry :/
08:31 masak what's wrong with '85?
08:31 masak I do think we did a good thing standardizing on floats in that way.
08:31 vendethiel pretty much everything we did (programming-wise) then has changed. Or at least, it certainly looks like it from my point of view.
08:32 masak I don't think all that many people need floats these days, however.
08:32 vendethiel *40 years ago*. If we go the other way, that's 1945, and "programming" is ...
08:32 masak I'm not sure what kind of fallacy that is. "if we go twice as far back..."
08:32 masak :)
08:32 vendethiel '85 is closer to cobol's birth than to us.
08:32 vendethiel whoops, I meant 30, not 40. anyway, not twice
08:32 masak vendethiel: I'd much much rather have IEEE 754 than no standards for floats (and most of the designed by amateurs)
08:33 vendethiel I'm just taking '85 and going backward instead of forward
08:33 oha perhaps the point is that NaN makes sense in some scopes, but in a higher level language it is more easy to handle exceptions?
08:33 ShimmerFairy I don't see anything wrong with NaN, but then again I'm not the world expert on floating point :)
08:33 masak er, "lots of standards", I mean.
08:33 masak ShimmerFairy: you said you tried to avoid the semipredicate problem at all times. ShimmerFairy, meet NaN.
08:33 oha or actually, failures
08:33 inokenty joined #perl6
08:34 RabidGravy in 1985 I only knew COBOL, BASIC and some Assembly language
08:34 masak NaN's purpose is to propagate up your calculations, blanking them all out as it goes.
08:34 RabidGravy oh and Logo
08:34 ShimmerFairy masak: It's more for when I'm designing something, I really like making sure the failure value can't be a valid value too.
08:36 masak ShimmerFairy: there are many situations where one has to express the idea of (a) "there is no value here", or (b) "I don't know this value".
08:36 g4 joined #perl6
08:38 masak Ovid has some nice blog posts about how NULL can mess up your SQL logic, because boolean logic invisibly turns into three-value logic.
08:38 masak and he's right. but there is often a real, practical need for NULL in some columns too.
08:39 masak why? because the world refuses to be as neat and filled with perfect knowledge as we would like.
08:40 DrForr Multivalue screws up the underlying Coad-Yourdon model.
08:40 daxim joined #perl6
08:41 jkva DrForr: Never seen that before, thanks
08:41 masak DrForr: I didn't know what "Coad-Yourdon model" was, so I looked it up. looks vaguely UML-y.
08:41 DrForr I might have the name wrong actually.
08:41 DrForr It's the mathematical underpinnings to SQL.
08:41 DrForr And I think actually 'multiset' is the problem I was looking for.
08:42 masak you're not thinking of Edgar F. Codd, are you?
08:42 DrForr Codd, yes, thanks.
08:42 masak his paper set off the SQL thing.
08:42 masak http://www.seas.upenn.edu/~zives/03f/cis550/codd.pdf
08:42 DrForr One damn character.
08:42 jkva Huh, I ended up at https://conceptdraw.com/a2283c3/preview
08:42 masak DrForr: I seem to recall you're right. Codd never liked NULL at all.
08:43 masak DrForr: but the *industry* did, and even though that's not all that great perhaps, I would say it's significant.
08:43 DrForr And of course it made it practical rather than a pure model.
08:44 masak aye.
08:44 masak I would say though that SQL has still benefited from being based on a mathematical model as opposed to, say, OOP.
08:45 DrForr Oh, I wouldn't question that.
08:52 yakudza joined #perl6
08:52 RabidGravy you can always tell which database engine someone firsted learned SQL on by whether they always tend to do "foo is not null and foo = bar" or not
08:55 amurf joined #perl6
08:55 masak unless there are only two database engines, I'm not sure you can :P
08:55 nwc10 country *and* western? :-)
08:56 masak https://www.youtube.com/watch?v=YSTJ5Xe-E8c
08:58 abraxxa joined #perl6
08:59 RabidGravy There are only two
08:59 RabidGravy Oracle and Informix
09:00 araujo joined #perl6
09:04 bjz joined #perl6
09:09 RabidGravy there's a comment in IO::Handle that the $whence argument should be an Enum, is there any reason why that hasn't been done?
09:13 masak m: say Pair ~~ Enum # note that the type "Enum" may not be what you think it is
09:13 camelia rakudo-moar 9ed640: OUTPUT«True␤»
09:14 RabidGravy oh it is
09:15 RabidGravy unfortunate mis-capitalization
09:15 espadrine_ joined #perl6
09:16 masak if I remember my S12 correctly, it encourages people to call the whole thing an "enumeration", and its individual constituent parts "enums" or "enum values".
09:16 masak this despite the fact that the *keyword* for the whole thing is just `enum`.
09:17 masak a little similar to the fact that the name of the thing you create in Perl 6 using the keyword `given` can be referred to as a "switch statement".
09:19 RabidGravy (just documenting seek() and tell() - I'll leave the other bit to later)
09:19 azawawi m: class Foo { has Int $.a; }; my $o = Foo.new(:b(1),:a(1)).a;
09:19 camelia rakudo-moar 9ed640: ( no output )
09:20 azawawi should rakudo warn about parameter b?
09:21 ShimmerFairy Not currently, and that's thanks to the implicit *%_ on methods :)
09:21 masak azawawi: there's been a persistent wish for that, yes.
09:21 masak azawawi: ShimmerFairy has it right.
09:23 RabidGravy also shouldn't IO::Handle.slurp-rest be a multi? (i.e. one with :bin returning a BUf and one without returning a Str)
09:23 ShimmerFairy That actually wouldn't work IIRC, because of implicit *%_
09:23 masak RabidGravy: that sounds reasonable, yes.
09:24 masak ShimmerFairy: if does if you mark the :$bin! as required
09:24 RabidGravy indeed
09:25 masak m: class C { multi method foo() { say "without" }; multi method foo(:$bin!) { say "with" } }; given C.new { .foo(); .foo(:bin) }
09:25 camelia rakudo-moar 9ed640: OUTPUT«without␤with␤»
09:25 ShimmerFairy right, my mistake :)
09:25 masak not everything gets screwed up by *%_ :P
09:25 RabidGravy I'll do that later (and leave documenting slurp-rest until then.)
09:25 azawawi thanks
09:26 ShimmerFairy masak: Still haven't seen what good *%_ does either :P
09:26 laouji joined #perl6
09:26 masak if it were unambiguously bad, we'd have removed it ages ago.
09:27 dalek doc: 63fb6eb | RabidGravy++ | lib/Type/IO/Handle.pod:
09:27 dalek doc: document seek/tell somewhat
09:27 dalek doc: also slurp is deprecated
09:27 dalek doc: review: https://github.com/perl6/doc/commit/63fb6eb6f3
09:27 laouji joined #perl6
09:27 ShimmerFairy masak: It's been complained about for a long time now, and I've never been able to understand (or been shown) what it helps with.
09:31 masak ShimmerFairy: it makes a method in a base class resilient to named arguments it doesn't know but which a deriving class might know what to do with.
09:31 masak I wish I had a real example to demonstrate it with.
09:31 ShimmerFairy Shouldn't it be the other way around? Or are there cases where the base class' methods are tried first? O_o
09:32 masak for now, maybe imagine `class Coord3d is Coord2d`, and you can initialize either one with .new(:$x, :$y, :$z)
09:32 masak ShimmerFairy: it matters for things like `nextsame`
09:33 masak in fact, `nextsame` (I now recall) tends to be the argument that makes *%_ not be removed :)
09:33 ShimmerFairy masak: I think my question then is why isn't  .new($x, $y, $z)  afforded the same resiliency?
09:34 araujo joined #perl6
09:35 masak ShimmerFairy: I think it's grounded in the fact that positional arguments and named arguments are used differently in practice.
09:35 masak a positional is required by default, and tends to be part of the necessary/primary information going into a call.
09:36 masak a named is optional by default, and tends to be used for "extra" information, or tweaks, or settings.
09:36 ShimmerFairy What about optional positionals then, at least? (Imagine if Coord3D made the $z positional optional and defaulted to zero when not supplied)
09:37 ShimmerFairy Couldn't the argument be made that nextsame should treat foo($x, $y, $z?) and foo($x, $y) equivalently?
09:40 masak it could.
09:40 masak but it's probably significant that it hasn't ;)
09:41 ShimmerFairy masak: I just think that *%_ has historically caused far more problems than it solves, on top of the fact that I've never even seen a solution showing how useful having implicit *%_ in the lang is :)
09:42 ShimmerFairy I'm not so sure the problem of "extraneous nameds" is nearly as prevalent as implicit *%_ would suggest.
09:42 ShimmerFairy (The other inconsistency question aside from positionals is why subs don't get the same implicit *%_ ? Can't we use the nextsame bunch outside of classes too?)
09:43 masak classes have a different story to them. someone else can subclass your base class.
09:44 masak whereas multi subs and the like are tied to nested lexical scopes, all of which tend to be under your control.
09:48 atroxaper joined #perl6
09:49 ShimmerFairy masak: I think my problem with implicit *%_ is that it purports to fix something I've never seen be a problem. I understand the concern to not die on extra, unknown nameds by default. Problem is, I don't know when that ever is likely to happen.
09:50 ShimmerFairy Only in cases like  foo(|c)  (where you're passing a collection of things as args), but then you also have to worry about positionals.
09:51 ShimmerFairy Er, I can only see it potentially happening in cases like that, to be clear.
10:01 RabidGravy I can see a case like 'my %conf = get-config-from-file();   my $foo = Foo.new(|%conf)'   where thee config may be shared between multiple types and a given type is only interested in a sub-set
10:03 ShimmerFairy Essentially I don't see nameds and positionals as being fundamentally different (they're just different ways of accepting arguments from callers), so I don't understand why just nameds get this special and unintuitive treatments, in just methods too.
10:04 espadrine_ joined #perl6
10:06 masak I find optional positionals to be quite similar to nameds :)
10:06 masak required positionals, not so much. YMMV
10:06 spider-mario joined #perl6
10:08 ShimmerFairy masak: I don't doubt their typical usages, btw. I only doubt that those typical usages should be upheld in design to the extent that *%_ does. (Look at the Coord2d/3d example you shared earlier, for an example of nameds not being "extra" info)
10:08 RabidGravy y'see for me as an application designer I would probably favour a multi over optional positionals
10:12 renormalist joined #perl6
10:13 renormalist joined #perl6
10:17 baest_ joined #perl6
10:19 jdv79 lizmat: define "batched"
10:19 Spot___ joined #perl6
10:19 laouji_ joined #perl6
10:20 mr-fooba_ joined #perl6
10:29 jdv79 tadzik: sup wit smoke runs?
10:30 RabidGravy the oom killer got my last smoke on raspberry pi
10:30 nine RabidGravy: so what about "foo is not null and foo = bar"?
10:33 RabidGravy some databases comparison of a null to a non null yields false, some it's undefined
10:34 RabidGravy roughly split between Sysbase/MS-SQL/Informix and the rest
10:34 tadzik jdv79: I have no idea, I don't smoke :)
10:36 oha tadzik, you don't smoke? mh... let's see...
10:37 jkva joined #perl6
10:40 RabidGravy just multi'd slurp-rest in https://github.com/rakudo/rakudo/pull/480 if anyone cares to take a look
10:41 dalek rakudo/nom: 8a46049 | RabidGravy++ | src/core/IO/Handle.pm:
10:41 dalek rakudo/nom: Make IO::Handle.spurt-rest a multi
10:41 dalek rakudo/nom: If nothing else this aids dcumentation and discovery
10:41 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8a46049fc2
10:41 dalek rakudo/nom: e3314c8 | FROGGS++ | src/core/IO/Handle.pm:
10:41 dalek rakudo/nom: Merge pull request #480 from jonathanstowe/slurp-rest-multi
10:41 dalek rakudo/nom:
10:41 dalek rakudo/nom: Make IO::Handle.spurt-rest a multi
10:41 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e3314c8fda
10:41 vendethiel lgtm, it seems :)
10:42 RabidGravy last great trans-dimensional meatload?
10:45 nine masak: I understand your caution regarding Pos(0) being True. I just really like that it's the first time I see such an API where the intuitive or naive approach to using it is actually the right one.
10:47 nine Up until that, I've only seen bad solutions and worse. PHP gives you False which is harder to differentiate from 0 in boolean context. Python and Javascript are horrible in that they are both dynamic languages yet feel the need to invent yet another error indicator (-1) when both already have ways to express undefinedness + exceptions
10:47 rurban1 joined #perl6
10:47 timotimo o/
10:48 masak nine: JS gets a lot of flak because it has an == operator in which 0 == "0", 0 == "", but "0" != "". it feels to me that we're making a similar thing, breaking a common expectation somewhere.
10:49 masak nine: I'm usually quite proud of Perl 6 for making a proper distinction between true/false and defined/undefined
10:53 ShimmerFairy masak: If we think of the index as being defined when it can find what it's looking for, and undefined otherwise, then the problem with something like Int is that you can't simply check if it's a type object or not without creating a temporary variable.
10:54 nine For use cases where the exact position is not needed, I'd rather see a .contains method with a Bool result. That leaves two cases: one where we just want to know the index. And the other, where we don't know yet if the string is actually contained and need the exact index if it is.
10:54 ShimmerFairy masak: if the statement    if "foo".index("bar").defined -> $idx { ... }    put the actual index in $idx (not necessarily .defined exactly, but something like it at least), I suppose there's a bit less reason for Pos.
10:55 timotimo right; that's what lizmat means with "if foo.index(bar) -> $idx { ... }"
10:57 FROGGS m: if "foobar".index("foo").grep(*.defined) -> [$idx] { say $idx; say $idx.WHAT }
10:57 camelia rakudo-moar 9ed640: OUTPUT«0␤(Pos)␤»
10:57 timotimo ouch :D
10:57 FROGGS it is a workaround, surely
10:57 dalek doc: e7c25b1 | RabidGravy++ | lib/Type/IO/Handle.pod:
10:57 dalek doc: Document IO::Handle.slurp-rest
10:57 dalek doc: review: https://github.com/perl6/doc/commit/e7c25b1227
10:59 RabidGravy there, now back to writing my own stuff
10:59 nine Please note, that we currently don't have a .contains, so this needs covering, too: if $string.index("foo") { ... }
10:59 timotimo don't we have has-substr?
10:59 ShimmerFairy One of my biggest problems in any language is when you basically need two values from something. This feels similar to me to when you want to do  for @items -> $item { ... }  but you also need the index, so you end up having to do something like  for ^+@items -> $idx { $items = @items[$idx] }
10:59 timotimo m: "foobar".has-substr("oob").say
10:59 camelia rakudo-moar 9ed640: OUTPUT«Method 'has-substr' not found for invocant of class 'Str'␤  in block <unit> at /tmp/6TOlZNfCu2:1␤␤»
10:59 timotimo hm
10:59 RabidGravy boo
10:59 timotimo ShimmerFairy: well, we do have .kv for that particular case
11:00 leont joined #perl6
11:00 timotimo and python has enumerate(...) together with index unpacking
11:00 timotimo other languages ... not so much
11:01 ShimmerFairy timotimo: Huh, I didn't think of .kv , probably because that's a very Associative method for something I'm not using in a hash-like fashion :)
11:01 leont Can someone tell me where coersions are documented, and what their current state is?
11:01 timotimo ah!
11:01 timotimo well, we're "proud" of our Cool and Any things
11:01 timotimo m: say "hello".kv.perl
11:01 camelia rakudo-moar 9ed640: OUTPUT«(0, "hello")␤»
11:01 timotimo m: say "hello".pairs.perl
11:01 camelia rakudo-moar 9ed640: OUTPUT«(0 => "hello",)␤»
11:02 ShimmerFairy timotimo: maybe .iv or .ie ("index/value" or "index/element") for the array-related use :P :P
11:02 timotimo not only do single items behave like lists of that single item, our lists also behave like hashes of index to value
11:03 ShimmerFairy timotimo++  # reminding me of .kv is gonna help me out a lot in the future, since I seem to do stuff requiring index + value somewhat often :)
11:03 timotimo yay
11:05 RabidGravy leont, http://design.perl6.org/S02.html#Coercive_type_declarations
11:05 RabidGravy and currently only work for argument types IIRC
11:05 atroxaper joined #perl6
11:08 leont Does not appear to work on Array arguments :-s
11:08 timotimo yeah, that won't work
11:09 timotimo typed arrays are more of a "all or nothing" thing
11:10 robinsmidsrod joined #perl6
11:12 Begi joined #perl6
11:13 chenryn joined #perl6
11:14 RabidGravy I think that is stated explicitly elsewhere in the design docs
11:16 jdv79 tadzik: i meant why is smoke.perl6.org stalled at 7/21
11:16 Woodi hi today :)
11:18 FROGGS jdv79: ups
11:18 FROGGS ohh, unups
11:18 FROGGS I can't fix that
11:19 FROGGS jdv79: ask colomon
11:20 Woodi whatever "chaining" is  $a ~~ (2..3) is strange. it should be the same with () and without. probably via DWIM. we need GLR to remove DWIM *inside* core but keep it user facing. maybe redefining some user things too...
11:21 robinsmidsrod joined #perl6
11:21 Woodi but anyway, it is Perl ! sooner or later someone will remove need for () :)
11:22 Woodi m: (2 ~~ 1 .. 3 ~~ 0..4) ~~ True  # chaining...
11:22 camelia rakudo-moar e3314c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/slSEl48ldW␤Operators '~~' and '..' are non-associative and require parentheses␤at /tmp/slSEl48ldW:1␤------> 3(2 ~~ 17⏏5 .. 3 ~~ 0..4) ~~ True  # chaining...␤    expecting any of:␤        infix…»
11:23 Woodi m: (2 ~~ (1 .. 3) ~~ (0..4)) ~~ True  # chaining...
11:23 camelia rakudo-moar e3314c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/QIMZ1PXu50␤Operators '~~' and '~~' are non-associative and require parentheses␤at /tmp/QIMZ1PXu50:1␤------> 3(2 ~~ (1 .. 3) ~~7⏏5 (0..4)) ~~ True  # chaining...␤    expecting any of:␤        inf…»
11:24 Woodi m: (2 ~~ ((1 .. 3) ~~ (0..4))) ~~ True  # chaining...
11:24 camelia rakudo-moar e3314c: OUTPUT«Potential difficulties:␤    Smartmatch against True always matches; if you mean to test the topic for truthiness, use :so or *.so or ?* instead␤    at /tmp/bLgqlc4yQx:1␤    ------> 3(2 ~~ ((1 .. 3) ~~ (0..4))) ~~7⏏5 True  # chaining...␤»
11:24 Woodi m: (2 ~~ ((1 .. 3) ~~ (0..4))) so True  # chaining...
11:24 camelia rakudo-moar e3314c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4hnVkhEDRu␤Two terms in a row␤at /tmp/4hnVkhEDRu:1␤------> 3(2 ~~ ((1 .. 3) ~~ (0..4)))7⏏5 so True  # chaining...␤    expecting any of:␤        infix␤        infix stopper␤        statement …»
11:24 Woodi m: (2 ~~ ((1 .. 3) ~~ (0..4))) :so True  # chaining...
11:24 camelia rakudo-moar e3314c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CDXph6L_gs␤You can't adverb that␤at /tmp/CDXph6L_gs:1␤------> 3(2 ~~ ((1 .. 3) ~~ (0..4))) :so7⏏5 True  # chaining...␤    expecting any of:␤        pair value␤»
11:25 RabidGravy right off out for a bit.  play nicely.
11:26 leont It seems Proc.status is returning crap :-/
11:27 leont Probably tries to perform math on Int:D + Any:U
11:30 leont Yeah, «($!exitcode +< 8) +| $!signal», with $!signal being Any:U
11:32 leont I think submethod BUILD should handle $!signal (and possibly $!pid)
11:32 * azawawi Atom::Electron windows events are now working :)
11:35 azawawi https://github.com/azawawi/perl6-atom-electron/blob/master/bin/electron_bridge_launcher   # Finished Atom::Electron example
11:35 Woodi azawawi: !  some tutorial or blog post pleas ! :)
11:36 azawawi Woodi: on it :)
11:36 * Woodi should read-first
11:36 jdv79 .tell colomon smoke is stalled
11:36 yoleaux jdv79: I'll pass your message to colomon.
11:37 azawawi Woodi: basically write Perl 6 desktop webapps and control chromium (aka google chrome) windows :)
11:37 Woodi azawawi: bookmarks too ?
11:38 azawawi Woodi: you run your own chromium instance. you dont control google chrome
11:39 azawawi Woodi: so you can run your own web app and create a window and load that web app and handle its events directly
11:41 azawawi what's the tool we use to generate module documentation in Perl 6?
11:42 moritz what tool? :-
11:42 moritz )
11:43 moritz there's Pod::To::HTML, but it just generates one HTML file, and you have to manually take care of running it for each module
11:44 masak <leont> It seems Proc.status is returning crap :-/
11:44 masak leont: please submit a rakudobug.
11:45 azawawi moritz: API to wrap https://github.com/atom/electron/tree/master/docs/api ... it is a fair daunting task :)
11:47 Woodi so it is GUIs future ? :)
11:47 tadzik heh, I hope not, but I'm afraid yep
11:48 masak we are all afraid
11:48 Woodi anyone have examples or some pointers to that technology that "in 100 year we will not use code" ?
11:49 masak Woodi: that doesn't square too well with Perl 6 being a 100-year language ;)
11:50 awwaiid naw, just need to add the NLP grammar
11:50 Woodi masak: too :) but I read this few times here as sure thing :)
11:50 awwaiid or maybe the robots will still program in perl6
11:50 moritz Woodi: I've herad the interesting notion that, eventually, we'll stop writing code, and start growing it instead
11:50 moritz *heard
11:50 awwaiid so... if "we" == humans... there are LOTS of reasons why humans won't be programming in perl6 :)
11:51 moritz like, guiding program auto-assemble from many small parts
11:51 Woodi for sure programming could be less university-grade occupation... artisanal web pages should be by ppls without engeenering degree...
11:51 azawawi or machines writing code and then figure out it is easier to outsource it to humans :)
11:52 Woodi as soon some code is generated noone is interested in quality or performance...
11:53 Woodi I mean things like XML configs not compiler output :)
11:54 cognominal joined #perl6
11:55 itz joined #perl6
11:55 freeze joined #perl6
12:00 masak moritz: I like that. I think I would prefer a future where I discussed the design of a system with an expert system, and then the expert system coordinated the implementation.
12:06 itz joined #perl6
12:07 Woodi anyone know how to exit from emacs ?
12:07 gfldex joined #perl6
12:07 nine Woodi: kill -9?
12:08 Woodi nine: this is not from inside it :)
12:09 * Woodi asked before running emacs... but stackoverflow knows everything :)
12:10 nwc10 Woodi: control-X control-C
12:10 nwc10 and if someone has unmapped *that*
12:10 nwc10 try
12:10 nwc10 ESC x save-buffers-kill-emacs
12:10 nwc10 but why would anyone want to leave emacs?
12:11 nwc10 or just hit control G a lot.
12:13 Woodi nwc10: exiting is first reaction after entering vi, so I wanted to be prepared :)
12:14 Woodi of course it *do not* tell anything about vi quality :)
12:14 nine Well on pressing Ctrl-C in vim, it at least tells you exactly how to exit.
12:16 Woodi someone have some advice about C developmnet on Windows ? eg. compiling Moar. looks gcc hallow.c is not all...
12:21 azawawi Woodi: C/C++ development on windows = Visual Studio Express Community edition
12:22 FROGGS but not the 2015 version
12:22 Woodi azawawi: yes, but Express probably do not allow eg. mysql libs linking or I just have problems...
12:23 azawawi Woodi: you link the .lib and you are set
12:24 azawawi Woodi: but then again i used professional in the past
12:25 llfourn joined #perl6
12:25 Woodi in *nix you say gcc file.c and you have a.out... in windows you need ide tons of swithes and libraries for simple "Hallo World"...
12:26 FROGGS Woodi: no, you don't
12:27 FROGGS you can also use gcc or cl directly
12:27 Woodi I just tried once :)
12:28 atroxaper joined #perl6
12:28 masak I would just like to say about 0.Pos and all that -- I'm not staunchly against it. many people like the change, and I can see why. the design feels to me like it replaces risk by magic, which I'm not sure is the right thing to do. but it may be that it's still a net win.
12:28 masak again one might argue that good tutorials and idioms trump the actual language choice we make.
12:32 amurf joined #perl6
12:34 jdv79 why does calling $*SCHEDULER.queue.elems always return 1?
12:35 Woodi num of treads ?
12:35 masak jdv79: the answer to that lies in learning what $*SCHEDULER.queue is. what type is it?
12:35 jdv79 its seems to be a "ConcBlockingQueue" repr
12:37 jdv79 trying to print it seems to always yield "Queue.new"
12:37 jdv79 :(
12:40 masak jdv79: so my guess is that it simply doesn't have its own .elems, and so the method call falls back to Any.elems
12:40 dalek rakudo-star-daily: 2232970 | coke++ | log/ (8 files):
12:40 dalek rakudo-star-daily: today (automated commit)
12:40 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/2232970258
12:40 masak m: say Any.new.elems
12:40 camelia rakudo-moar e3314c: OUTPUT«1␤»
12:42 jdv79 ah
12:42 masak jdv79: I agree with you that a Queue should be expected to have its own .elems, though
12:42 jdv79 i see elems in the .c file
12:42 masak jdv79: so essentially, you've found a bug.
12:42 jdv79 i tried nqp::elems($queue) and nope
12:42 jdv79 any ideas?
12:42 masak jdv79: please submit to rakudobug@perl.org
12:43 jdv79 Well Queue is an empty class in ThreadPoolScheduler so idk...
12:43 jdv79 but i'll but it
12:43 jdv79 *bug
12:43 timotimo if it's empty, it probably gets all of its functionality from the REPR it uses
12:43 jdv79 i just don't know how to work with opaue vm-ish things yet
12:44 [Coke] (you have to make some value exceptional) ... if only we had... exceptions.
12:46 masak [Coke]: :)
12:46 masak [Coke]: not really applicable, since the use case is "if it's in the string (then give me the position of its first occurrence)"
12:46 jdv79 timotimo: any idea how to call its elems func?
12:47 masak [Coke]: it's not "I'm going to assume it's in the string, and please blow up if it isn't"
12:49 azawawi masak: is it possible to run n Bailador servers within the same Perl 6 process using start { baile; } ?
12:49 azawawi masak: with different ports that is
12:49 masak azawawi: no idea; maybe ask tadzik?
12:51 yqt joined #perl6
12:51 chenryn joined #perl6
12:53 azawawi https://github.com/azawawi/perl6-atom-electron/blob/master/bin/bailador_example.p6  # it works sometimes lol :)
12:53 Woodi Perl6 should have something like emacs --daemon, then using emacsclient just connect to server :) would solve startup time problems...
12:54 jnthn [6~
12:55 Woodi azawawi: I saw WebContent.undo in Electron API, what it can do ?
12:56 azawawi Woodi: link it please
12:56 moritz Woodi: we have that for the JVM
12:56 timotimo jdv79: you can try "use nqp; nqp::elems(nqp::decont($thequeue))" or something
12:57 Woodi https://github.com/atom/electron/blob/master/docs/api/browser-window.md#webcontentsundo
12:57 [Coke] I have no problem with other languages where the sentinel value used isn't possible, like -1.
12:58 * [Coke] re-reads what he just wrote.
12:58 jdv79 timotimo: segfault
12:58 Woodi moritz: looking
12:58 jdv79 i'll ignore it for now
12:58 timotimo oh my
12:59 masak m: my $i = "foo".index("y"); say $i.perl
12:59 camelia rakudo-moar e3314c: OUTPUT«Pos␤»
12:59 masak m: my $i = "foo".index("y"); say $i
12:59 camelia rakudo-moar e3314c: OUTPUT«(Pos)␤»
13:00 masak :/
13:00 * [Coke] , having had at least some coffee, is still ok with that.
13:00 masak I didn't realize Pos was (re?)applied to nom. I wanted to check what kind of undefined value we used to return from .index
13:01 moritz well, its .perl method needs some improvement
13:01 masak guess I can check the source
13:01 ShimmerFairy masak: It was (Int)
13:01 moritz aye
13:01 masak ShimmerFairy: thank you.
13:01 moritz star: say 'foo'.index('why?')
13:01 camelia star-m 2015.03: OUTPUT«(Int)␤»
13:01 azawawi Woodi: i think it is for controlling text fields (editing commands), undo/redo/replace/etc...
13:02 masak moritz++
13:03 masak well, if people are OK with this change, then I'll be silent. my unease could be just a measurement glitch or something.
13:03 azawawi jnthn: any idea why https://gist.github.com/azawawi/901a7c4e086615ea6721 is not capturing prompt output from either thread?
13:04 [Coke] If we're going with Pos, I assume there's a ton of places where it would make sense to use. It's basically the old StrPos from the syn with a new name, yes?
13:04 masak yes.
13:04 jnthn You're really not meant to use what .queue returns directly. It's only for passing off to various other VM-level APIs, and decidedly not intended for use in userspace.
13:05 masak though I always saw the advantage of StrPos in being that it abstracted a numerical position into a more "cursor-like" thing that could straddle/ignore the bytes/chars/graphs levels.
13:05 masak that doesn't seem to be the case with this new Pos. it seems to be a subtype of Int.
13:05 [Coke] I am torn. It handles the use case it was introduced for very nicely, but it's yet another type. I am probably just an old fart at this point, but having to save the result of an expression if I want to inspect it multiple ways seems like "the way to do it" not a big problem.
13:06 jdv79 i was just poking at the async stuff
13:06 jnthn azawawi: Using sync IO handles from threads other than the one that created them is currently not supported
13:06 jdv79 i'll find a better way later i guess to do what i was attempting
13:06 jnthn (It's on the to-fix list.)
13:06 jnthn jdv79: What were you trying to do?
13:06 tadzik azawawi: it may not be
13:06 tadzik azawawi: but probably you can read what start() does and just replicate it with different values for port and stuff :)
13:06 jdv79 just fan out and collect - experimenting in general
13:07 jdv79 the particular issue was detecting when the queue is exhausted
13:07 azawawi jnthn: so `use Bailador; start { baile; }; start { baile; }` # wont be supported?
13:07 jdv79 but its the wrong way about it anyway for anything real
13:07 jnthn jdv79: my @results = await do for @work { start { ...computation... } }
13:08 cognominal joined #perl6
13:08 jdv79 that's higher level than i wante
13:08 jnthn Why?
13:09 jdv79 just wanted to see how much extra taht is from a minimal impl
13:09 jdv79 just for fun
13:09 jnthn ah
13:09 ggoebel joined #perl6
13:09 jnthn You can't do it by looking at the queue
13:09 jnthn Not reliably
13:09 jnthn That'll be full of races
13:09 llfourn joined #perl6
13:10 jnthn You need a semaphore or cond var somewhere so you can wait efficiently
13:10 jnthn azawawi: That's almost certainly the wrong way to do it
13:10 jdv79 yeah, i know.  i was trying to do the absolute min and then build up
13:11 jdv79 less min tehn
13:11 jdv79 thanks
13:11 moritz well, you can start by startings Tread objects and joining them in the end
13:11 jdv79 yeah but i didn't want to code a pool mgr
13:12 jdv79 i'll fool later - have to run though.  thanks!
13:13 * masak .oO( run, you fools! )
13:13 moritz fool, you, run!
13:14 masak [Coke]: well, the expectation we're breaking is essentially that ?$pos == ?+$pos
13:14 Woodi moritz: eval-client.pl reads file and sents to perl-j listening on port and doing eval ?
13:16 azawawi jnthn: thanks... run Bailador in an async process ftw https://github.com/azawawi/perl6-atom-electron/blob/master/bin/bailador_example.p6
13:17 moritz Woodi: iirc it named socket/pipe
13:22 azawawi moritz: with that bailador example, we could run perl6 REPL in a very nice GUI and control the browser window shortcuts (no more Ctrl-W closing the window ...etc)
13:23 azawawi moritz: we can even run web irc in a separate browser tab.
13:24 Begi joined #perl6
13:27 moritz azawawi: nice
13:28 ribasushi joined #perl6
13:31 azawawi is panda install HTTP::Server::Async failing on your dev box? where is the testers link?
13:38 laouji joined #perl6
13:39 Woodi can be electron binary packaged with app ?
13:40 JimmyZ_ joined #perl6
13:40 azawawi Woodi: yes we can :)
13:41 azawawi Woodi: just make it available in your $PATH
13:42 raiph joined #perl6
13:43 azawawi Woodi: did you download the appropriate runtime for your plaform from https://github.com/atom/electron/releases/tag/v0.30.1?
13:46 Woodi azawawi: not downloaded yet. but thinking about making Windows apps becouse on linux I usually don't have X desctop
13:46 Woodi *desktop
13:47 Woodi curently there is a fashion for making game launchers that rsync conntent for you :)
13:55 timotimo do you mean content as in game updates or as in save games and such?
13:57 Woodi timotimo: content. eg. DayZ mod for Arma2
13:57 azawawi Woodi: cool
13:57 timotimo mhm
13:57 Woodi azawawi: can I replace firefox with electron and have my own session manager ? :)
13:58 timotimo you would have your own session manager, but not much else
13:58 Woodi timotimo: but having GUI for app builded on SDL would be nice
13:58 timotimo very difficult to embed, i assume
13:59 Woodi what to embed ? SDL window with menu, status bar and grid...
13:59 dalek doc: 53189e2 | (Lloyd Fournier)++ | lib/Language/modules.pod:
13:59 dalek doc: 1. Addressed some of the tense and passive voice issues
13:59 dalek doc: 2. Added section addressing need,use,require and import
13:59 dalek doc: 3. Fixed some mistakes
13:59 dalek doc: review: https://github.com/perl6/doc/commit/53189e2ecd
13:59 dalek doc: 33b9276 | (Lloyd Fournier)++ | lib/Language/modules.pod:
13:59 dalek doc: small touch ups and sentence rewrites on modules
13:59 dalek doc: review: https://github.com/perl6/doc/commit/33b927637d
13:59 dalek doc: ccf8229 | paultcochrane++ | lib/Language/modules.pod:
13:59 dalek doc: Merge pull request #108 from LLFourn/master
13:59 dalek doc:
13:59 dalek doc: Attempted to address passive vs active voice and added examples for need,use,import and require
13:59 dalek doc: review: https://github.com/perl6/doc/commit/ccf8229499
13:59 timotimo i thought you meant SDL + electron
14:00 Woodi no, electron is 30Mb, SDL 3 ?
14:01 timotimo SDL doesn't load different image and video formats and doesn't do text layouting and 3d stuff ...
14:01 raiph joined #perl6
14:01 nine [Coke]: unfortunately if $string.index('foo') { ... } is such an easy trap to fall into.
14:02 khw joined #perl6
14:06 azawawi Woodi: it is Atom::Electron. i have not seen a way to embed firefox while doing research
14:07 timotimo well, you can use gecko
14:07 azawawi true
14:08 azawawi but then again electron is more actively developed because of the Atom editor atm :)
14:08 * azawawi going home in 10 min :)
14:09 timotimo right
14:11 skids joined #perl6
14:17 azawawi Woodi, timotimo: Enjoy http://i.imgur.com/Nbf57YO.png # Electron + Bailador :)
14:17 Woodi azawawi: maybe I do not understand how electron is working... it framework for making desktop apps. it can load url. so I can have many windows like in firefox -> session manager, bookmarks :) maybe not tabs
14:18 masak azawawi: wow!
14:18 masak azawawi++
14:18 azawawi Woodi: you can make new BrowserWindow(s) :)
14:18 azawawi Woodi: and there is Session management but not wrapped yet
14:18 Woodi I think about something on Perl side...
14:18 azawawi Woodi: https://github.com/atom/electron/blob/master/docs/api/browser-window.md#sessioncookies
14:19 Woodi azawawi: that "File View Help" is standard thing ?
14:19 * azawawi off to get a Frappuccino to celebrate :)
14:20 azawawi Woodi: can be disabled, it is for development
14:20 Woodi azawawi: I want to have it :) windows on the right could be hidden...
14:22 azawawi masak: the fun thing is that we can also use clipboard api, frameless transparent windows, tray api and shell api :)
14:22 amurf joined #perl6
14:22 azawawi Woodi: BrowserWindow->new(:show(False));  # should work :)
14:24 masak azawawi: nice!
14:24 atroxaper joined #perl6
14:25 azawawi masak: so basically it is a wxwidgets app but with a HTML/CSS layout engine :)
14:25 azawawi masak: cross platform, hopefully lol
14:26 * azawawi home &
14:30 cognominal joined #perl6
14:34 timotimo cute
14:34 timotimo the image
14:34 jkva joined #perl6
14:37 dalek roast: f30dec1 | skids++ | S06-currying/named.t:
14:37 dalek roast: Remove unused sub from test file.
14:37 dalek roast: review: https://github.com/perl6/roast/commit/f30dec1413
14:41 Begi azawawi : nice ! I'll try that !
14:42 skids So... question for those who think removing the implicit *%_ is a good idea: "class A { has $.a }".  What should be the signature of the implicitly defined A.new and A's submethod BUILD?  Will it still be Mu's, or an autogenerated one?  Curious just how radical you rebels are.
14:44 telex joined #perl6
14:44 moritz skids: I still think Mu.new can accept any named param
14:47 skids Right, but would A have Mu's new, or an autogenerated one based on attributes?
14:48 moritz it can have Mu's new
14:48 skids OK, so anyone who wants to NOT take unnown named attributes to new will have to define their own new anyway.
14:49 moritz yes
14:49 skids (just as they do now)
14:49 moritz it's all the other methods I'm concerned about right now :-)
14:50 * skids does not share that concern frankly.  But that's good to know.
14:56 brrt joined #perl6
14:57 vendethiel m: [1] @ [2]
14:57 camelia rakudo-moar e3314c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/EE4eHIqWNs␤Two terms in a row␤at /tmp/EE4eHIqWNs:1␤------> 3[1]7⏏5 @ [2]␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤      …»
14:57 vendethiel ^ @ is now an operator python has, and we don't :P
14:57 brrt \o
14:58 vendethiel o/ brrt
14:58 brrt \o vendethiel
15:01 RabidGravy joined #perl6
15:02 RabidGravy boom
15:06 jkva joined #perl6
15:32 dustinm` joined #perl6
15:36 mtj_- joined #perl6
15:36 petercommand joined #perl6
15:36 agentzh joined #perl6
15:38 vendethiel looking at PEP-492, it looks like me that we... "folded" the generator feature that languages added/are adding (php5.6, python, es6) into gather thanks to infinite lists, and I like it :D.
15:39 vendethiel one thing "interesting" is that "await" really applies to "one expression". Like: "await fut + 1" will be parsed as "(await fut) + 1". Basically, you're really "calling a function with a modifier", it's not like our "await {}"
15:42 captain-adequate joined #perl6
15:43 nine Assuming I can fix all emerging issues, would it actually be a good idea to have Perl5Object inherit from Mu instead of Any? One one hand it would fix issues with Any's methods shadowing the Perl 5 object's methods. On the other hand those objects would feel less like Perl 6 objects.
15:43 Begi joined #perl6
15:46 diana_olhovik joined #perl6
15:47 masak vendethiel: do you mean "one term"?
15:48 vendethiel masak: where?
15:49 vendethiel oh, yes. I did.
15:54 [Tux] joined #perl6
15:54 timotimo nine: i think it's a bit problematic because we basically limit the big majority of parameters to Any
15:54 timotimo by default, that is
15:54 timotimo for pointy blocks, parameters are Mu, but for subs and methods, they are Any by default
15:55 nine timotimo: sounds like an excellent argument for keeping Any as base class. Especially since I hit that even in Inline::Perl5's code itself.
15:56 nine timotimo: I wonder how this works with custom meta objects?
15:57 yqt joined #perl6
15:57 timotimo haven't tried
15:59 dalek doc: 7485ab2 | (Lloyd Fournier)++ | lib/Language/functions.pod:
15:59 dalek doc: added example of type coercions for non builtin types
15:59 dalek doc: review: https://github.com/perl6/doc/commit/7485ab286a
15:59 dalek doc: c874e11 | LLFourn++ | lib/Language/functions.pod:
15:59 dalek doc: Merge pull request #109 from LLFourn/master
15:59 dalek doc:
15:59 dalek doc: added example of type coercions for non builtin types
15:59 dalek doc: review: https://github.com/perl6/doc/commit/c874e112dc
16:02 rurban joined #perl6
16:03 rurban1 joined #perl6
16:06 smls joined #perl6
16:08 smls https://gist.github.com/jnthn/a56fd4a22e7c43080078 looks pretty cool, jnthn++
16:08 smls I especially like supply/emit as the observable equivalent to gather/take
16:09 masak me too.
16:09 masak and whenever as an async loop construct.
16:11 smls I admit I don't quite understand why  whenever $supply { }  is needed when  for $supply.list { }  already works
16:12 smls or after pmichaud's GLR changes, simply  for $supply { }
16:12 masak I can't imagine that those have the same semantics.
16:12 masak (the first two)
16:12 masak the for loop looks blocking to me
16:13 smls and whenever doesn't?
16:13 smls oh right, "asynchronous looping construct"
16:13 xinming_ joined #perl6
16:14 dalek Inline-Perl5/mu: f1d4668 | (Stefan Seifert)++ | / (2 files):
16:14 dalek Inline-Perl5/mu: Failed attempt to use Mu as base for Perl5Object
16:14 dalek Inline-Perl5/mu:
16:14 dalek Inline-Perl5/mu: Using Mu instead of Any as base class for Perl5Object and Perl5Package
16:14 dalek Inline-Perl5/mu: classes might have helped cases where Any's methods shadow the Perl 5
16:14 dalek Inline-Perl5/mu: object's methods.
16:14 dalek Inline-Perl5/mu:
16:14 dalek Inline-Perl5/mu: But as timotimo++ pointed out, the big majority of parameters is restricted
16:14 dalek Inline-Perl5/mu: to Any (so Perl5Objects would not be accepted). So this would probably cause
16:14 dalek Inline-Perl5/mu: more harm than good.
16:14 dalek Inline-Perl5/mu:
16:14 dalek Inline-Perl5/mu: Push it into a branch to document this fact and what changes would have
16:14 dalek Inline-Perl5/mu: been necessary.
16:14 dalek Inline-Perl5/mu: review: https://github.com/niner/Inline-Perl5/commit/f1d4668c40
16:14 smls Though inside a supply { }, using a blocking loop should be fine too shouldn't it? If it works like gather { }
16:28 masak yeah, but two `whenever`s can work in parallel without any extra instructions, which is nice.
16:28 smls yeah, I think I see the benefits now
16:32 * lizmat is back
16:32 lizmat and has read all of the backlog
16:32 lizmat (of today)
16:33 lizmat I like the idea of Str.contains(Str) returning a boolean
16:33 lizmat I wonder if .contains could be more general
16:33 lizmat and a replacement for the $int ~~ ^10 meme
16:34 lizmat (^10).contains($int)
16:34 smls What's wrong with .index().defined ?
16:35 lizmat if "foo".index("f").defined -> $pos   # doesn't work
16:35 smls Neither will  .contains -> $pos  if it returns a Bool will it?
16:35 lizmat no, but if you use .contains you declare not being interested in the position
16:36 lizmat there are a few places in the core where .index is used in that way
16:36 lizmat .contains will *always* return a bool
16:37 smls index().defined  too :)
16:37 lizmat I wonder whether we should maybe change .defined in such a way that it will pass on the value but True ?
16:38 lizmat m: if "foo".index("f") -> $pos { say $pos }   # says $pos even if it is 0 and therefore false in the Int interpretation
16:38 camelia rakudo-moar e3314c: OUTPUT«0␤»
16:38 flussence re: *%_ -- the kernel devs do a similar thing, with `flags` params in all new syscalls for future-expansion stuff. That's one reason to have it, but it'd be nice to fix the awkward things it causes too.
16:38 lizmat ISTR that jnthn at least has an idea for complaining about unused named parameters
16:38 smls Maybe .defined needs a shorter name (akin to .so) to make encourage its use?
16:38 lizmat that would at least solve some of the issues
16:38 flussence that'd help a lot, yeah :)
16:39 lizmat smls: it's not about the name, it is about the functionality
16:39 lizmat if you find something *and* you want to know its position, you needed (before Pos) to go through hoops
16:39 lizmat *or* forget the case it was found at the first position
16:40 lizmat m: my $pos = "foo".index("f"); if $pos.defined { say $pos }   # old situation
16:40 camelia rakudo-moar e3314c: OUTPUT«0␤»
16:40 smls right, but introducing .contains would not help at all with that
16:41 lizmat no, but it *would* clarify the intended use better...
16:41 smls maybe
16:42 lizmat and it could be made to be slightly faster than .index
16:43 lizmat basically: nqp::index( nqp::unbox_s(self.Str), nqp::unbox_s($needle.Str), nqp::unbox_i($pos.Int) ) >= 0
16:44 smls For some reason, use of .index() for merely checking existence does not bother me much, but using .first/.first-index on a list for merely checking existence does bother whenever I see it
16:44 lizmat I would say: another case for .contains  :-)
16:45 smls or, make  $needle == any(@haystack)  really short-circuiting and optimized :P
16:45 * leont would like a short-cutting contains on lists
16:46 smls What comparison would List.contains use? eqv?
16:46 leont Yeah, that is the tricky bit
16:46 leont If junctions in boolean context can be optimized to short-cut, that may be helpful too, but I'm not sure they could be
16:48 atroxaper joined #perl6
16:50 smls I was always under the impression that the reason why Perl 6 does not have a .contains (or "in" operator like Python), was that we are supposed to combine junctions with a comparison operator for that
16:51 smls But I vaguley remember that junctions also are supposed to be allowed to parallelize, which would be mutually exclusive with short-circuiting
16:53 smls lizmat: Also, overloading .contains for both strings and lists, would be unusual in the context of Perl 6
16:54 smls e.g. $string.grep does not grep characters, it treats $string as a single-element list
16:54 lizmat good point, smls++
16:57 dalek roast: beded9e | moritz++ | S32-io/slurp.t:
16:57 dalek roast: Remove a test that does not work anymore
16:57 dalek roast: review: https://github.com/perl6/roast/commit/beded9e4d3
16:58 * lizmat starts backlogging the past 2 weeks to be able to write the P6W
16:58 moritz lizmat: did you do a roeast cleanup? 'cause a "make spectest" with RAKUDO_DEPRECATIONS_FATAL=1 seems pretty clean
16:58 lizmat moritz: I haven't done much in the past 2 weeks being on the road and such
16:59 lizmat I *did* remove some deprecations before the release and their associated tests
16:59 lizmat maybe that could account for the difference?
16:59 moritz lizmat: uhm, no, it seems that RAKUDO_DEPRECATIONS_FATAL=1 doesn't do much
16:59 lizmat oh?
16:59 moritz export RAKUDO_DEPRECATIONS_FATAL=1;  make t/spec/S17-su│··
16:59 moritz pply/rotor.t
16:59 moritz passes
17:00 moritz even though there's a deprecation warning
17:01 lizmat hmmm.....
17:01 moritz ah no
17:01 moritz it's a dies-ok { ... }, 'no param version illegal'
17:02 moritz and that triggers the deprecation warning
17:02 moritz and RAKUDO_DEPRECATIONS_FATAL=1 makes it fatal, thus passing the otherwise TODOed test
17:02 lizmat maybe we should have a RAKUDO_DEPRECATIONS_EXIT ?
17:03 moritz don't bother
17:03 moritz is a sufficiently obscure case that we shouldn't optimize for it
17:03 lizmat okidoki  :-)
17:08 [Coke] I thought we absolutely had an in operator for sets.
17:08 leont There's unicode for that :-p
17:08 TimToady .tell mdinger the way to think about it is that all assertions are about the current cursor, so <?after foo> means "is the cursor after foo?", and <?before baz> means "is the cursor before baz?"
17:08 yoleaux TimToady: I'll pass your message to mdinger.
17:09 leont Yeah, that was initially confusing for me too
17:10 smls [Coke]: Right, but sets are special-purpose and have a settled on === comparison for everything
17:10 moritz not more or less confusing that look-ahead and and look-behind
17:10 moritz if you look ahead to something, it's before you, no?
17:11 smls [Coke]: The ASCII version is called   $needle (elem) $haystack   I think
17:11 leont "Is foo after this" versus "is this after foo"
17:12 [Coke] moritz: now you're confusing meanings of before. :P
17:12 moritz [Coke]: am I?
17:15 [Coke] are you referring to looking ahead in time or place?
17:16 lizmat .oO( when it's Daylight Saving Time, is it earlier or later than before?  :-)
17:16 [Coke] and did it happen before now, or does it lay before your current position? I agree with OP that this is potentially confusing. I think TimToady answered it fine.
17:17 [Coke] lizmat: I don't know, but I'm sure all the IT people in the room are grumpier when it's DST. :P
17:27 Juerd A thought crossed my mind, and please don't take this seriously: shouldn't $_ be renamed to $- now? ;)
17:29 [Coke] m: say $-;
17:29 camelia rakudo-moar e3314c: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ZgNU7T3_VG␤Missing required term after infix␤at /tmp/ZgNU7T3_VG:1␤------> 3say $-7⏏5;␤    expecting any of:␤        prefix␤        term␤»
17:29 lizmat Juerd: no, because you cannot have a trailing -
17:29 Juerd I know :)
17:31 lizmat or an identifier starting with -
17:34 b2gills $-      The number of lines left on the page of the currently selected output channel. ( from perldoc -v '$-
17:34 Juerd b2gills: That's Perl 5
17:35 raiph TimToady: did you suggest a Maybe thing sitting alongside junctions that does stuff like collapsing to a Bool but value?
17:36 TimToady don't recall that
17:36 TimToady I did suggest an Each that autothreads lists though
17:38 nine smls: .index().defined is stating how it should be done, while .contains() states what should be done.
17:44 vendethiel https://metacpan.org/pod/Dios Damian Conway is just insane :o). In a good way,obviously
17:49 leont Obviously, he is!
17:51 * vendethiel is now reading the source code
17:53 * leont says goodbye to vendethiel's sanity
17:53 vendethiel leont: I could do with a definition of "sanity" before leaving :D.
17:58 zakharyas joined #perl6
17:58 leont Being able to distinguish up and down :-p
18:00 amurf joined #perl6
18:05 ChoHag joined #perl6
18:06 ChoHag How's perl 6's support of unicode wrt. modules and their filenames?
18:07 ChoHag In particular considering that perl 5 doesn't allow non-ascii modules because of, largely, Windows' filesystem.
18:07 lizmat ChoHag: they should be supported, but aren't yet afaik
18:08 lizmat S11:420
18:11 ChoHag "internal names are Unicode-aware, even if the filesystem isn't"
18:12 ChoHag Уау!
18:13 dalek rakudo/nom: 174049f | TimToady++ | src/Perl6/Grammar.nqp:
18:13 dalek rakudo/nom: Revert "move ~~ from chaining to structural"
18:13 dalek rakudo/nom:
18:13 dalek rakudo/nom: This reverts commit 81ad2c0db9910fe7093c1db1d0e25e4710f3e67e.
18:13 dalek rakudo/nom:
18:13 dalek rakudo/nom: Consensus that the damage inflicted by changing the precedence is
18:13 dalek rakudo/nom: worse than the unnaturalness of considering ~~ a chaining op.
18:13 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/174049fb76
18:14 dalek roast: 687df77 | TimToady++ | S (9 files):
18:14 dalek roast: Revert "benign prep for ~~ going chained -> structural"
18:14 dalek roast:
18:14 dalek roast: This reverts commit ab605d96f42e531f9d544a167eef590a381a80b0.
18:14 dalek roast:
18:14 dalek roast: Don't need parens around ranges in ~~ again
18:14 dalek roast: review: https://github.com/perl6/roast/commit/687df77e10
18:26 leont ChoHag: in perl5 that could be solved, but no one @people.grep(Tuits&Win32-knowledge) eqv ()
18:27 kst joined #perl6
18:28 cognominal joined #perl6
18:32 ChoHag That's what I figured from the reading I was able to do on the subject.
18:32 ChoHag Except in English.
18:36 jnthn evening, #perl6
18:37 jnthn Few bits from backlog (mostly gut feeling, I'm too tired for anything else :))
18:40 jnthn On the eternal *%_ complaining (I guess 'cus named params are overused and Liskov is underunderstood :P): I wonder if we should make it be invocations with callsame/nextsame/callwith/nextwith that tolerate dropping extra named args, since that's where you actually want it. And normal invocations don't.
18:40 jnthn Basically, a failover on the "do we have any extra named args" check that realizes the invocation was done through callsame and friends.
18:40 jnthn And fails to complain in that case.
18:41 muraiki joined #perl6
18:41 lizmat jnthn o/
18:41 jnthn Probably we have to make $foo.Bar::baz() also behave the same way too
18:41 jnthn o/ lizmat
18:42 FROGGS joined #perl6
18:43 jnthn On 'for $supply.list { }': it's an anti-pattern to do this most of the time. It's occasionally useful. I would say it's useful in demos, but last time I did the .Net equivalent in a live demo my code deadlocked on itself. :P
18:43 jnthn The reason being that it is an async/sync transition. Such boundaries are inherently dangerous.
18:45 jnthn On hyper op parallelization semantics: I think we probably should have the operator form of hyper try to DWIM, and let named args be used to the method equivalents for when you really need the escape hatch.
18:46 bin_005 joined #perl6
18:46 jnthn Experience tells that too many folks think they can beat the runtime's decisoins without actually seeing if that's true...and even when they're right on the system they test the code on, that can all be undone by deploying on different hardware or on a loaded system (vs. their unloaded development machine).
18:47 jnthn So I'm inclined to dehuffmanize the "I want to over-specify things" path.
18:48 lizmat jnthn: so I understand, you're talking about @list>>.foo ?
18:48 jnthn lizmat: Yeah
18:49 jnthn Well, I'm talking more generally, but that's an example.
18:49 lizmat my idea was that methods would specify how they would like to be batched in hypers (if at all)
18:50 jnthn The method is only one axis of the decision making, though.
18:51 jnthn And you might legitimately want to make different decisoins in different uses of the method.
18:51 lizmat what is the other axis then?   Number of threads / cores available ?
18:51 jnthn Size of data set, and whether you care more about throughput or latency.
18:51 raiph isn't batching (1 or 100) what lazy vs mostly lazy was about?
18:52 lizmat but how can the system know from the outside how much CPU / wallclock a method will take ?
18:52 jnthn raiph: No; hyper is a form of eager that can thread.
18:52 raiph thanks
18:53 jnthn (We have used the word batching in the context of laziness though, so I understand the confusion. :))
18:53 jnthn lizmat: You can't know, but you can measure and use the past to predict the future.
18:54 jnthn lizmat: And even then you have to be somewhat dynamic about it.
18:54 lizmat ok, that would imply starting with one and adapting along the way ?
18:54 jnthn Crappy example 'cus I'm tired, but (^1000)>>.&a-stupid-recursive-fib-impl has vastly different costs for different calls over time.
18:55 jnthn lizmat: Yes.
18:55 jnthn lizmat: Thankfully there's lots of prior art we can look at on this. :)
18:56 jnthn lizmat: I think hill-climbing algos are common in this space, though.
18:57 jnthn I think that's what we should do as the default, anyways. But I'm all for a control know too. I just thing it's most useful on a use-case basis.
18:58 jnthn For example, if I'm throwing results onto a UI then I'd like to work in small batches to get the latency down. If I'm just crunching away non-interactively, I'd prefer bigger batches to keep the thread communication down.
18:58 jnthn uh, an control *knob*
18:58 jnthn and an a...
19:00 jnthn https://en.wikipedia.org/wiki/Hill_climbing is the thing I'm talking about, fwiw
19:00 Alina-malina joined #perl6
19:07 spider-mario joined #perl6
19:14 lizmat moritz: shall I mention the Rakudo * Release Candidate at http://hack.p6c.org/~moritz/r​akudo-star-2015.07-RC0.tar.gz ?
19:14 moritz lizmat: uhm, I could also just release it :-)
19:15 lizmat Fine by me too  :-)
19:15 lizmat .oO( long live P6W driven development  :-)
19:15 beastd joined #perl6
19:17 timotimo long live the lizmat
19:20 moritz http://hack.p6c.org/~moritz/rakudo-star-2015.07.tar.gz tests welcome
19:23 lizmat moritz: you want me to use that URL ?
19:23 moritz lizmat: no
19:23 lizmat okidoki
19:25 moritz release tagged, tarball uploaded
19:27 moritz lizmat: you can link to http://rakudo.org/2015/07/27/announce-rakudo-star-release-2015-07/ :-)
19:27 lizmat moritz++  (done)
19:28 jkva joined #perl6
19:29 timotimo is [release 2015.07.2] supposed to have brackets around it?
19:31 timotimo Notable changes in modules in modules:
19:31 moritz timotimo: linkified
19:31 timotimo there's one in modules in modules too modules in
19:32 dalek star: 60ecaef | moritz++ | docs/announce/2015.07.md:
19:32 dalek star: Grammar fix, timotimo++
19:32 dalek star: review: https://github.com/rakudo/star/commit/60ecaefd38
19:34 mr-foobar joined #perl6
19:36 zakharyas joined #perl6
19:36 espadrine_ joined #perl6
19:37 yqt joined #perl6
19:37 llfourn joined #perl6
19:37 timotimo moritz++ # rakudo star release
19:39 jnthn going for some rest...back tomorrow &
19:41 dalek star: f5f2ca3 | moritz++ | tools/star/release-guide.pod:
19:41 dalek star: mention 2015.07 release in release-guide.pod
19:41 dalek star: review: https://github.com/rakudo/star/commit/f5f2ca3a1d
19:42 moritz jnthn: have a RESTful night :-)
19:43 moritz R* release process finally winding down
19:44 moritz ... except for the missing .msi
19:45 Hor|zon joined #perl6
19:48 dha joined #perl6
19:49 brrt joined #perl6
19:49 rurban1 joined #perl6
19:50 dha I'm sure this is just me being confused, but where the heck is panda in my rakudo distribution?
19:51 lizmat it's not
19:51 lizmat panda lives separately, or in rakudo star
19:51 lizmat or installed with rakudobrew
19:51 dha I keep getting confused about rakudo vs. rakudo star.
19:52 lizmat generally, we don't announce rakudo compiler outside the echo chamber, just rakudo star
19:52 dha *nod*
19:55 RabidGravy but if you already installed rakudo & panda via rakudobrew then reinstall rakudo with it you'll get the new panda and all the modules reinstalled
19:56 smls_ joined #perl6
19:56 moritz panda intall Task::Star
20:03 dha I've not been using rakudobrew. In fact, I've not installed rakudo. Just been using it in its own directory.
20:03 dha rakudobrewing now, though.
20:03 dha Which, using the airplane's wifi, should be tons of fun.
20:04 lizmat .oO( building in the very fast lane )
20:04 * nine has never used rakudobrew
20:05 nine I just have a git checkout of rakudo and panda and do make install in rakudo
20:05 lizmat looking at $a.?foo and $a.*foo and $a.+foo
20:06 lizmat I've seen the first abused a lot when in fact we only want to call the method if the object is instantiated
20:06 lizmat so sometimes I think we need something like:
20:06 Hor|zon joined #perl6
20:06 lizmat $a//.foo
20:06 lizmat this would call "foo" on $a if $a was defined
20:07 lizmat m: sub infix:<//.>($obj,$method) { $obj.DEFINITE ?? $obj.$method !! Nil }; my $a; sub b { $^a + 2 }; say $a//.&b  # something like this
20:07 camelia rakudo-moar 174049: OUTPUT«Nil␤»
20:07 lizmat m: sub infix:<//.>($obj,$method) { $obj.DEFINITE ?? $obj.$method !! Nil }; my $a = 40; sub b { $^a + 2 }; say $a//.&b  # same, now defined
20:07 camelia rakudo-moar 174049: OUTPUT«42␤»
20:07 lizmat note the messy &b is needed to make sure we have a callable there
20:08 lizmat was this functionality discussed in the past in some way ?
20:12 ShimmerFairy lizmat: Any reason you couldn't use  Callable $method  or  &method  in the parameter list? (But for a sub call, you need & to use it as a method anyway)
20:14 lizmat m: sub infix:<//.>($obj,$method) { $obj.DEFINITE ?? $obj.$method !! Nil }; my $a = 40; say ($a//.Str).perl   # this actually works ???
20:14 camelia rakudo-moar 174049: OUTPUT«"40"␤»
20:14 lizmat probably not very optimized, as $method is a Str there
20:15 lizmat m: sub infix:<//.>($obj,$method) { dd $obj, $method; $obj.DEFINITE ?? $obj.$method !! Nil }; my $a = 40; say ($a//.Str).perl
20:15 camelia rakudo-moar 174049: OUTPUT«$obj = 40␤$method = Str␤"40"␤»
20:15 lizmat so we would need some syntactic sugar there
20:16 ShimmerFairy lizmat: Now I see why you thought you needed the & , and now I'm surprised it works too.
20:16 lizmat m: sub infix:<//.>($obj,$method) { $obj.DEFINITE ?? $obj.$method !! Nil }; my $a = 40; say ($a//.foo).perl   # interesting
20:16 camelia rakudo-moar 174049: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HepXEsCotM␤Undeclared routine:␤    foo used at line 1␤␤»
20:17 lizmat so, if it is not known, it thinks it's a sub
20:17 ShimmerFairy m: sub infix:<//.>($obj,$method) { dd $obj, $method; $obj.DEFINITE ?? $obj.$method !! Nil }; my $a = 40; say ($a//.pred).perl
20:17 camelia rakudo-moar 174049: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bgsotB_n_R␤Undeclared routine:␤    pred used at line 1␤␤»
20:17 lizmat and if it *is* known, it is passed as a string
20:18 ShimmerFairy lizmat: It always thinks it's a sub, you were just trying methods with sub versions, it turns out :)
20:19 brrt \o
20:19 ShimmerFairy o/
20:20 brrt hmm
20:20 brrt i'm not sure i can formulate my question clearly enough to expect an answer
20:21 rurban1 Dios is nice, but with its PPI dependencies too big. t/alias.t compiles to a 18M c files which runs out of memory. Do you like it's syntax? The {{{ }}} interpolation with <{ … }> expansion syntax is esp. ugly. I used `` for expansion.
20:21 brrt i'm trying to prune the combinations of rules to those that will actually appear
20:23 nine m: role Foo { $?CLASS.^add_method(list => method (|args) {}); }; my $class := Metamodel::ClassHOW.new_type( name => "Foo" ); $class.^add_role(Foo); $class.^compose;
20:23 camelia rakudo-moar 174049: OUTPUT«Cannot find method 'collisions'␤  in any apply at src/gen/m-Metamodel.nqp:2633␤  in any compose at src/gen/m-Metamodel.nqp:2810␤  in block <unit> at /tmp/lTIz0X99Nd:1␤␤»
20:23 nine why?? ^^^
20:23 nine m: role Foo { $?CLASS.^add_method("list", method (|args) {}); }; my $class := Metamodel::ClassHOW.new_type( name => "Foo" ); $class.^add_role(Foo); $class.^compose;
20:23 camelia rakudo-moar 174049: ( no output )
20:24 ShimmerFairy nine: probably because the Pair is gobbled up by *%_ , would be my guess
20:24 ShimmerFairy m: role Foo { $?CLASS.^add_method((list => method (|args) {})); }; my $class := Metamodel::ClassHOW.new_type( name => "Foo" ); $class.^add_role(Foo); $class.^compose;
20:24 camelia rakudo-moar 174049: OUTPUT«Cannot find method 'collisions'␤  in any apply at src/gen/m-Metamodel.nqp:2633␤  in any compose at src/gen/m-Metamodel.nqp:2810␤  in block <unit> at /tmp/KiczotfpnX:1␤␤»
20:24 nine This "Cannot find method 'collisions'" appears in some constellations and not in others. But I cannot find a system
20:24 atroxaper joined #perl6
20:25 nine It's not the =>. That's just one way to provoke it. In Inline::Perl5 it fails without a =>
20:25 ShimmerFairy nine: and I'm guessing there's a reason you can't just do  role Foo { method list (|args) { } }  and  class Foo { ... }  :)
20:26 nine ShimmerFairy: of course :) The class name is only known at runtime and the methods I add are Any.^methods
20:29 nine Oh, I think I know the system! It appears on any error during method creation:
20:29 nine m: role Foo { for Any.does-not-work -> $name { $?CLASS.^add_method($name, method (|args) {}); }; }; my $class := Metamodel::ClassHOW.new_type( name => "Foo" ); $class.^add_role(Foo); $class.^compose;
20:29 camelia rakudo-moar 174049: OUTPUT«Cannot find method 'collisions'␤  in any apply at src/gen/m-Metamodel.nqp:2633␤  in any compose at src/gen/m-Metamodel.nqp:2810␤  in block <unit> at /tmp/9KSnt7YtMK:1␤␤»
20:30 ShimmerFairy m: role Foo { $?CLASS.^add_method((list => method (|args) {})); }; my $class := Metamodel::ClassHOW.new_type( name => "Foo" ) but Foo; say $class; # mixing in the role with "but"
20:30 camelia rakudo-moar 174049: OUTPUT«'Foo+{Foo}' cannot inherit from 'Foo' because 'Foo' isn't composed yet (maybe it is stubbed)␤  in any add_parent at src/gen/m-Metamodel.nqp:774␤  in any generate_mixin at src/gen/m-Metamodel.nqp:1290␤  in any mixin at src/gen/m-Metamodel.nqp:1250␤ …»
20:33 nine m: role Foo { for <foo foo> -> $name { $?CLASS.^add_method($name, method (|args) {}); }; }; my $class := Metamodel::ClassHOW.new_type( name => "Foo" ); $class.^add_role(Foo); $class.^compose;
20:33 camelia rakudo-moar 174049: OUTPUT«Cannot find method 'collisions'␤  in any apply at src/gen/m-Metamodel.nqp:2633␤  in any compose at src/gen/m-Metamodel.nqp:2810␤  in block <unit> at /tmp/cYVtXaM62J:1␤␤»
20:34 nine I think this is what happens in Inline::Perl5 ^^^
20:35 nine I'm trying to add a method that is already inherited from somewhere. Ironically this works just fine when I crate the class using EVAL "class GLOBAL::$module does Perl5Package[\$p5, \$module] { }";
20:36 ShimmerFairy nine: maybe you can use a macro that creates a method instead of trying to go through the metamodel? (I'm not familiar with doing such complex language trickery, so I'm afraid I can't be of much help)
20:37 llfourn joined #perl6
20:45 dalek joined #perl6
20:48 nine Ok, I think the loop adding methods runs multiple times. No idea why though. A next if $?CLASS.^declares_method($name); in the loop seems to help.
20:54 bin_005 joined #perl6
20:55 nine "An exception occurred while evaluating a BEGIN"
20:55 nine Is it me or has rakudo's error reporting become drastically worse in the past few days? I'm now getting such usefull messages...
20:56 skids .oO(If we implemented failures to spec we could just have my $nosink = Any.method.fails.down.to.this.semicolon; # and not deal with syntax sugar.)
20:59 ShimmerFairy nine: There was something about error reporting over the last few days. Though if this is your first time messing with the MOP, I'd blame delving deeper into the internals as a cause for more cryptic errors :P
21:00 nine ShimmerFairy: unfortunately it's not only the messing around with the MOP
21:01 nine m: class Foo is Mu { }; say Foo.new ~~ Pair;
21:01 camelia rakudo-moar 174049: OUTPUT«X::Multi::NoMatch exception produced no message␤  in block <unit> at /tmp/JcPiZmeThD:1␤␤»
21:01 nine ^^^ another example of a pretty useless error message
21:01 skids Because someone did not put a .message in that.
21:01 nine And I have the feeling that "Cannot find method 'collisions'" is also new
21:01 nine There is code that should tell me that the message already exists
21:02 nine s/message/method/
21:03 skids Hrm what did you do to get the X::Multi::NoMatch?
21:03 skids OIC nm
21:03 skids I'll look at that when I get home.  That should not happen.
21:04 skids it has a .message method.
21:04 dha joined #perl6
21:04 skids (And is likely my fault somehow.)
21:05 [Sno] joined #perl6
21:06 nine Ok, the "Cannot find method 'collisions'" was already there on July 18th
21:07 nine class Foo is Mu { }; say Foo.new ~~ Pair; gave an equally unhelpful "Invocant requires a 'Failure' instance, but a type object was passed.  Did you forget a .new?"
21:07 skids I've only seen that one when doing something truly abusive with roles/scoping.
21:07 nine skids: so actually your changes really were an improvement. There's just more to be gained :)
21:09 skids Well, if there really is a type object being passed in, then no, that would not be an improvement.  Anyway decommute and then I'll dig at it a bit.
21:09 nine Since I only do Foo.new ~~ Pair, I think the source of the error is a missing ACCEPTS that Any would provide.
21:09 nine X::Multi::NoMatch is a mild indication to that effect.
21:10 smls_ lizmat: "was this functionality discussed in the past" -- I tried to. :P I think TimToady told me to use 'andthen'. (Once it works correctly. But even then, the low precedence will be bothersome.)
21:10 telex joined #perl6
21:10 smls_ i.e.  ($obj andthen .method)
21:12 smls_ My biggest gripe with "andthen" is actually, that its name makes it sounds like a version of "and" (which checks for truthiness), but it instead checks for definedness.
21:13 lizmat m: my Int $a; say $a andthen .succ  # how is this supposed to work ?
21:13 camelia rakudo-moar 174049: OUTPUT«(Int)␤Method 'succ' not found for invocant of class 'Any'␤  in block <unit> at /tmp/9tjkbHrpId:1␤␤»
21:14 lizmat m: my Int $a; say $a andthen $a.succ  # huh?
21:14 camelia rakudo-moar 174049: OUTPUT«(Int)␤Invocant requires a 'Int' instance, but a type object was passed.  Did you forget a .new?␤  in block <unit> at /tmp/s8WBKf681l:1␤␤»
21:14 ShimmerFairy m: my Int $a; say ($a andthen .succ); # low precedence caught you here, looks like
21:14 camelia rakudo-moar 174049: OUTPUT«(Int)␤»
21:16 smls_ andthen is supposed to make the LHS available as $_ before evaluating the RHS
21:23 diegok Hello, is there any config or anything to make p6 repl more friendly?
21:24 dha define "friendly". :-)
21:25 smls_ diegok: If you install the Linenoise module, the REPL will automatically use it and you'll get proper line editing, tab completion, and history support.
21:26 diegok smls_: thanks!, installing it :-)
21:26 paulmcquad joined #perl6
21:26 paulmcquad left #perl6
21:27 egrep joined #perl6
21:27 egrep left #perl6
21:28 smls_ Maybe the REPL should print a corresponding hint when started...
21:29 smls_ Python's REPL prints 3 lines of intro messages when starting the REPL; Perl 6 prints none so far...
21:30 diegok smls_: looks like a good idea... now I should understand why it isn't working for me :-(
21:30 dha Ironic. I'd expect Python to print 3 lines of whitespace.
21:30 dha ;-)
21:30 diegok dha: or tabs...
21:31 smls_ "Rakudo version 2015.07.1-11-ge3314c8 [no line-editing support enabled]. Type 'help' for info."  -- an intro message like this could really increase discoverability of the Linenoise feature...
21:32 dha Yeah, I just found something about Linenoise today. I would have liked to have found it some time ago. :-)
21:33 smls_ diegok: With "isn't working" you mean that even after installing the Linenoise Perl 6 module, the REPL doesn't have line editing support for you?
21:33 diegok smls_: right :-/
21:34 Fleurety joined #perl6
21:35 smls_ How did you install it? I installed Rakudo and panda via rakudobrew, and Linenoise via "panda install Linenoise", and it works for me.
21:35 diegok smls_: Linenoise module seems to be installed as I can 'use' it but has no effect :-/
21:36 diegok smls_: I've installed rakudo-star using homebrew today
21:36 dha Huh. I just got this error message when running the perl6 after installing Linenoise: "Cannot locate native library 'liblinenoise.dylib': dlopen(liblinenoise.dylib, 1): image not found"
21:36 dha ?
21:36 diegok smls_: and installed Linenoise with panda
21:36 smls_ strange
21:37 amurf joined #perl6
21:37 diegok dha: http://rjbs.manxome.org/rubric/entry/2081 ?
21:41 dha Thanks. I'll see if that helps.
21:46 dha Out of curiosity, where would panda be installing things?
21:53 dha Ok. used rjbs's fix, and I'm not getting the error, but the line editing still isn't working. :-
21:53 dha /
21:53 colomon_ joined #perl6
21:53 dha Ah. Now it's working. yay.
21:54 diegok hm... looks like I should use rakudobrew again :-)
21:55 dolmen joined #perl6
21:57 * lizmat has wrought another P6W: https://p6weekly.wordpress.com/2015/07/27/2015-2930-fastforwarding-to-the-present/
21:58 colomon joined #perl6
22:01 lizmat good night, #perl6!
22:01 colomon o/
22:01 yoleaux 11:36Z <jdv79> colomon: smoke is stalled
22:09 dha joined #perl6
22:19 Begi joined #perl6
22:26 fling joined #perl6
22:26 rurban joined #perl6
22:38 llfourn joined #perl6
22:41 diegok smls_: it just works with a fresh rakudobrew install, yay!
22:43 skids joined #perl6
22:51 dha joined #perl6
22:58 fling joined #perl6
22:59 Mhoram joined #perl6
23:00 khw joined #perl6
23:01 skids m: class Foo is Mu { }; say Foo.new ~~ Failure; 1;
23:01 camelia rakudo-moar 174049: OUTPUT«X::Multi::NoMatch exception produced no message␤  in block <unit> at /tmp/pPbuN9_oSG:1␤␤»
23:02 skids Yeah.  Because one of the things X::Multi::Nomatch.message does is take the Foo.new and ~~ Failure with it.  And off in circles we go.
23:04 skids Similar to the problem that necessitated https://github.com/rakudo/rakudo/pull/479
23:05 amurf joined #perl6
23:05 skids nine: ^^^
23:09 skids Really some of the core X:: classes are way too optimistic about how many language features they are allowed to get.
23:09 skids *use
23:28 lsm-desktop joined #perl6
23:43 BenGoldberg_ joined #perl6
23:47 Mhoram joined #perl6
23:54 bloomburgers joined #perl6
23:55 bloomburgers anyone know if rakudo supports method stubs in roles? I seem to be getting errors

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

Perl 6 | Reference Documentation | Rakudo