»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
ShimmerFairy wonders if the better solution to this kind of issue would be to have a built-in mechanism to 'link' different spellings of an operator, e.g. multi sub infix:<⊂> is texas("(<)") { ... } or multi sub infix:«⊂ (<)» 00:00
Sgeo Will there eventually be guidelines on fail vs die? 00:08
Also I'm curious why the ternary operator is ?? !! instead of PErl5 and everyone else's ? : 00:10
ShimmerFairy I would hope so :) . At first guess I'd say that 'fail' is for when you want something kinda similar to NaN for floating point, and 'die' is for more "traditional" exception handling mechanism. (I'm not too well-versed in exception handling in P6 though)
Sgeo: I guess there might be parsing reasons for it, but additionally I think ?? !! does a better job of communicating what the following bit of code does (_especially_ !! when compared to : ) 00:12
TimToady we didn't want to waste two perfectly good ascii characters for a single construct, and the doubling fits in better with other thunky operators like || and && 00:19
an invocant colon would be formally ambigous with the : as well
ShimmerFairy I figured the colon was the parsing issue (since everybody wants it) :P 00:20
Also, there's no chance of your prefix:<?> being misinterpreted due to extra whitespace :)
dalek c: 64b148b | ShimmerFairy++ | lib/Language/operators.pod:
Document the flipflop operators

I wasn't sure as to the level of detail desired on the operator page, so hopefully it's not too much or too little for these eight operators. These operators feel like they could benefit from an(other,) independent page explaining things in a bit more detail anyway.
00:23
ShimmerFairy TimToady: do you have any thoughts on some sort of "synonym" mechanism for unicode & texas versions of operators? On the one hand I feel it would be a better way of defining them, but on the other hand I get the sneaking suspicion there are some nasty dragons in that idea :) 00:26
TimToady well, personally, I think the main ones should be Unicode, and the Texas ones aliases, but that's not really addressing your question 00:30
Sgeo B<"=begin code" ff "=end code"> 00:33
ShimmerFairy TimToady: that's what I think too, since I want to define unicode multis instead of texas, but I can already see other people preferring the texas versions and wanting to define multis on that.
Sgeo What is that B< >, and how does it relate to string comparison?
ShimmerFairy Sgeo: it gets rendered as boldface when processed (see the :allow<B V> on the code block, which allows use of B<> and V<> formatting codes)
Sgeo I guess ff is smartmatching on the strings, and the V<=> isn't really there/ 00:34
ShimmerFairy The V<=> is to prevent accidental parsing of the =begin code and =end code directives by the Pod parser. (the =end code is the more concerning one)
Sgeo There was a djkistra thing promoting including start but not stop conditions
But at least Perl6 seems consistent with ^ markers 00:35
ShimmerFairy Crap, I knew I forgot something; using Whatever on the RHS :)
Sgeo Seems saner than .. vs ... or whatever
ShimmerFairy "start" ff * has no stop condition
00:35 mjgardner joined
Sgeo If closures were used, would a library-based ff be possible? 00:37
ShimmerFairy Maybe, I only just learned about flipflop the other day because I finally wanted to know what they did (so looked at P5 stuff), and then decided to write docs for P6 :) 00:39
(I'm also not sure what "library-based" means, exactly)
00:39 llfourn joined 00:40 cognominal left
Sgeo AS in defining it as an infix operator without special compiler knowledge of it 00:40
ShimmerFairy Sgeo: ah. The issue is that flipflop keeps a global state per instance of it in code, so a "pure P6" version would end up taking up some global space, for sure (don't know if macros would change that). You'd also have to keep track of instances of the op, which is aaagh :) 00:43
00:44 llfourn left
timotimo the op could just desugar to implementation(state $, LHS, RHS) or something 00:44
Sgeo Per instance in code? I was thinking maybe it was scoped the way state is (which I'm not sure I fully grasp either)
timotimo then the perl6 implementation will do the rest for you
it gets instantiated when a clone happens
ShimmerFairy Sgeo: in P5 it persists across sub calls (say), so the "isolated" version involves returning a sub that does the flipflop. I haven't tested that in P6, but AFAIK it likely works out the same. 00:45
timotimo m: for 1, 2, 3 -> $o { for <a b c> -> $i { state $outer = $o; say "$o $i $outer" } }
camelia rakudo-moar 1a3f1a: OUTPUT«1 a 1␤1 b 1␤1 c 1␤2 a 2␤2 b 2␤2 c 2␤3 a 3␤3 b 3␤3 c 3␤»
timotimo er, that's not so amazing
m: for 1, 2, 3 -> $o { for <a b c> -> $i { state $outer; $outer ~= "$o$i"; say "$o $i $outer" } }
camelia rakudo-moar 1a3f1a: OUTPUT«1 a 1a␤1 b 1a1b␤1 c 1a1b1c␤2 a 2a␤2 b 2a2b␤2 c 2a2b2c␤3 a 3a␤3 b 3a3b␤3 c 3a3b3c␤»
timotimo there the outer for loop causes the inner block to get cloned and a new state var "happens" 00:46
m: say (state $; $ ~= "a") xx 10 00:47
camelia rakudo-moar 1a3f1a: OUTPUT«(Any) a (Any) aa (Any) aaa (Any) aaaa (Any) aaaaa (Any) aaaaaa (Any) aaaaaaa (Any) aaaaaaaa (Any) aaaaaaaaa (Any) aaaaaaaaaa␤»
ShimmerFairy m: sub foo(@a) { for @a { say $_ if /C/ ff * } }; my @list = <A B C D E>; foo(@list); foo(@list); # huh, my limited understanding of QAST led me to believe this would behave like in P5.
camelia rakudo-moar 1a3f1a: OUTPUT«C␤D␤E␤C␤D␤E␤»
ShimmerFairy I believe P5 would've printed the entire list on the second call.
dalek c: aa0d2ea | ShimmerFairy++ | lib/Language/operators.pod:
Forgot to mention * as the right arg of flipflop.

  $a ff * (or any of the other flipflop ops) means that there is no stop
condition. Once $a matches, the flipflop is always successful.
00:50
00:51 gfldex left
Sgeo What happens if you want to test the same expression against being true? Is there a &id that could be used for both sides of the flip flop? 00:52
I guess something like .Bool ff .Bool?
skids FWIW fail is indeed supposed to be a NaNish thing. The "use fatal" directive cannot muck with you if you use it that way because it scopes lexicially. However, at some point we turned on warnings for GCed failures, I think maybe just as a temporary leak detector, and until they get turned off again it is hard to use it as intended. 00:54
ShimmerFairy m: say $_ if /C/ ff /C/ for <A B C D E> 00:55
camelia rakudo-moar 1a3f1a: OUTPUT«C␤»
ShimmerFairy m: say $_ if /C/ fff /C/ for <A B C D E>
camelia rakudo-moar 1a3f1a: OUTPUT«C␤D␤E␤»
ShimmerFairy Sgeo: depends on if you're using ff or fff ^^^
b2gills Putting the same condition on both sides of a ff is kind of pointless, as you can just test against the conditional, now on fff it can make a certain amount of sense. 00:57
Sgeo How about .Bool ff .Bool.not 00:58
:m 5.Mu 00:59
m: say 5.Mu
camelia rakudo-moar 1a3f1a: OUTPUT«Method 'Mu' not found for invocant of class 'Int'␤ in block <unit> at /tmp/DSbmwnlRBZ:1␤␤»
b2gills m: say ($++, $ ~= "a") xx 10 # every unnamed scalar is it's own state value
camelia rakudo-moar 1a3f1a: OUTPUT«0 a 1 aa 2 aaa 3 aaaa 4 aaaaa 5 aaaaaa 6 aaaaaaa 7 aaaaaaaa 8 aaaaaaaaa 9 aaaaaaaaaa␤»
b2gills .Bool ff .Bool.not would match all of the trueish values, and one additional one, which could be handy, now .Bool ff^ .Bool.not would be the same as just .Bool 01:02
ShimmerFairy I'm open to a P6-based version (the less "special" operators, the better, imo). But I suspect there's a very good reason it hasn't been done yet, so I'd speak with our resident compiler experts about it beforehand :) 01:04
timotimo thank you for the reminder, b2gills 01:05
01:09 atta joined, atta left 01:15 yqt left 01:24 rmgk_ joined, rmgk is now known as Guest59037, Guest59037 left, rmgk_ is now known as rmgk 01:31 colomon left 01:34 colomon joined
Sgeo So, True and False on RHS of smartmatch gives True and False, so you can use normal expressions on RHS of smartmatch and the result will be what's expected. But I can imagine someone using a truthy or falsey expression on the RHS of a smartmatch (e.g. the conditions of ff) and the smartmatch causing it to mean something other than what's expected 01:38
01:38 skids left
Sgeo e.g. @foo.elems ff @bar.elems doesn't check for @foo's nonemptiness as the condition of flip-flopping, but the smartmatch of that number against $_ 01:39
And I can easily see someone making that mistake
ShimmerFairy That's a problem that would also come up in when $x { } blocks, fwiw 01:40
Sgeo Hmm that makes it more obvious and is more likely to occur, yeah 01:44
ShimmerFairy That's indeed going to be a potential issue in place with implicit ~~ matching, but not one that's solved besides "it's not gonna coerce to boolean here". (For things like ff and when, for instance, using something other than smartmatch would ruin the ability to use regexes)
Sgeo Maybe it could be considered a problem with smartmatch itself? 01:45
I don't know what the fix is though
01:45 tommi left
ShimmerFairy Well, smartmatch is specifically supposed to be most permissive ("most human", if you will) form of equivalence in Perl 6. ~~ also takes its left arg as the $_ for the right arg, which is why it's used with regexes. 01:47
But if you're like me and you typically read $a ~~ /regex/ with no thought about the fact that /regex/ matches against $_, it feels like there could/should be a separate "regex match" operator :)
Sgeo I thought m/regex/ matches against $_ ? 01:48
ShimmerFairy m: for <A B C> { say /C/ ?? "OK!" !! "nope" }; for <A B C> { say /C/ } 01:49
camelia rakudo-moar 1a3f1a: OUTPUT«nope␤nope␤OK!␤/C/␤/C/␤/C/␤»
ShimmerFairy m: for <A B C> { say m/C/ ?? "OK!" !! "nope" }; for <A B C> { say m/C/ }
camelia rakudo-moar 1a3f1a: OUTPUT«nope␤nope␤OK!␤Nil␤Nil␤「C」␤»
01:49 gfldex joined
ShimmerFairy Not in all the places m// matches, but /.../ still does match against $_ . 01:49
(I don't know if that say /C/ is a bug) 01:50
Sgeo That's... confusing
ShimmerFairy While I'm not a fan of the implicit matching against $_ for regex literals, it does get used. I would like to see a specific "regex equality" operator, since I think the very permissive ~~ is an unfortunate only operator option for regex testing, but I don't feel too strongly about it. 01:52
.oO( multi sub infix:</==/> ... say $string /==/ /regex/; :P )
01:53
Sgeo Do we really need both $_ + 1 and { $_ + 1 } to match on the RHS? That is, why not just the latter, and drop the implicit setting of $_, which could still allow regex literals to match 01:54
It occurs to me that this probably does not help the situation that much 01:55
ShimmerFairy I fear it's far too ingrained at this point to sanely deprecate that if it was decided for :( Also, remember that $left ~~ $right desugars to $right.ACCEPTS($_) , where $_ is set to $left
Sgeo: ~However~, there was recently talk that, in order to make ~~ chain like it's supposed to, the chaining version of ~~ wouldn't topicalize (set $_). 01:56
01:58 colomon left, colomon joined 02:08 aborazmeh joined, aborazmeh left, aborazmeh joined
b2gills m: say /c/.ACCEPTS('c') 02:11
camelia rakudo-moar 1a3f1a: OUTPUT«「c」␤»
Sgeo $_ ~~ $_ could be pretty interesting
timotimo unless someone figures out how my latest commit to nqp breaks deepmap when combined with things returning whatever .map creates (as can be tested with ("a", "b")>>.ords returning an empty list), it may be a good idea to revert that nqp commit :| 02:13
ShimmerFairy timotimo: on a cursory glance, I see :op('while') in Optimizer.nqp:1499 and World.nqp:2011 , if those spots could be helpful to investigate. 02:15
also in Actions.nqp:1226 02:16
02:20 skids joined
ShimmerFairy timotimo: looking at the diff for your nqp commit, the only thing that jumps out at me is the use of =:= . It's not necessarily wrong (I wouldn't know), but the fact that you don't see it all that often makes me wonder if === or something isn't the better operator. 02:23
02:27 camelia left
ShimmerFairy meh, apparently camelia didn't like me trying nqp: 02:27
timotimo: is there some reason you weren't able to do nqp::defined($res_reg) instead of setting it to and testing for MAST::VOID in the unless statement? 02:28
02:28 camelia joined 02:29 AlexDaniel left, ChanServ sets mode: +v camelia
Sgeo Can Perl6 regexes do HTML? 02:36
Sgeo looks around for Cthulhu
ugexe seems like one of the latest nqp commits has introduced a precomp bug where it cant find &Symbol of SomeModule::Symbol when it could before
ShimmerFairy Sgeo: sure, just last night I found myself discussing parsing XML :) (I wrote an XML 1.1 parser not too long ago) 02:38
02:38 mjgardner left
Sgeo And how do P6 regexes compare with Haskell parsec? 02:38
Can I do the sort of thing with parsec where a value obtained by parsing controls the next regex to be run?
02:40 noganex joined, llfourn joined
ShimmerFairy m: say "0foo" ~~ /<digit> [ <?{+$<digit> == 0}> foo | <?{+$<digit> == 1}> bar ]/ # Sgeo: like this? 02:41
camelia rakudo-moar 1a3f1a: OUTPUT«「0foo」␤ digit => 「0」␤»
ShimmerFairy I've written conditionals in regexes using <?{}> and <!{}> before :) 02:42
02:43 noganex_ left 02:45 llfourn left
ShimmerFairy Sgeo: here's an example: github.com/lue/synopsis-generator/...Blinks.pm6 here I used a dynamic variable to track whether I was inside a <> or a «» construct, and then tested that variable in <?{}> assertions in subrules where I needed to know. 02:45
(I need to get to working on that repo again soon, btw, but the example is still valid) 02:46
Sgeo I don't know anywhere near enough about P6 regexes 02:49
02:50 bayprogrammer joined
ShimmerFairy Sgeo: that's fine. <?{}> is a successful zero-width match if the code inside the {} evaluates to True, and <!{}> is successful if the code is False. Like other zero-width matches you use them as a kind of 'prerequisite' for the rest of the regex (confined within brackets and such of course) 02:52
Sgeo Could I, in theory, parse a piece of text, get a regex out of it, then use that regex to parse the next section? Possibly with an action also determined by the results of parsing/actioning the previous text? 02:54
ShimmerFairy m: my $strx = "a*b"; say "b" ~~ /<$strx>/ 02:56
camelia rakudo-moar 1a3f1a: OUTPUT«「b」␤»
Sgeo I guess I was hoping that one regex could do it
ShimmerFairy You can construct a regex in a string and then use it like that, for example.
Sgeo Or... I'm not sure. I just want monadic parsing
ShimmerFairy I have no knowledge of monads, much less monadic parsing, so I couldn't help with that I'm afraid :( However, I've found P6 grammars to be quite powerful nonetheless (it's used to parse Perl 6, after all ☺) 02:57
02:58 bayprogrammer left, bayprogrammer joined 02:59 bayprogrammer left 03:00 mjgardner joined, bayprogrammer joined
Sgeo foo = do { a <- someParser; b <- a; return b} defines a parser foo. a is the result of parsing with someParser, and b is the result of, in tern, processing a. The result of the parser is b 03:00
s/processing/parsing with/
This doesn't happen as foo is defined, but rather, each time that foo is used as a parser, and foo itself can be used to build larger parsers similarly 03:01
ShimmerFairy Sgeo: in terms of parsers returning parsers (or regexes returning regexes, in a sense), it's certainly possible, but it would be interesting. :) nqp's src/QRegex directory comes to mind as an example of what is ultimately regexes parsing regexes. 03:03
Sgeo Doesn't necessarily have to be reading regexes in, just resulting in a regex value 03:04
Not entirely sure whether a monadic parser would in P6 terms be just a regex or regex+action
And then using that resulting value as the next thing (or not necessarily immediately, but being able to later on) to run as regex 03:05
All contained in its own little unit
ShimmerFairy If you're more concerned with building a grammar out of smaller parts, that's easily accomplished with subrules and inheritance (IIRC Perl6 grammars implicitly inherit from some "base" grammar, but I can't be certain)
Sgeo I don't know if this is equivalent, but I think it might be: Can Perl6 regexes be used to parse context-sensitive grammars? 03:06
ShimmerFairy as long as the grammar has some way of knowing the context, it can. The grammar for Perl6 has a _lot_ of dynamic ($*STUFF) variables for carrying information down into called subrules and even into action methods. 03:08
03:08 mjgardner left
ShimmerFairy Sgeo: I think monadic parsing is certainly possible in Perl 6, but without knowing it too well I can't say how difficult it would be. I suspect there's definitely room for something like use Monadic::Parser; to ease things :) 03:10
b2gills m: say 'abcasdf' ~~ / (.) (.*) $0 /
camelia rakudo-moar 1a3f1a: OUTPUT«「abca」␤ 0 => 「a」␤ 1 => 「bc」␤»
03:10 shinobi-cl joined 03:12 gfldex left
shinobi-cl Hi all... is there a way to enable iteration in a class of mine? something like a interface with first, index, next, prev methods? 03:12
dalek kudo/nom: 66d946e | TimToady++ | src/Perl6/Actions.nqp:
hook up new with/without opcodes
kudo/nom: c70e5e1 | TimToady++ | tools/build/NQP_REVISION:
bump NQP for new with/without ops
p: 4de65a5 | TimToady++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
implement with/without ops

These are just like if/unless except they test for .defined, but still pass the original object to the block.
03:13
ShimmerFairy Sgeo: note that there are some features related to using previously-seen parts, like <~~>, that aren't yet implemented.
b2gills shinobi-cl: jnthn is currently working on the design of that 03:14
I think that the Perl 6 grammar ( the grammar used to parse Perl 6 ) is at least a context sensitive grammar ( as far as I know ) 03:15
ShimmerFairy m: say "foodbard" ~~ / (foo|bar) d <~~0> d /; # this would, if implemented, match the whole string, whereas neither $0 nor <$0> would do so in the place of <~~0> 03:16
camelia rakudo-moar 1a3f1a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/c5a46f_UT4␤Sorry, ~~ regex assertion with a capture is not yet implemented␤at /tmp/c5a46f_UT4:1␤------> 3say "foodbard" ~~ / (foo|bar) d <~~07⏏5> d /; # this would, if implemented, ma␤»
03:17 travis-ci joined
travis-ci Rakudo build failed. TimToady 'bump NQP for new with/without ops' 03:17
travis-ci.org/rakudo/rakudo/builds/74663462 github.com/rakudo/rakudo/compare/1...0e5e1935b4
03:17 travis-ci left
shinobi-cl b2gills: cool!! 03:17
b2gills Perl 6 steals ideas from everywhere, and removes the artificial limitations ( even when it isn't immediately obvious that it was an artificial limitation ) 03:21
03:22 nys left
Sgeo IIUC, a function can take a closure that takes a closure etc can specify the type of all of these somehow? 03:24
When it does so, how accurate is the error message if an incorrectly typed thing is given?
Like, if the type of a function is Int --> Str, it's the caller's fault if it's given a non-Int, and the function's fault if it returns a non-Str. And things get more complicated at higher-order etc 03:25
b2gills m: my sub example ( &b where \() ~~ &b.signature ){ say b }; example ->{ 'hello' } 03:34
camelia rakudo-moar 1a3f1a: OUTPUT«hello␤»
b2gills m: my sub example ( &b where \() ~~ &b.signature ){ say b }; example -> $ { 'hello' }
camelia rakudo-moar 1a3f1a: OUTPUT«Constraint type check failed for parameter '&b'␤ in sub example at /tmp/43r0dIUCLO:1␤ in block <unit> at /tmp/43r0dIUCLO:1␤␤»
b2gills There is probably a better way of writing it 03:35
03:35 bayprogrammer left
Sgeo Suppose a Parser[Foo] is a thing that, among other things, when given an Str, can try to get a Foo out. If Parser is monadic, then there exists a function join such that you can take a Parser[Parser[Foo]] and turn it into a Parser[Foo] 03:35
(And a few laws about that function join)
geekosaur next up, Par6ec 03:36
Sgeo So it takes a parser that results in a parser that results in Foo, and gives a parser that can just give back Foo
ShimmerFairy timotimo: looking at deepmap, it appears that the nqp::while's it uses are 1) conditional, and 2) use an nqp::stmts after the condition. Do you know if nodemap and Range.reify are broken too? (they both have nqp::while loops with nqp::stmts) 03:42
03:43 raiph left
shinobi-cl r: my @re = (rx/4/, rx/6/); my @d = (1,12,34,44,46,66,65,90); @re ~~ @q; 03:59
camelia rakudo-{moar,jvm} c70e5e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile␤Variable '@q' is not declared␤at /tmp/tmpfile:1␤------> 3y @d = (1,12,34,44,46,66,65,90); @re ~~ 7⏏5@q;␤»
shinobi-cl r: my @re = (rx/4/, rx/6/); my @d = (1,12,34,44,46,66,65,90); @re ~~ @d; 04:00
camelia ( no output )
04:00 raiph joined 04:01 raiph left
Sgeo What's the difference between m and r? 04:01
04:01 raiph joined 04:02 raiph left 04:03 raiph joined 04:05 raiph left 04:07 raiph joined 04:08 raiph left 04:09 bin_005 left, raiph joined, bin_005 joined 04:10 raiph left 04:11 raiph joined 04:17 raiph left 04:18 raiph joined
dalek ast: 41defae | skids++ | S32-str/encode.t:
Add tests for RT#107204

Also adjust comments for autogenned RTs that can be merged
04:19
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=107204
04:29 llfourn joined 04:34 shinobi-cl left 04:44 raiph left, raiph joined 04:50 Sgeo left 04:51 Sgeo joined
b2gills Sgeo: m: uses the MoarVM backend j: uses the JVM backend r: uses both 05:08
Sgeo Ah 05:17
ugexe this new precomp bug is quite frustrating. RAKUDO_MODULE_DEBUG shows the module XXX::Request as having been loaded, but then fails because it cant find the symbol &Request. Source code works fine, and precomp worked fine a couple days ago. 05:21
precompiled code worked fine^
05:34 skids left 05:42 aborazmeh left 05:46 DrForr joined 05:47 diana_olhovik joined, sivoais joined 05:54 sivoais left 05:56 sivoais joined 05:58 llfourn_ joined, preyalone left, llfourn left, preyalone joined 06:02 geekosaur left 06:04 dsm left, eam left 06:05 eam joined, dsm joined
TimToady m: with "abc".index("a") { say $^pos } 06:06
camelia rakudo-moar c70e5e: OUTPUT«0␤»
06:06 diakopter left 06:07 diakopter joined 06:10 telex left 06:12 brrt joined, telex joined
jdv79 ugexe: i also hit an error like that 06:12
quite fun indeed
06:14 geekosaur joined
Sgeo with? 06:14
Function application as a function? 06:15
TimToady more like "success" in logic programming
Sgeo Where are docs?
TimToady aren't any yet
Sgeo Where is definition?
TimToady not even any tests yet :)
but these are all related to 'andthen', which does have some documentation 06:17
jdv79 at my last job i would automatically fail a code review if it had no tests
i didn't get many code reviews
TimToady m: "abc".index("a") andthen .say
camelia rakudo-moar c70e5e: OUTPUT«0␤»
Sgeo Is with like an if defined -> $blah sort of thing? 06:18
TimToady yes
m: .say with "abc".index("a") 06:20
camelia rakudo-moar c70e5e: OUTPUT«0␤»
TimToady works as a statement modifier too
Sgeo Do custom statement modifiers exist?
jdv79 we can finally put the whole Pos/Index thing behind us!
TimToady not yet
there's a syntax category, so the macro system should eventually allow targeting that slot 06:21
Sgeo m: say "abc".index("a").WHAT
camelia rakudo-moar c70e5e: OUTPUT«(Int)␤»
Sgeo m: say (my $a).VAR.WHAT
camelia rakudo-moar c70e5e: OUTPUT«(Scalar)␤»
TimToady m: .say with .index("a") for 'aaa' ... 'zzz'
camelia rakudo-moar c70e5e: OUTPUT«Method 'index' not found for invocant of class 'Any'␤ in block <unit> at /tmp/LWoL6CisSP:1␤␤»
TimToady hmm, looks like a bug 06:22
Sgeo m: say (my $a).VAR
camelia rakudo-moar c70e5e: OUTPUT«Any␤»
Sgeo m: say (my $a).VAR.perl
camelia rakudo-moar c70e5e: OUTPUT«Any.new␤»
Sgeo should stop spamming
TimToady m: (.say with .index("a")) for 'aaa' ... 'zzz' 06:27
camelia rakudo-moar c70e5e: OUTPUT«0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤0␤…»
TimToady m: (.say with .index("a")) for 'baa' ... 'zzz'
camelia rakudo-moar c70e5e: OUTPUT«1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤1␤…»
TimToady oughta work without the parens though
06:35 xfix joined 06:47 llfourn_ left 06:57 rurban joined 07:05 danaj left 07:10 RabidGravy joined
RabidGravy marning 07:20
Sgeo m: print 5.&infix:<~>; 07:30
camelia rakudo-moar c70e5e: OUTPUT«5»
Sgeo m: print 5.&infix:<~>.perl
camelia rakudo-moar c70e5e: OUTPUT«"5"»
Sgeo That's almost certainly not the obvious way to do it 07:31
07:48 darutoko joined 07:50 xfix left 07:51 brrt left 08:14 brrt joined 08:28 danaj joined 08:41 brrt left 08:44 TEttinger left, llfourn joined, rurban left 08:48 llfourn left
dalek line-Perl5: ffa10fe | (Stefan Seifert)++ | lib/Inline/Perl5.pm6:
Fix can on Perl6::Object:: packages
09:01
Inline-Perl5: 9a6bc58 | (Stefan Seifert)++ | / (5 files):
Inline-Perl5: Better fake inheritance from P5 classes by P6 classes
09:01 dalek left, dalek joined, ChanServ sets mode: +v dalek
nine I'll never understand why dalek sometimes can print a screen full and at other times get kicked after just 5 lines 09:01
RabidGravy different servers? 09:05
09:07 diana_olhovik left, xfix joined 09:08 diana_olhovik joined 09:16 diana_olhovik left 09:20 cognominal joined 09:24 woolfy joined 09:25 coffee` left, coffee` joined
woolfy Perl 6 Hackathon at Swiss Perl Workshop is going to be great: act.perl-workshop.ch/spw2015/wiki?n...nAttendees 09:26
09:26 woolfy left 09:29 cognominal left 09:30 cognominal joined 09:40 gfldex joined 09:42 rurban joined 09:44 llfourn joined 09:45 diana_olhovik joined 09:48 llfourn left
dalek rl6-most-wanted: bd6ca64 | (Bradley Andersen)++ | most-wanted/modules.md:
adding info on p6 Math::Trig

work to begin next week, unless you know of someone else already doing it
10:12
rl6-most-wanted: 4df6961 | lizmat++ | most-wanted/modules.md:
Merge pull request #5 from elohmrow/patch-1

adding info on p6 Math::Trig
10:13 diana_olhovik left
sergot AlexDaniel: thanks! 10:14
RabidGravy which reminds me 10:18
10:20 Alina-malina joined
dalek kudo/nom: 16e5d29 | sergot++ | src/core/Exception.pm:
fix X::Dynamic::Postdeclaration exception message #125733
10:25
kudo/nom: d3eb00a | lizmat++ | src/core/Exception.pm:
Merge pull request #488 from sergot/exception-msg-fix

fix X::Dynamic::Postdeclaration exception message #125733
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125733
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125733
rl6-most-wanted: 78b07e3 | RabidGravy++ | most-wanted/modules.md:
Added Log::Syslog::Native and Term::Cap as WIP
10:27
10:38 xfix left 10:42 rindolf joined 10:44 brrt joined, rurban left
dalek ast: f8b1530 | lizmat++ | S04-statements/with.t:
Add some more with/orwith/without tests
10:48
10:49 rurban joined
dalek kudo/nom: a32c146 | lizmat++ | t/spectest.data:
Add with/without/orwith tests to spectest
10:50
10:51 isBEKaml joined 10:55 brrt left 11:02 RabidGravy left 11:07 Averna joined
dalek kudo/nom: 42e19ee | lizmat++ | src/core/ (4 files):
Fix spectest errors caused by Index changes

This is actually mostly a revert of 391bdb1dc3a6962a049992dba , but using new with/without functionality where appropriate
11:21
11:24 diana_olhovik joined 11:31 rurban left 11:43 isBEKaml left 11:45 llfourn joined 11:49 llfourn left 11:57 diana_olhovik left 11:58 leont joined
leont I'm trying to debug a grammar, how can I say get the string in front of the current position? 12:00
timotimo leont: why don't you install Debugger::UI::Commandline and perl6-debug-m your script? :) 12:01
m: "hello how are you?" ~~ / \w { say $/.CURSOR.prematch; } '?' /
camelia rakudo-moar a32c14: OUTPUT«Method 'prematch' not found for invocant of class 'Cursor'␤ in block <unit> at /tmp/G0V1kzQo9X:1␤␤»
timotimo m: "hello how are you?" ~~ / \w { say $/.CURSOR.pos; } '?' /
camelia rakudo-moar a32c14: OUTPUT«1␤2␤3␤4␤5␤7␤8␤9␤11␤12␤13␤15␤16␤17␤»
timotimo m: "hello how are you?" ~~ / \w { say $/.orig.substr(0, $/.CURSOR.pos - 1); } '?' / 12:02
camelia rakudo-moar a32c14: OUTPUT«␤h␤he␤hel␤hell␤hello ␤hello h␤hello ho␤hello how ␤hello how a␤hello how ar␤hello how are ␤hello how are y␤hello how are yo␤»
leont Ah, now I understand, I forgot about .orig
timotimo useful, no? :)
i'm glad to hear you're working on perl6 stuff again 12:03
will i see you at the SPW?
leont I'm on vacation that week, so no 12:04
timotimo oh, ok 12:05
leont is trying to write a YAML::Tiny, but the significant whitespace is a mess to parse 12:07
timotimo ah 12:08
i take it you saw the grammar that does significant whitespace and turns it into "suites" for you?
12:08 avalenn joined
leont I didn't 12:10
12:14 pmurias joined
timotimo oh 12:14
sorry i took it, then
you can have it back :)
12:26 rmgk left 12:27 cognominal left
leont Match seems to fail at the very end, don't grok why :-/ 12:32
12:36 brrt joined
timotimo probably want to match \n, but not $ 12:38
and then $ comes without a \n in front and boom
nine lizmat++ # writing tests is greatly appreciated :)
leont Ha, found it! %% didn't DWIM apparently 12:39
nine computers-- # always so picky about everyting
timotimo oh 12:40
%% allows the thing after %% to appear at the end once, to
too*
12:40 Averna left
leont Yeah, but replacing it by % seems to make things parse, probably because I was using it inside a token 12:41
timotimo ah, yeah
if you :r, it'll try matching and not be able to backtrack
to be honest, i don't really grok backtracking and ratcheting too well
leont Obvious in hindsight, not so obvious when stuck in it 12:43
timotimo very yes
hence: perl6-debug-m :)
have you seen that yet? 12:44
it'll give you really pretty output for regex matching 12:45
leont s not meaning the same as in gdb was confusing though 12:54
Is there a way to make the line-editing work in the debugger? (I already installed Linenoise) 12:59
timotimo oh, hmm 13:03
it probably wants to be modified so that it uses linenoise, too
until then, rlwrap is your friend
gotta go 13:04
13:05 RabidGravy joined 13:16 cognominal joined, Sqirrel left 13:18 cognominal left 13:31 cognominal joined 13:37 nys joined
leont ingy: not sure if I should call my module YAML::Tiny or YAMLish (given I'm not intending to write a complete implementation), opinions? 13:38
Zoffix_ leont, YAMLish 13:40
RabidGravy SortaKinda::YAML 13:41
Zoffix_ leont, hm, there's YAML::Tiny in P5 that does exactly what you're planning. I think for consistency for any converts it'd be good choice. YAMLish sounds cooler though and is easier to write :)
JimmyZ YAML::ish ... 13:44
13:46 llfourn joined 13:51 llfourn left
pmurias YAML::Kindof 14:12
YAML::ish++ 14:13
14:15 telex left, telex joined
ugexe YAYAML 14:21
14:23 telex left
flussence YAMeh :) 14:24
14:24 telex joined
ugexe ooo. the precomp bug that suddenly reared itself in the last 2 days out of nowhere is not present on r-j 14:26
lizmat ugexe: could you test again after my latest fix, aka 42e19ee5be55d7e3d4d472 ? 14:28
I have a feeling they're related
lizmat starts off a JVM build and test 14:29
ugexe i tried, no go :( 14:31
dalek line-Perl5: 73cae34 | (Stefan Seifert)++ | / (3 files):
Full support for 'can' on P6 subclasses of P5 classes

We now support $object->can('bar') and $class->can('bar') and return methods found in the Perl 6 subclass or the Perl 5 parent as code reference.
14:45
nine Now there's only one nasty reference count problem between me and an epic demo at YAPC :) 14:46
14:51 lucasb joined 14:52 colomon left, colomon joined 14:58 skids joined
ugexe i take that back, jvm fails as well, but not under as many circumstances. if i do `perl6 -Iblib/lib t/Module-Some-Reqest.t` i get the same "Cannot find symol &Request". However, `-Iblib/lib -Ilib` is what was really passing on JVM for me. The thing is, on MoarVM `-Iblib/lib -Ilib` and `-Iblib` both give me the cannot find symbol error 14:59
s/and `-Iblib`/and `-Ilib`/ 15:00
so maybe unrelated, but it would seem that the JVM will load the source of it cant find the precompiled version and moar isnt? 15:01
nine No, MoarVM should do the same 15:04
ugexe i know what it should do, im referring to a recent precomp bug 15:10
jnthn gist.github.com/jnthn/aa370f8b32ef98e4e7c9 (GLR gist) now contains early work on .race() (this is also most of the work for .hyper()) that actually uses multiple CPU cores. 15:11
I've not done any optimization yet, and it's certainly not smart enough to make good guesses about batch size and degree, but here's the results from the first little benchmark I did: gist.github.com/jnthn/03e2082ca5ed20ff8d44 15:12
15:13 bin_005_g joined 15:14 bin_005 left
nine jnthn: wow, looks quite promising :) 15:14
jnthn bbl 15:20
lizmat hmmm... JVM doesn't build for me at all 15:27
lizmat nukes install and tries again 15:28
b2gills jnthn: GLRHyperWorkBuffer.swap doesn't use the variable $new-input, why is it there? 15:36
15:36 davido___ joined 15:38 davido__ left
lizmat alas, no go: this is the gist: gist.github.com/lizmat/d8f40d3b445b4db54031 15:43
15:43 brrt left 15:45 kaare__ left 15:47 llfourn joined 15:51 llfourn left 15:57 brrt joined
RabidGravy jnthn, the problem is I'm somewhat osborned by the greatness that is coming ;-) 15:59
raiph Am I nuts? What about adverbs / named args being syntactically distinguished from pairs; adverbs applying to the closest non adverb non value on their immediate left; with/without becomes if :D, if :U? 16:00
TimToady :D measures .DEFINITE, not .defined 16:02
m: say Failure.new.DEFINITE
camelia rakudo-moar a32c14: OUTPUT«True␤»
TimToady m: say Failure.new.defined
camelia rakudo-moar a32c14: OUTPUT«False␤»
raiph if :d ... ? 16:03
TimToady and you can't put adverbs right after an infix, or they'll be taken as a term
'with' also has a different topicalization policy from 'if' 16:05
skids m: if 1 :D { } # already parses as an adverb
camelia rakudo-moar a32c14: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4hsoyfIRrX␤You can't adverb that␤at /tmp/4hsoyfIRrX:1␤------> 3if 1 :D7⏏5 { } # already parses as an adverb␤ expecting any of:␤ pair value␤»
geekosaur heh
TimToady because it's at an infix position
RabidGravy CRACK PARTY!
raiph <TimToady> 'with' also has a different topicalization policy from 'if' <-- Well, I was (insanely?) imagining allowing adverbs to be applied to keywords and doing things like altering topicalization 16:08
TimToady I think anything as violent as that really deserves a different keyword 16:09
otherwise logic programming is gonna be all full of colons 16:10
nine I guess we already have enough of those :) 16:11
16:11 brrt left 16:15 raiph left 16:19 AlexDaniel joined
zostay is it possible to create your own trait_mod verb's, e.g., trait_mod:<must>? 16:19
colomon zostay: design.perl6.org/S14.html#Traits 16:22
leont Of couse it's possible, it's perl 6 ;-)
zostay that's what i thought, but it's not working, so i must be doing it wrong then... just making sure it wasn't one of those things that "yes, but it doesn't work yet" 16:23
RabidGravy my understanding is that rakudo doesn't allow it yet 16:24
zostay adding another <is> has worked in my playing around in the past, but adding a new one like <must> isn't and adding a new <will> variant is not working for me either 16:26
colomon hmmm… it does look like it’s enumerating all the possibilities in the grammar. :\
RabidGravy yes
zostay most of the time, i hunt around src/* in rakudo and try to emulate what's there to see if it works before i ask questions here ;) 16:28
colomon zostay: good plan
zostay experimenting with adding some optional traits to the P6SGI spec to be used by apps and middleware to allow a variety of interfaces to be automatically adapted into the standard interface 16:30
16:32 raiph joined
zostay defining is trait isn't working now for me 16:33
raiph TimToady: Have I misunderstood "with"? I thought it changed the condition test, not topicalization
16:35 mjgardner joined
raydiak good morning #perl6 16:36
raiph hi raydiak 16:39
b2gills ` with $a { .say } ` is similar to ` given $a { if .defined { .say } } ` 16:42
TimToady except I haven't managed to implement that degree of topicalization yet, having tried for hours... 16:45
so currently you still have to say with $a -> $_ { .say } 16:46
or use the modifier form, which does topicalize already
m: .say with 42
camelia rakudo-moar a32c14: OUTPUT«42␤»
TimToady m: .say with Nil 16:47
camelia ( no output )
TimToady m: say (42 with Nil)
camelia rakudo-moar a32c14: OUTPUT«(Any)␤»
TimToady there's a bug I just found, should be returning Empty (soon to be Slip)
16:51 bin_005_g_k joined
lucasb m: my @a; with @a { say 'yes' } 16:51
camelia rakudo-moar a32c14: OUTPUT«yes␤»
lucasb m: my @a; say 'yes' with @a
camelia ( no output )
16:51 bin_005_g left 16:53 eam left 16:56 brrt joined
TimToady m: my @a; say @a.defined 17:01
camelia rakudo-moar a32c14: OUTPUT«True␤»
TimToady hmm
dalek ast: b630ee3 | skids++ | S02-types/nil.t:
Add test for RT#118717 which can probably be closed
17:02
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=118717
Sgeo Ok shouldn't it be one or the other (the say 'yes' with @a vs with @a { say 'yes' } )? 17:05
17:05 eam joined
Sgeo TimToady, if it's a closure, why does it need to topicalize to be able to use .say? Shouldn't the mere use of a $_ reliant form turn it into... or do you need a literal $_ for that? 17:06
TimToady neither of those are good enough for 'if' blocks, and we're piggybacking on that implementation 17:07
(so that we can intermix if/with clauses)
Sgeo Ah 17:08
m: { .say }.WHAT
camelia ( no output )
Sgeo m: say { .say }.WHAT
camelia rakudo-moar a32c14: OUTPUT«(Block)␤»
Sgeo m: { .say }(5)
camelia rakudo-moar a32c14: OUTPUT«5␤»
TimToady but the if/else implementation really doesn't want to force topicalization like given/when does; at least, I've tried 20 or 30 ways to do it already, and there's always some method it can't find because the types of blocks expected are too different 17:09
one of these days I'll have to actually understand what's going on rather than just cargo-culting code from other spots... 17:10
well, I can write a test for it, even if it's failing currently
and copying stuff in from the implementations of given or for just gives the opcode generator heartburn 17:12
I'm sure jnthn++ could hook it up in 15 minutes, but he actually knows what he's doing :) 17:13
jnthn b2gills: Thanks for noticing, it shoulda been what I assign to $!input. :) This is why I need to write more than one test case. :) 17:20
17:21 ChoHag joined
ChoHag Can I have a signature with two (or more but they're irrelevant) arguments where one argument's default is the value of the other (required) argument? 17:21
jnthn On people asking about custom traits and noting they are enumerated in the grammar: yes, because different traits parse different things after them. And it's not clear there's on sane default (though we could I guess pick "same parse as <is>"). So it's probably in slang teritory... 17:22
ChoHag Never mind. The obvious answer is correct, I just missed the $. 17:23
17:23 kaare__ joined
rjbs Who is "elohmrow"? 17:24
lucasb it's 'wormhole' backwards :) 17:25
rjbs He reported a p6 bug in a p5 library. /me just closes with a note. 17:26
nine rjbs: a p6 bug in a p5 library? 17:28
rjbs github.com/pvande/Template-Mustache/issues/20 17:29
nine Oops :) Probably meant github.com/softmoth/p6-Template-Mustache/ 17:30
rjbs adds that.
tadzik hehe, history's happening 17:35
Sgeo So wrong repo, not someone trying to run P5 code on P6? 17:37
nine yep
17:37 zakharyas joined
dalek ast: f00b2ca | skids++ | S14-roles/stubs.t:
Add (fudged) tests for RT#124393
17:38
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=124393
17:40 pmurias left 17:44 mjgardner left 17:47 mjgardner joined 17:48 llfourn joined 17:53 llfourn left, rmgk joined
nine So I just spent 3 hours installing a perl with all debugging options enabled and hundreds of CPAN modules to debug my refcount problem. And with this, I cannot repro the error anymore :( 17:56
dalek ast: a56dd50 | skids++ | S06-routine-modifiers/proxy.t:
Add (fudged) tests for RT#124341
18:08
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=124341
18:10 rindolf left 18:20 brrt left 18:27 kernel joined, kernel is now known as Guest94770 18:29 Guest37893 left
dalek ecs: 614b6f3 | TimToady++ | S04-control.pod:
doc with/without
18:38
18:38 kaare__ left 18:49 zakharyas left, cognominal left 18:54 mjgardner left
dalek kudo/nom: 68c01f4 | TimToady++ | t/spectest.data:
add test files for with/without modifiers
19:00
kudo/nom: b527b31 | TimToady++ | src/ (2 files):
without is different from orelse
ast: 8a752ca | TimToady++ | S04-statement-modifiers/with (2 files):
Add test files for with/without modifiers
ast: 86a4c3e | TimToady++ | S03-operators/andthen.t:
andthen returns Empty on failure
timotimo jnthn: i wonder why the time for :degree(1) and :degree(2) is exactly the same 19:03
other than that: way cool!
ChoHag How do you say 'Array of <foo>' in a Signature? 19:06
Type check failed binding @foo: expected 'Positional[Array[Str]]' but got 'Array' 19:07
TimToady the @ already implies Positional, you just say 'foo @foo' 19:09
jnthn timotimo: oh...because I mis-copied 19:10
ChoHag Type check failed binding @foo: expected 'Positional[Str]' but got 'Array'
jnthn timotimo: Thankfully still had them in scroll back in my console. Fixed gist.
ChoHag FWIW, the value passed in is the result of a Str.split() 19:11
TimToady ChoHag: it won't coerce the elements for you; you either have to create an Array[Str] or leave off the type declaration in the sgi
you can't have strict typing and lax typing at the same time :)
*sig 19:12
ChoHag Ah it's happy if the split is passed into a my Str @foo rather than just @foo. 19:13
s/just @foo/just my @foo/
dalek ast: e7f5bb7 | skids++ | / (2 files):
Add (fudged) test for RT#124324

Also, silence nqp warnings from inside evals in Test::Compile
19:14
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=124324
timotimo jnthn: ah, yes, much better :)
ChoHag Seems like it's something that hangs on compile vs. run time.
timotimo i'm glad
jnthn :)
So, guess I better write a few more tests...
Though tbh I'm happy the overall design/API is sane 19:15
leont My code is returning a Parcel when I really want an Array or some such, what's the clean way to get it? 19:21
(other than wait for GLR to finish, I suppose)
Putting it in a [􏿽x85] seems a bit odd 19:22
19:23 synbot6 left
jnthn Does .Array work as a coercion? 19:23
Or just assign the result into an array? 19:24
Sgeo I feel like I should wait for GLR to finish before attempting to understand more of Perl 6 19:26
leont .Array seems to flatten, which wasn't what I wanted
[ <expression> ] it is, I suppose
TimToady that flattens too 19:27
(pre GLR)
19:27 kaare__ joined
jnthn Well, on the inside yes... 19:27
TimToady oh, is okay if he was referring to the outside then
leont expression is something like @<foo>􏿽xBB.ast, calling .Array on that does surprising (to me) things 19:28
TimToady jnthn: the basic problem I'm having with 'with' control blocks is that the if/elsif/else machinery assumes all over that it's dealing with Block, while the usual ways of turning a block into a topicalized block seem to make it not a Block anymore 19:29
skids Well, especially of @<foo> is undefined :-)
*if
tadzik Sgeo: well, to be fair, there's a lot more to understand aside of lists :) 19:30
19:30 cognominal joined
TimToady jnthn: but obviously an explicit -> $_ {...} block works, so obviously I just haven't achieved the correct incantation yet to make it look like that 19:32
19:35 AlexDaniel left
jnthn TimToady: Can you arrange for it to do <xblock(1)> when it's a with, not just <xblock>? 19:35
19:39 cognominal left
TimToady thanks, I'll whack at it some more, hopefully not another several hours :) 19:40
Sgeo Will GLR affect the weird way map works?
jnthn TimToady: Fingers crossed that nails it
Sgeo Where map can apparently be called with @foo or $a, $b, and @foo just sort of ...flattens into the argument list as though |@foo was used 19:41
jnthn Sgeo: You're going to have to be more specific about what you think is weird.
Generally, though, less flattening happens by default in the GLR 19:42
There's very few places it does
19:42 zakharyas joined
Sgeo So do I wait for GLR to try to understand it? 19:43
jnthn I'd say so, given it's (a) soon, and (b) easier to understand
Though I can't promise easier to agree with :P 19:44
Sgeo ok, ty 19:45
19:49 llfourn joined 19:54 llfourn left
ChoHag What's the type object of a type object? 19:57
b2gills Really there are quite a few different axis of differentiation for Lists ( eager(hyper|race|sequential) ... lazy(includes infinite) , flattening|non-flattening , itemizing|non-itemizing )
jnthn ChoHag: identity 19:58
skids b2gills: And "santa-clause's" :-)
ChoHag I mean what can I put in a signature which will accept 'a type object'? 19:59
leont isn't sure he completely understands itemizing, it it's not related to non-flattening
skids :U
b2gills Mu:U or Any:U
ChoHag Or ideally 'an object of type X or a type object'.
skids That would be "X" 20:00
Where only an object would be "X:D"
But you should not name you class X :-)
b2gills m: say test ( Mu:U ::T $a ){ my T $b = $a }; test 5
camelia rakudo-moar a32c14: OUTPUT«5===SORRY!5=== Error while compiling /tmp/KSrDXDjyrC␤Confused␤at /tmp/KSrDXDjyrC:1␤------> 3say test ( Mu:U :7⏏5:T $a ){ my T $b = $a }; test 5␤ expecting any of:␤ colon pair␤»
skids m: say test ( ::T Mu:U $a ){ my T $b = $a }; test 5 20:01
camelia rakudo-moar a32c14: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol T␤»
skids hrm, anyway, captures come first. 20:02
ChoHag Whitespace is an interesting choice of seperator.
geekosaur m: test(::T:U $a) {my T $b = $a}
camelia rakudo-moar a32c14: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol T␤»
geekosaur m: test(::T:U $a) {my ::T $b = $a}
camelia rakudo-moar a32c14: OUTPUT«===SORRY!===␤Could not locate compile-time value for symbol T␤»
geekosaur bah
ChoHag What#s the significance of the preceeding :: in '(::Foo Mu:U $thing)'?
b2gills m: sub test ( ::T Mu $a ){ my T $b = $a; say $a; say T.^name }; test 5
camelia rakudo-moar a32c14: OUTPUT«5␤Int␤»
skids ChoHag: it is supposed to give you an alias to the passed type of the arument. 20:03
TimToady you can put Mu:U there
ChoHag m: class Foo { }; sub bar (::Foo Mu:U $thing) { say "Barring $thing" }; bar(Foo.new); bar(Int)
camelia rakudo-moar a32c14: OUTPUT«Parameter '$thing' requires a type object of type Foo, but an object instance was passed␤ in sub bar at /tmp/3hM6jFmGi8:1␤ in block <unit> at /tmp/3hM6jFmGi8:1␤␤»
b2gills m: class Foo { }; sub bar (::Foo Mu:U $thing) { say "Barring $thing" }; bar(Foo);
ChoHag Interesting. That works with a more complete 'Foo'
camelia rakudo-moar a32c14: OUTPUT«Use of uninitialized value $thing of type Foo in string context in sub bar at /tmp/33ctf8Y3bx:1␤Barring ␤»
jnthn TimToady: Are there any areas you think we should explore more in the GLR gist before starting on a "get it into Rakudo" branch? 20:04
b2gills jnthn: I would say that you would be the best person to decide that 20:05
skids
.oO(native array interaction?)
20:06
Or maybe that "just works" 20:07
jnthn skids: I think that's a case of "I get to simplify the current code" :) 20:08
I'm not too worried about that bit, anyway; it doesn't have any unknowns. 20:09
b2gills: Sure, but I can have blind spots :)
b2gills I know I pointed one out earlier
jnthn Fixed in latest: gist.github.com/jnthn/aa370f8b32ef98e4e7c9 20:10
b2gills: Plus a test that actually exercises that code path.
b2gills The only kind of exercise a programmer wants 20:11
jnthn I'm not going to do hyper for now because it's basically just paying attention to the sequence number that's already there, so not really critical path
TimToady I can't think of anything offhand 20:12
is there a way we can put an "emulate old stuff in the scope of this env-var"? 20:13
that might aid in people porting things bit by bit
ChoHag Something's not quite right.
TimToady s/env-var/dyn-var/
jnthn TimToady: I...don't easily see a way. 20:14
TimToady: And the old/new really don't play nice together.
TimToady yeah, it didn't work out well for glrish
ChoHag I want to pass a variable into a function so that a calculated variable can be ~~'d against it. The variable will either be a specific object or an object type, possibly of a type which the specific object isn't.
TimToady so maybe it's bite-the-bullet time
jnthn Like, every time I mentioned a bit of the previous implementation by accident, I got pretty dramatic explosions. 20:15
Or totally useless results.
ChoHag It seemed to work until the object type included a ::, so (::Foo::Bar Mu:U :$check) didn't work, though until I included the 'or an object type' check, (Foo::Bar :$check) did.
TimToady well, I'll be around till Wed, then off to(ward) Japan, so maybe better is sooner 20:16
jnthn *nod*
jnthn is flying on the 18th
TimToady 12th to Seattle, 14th to Kyoto
jnthn Ah, and some sight-seeing in Kyoto ahead of the conf? :) 20:17
TimToady taking Heidi & Andy
b2gills ChoHag: the ::Foo notation creates an alias to the type object of the type of $check
ChoHag I'm too drunk to understand that.
jnthn Nice :) 20:18
jnthn enjoyed kyoto
b2gills ChoHag: (::Foo $check) is similar to `my \Foo = $check.WHAT` 20:19
ChoHag: so (::Foo Mu:U $check) is actually rather pointless as `Foo =:= $check` because $check is required to be just a type object because of the :U 20:22
ChoHag How do you create a type check in a signature which is an either/or theb? 20:23
then
jnthn TimToady: Not having what ;-lists produce worked out will likely be the earliest blocker. 20:24
(for now, LoL is going away)
20:24 darutoko left
skids Will ==> and <== even be needed post-GLR, or a stricter lazy? 20:25
jnthn I'm not sure about those yet 20:26
I have...many hazy ideas...for them
20:26 plicease left 20:27 plicease joined
b2gills m: class Foo { }; sub bar (::Foo $thing) { say "Barring $thing is of type { Foo.^name }" }; bar(Foo.new); 20:30
camelia rakudo-moar a32c14: OUTPUT«Barring Foo<140296743866032> is of type Foo␤»
b2gills m: class Foo { }; sub bar (::Bar $thing) { say "Barring $thing is of type { Bar.^name }" }; bar(Foo.new);
camelia rakudo-moar a32c14: OUTPUT«Barring Foo<140621048503984> is of type Foo␤»
ChoHag I have to go. 20:31
That looks a little weird and I'll try to understand it in the morning.
Thanks for playing.
20:32 ChoHag left
dalek kudo/glr: 63a8a38 | jnthn++ | src/vm/moar/ (2 files):
Toss some C VM extensions not needed post-GLR.
20:47
jnthn (Note: don't expect GLR to even get through build, let alone work, for a while.) 20:48
20:52 lucasb left 20:54 zakharyas left
dalek kudo/glr: 10efc4c | jnthn++ | src/Perl6/World.nqp:
Replace an nqp::p6parcel with a die for now.

This gets things building through to BOOTSTRAP.
20:58
kudo/glr: b2f1242 | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
Comment out and die on things that'll need fixes.
kudo/glr: b98dec9 | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
Toss various types going away in GLR.
kudo/glr: 1a2a617 | jnthn++ | src/Perl6/World.nqp:
Comment convention consistency correction.
21:03
kudo/glr: 346e276 | jnthn++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
Update List and Array definition in BOOTSTRAP.
jnthn Well, that's the bull grabbed by the horns... 21:05
Enough for today... 21:06
RabidGravy :)
21:10 bin_005_g_k left
leont What's the (rough) timescale for the glr merge? 21:13
timotimo m. 21:15
a week perhaps?
hmm. that seems unoptimistic
jnthn Ask again in another day or two, when I've got a better feel for now hard it's going to be. 21:17
skids Ooh. We get to see blow-by-blow GLR now :-) 21:25
21:27 kaare__ left 21:29 espadrine left
TimToady hopefully this will be the most disruptive change between now and Christmas :) 21:35
jnthn imagines so 21:36
I don't see any competitors. :)
'night, #perl6 o/ 21:37
nine Good night jnthn
lizmat good night, jnthn 21:40
ShimmerFairy TimToady: last night I happened to stumble on an old bug report on :U , and figured out that technically there was no bug :) (since the spec mentions DEFINITE, not defined). It however got me thinking about the utility of :T. It's NYI, and until that bug report I always saw :U as the type object constraint (since core seems to think so). 21:41
(the bug in question: rt.perl.org/Ticket/Display.html?id=114442 )
In fact, the spec suggests that :T is just :U but without allowing Failure objects, but AIUI you can't pass Failure objects to an Int-constrained parameter (for example) regardless of the smiley, so there seems to be no difference between :T and :U anymore. 21:49
21:50 jjido joined, llfourn joined 21:55 llfourn left 22:01 pippo joined
pippo o/ #perl6 22:01
I have installed Linenoise but unable to have command history or tab completion in the repl. How can I debug this? 22:02
Sgeo m: -> Int $x { say $x }(Failure.new);
camelia rakudo-moar a32c14: OUTPUT«Earlier failure:␤ Failed␤␤Final error:␤ Type check failed in binding $x; expected 'Int' but got 'Failure'␤ in block <unit> at /tmp/0m5sgEGBtZ:1␤␤»
Sgeo m: sub (--> Int) { fail "Oops!" if True; 5 }(); 22:03
camelia rakudo-moar a32c14: OUTPUT«Oops!␤ in sub at /tmp/s7KMKfVLxl:1␤ in block <unit> at /tmp/s7KMKfVLxl:1␤␤Actually thrown at:␤ in block <unit> at /tmp/s7KMKfVLxl:1␤␤»
Sgeo SHouldn't that not have compiled since the sub is capable of throwing a Failure but claims to return an Int? 22:04
22:06 TEttinger joined
geekosaur Failure has never worked that way and I'm not sure it retains any usefulness in a Perl 6 context if you require that it be represented in the result type 22:09
and I don't think Perl 6 has ever claimed to be Haskell
...come to think of it, even Haskell lets you do that; see `error' 22:10
Failure is not so much a distinct type, as a special value that inhabits every type 22:11
Sgeo Haskell doesn't really let you detect it though 22:14
pippo good night #perl6 22:15
22:15 pippo left
Sgeo But I'm a bit more scared about type objects in that context, I don't see the difference between that and Java null 22:15
timotimo a null in java is just "null" 22:16
a type object is still of the right type
geekosaur Haskell also doesn't have an object hierarchy wherein a Failure could be seen as a distinct out-of-band value provided by Mu... 22:21
...and as someone who's seen more than enough Java code that declares it throws any possible exception rather than try to handle declaring exceptions the way that was intended, I am not sure you gain anything by adding such to another lnaguage (and indeed, pretty much nobody else has bothered after seeing how it turned out in Java) 22:22
raiph Sgeo: Am I right that, in Haskell, if you write code that acknowledges the possibility of a Nothing value then that code must explicitly specify what to do with the Nothing possibility? 22:26
Sgeo raiph, yes, although it can be as simple as giving up. And you can't not acknowledge the possibility of a Nothing value 22:28
fromJust is maligned because it's the way to deal with Nothing by dying, and the error message isn't so great at pinpointing the right location in code
geekosaur, what about Rust? 22:29
fromMaybe with error is a bit better I think
raiph, you can write code that uses Maybes monadically such that Nothing is automatically handled by having the whole thing be Nothing 22:30
raiph Sgeo: I think Perl 6 works the same way in that regard.
Sgeo: or I should say: equivalently in that regard afaics 22:31
Sgeo I don't think I dislike the Failure concept or anything, was just surprised when I saw it being strict about the types in one way but not the other 22:33
raiph Sgeo: Aiui, in Perl 6 you can choos to not acknowledge Nothing, but if you try to use such a value you'll get a run-time exception
Sgeo raiph, so a closer equivalent to Haskell would be if you had to do a check or at least a method like .value to get the value out if there's a possibility of failure 22:34
raiph Sgeo: Fwiw I'm still confused about the Failure concept and that's why I'm having fun talking with you about it :) 22:35
geekosaur isn't part of this so that some pragma could cause the Failure to reify as an actual value (e.g. 0 for a number, '' for a string) á la Perl 5?
Sgeo For what it's worth, I see the fail function as doing something similar to Rust... in Rust, there's a try!() macro that looks at a Result<> and either gives the value if it's Ok or causes the function to return if it's Err, defined doc.rust-lang.org/std/macro.try!.html 22:36
I do wish it was either one or the other, it seems weird to have two things to do if there's a problem, and the caller needs to know which is in use if it wants to handle it 22:37
raiph geeokosaur: yes, aiui Perl 6 Failures approximate to alap runtime handling of Nothings by default, leaving any number of ways to choose to tighten things up
Sgeo (I mean, either pervasive fail for erroring or pervasive die, not both)
timotimo i'm not entirely sure why rakudo doesn't put a :D onto a method's invocant parameter as soon as it sees a '$!' sigiled variable be used 22:38
hm. perhaps because it could be inside a try { ... }
22:40 shinobi-cl joined
ShimmerFairy timotimo: there are some pragmas in S12 that are meant to control default smileys 22:41
raiph Sgeo: I think the idea is that a coder writes "die" if they mean to force an end of the process containing the "die", and "fail" if they wish to explicitly leave it up to the caller.
ShimmerFairy timotimo: > In standard Perl 6, C<Int> is generally assumed to mean C<Int:_>, except for invocants, where the default is C<Int:D>.
Sgeo But die's and other exceptions are catchable... or is it like Rust where even though they might be catchable it should still be death? 22:42
ShimmerFairy timotimo: except for method new, where the invocant is :T instead of :D (but :T is NYI, and as I mentioned it doesn't seem to be useful anymore, so that should perhaps be :U ?)
timotimo of course, new must have :T 22:43
Sgeo So I can call an ordinary function with method syntax, can I call an actual method with an arbitrary invocant using function syntax?
timotimo but it also won't use $! sigiled vars :)
raiph Sgeo: aiui dies are catchable (undying) and fails are fatalizable
timotimo Sgeo: in order to get the method object, you have to go through .^find_method
ShimmerFairy timotimo: I personally think :T is of limited use (unless someone can point out a difference between :T and :U that isn't the seemingly-outdated ":U but without Failure objects") 22:44
Sgeo m: say Bool.^find_method("ACCEPTS")
camelia rakudo-moar a32c14: OUTPUT«ACCEPTS␤»
ShimmerFairy My personal recommendation is to remove and replace mentions of :T in the spec, and see how much doesn't happen :P
shinobi-cl Hi all! 22:48
r: my Str @s =<Hello World>; my @rx = map({rx/$_/}, @s); say @rx.perl;
camelia rakudo-{moar,jvm} a32c14: OUTPUT«[rx/$_/, rx/$_/]<>␤»
shinobi-cl r: my Str @s =<Hello World>; my @rx = map({rx/^$_$$/}, @s); say @rx.perl;
camelia rakudo-{moar,jvm} a32c14: OUTPUT«[rx/^$_$$/, rx/^$_$$/]<>␤»
raiph m: (my method m ($self:) { say $self })(5) # Sgeo 22:49
camelia rakudo-moar a32c14: OUTPUT«5␤»
raiph hi shinobi-cl
japhb TimToady: Unless I'm misunderstanding, it appears the with-orwith-else example you added to S04 suffers from copy pasta in the index() arguments 22:50
ShimmerFairy timotimo: there's absolutely no mention of :T in roast or rakudo, not even so much as an NYI. I've concluded that :T is unnecessary, that :U/:D should be the type object/"value object"(?) distinction, and if necessary changes made to :U/:D to better fit that.
raiph m: my &foo = my method m ($self:) { say $self }; foo(5) # Sgeo 22:51
camelia rakudo-moar a32c14: OUTPUT«5␤»
dalek ecs: 584047e | TimToady++ | S04-control.pod:
copy pasta noticed by japhb++
Sgeo raiph, cool
timotimo i has to go to a sleep :S
raiph goodnight timotimo 22:52
ShimmerFairy If you check S12/Class methods, you can even see that the spec refers to :U as being for type objects vs. instances! :) (granted, it was written in 2014, but still...)
Sgeo ShimmerFairy, it almost seems like type objects are sometimes used in context as a failing type anyway (see .index())
ShimmerFairy timotimo o/
timotimo and tomorrow will probably be a mostly timoless day :(
ShimmerFairy timotimo: quick thing; figure out that nqp::while bug to some extent?
Sgeo m: say Nil == Nil.WHAT
camelia rakudo-moar a32c14: OUTPUT«Use of Nil in numeric context in block <unit> at /tmp/fesM14PLKT:1␤Use of Nil in numeric context in block <unit> at /tmp/fesM14PLKT:1␤True␤»
Sgeo m: say Nil =:= Nil.WHAT 22:53
camelia rakudo-moar a32c14: OUTPUT«True␤»
TimToady m: say "abc".index('z').WHAT
camelia rakudo-moar a32c14: OUTPUT«Nil␤»
timotimo but you'll cope, i'm sure 22:54
ShimmerFairy Sgeo: yeah, the only distinction between :T and :U in the spec is that :T doesn't accept Failure types, but like I said that doesn't appear to be allowed with any smiley (including the default :_ )
Sgeo They don't accept Failure types dynamically but do accept them statically?
Do I have that correct? 22:55
ShimmerFairy As far as I understand, Failures are supposed to be like NaN, but for everything (instead of just floating-point)
(and I don't understand very far ☺)
Sgeo m: sub foo (Any:D $x) { say $x; }; my Failure $f = Failure.new; foo($f); 22:56
camelia rakudo-moar a32c14: OUTPUT«Failed␤␤Actually thrown at:␤ in sub foo at /tmp/yVOTsBBR2R:1␤ in block <unit> at /tmp/yVOTsBBR2R:1␤␤»
Sgeo m: sub foo (Any:D $x) { say $x; }; my Mu $f = Mu.new; foo($f);
camelia rakudo-moar a32c14: OUTPUT«X::TypeCheck::Binding exception produced no message␤ in sub foo at /tmp/NgBaKksto8:1␤ in block <unit> at /tmp/NgBaKksto8:1␤␤»
Sgeo I guess first is dynamic second static, but it might be tricky to see that? 22:57
m: sub foo (Any $x) { say $x; }; my Mu $f = Mu.new; foo($f);
camelia rakudo-moar a32c14: OUTPUT«X::TypeCheck::Binding exception produced no message␤ in sub foo at /tmp/8wp9SLycWR:1␤ in block <unit> at /tmp/8wp9SLycWR:1␤␤»
ShimmerFairy TimToady: is there still a place for :T that's not been explored (my understanding of :U/:D came from looking at src/core, which taught me that :U is for type object, :D is for instances, though that may not be quite to spec), or would it be safe to remove it from the spec? 22:58
TimToady we can remove it 22:59
23:05 ggoebel left
raiph Sgeo: aiui, all "compile time" messages start with the word SORRY. 23:06
ShimmerFairy Or "Potential difficulties" :)
dalek ecs: 68eb8a2 | ShimmerFairy++ | S (2 files):
Remove :T smiley from specs

The :U smiley has taken the place of :T over the years, and the only difference specified between them (where :U accepts Failures but :T does not) doesn't appear to make sense anymore. Now :U is spec'd to mean type objects, and :D means instances.
The only potentially significant change for rakudo is the change from :T to :U as the default smiley for method new's invocant, but depending on existing implementation may already be how it works.
23:07
shinobi-cl r: my Str @s =<Hello to the World>; my @t = <Hello Mars - the red planet>; my @rx = map({rx/^$_$$/}, @s); my @results = @s.flatmap( { @t.grep($_) } ); say @results.perl
camelia rakudo-{moar,jvm} a32c14: OUTPUT«["Hello", "the"]<>␤»
raiph ShimmerFairy++ # friendly warning that I forgot something :)
shinobi-cl r: my Str @s =<Hello to the World>; my @t = <Hello Mars - the red planet>; my @rx = map({rx/^$_$$/}, @s); my @results = @s.flatmap( { @t.grep($_) } ); say @results.perl; say @rx.perl;
camelia rakudo-{moar,jvm} a32c14: OUTPUT«["Hello", "the"]<>␤[rx/^$_$$/, rx/^$_$$/, rx/^$_$$/, rx/^$_$$/]<>␤»
shinobi-cl so, all the elements on @rx has /^$_$$ / 23:08
ShimmerFairy raiph: well, "potential difficulties" are for worries, SORRY! is for sorrows (and worries we end up being sorry for), as far as I understand src/Perl6/ :)
.oO("Potential difficulties: forgot one kind of compile-time message.")
shinobi-cl r: my Str @s =<Hello to the World>; my @t = <Hello Mars - the red planet>; my @rx = map({rx/^$_$$/}, @s); my @results = @s.flatmap( { rx/^$_$$/ ); say @results.perl; say @rx.perl;
camelia rakudo-{moar,jvm} a32c14: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile␤Missing block␤at /tmp/tmpfile:1␤------> 3; my @results = @s.flatmap( { rx/^$_$$/ 7⏏5); say @results.perl; say @rx.perl;␤ expecting any of:␤ statement end␤ statem…»
shinobi-cl r: my Str @s =<Hello to the World>; my @t = <Hello Mars - the red planet>; my @rx = map({rx/^$_$$/}, @s); my @results = @s.flatmap( { rx/^$_$$/ } ); say @results.perl; say @rx; 23:09
camelia rakudo-{moar,jvm} a32c14: OUTPUT«[rx/^$_$$/, rx/^$_$$/, rx/^$_$$/, rx/^$_$$/]<>␤rx/^$_$$/ rx/^$_$$/ rx/^$_$$/ rx/^$_$$/␤»
raiph .oO ( presumably sorries can not be reduced to mere worries but worries may (one day) be promotable in a scope to sorries ) 23:11
ShimmerFairy raiph: 'use fatal' is a quick way to make rakudo sorry for any worries :) (might as well be 'use Werror' :P)
geekosaur .oO { use mere-annoyance; } 23:12
raiph ShimmerFairy: nice 23:14
ShimmerFairy loves that <.cry_sorrows> is a method that appears in the Perl 6 grammar :P 23:16
23:17 virtualsue joined
ShimmerFairy raiph: I was working out some tests the yesterday (need to get back to them), and before I figured out a way to test something without another eval- test, I wrote it so that a redeclaration warning was success, using 'use fatal' and eval-dies-ok :) 23:17
raiph loves to be around folk who love that cry_sorrows is a method in core 23:18
ShimmerFairy: :)
ShimmerFairy raiph: I love cry_sorrows because at the same time you'd never expect to see that in code (much less typically-"serious business" compiler code), and yet it makes perfect sense :P 23:19
raiph .oO ( let's not mention out loud that cry_sorrows isn't cry-sorrows ... )
23:19 RabidGravy left
ShimmerFairy I'd be fine with that, less so if it were a yelling kebab :) 23:20
raiph :)
japhb Is there a (clean, idiomatic) way to specify that you only want to pass an argument if it is defined (or definite, either will do for this case)? 23:22
The use case is for a middle-layer method with an optional argument, that wants to pass that argument on to the lower layer iff it was specifically supplied by the upper layer caller, because if not, the lower layer's defaults should kick in. 23:23
japhb wonders if there is something like :?$foo 23:24
ShimmerFairy japhb: with $optional { lower($args, $optional) } else { lower($args) } ? 23:25
23:25 telex left 23:26 telex joined
TimToady lower($args, |($_ with $optional)) maybe 23:26
lower($args, |($optional // Empty)) maybe
ShimmerFairy I was think a 'with' modifier in the arglist, but wasn't sure if that would/could work.
diakopter oy 23:27
japhb ShimmerFairy: Yeah, I'm doing something similar to what you did, but was hoping for something a little more in the DRY spirit
raiph diakopter: yo
japhb TimToady: Oooh, that may well work.
ShimmerFairy yeah, one of TimToady's suggestions should work 23:28
japhb What would be the equivalent for a named arg?
o/ diakopter
ShimmerFairy m: sub foo(:$bar) { say $bar }; foo(); foo(:bar(5)); foo( |(:bar(42)) ) 23:29
camelia rakudo-moar a32c14: OUTPUT«(Any)␤5␤42␤»
raiph m: sub foo (:$foo = 42) { say $foo }; foo |(Empty)
camelia rakudo-moar a32c14: OUTPUT«42␤»
23:32 virtualsue left
japhb m: sub lower(:$bar = 12) { say $bar }; sub middle (:$bar) { lower(|(:$bar with $bar)) }; middle(); middle(42); 23:34
camelia rakudo-moar a32c14: OUTPUT«12␤Too many positionals passed; expected 0 arguments but got 1␤ in sub middle at /tmp/GUGLLucSxd:1␤ in block <unit> at /tmp/GUGLLucSxd:1␤␤»
japhb m: sub lower(:$bar = 12) { say $bar }; sub middle (:$bar) { lower(|(:$bar with $bar)) }; middle(); middle(:bar(42));
camelia rakudo-moar a32c14: OUTPUT«12␤42␤»
japhb Still a little WET, but way better than my original 23:35
ShimmerFairy japhb: you could use $_ in that with, but I think :bar($_) would be more characters in this case :P 23:45
Sgeo m: Hopefully this, is totally! garbage meaningless comile time syntax 23:50
camelia rakudo-moar a32c14: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zvuYUtl2yz␤Negation metaoperator not followed by valid infix␤at /tmp/zvuYUtl2yz:1␤------> 3Hopefully this, is totally!7⏏5 garbage meaningless comile time syntax␤ expecting any of:␤ inf…»
Sgeo Huh. So that message before wasn't compile time?
23:51 llfourn joined
geekosaur if it doesn't start with "===SORRY!=== Error while compiling ", it's not compile time 23:52
Sgeo m: sub foo(Int $x) { say $x; }; my $f = "Hi!"; foo $f; 23:53
camelia rakudo-moar a32c14: OUTPUT«Type check failed in binding $x; expected 'Int' but got 'Str'␤ in sub foo at /tmp/ishCuGoXZI:1␤ in block <unit> at /tmp/ishCuGoXZI:1␤␤»
Sgeo So what can trigger static type checking?
geekosaur not sure static type checking is much implemented currently?
japhb goes to run his updated code and realizes he needs a new Rakudo to use 'with' :-)
geekosaur it's intended at some point
japhb m: sub foo(Int $n) { say $n * $n }; foo(9); foo("bar"); 23:54
camelia rakudo-moar a32c14: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GpJe7qnN7O␤Calling foo(str) will never work with declared signature (Int $n)␤at /tmp/GpJe7qnN7O:1␤------> 3ub foo(Int $n) { say $n * $n }; foo(9); 7⏏5foo("bar");␤»
japhb Sgeo: ^^
Sgeo So just with literals right now?
japhb Sgeo: In Rakudo, static type checking is a side effect of the optimizer trying to do type proofs and failing. 23:55
So in Rakudo, you currently only get it for things the optimizer understands.
This is not intrinsic to the language, nor necessarily the future of Rakudo. 23:56
Sgeo Ah
23:56 llfourn left
japhb It's just the way it currently works. 23:56
Sgeo: Actually, that's not quite true, as it's a subset of the stuff Rakudo gets right. 23:57
You will also get it for assignment to typed scalars, where the RHS is guaranteed not to match the scalar's type constraint. 23:58
And of course at runtime there's a lot of type checking. 23:59