»ö« 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.
00:28 gfldex left 00:31 geekosaur left 00:32 Ben_Goldberg joined, geekosaur joined 00:35 cognominal_ joined 00:37 cognominal left 00:46 tinyblak joined
dalek kudo/nom: da530e3 | labster++ | src/core/Temporal.pm:
Time zone changes now preserve fractional seconds

Also get rid of some supersticious use of float() and .Int, use int div. Now 3% faster DateTime.now() ... still kinda slow.
00:51
timotimo labster: thanks for working on this :) 00:56
m: say now
camelia rakudo-moar 6e425f: OUTPUT«Instant:1436230654.277332␤»
timotimo does this also get faster, out of curiosity? 00:57
01:09 smls left 01:12 rmgk left 01:14 vendethiel left 01:15 rmgk joined 01:30 vendethiel joined 01:32 kanl joined
labster timotimo: no, just the DateTime object, because it does time zone conversion 01:34
01:36 dayangkun joined
timotimo OK 01:43
still a good thing to improve, of course! 01:46
02:02 kaare_ joined
dalek ast: ee637c4 | skids++ | S06-signature/introspection.t:
Add idempotency tests for .perl of Signatures with anonymous parameters
02:04
02:19 noganex_ joined 02:21 nys left 02:22 noganex left 02:27 aborazmeh joined, aborazmeh left, aborazmeh joined 02:41 aborazmeh left 02:43 aborazmeh joined, aborazmeh left, aborazmeh joined 02:48 lsm-desktop left 02:49 dayangkun left
kanl m: say [||] ( True, False ) ?? 'a' !! 'b'; say [&&] ( True, False ) ?? 'a' !! 'b'; 02:55
camelia rakudo-moar da530e: OUTPUT«a␤a␤»
kanl blinks
02:59 dayangkun joined
ShimmerFairy m: say [||] ( True, False ) ?? 'a' !! 'b'; say ([&&] ( True, False )) ?? 'a' !! 'b'; 02:59
camelia rakudo-moar da530e: OUTPUT«a␤b␤»
kanl why [||] need not be quoted? 03:00
ShimmerFairy The conditional was checking the truth value of the list (that is, ?(True, False) ),
m: say [||] (False, False) ?? 'a' !! 'b'
camelia rakudo-moar da530e: OUTPUT«a␤»
03:00 lsm-desktop joined
ShimmerFairy m: say ([||] (False, False)) ?? 'a' !! 'b' 03:00
camelia rakudo-moar da530e: OUTPUT«b␤»
ShimmerFairy the [||] needs to be in parens too, you just got lucky with the list you were using :) 03:01
kanl how is it parsed in the case when i was lucky? 03:02
i'd expect it to say True/False instead of any varieties of 'a', 'b'
ah, ic. [] has the lowest precedence, apparently. 03:04
so [&&] on 'a'/'b' would get 'a'/'b' 03:05
leont Reduction operators are list operators, they have very low precedence
kanl ( True, False ) of course, evaluate to True, being not empty. 03:06
thanks!
it's probably one of those best-practices things, new operators increase potential for misuse :) 03:07
leont It's the same in perl5 really 03:10
kanl i'm not familiar with this feature in p5. 03:11
leont It doesn't have reduction operators, but it does have list operators
kanl leont: such as? ( i honestly am not familiar with any list ops in p5, other than things like splice et-al. :) 03:15
Ben_Goldberg m: sau ?(False, False) 03:16
camelia rakudo-moar da530e: OUTPUT«5===SORRY!5=== Error while compiling /tmp/aXgwRH9o2A␤Undeclared routine:␤ sau used at line 1. Did you mean 'say'?␤␤»
Ben_Goldberg m: say ?(False, False)
camelia rakudo-moar da530e: OUTPUT«True␤»
Ben_Goldberg m: say ?(False)
camelia rakudo-moar da530e: OUTPUT«False␤»
kanl m: say ?(False,)
camelia rakudo-moar da530e: OUTPUT«True␤»
Ben_Goldberg kanl, You read my mind! I was about to type that :)
03:18 leont left
labster m: say ([&&] True, False) ?? 'a' !! 'b'; # don't need the inner parens, commas make a List 03:20
camelia rakudo-moar da530e: OUTPUT«b␤»
kanl old p5 habits die hard :p 03:21
dalek kudo/nom: d524b22 | (Nick Logan)++ | src/core/IO/Path.pm:
bugfix: chdir ensure `.` is resolved to abspath

Fixes:
   nickl@localhost:~/perl6$ perl6 -e 'say ".".IO.chdir("rakudo/t").IO.perl.say'
   Failed to change the working directory to '/rakudo/t': does not exist
This also addresses windows behavior where the volume would become lost.
03:24
kudo/nom: f0816d3 | lizmat++ | src/core/IO/Path.pm:
Merge pull request #462 from ugexe/patch-9

bugfix: chdir ensure `.` is resolved to abspath
03:36 Ben_Goldberg left 03:39 amurf left
dalek ast: 961c60f | lizmat++ | S32-temporal/DateTime.t:
Unfudge now passing test, labster++
03:54
03:56 dj_goku left 04:13 dj_goku joined 04:22 davido__ left, mr-foobar left 04:23 davido__ joined 04:24 amurf joined 04:29 davido___ joined 04:32 davido__ left
dalek kudo/nom: f5ebbf4 | skids++ | src/core/Block.pm:
.assuming now produces closures with populated signatures.

   ... outdated due to trying to use named parameters to fill positionals)
   .assuming now supports * and Nil primers with special behaviors.
   .assuming will try to bind primer arguments to a partial signature:
   ... currently it will mix most failures into the returned closure.
   ... eventually we can phase-in throwing them instead.
   For now, subsignatures are mostly ignored during this bind.
   For now, constraints pointing to captured types are stripped.
   Where clauses and default value exprs are not evaluated until runtime invoke.
   This currently uses EVAL to construct the closure, which is LTA,
   but it gives us something functional/testable to work forward from.
   Roast tests available at github.com/skids/roast/tree/assuming
04:32
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...l?id=78240
kudo/nom: 072d691 | lizmat++ | src/core/Block.pm:
Merge pull request #463 from skids/assuming

   .assuming now produces closures with populated signatures.
skids Thanks, lizmat++ 04:33
dalek kudo/nom: 07a05cd | lizmat++ | src/core/Exception.pm:
Add latest P5 worries as exceptions
04:34
kudo/nom: 369ec75 | lizmat++ | src/core/Exception.pm:
Hmmm... apparently we can't heredoc in the core
kudo/nom: 47d1ed6 | lizmat++ | src/Perl6/Grammar.nqp:
Make P5 reference worries typed
lizmat skids: yw
04:36 Dee22 joined 04:39 VinceDee left 04:49 khw left
dalek kudo/nom: a891f98 | lizmat++ | src/ (2 files):
Make 0234 octal warning a typed exception
04:52
ugexe zef can now bootstrap itself from source and install modules on windows/linux and moar/jvm :D gist.github.com/ugexe/2a2d4a2654dea9b253a2 04:53
skids wonders how long to wait to push/unskip/unfudge spectests so as not to catch any autobuilds without the new .assuming code.
lizmat anybody smoking spectests is assumed to get the latest code 04:55
so it should be safe now, I think 04:56
dalek ast: a19359e | skids++ | S06-currying/named.t:
Tests for new .assuming implementation
04:57
ast: d97da19 | skids++ | S06-currying/ (2 files):
Unfudge/unskip passing JVM tests
lizmat runs a spectest
$ perl6 t/spec/S06-currying/named.t 05:02
===SORRY!===
Could not find Test::Assuming in any of:
skids: could it be you forgot to add Test::Assuming ? 05:03
hmm... it also seems to cause t/spec/S17-supply/classify.t to hang 05:04
hmmm.. flapper
skids Oh doh I screwed that commit up. Forgot to add after patching my main tree. 05:05
lizmat please PR, and I'll merge
05:06 leont joined
skids Rather than just push them? 05:06
lizmat ah, well, if you can push, then push!
dalek ast: 216231d | skids++ | / (4 files):
Add forgotten files for .assuming tests
05:07
lizmat runs another spectest
skids Wow JVM spectest takes time.
lizmat yeah :-( 05:08
05:08 diana_olhovik_ joined
skids At least S06 is towards the top :-) 05:10
05:13 atroxaper joined
dalek ast: ab80106 | lizmat++ | S06-currying/named.t:
Add missing 'use lib'
05:14
lizmat skids: after adding ^^, I get:
t/spec/S06-currying/named.rakudo.moar (Wstat: 768 Tests: 27 Failed: 3)
Failed tests: 4, 21, 27
TODO passed: 5, 22
skids Hrm those should be fudged. 05:19
lizmat even after that fix, I see all of the S17-supply tests flapping, and worse, hanging when they flap
skids I don't think .assuming is used anywhere in core.
lizmat I think the EVAL is somehow interacting badly 05:20
true
but still, empirically, I see this
let me revert your patch (locally) and make sure it's not one of the things I just did this morning 05:21
skids wonders why his "todo"s don't work in named.t 05:22
lizmat no flappers with your patch reverted :-( 05:27
05:27 diana_olhovik_ left
skids Hrm. 05:27
lizmat how about we give it a day and hope jnthn will be able to shed a light as to why your patch has this effect ?
skids Yeah. I'm up too late yet again. 05:28
Is a new moarvm invoked for each test file? 05:29
05:29 tinyblak left
lizmat yes, afaik 05:30
judging from top and the hanging tests, I'm quite sure :-)
skids Soo how the heck... well it's not like I've never seen code work just because I moved something else around.
skids wonders if anyone can wider-ecosystem-grep to see how much .assuming use is out there. 05:31
lizmat perhaps someone will as they wake up 05:32
lizmat is just up early to ventilate the house before another hot day
.tell jnthn Could you have a look as to why f5ebbf480c5936 is causing S17-supply hangs 05:35
yoleaux lizmat: I'll pass your message to jnthn.
skids Yeah my housemate goes crazy with the box fans about this time of night. 05:36
05:36 tinyblak joined
skids Probably using more wattage than an AC would. 05:36
lizmat only using natural ventilation here (open all of the possible windows *wide*) 05:37
skids Anyhow I hate to leave breakage in my wake, but my "wake" is waning fast. 05:38
lizmat don't worry about it... 05:40
mind if I try some things in the mean time ?
skids No go right ahead. I've got nothing related pending. 05:41
good n8, thanks for the help again
05:41 spollei left
lizmat yw, sleep well! 05:41
dalek kudo/nom: eaee44f | lizmat++ | src/Perl6/Grammar.nqp:
Seems we don't need worryobs anymore
05:42
05:45 skids left
dalek kudo/nom: 0585860 | lizmat++ | src/core/Block.pm:
Return more gently
05:58
kudo/nom: cbff68a | lizmat++ | src/core/Block.pm:
Change $s.substr(0,..) eq $f to $s.starts-with($f)

Oddly enough, this change seems to fix the hanging S17-supply tests!
lizmat .tell jnthn empirically, cbff68a fixes the hanging S17-supply tests 06:04
yoleaux lizmat: I'll pass your message to jnthn.
06:04 diana_olhovik_ joined 06:12 mr-foobar joined 06:27 FROGGS joined 06:30 atroxaper left 06:31 RabidGravy joined 06:33 atroxaper joined 06:44 abraxxa joined, xinming left 06:46 brrt joined 06:50 domidumont joined, quester joined 06:54 domidumont left, domidumont joined 07:00 espadrine_ joined 07:11 darutoko joined, xinming joined 07:21 g4 joined, g4 left, g4 joined
nine That's odd: 07:21
m: say [{a => 1}][0].perl; say [{a => 1}, {a => 2}]>>.perl
camelia rakudo-moar cbff68: OUTPUT«{:a(1)}␤a => 1 a => 2␤»
nine Why is >>.perl giving me something different than .perl on individual elements? 07:22
moritz nine: because >> descends into hashes 07:23
nine m: say [{a => 1}, {a => 2}].map: *.perl 07:24
camelia rakudo-moar cbff68: OUTPUT«{:a(1)} {:a(2)}␤»
lizmat m: (a=>1).perl.say
camelia rakudo-moar cbff68: OUTPUT«:a(1)␤»
nine So there is a difference between map and >>
moritz yes 07:25
lizmat m: say [<a b>]>>.WHAT.say
camelia rakudo-moar cbff68: OUTPUT«(Array)␤True␤»
lizmat m: say [<a b>]>>.WHAT.elems.say
camelia rakudo-moar cbff68: OUTPUT«0␤True␤»
lizmat m: say [<a b>]>>.elems.say
camelia rakudo-moar cbff68: OUTPUT«1 1␤True␤»
lizmat should wak up 07:26
El_Che lizmat: wake up or you'll miss Christmas!
lizmat getting up at 5am is not my cuppa tea
nine lizmat: still so hot up there? 07:28
RabidGravy marnin!
lizmat nine: high of 31C / 88F expected again 07:29
moritz we expect more like 36C
07:30 quester left
El_Che lizmat: where are you now? 07:31
lizmat at home :-)
El_Che exotic limburg :)
lizmat RabidGravy o/ 07:32
RabidGravy are we all fabulous this morning?
labster super fabulous here 🌈 07:33
lizmat the part of me that's awake, is fabulous
moritz is tinkering with continuous deployment
RabidGravy most excellent!
moritz fun, if a bit tedious
lizmat
.oO( all the time! )
07:34
labster I almost have some comparison operators for DateTime, just need to write some tests. 07:35
07:47 amurf left
DrForr It was 37 or so yesterday afternoon. 07:50
moritz yesterday was fine here (not too hot), but it was 37 to 38 on the weekend 07:52
07:53 atroxaper left, domidumont left
masak morning, #perl6 07:57
moritz 'o masak 07:58
07:59 dakkar joined
masak labster++ # DateTime cmp ops 08:02
08:10 domidumont joined
masak I discovered I needed them the other day when I was writing Real Actual Code. 08:20
dalek ast: c1c25bf | lizmat++ | S02-types/WHICH.t:
Add the X::Worry classes
08:24
lizmat afk for a few hours&
08:25 virtualsue joined 08:28 [TuxCM] joined 08:32 rindolf joined 08:37 atroxaper joined 08:39 mr-fooba_ joined 08:40 mr-foobar left 08:41 leont left 08:46 larion joined, Fleurety joined 08:47 aborazmeh left 08:48 smls joined
oha gethost() is not implemented in rakudo, right? 08:48
08:48 espadrine_ left
smls right 08:49
The design docs only seem to mention this signature for 'fail': 08:50
multi fail (Str $message)
But Rakudo has these:
sub fail (Exception $e)
sub fail ($payload)
sub fail (*@msg)
Are those official (and should be documented on p6doc)?
And isn't the second-to-last one redundant? 08:52
moritz not quite 08:54
it probably doesn't stringify $payload
whereas the *@msg case stringifies
(which makes the Str case redundant) 08:55
but it's a nice optimization
I'm pretty sure fail ( Exception ) should be documented on perl6/doc
smls *@msg dfoesn't stringify either for the n=1 case: my $payload = @msg == 1 ?? @msg[0] !! @msg.join;
moritz oh
the way I understand multi dispatch, it should never happen
08:56 brrt left 09:03 Dee22 left
labster masak: I'm afraid time cmp ops are going to have to wait until tomorrow, my brilliant plans didn't take time zones into account :/ Incidentally, how do you feel about comparing Date to DateTime? Might DWIM, might just be weird. 09:05
masak labster: uuh 09:06
labster: (1) just convert both DateTimes to Instant and compare those? you don't have to do the calculation yourself...
labster Yes that makes more sense I realize now, but I had fun. 09:07
masak labster: (2) I think we should disallow comparing Date to DateTime. even though for "most" values it makes sense, for some it doesn't.
I'd rather people convert their DateTime to a Date, and compare that with the other Date.
labster Right, so no Datish candidates then. 09:08
masak main hiccup with DateTime vs Date comparisons would be when the DateTime falls within the Date. breaks transitivity. 09:09
09:10 espadrine_ joined
masak rather than hide the underlying complexity of that, better to force the programmer to be explicit. 09:10
09:11 tinyblak left 09:12 espadrine_ is now known as espadrine
masak lunch & 09:13
09:14 mr-fooba_ left 09:15 rurban joined, mr-foobar joined
oha m: say v1.3 le v1.25, v1.3 cmp v1.25; 09:17
camelia rakudo-moar cbff68: OUTPUT«FalseLess␤»
oha is le coercing to Str, while cmp being smart? 09:19
moritz yes
m: say v1.3 before v1.25 09:20
camelia rakudo-moar cbff68: OUTPUT«True␤»
oha i see now, i should use before
right
thanks
dalek c: ad5acd2 | smls++ | lib/Type/Exception.pod:
Document sub fail
09:26 bin_005 joined 09:28 AlexDaniel joined 09:33 rindolf left 09:36 amurf joined 09:37 brrt joined 09:40 amurf left 09:44 tinyblak joined 09:49 andreoss joined, telex left
timotimo had unRESTful sleep :| 09:50
09:50 telex joined
timotimo not actually sure if the sleep can be said to have been had 09:50
RabidGravy Oooh "Package rakudo-star.x86_64 0:0.0.2015.06-1.fc21 will be an update" pretty snappy there from Fedora 09:51
09:52 VinceDee joined 09:53 TEttinger left 09:56 nowan left 09:58 atroxaper left 09:59 nowan joined, atroxaper joined 10:07 domidumont left 10:14 rindolf joined 10:19 Alina-malina left 10:22 aborazmeh joined, aborazmeh left, aborazmeh joined 10:26 andreoss left 10:39 huf left 10:42 huf joined 10:59 AlexDaniel left
smls Can the Perl 6 type system express "either a string, or an array of strings" ? 11:00
11:00 xinming left 11:01 xinming joined
vendethiel smls: it's always the case :P 11:05
m: my $a = "a string"; say $a[0]; # *g*
camelia rakudo-moar cbff68: OUTPUT«a string␤»
vendethiel m: sub f(@strs) { say @strs.elems }; f("hey"); f(("hey", "foo")); 11:06
camelia rakudo-moar cbff68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/c7TCdKpIP0␤Calling f(str) will never work with declared signature (@strs)␤at /tmp/c7TCdKpIP0:1␤------> 3sub f(@strs) { say @strs.elems }; 7⏏5f("hey"); f(("hey", "foo"));␤»
smls No, I mean a type constraint that aceepts an Array objects whose elements are Str, *or* a single Str, but nothing else
vendethiel m: subset OneOrManyStr where all($_) ~~ String; say "a" ~~ OneOrManyStr; say ("a", "b") ~~ OneOrManyStr; 11:09
camelia rakudo-moar cbff68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/OrGNEwYzi_␤Undeclared name:␤ String used at line 1. Did you mean 'Stringy'?␤␤»
11:09 kanl left
vendethiel m: subset OneOrManyStr where all($_) ~~ Str; say "a" ~~ OneOrManyStr; say ("a", "b") ~~ OneOrManyStr; 11:09
camelia rakudo-moar cbff68: OUTPUT«True␤False␤»
vendethiel m: subset OneOrManyStr where all($_.list) ~~ Str; say "a" ~~ OneOrManyStr; say ("a", "b") ~~ OneOrManyStr; 11:10
camelia rakudo-moar cbff68: OUTPUT«True␤True␤»
11:10 kanl joined
vendethiel smls: sigils aren't first-class, so... I guess that way? 11:10
smls hm, I guess 11:11
11:12 domidumont joined
smls is there a declarative way (i.e. without 'where') to specify an "Array whose elements are Str" constraint? 11:14
Array[Str] does the wrong thing
Array[Str]() does not seem to work either 11:15
vendethiel smls: not if you didn't declare your array explicitly as such
smls :( 11:16
oha smls, i might be wrong, but i read something about roles that could support template type signatures, but not sure if that would help anyways
vendethiel problem being that "if you pass an Array to a function expecting Array[Str], someone *outside* could add something that's not an int" 11:18
s/int/Str/
11:18 dayangkun left
oha smls, doc.perl6.org/language/objects#Para...ized_Roles but i don't know if there is a "core" role that works as an array container 11:20
vendethiel there's Array[X] AFAIK 11:21
11:25 amurf joined 11:30 amurf left
nine Captures are the closest analogue to Perl 5's scalar references we have, aren't they? 11:32
moritz or containers (type Scalar), depending on the context 11:35
nine Well, I'm trying to find something that can represent a P5 scalar ref in Perl 6 land. DBIx::Class expects a reference to a string for literal SQL and I wonder how I could pass that from Perl 6. 11:37
smls exoecting a Capture would be the most generic way to handle such cases for the purposes of Inline::Perl 11:39
though if you're talking about *porting* DBIx::Class to Perl 6, you should change the API to be more 6ish. 11:40
nine smls: I'm talking about using Perl 5's DBIx::Class as is :)
lizmat nine: what would be wrong with just passing the string from P6 ? 11:41
and make it a ref on the P5 side? 11:42
by doing a nqp::getattr($s,Str,'$!value') ?
smls lizmat: I guess the PErl 5 side wants to distinguish different meanings basewd on whether it got a CALAR
or reference
*scalar 11:43
nine lizmat: the string ref is an argument for DBIx::Class::ResultSet::search. Making it a ref on the P5 side would mean that I have to write a wrapper for every call of that method where I want to supply a ref.
lizmat but that's really an optimization, isn't it?
RabidGravy for anyone who cares DBIsh seems afflicted by the recent \ Capture changes
lizmat because it generates a lot of worries? or maybe too many? 11:44
nine $resultset->search({foo => "bar"}) generates ~~ select * from table where foo = 'bar'; while $resultset->search({foo => \"= bar"}) generates ~~ select * from table where foo = bar; # without the quoting, thereby allowing literal SQL 11:45
RabidGravy a lot of worries, I'll check it out later
nine m: sub test(Positional $foo) { say $foo.WHAT }; test(\("foo"));
camelia rakudo-moar cbff68: OUTPUT«Type check failed in binding $foo; expected 'Positional' but got 'Capture'␤ in sub test at /tmp/PAyfZfHCh3:1␤ in block <unit> at /tmp/PAyfZfHCh3:1␤␤»
nine But according to doc.perl6.org/type/Capture class Capture does Positional does Associative { } 11:46
lizmat Associative for the named parameters, I think
I mean, there's a *lot* of machinery around a Capture 11:47
ribasushi nine: both \$sql and \[ $sql, @bind ] are actually SQL::Abstract syntax thingies 12:00
so the application is wider 12:01
12:02 atroxaper left
lizmat ribasushi: would \[$sql]' be the same as \$sql ? 12:02
ribasushi lizmat: yes, but both are user-facing API 12:03
lizmat so nine could fake this on the P6 side by either doing $sql or [$sql]
12:04 atroxaper joined
ribasushi he can't just do $sql... how do you tell it apart from "value containing the string $sql" 12:04
let me show a clearer example
ShimmerFairy Would it be possible to make use of blocks with use v5; in them? 12:05
huf :q!
nooooo
12:06 atroxaper left
ribasushi paste.scsys.co.uk/492394 12:09
12:09 gfldex joined
ribasushi lizmat: ^^ 12:09
smls: ^^
nine: ^^
note the presence/absence of ` quotes
12:09 Possum joined 12:10 ShimmerFairy left
moritz maybe one needs to create a type P5Ref or so for explicit (un)marshalling 12:10
ribasushi doesn't have an informed opinion about the p6 side, just pointing that all of the above are different invocations in active use by end users 12:12
smls moritz: So one would have to write P5Ref.new("= col as-is") on the Perl 6 side? 12:14
instead of \"= col as-is"
moritz smls: yes 12:15
maybe there's a way to make Capture marshalling DWIM
smls I guess P5Ref could be made to act like Scalar, so that when it is *returned* from a P5 sub, the Perl 6 side doesn't even have to care that it got a reference
but can still check ~~ P5Ref in case that it does care 12:16
ribasushi paste.scsys.co.uk/492397 <--- better paste, showcasing *why* there is a { -value } 12:17
smls getting back a Capture would be... unwieldy.
thought for *calling* Perl 5 subs, \ is prettier than P5Ref.new()
ribasushi (think PostgreSQL arrays)
moritz m: sub prefix:<P5\>($x) { say "P5 ref to $x" }; say P5\"foo" 12:18
camelia rakudo-moar cbff68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8CXnRrZRO2␤Unable to parse expression in quote words; couldn't find final '>'␤ ␤at /tmp/8CXnRrZRO2:1␤------> 3$x) { say "P5 ref to $x" }; say P5\"foo"7⏏5<EOL>␤ expecting any of:␤ …»
moritz m: sub prefix:<P5\>($x) { say "P5 ref to $x" }; say P5\ "foo"
camelia rakudo-moar cbff68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fiI7NRG00w␤Unable to parse expression in quote words; couldn't find final '>'␤ ␤at /tmp/fiI7NRG00w:1␤------> 3x) { say "P5 ref to $x" }; say P5\ "foo"7⏏5<EOL>␤ expecting any of:␤ …»
moritz m: sub prefix:<P5\\>($x) { say "P5 ref to $x" }; say P5\ "foo" 12:19
camelia rakudo-moar cbff68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/6KQ_KGO_Dy␤Bogus postfix␤at /tmp/6KQ_KGO_Dy:1␤------> 3P5\\>($x) { say "P5 ref to $x" }; say P57⏏5\ "foo"␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
ribasushi and then there is "the other direction", also public API and used all over the place: metacpan.org/pod/DBIx::Class::Resu...t#as_query 12:21
nine moritz: introducing a P5Ref type for this (presumabliy in Inline::Perl5) would be a step back to where the user has to use Inline::Perl5 explicitly.
ribasushi: yep, that happens when people who write extremely important modules know perl too well.
12:22 tinyblak left
ribasushi all of these "design decisions" were made way before me, and the step from one to the other is straightforward 12:23
12:23 ShimmerFairy joined
ribasushi "ohhh you want to pass in whatever? - sure just give a reference to it" 12:23
"ooooh... you also need to pass binds... hmm well if \$sql means as-is, then \[ $sql, @binds ] is a no-brainer"
"hmmm you want to pass around random snippets in a stateless manner? - well we will just return you the \[ ... ] you already know and love" 12:24
nine To be fair, it is actually a quite ok interface.
moritz and this is where sqlalchemy just feels much better designed
smls nine, moritz: Why not both? Automatically turn a P6 Capture into a P5 reference, but when *returning* a P5 reference to P6 code, return it as a P5Ref object that acts like P6's Scalar
12:24 Alina-malina joined
ribasushi moritz: haven't had much experience with it, so can't comment 12:25
nine smls: I'd really like this stuff to round-trip without modification
ribasushi: sqlalchemy really is worth a look
moritz ribasushi: I'm using it for a $work project now, and quite enjoy it
12:25 tinyblak joined
ribasushi if it is better designed surface-wise, but without the ability to inject random stuff in any spot - this is actually a drawback 12:25
moritz ribasushi: also it gives much better error messages when doing something wrong during the schema definition
ribasushi nod 12:26
smls nine: Well, it still rount-trip in the sense that you could feed the P5Ref back to P5: Capture --1st-trip--> P5Ref --2nd-trip--> P5Ref ...
12:27 leont joined
ribasushi moritz: I will be the first to say - DBIC is rather user-unfriendly, as the user-facing side was not really designed, but instead built on top of built on top of built on top ;/ 12:27
in any case - does either of you have a pointer to sqlalchemy's "insert random RDBMS-specific thing" ? 12:28
moritz ribasushi: docs.sqlalchemy.org/en/latest/core/compiler.html is the first thing I could find 12:30
ribasushi: doesn't seem to be quite as ad-hoc as dbic 12:31
nine ribasushi: docs.sqlalchemy.org/en/rel_1_0/core...using-text 12:32
smls: but if I give a Capture to Perl 5 code that just returns it, I get some weird P5Ref thing back instead of what I put in. 12:33
ribasushi right... that's what I got back when I was looking - it's an "either/or" 12:34
smls true
ribasushi wheread in DBIC he "low-tech" approach allowed for arbotrary "mix-n-match"
which has its own strengths and drawbacks
bah mucho typos :/ 12:35
nine ribasushi: this looks pretty mix-n-match to me: select([ text("users.fullname || ', ' || addresses.email_address AS title") ]).where(and_(text("users.id = addresses.user_id"),
ribasushi nine: I meant more like this: youtu.be/aqUcMFalaek?t=193 12:36
i.e. usable directly from the high-level API
it's likely possible with a custom-compilation akin to Class::DBI, but that borders on "SQL dictionary" in a sense 12:37
nine In any case, I can't wait to see the results, when someone finally uses all of Perl 6's possibilities to create the one API to rule them all :) 12:38
ribasushi if someone takes on this project I am always available to shoot holes in whatever beta-API someone comes up with
ribasushi doesn't have many design chops, but has plenty of "this is bad, because users will abuse it like that" experience 12:39
nine I hope this someone will not make the same mistake like pretty much all others and starts with basic queries. One should really take the most extreme query imaginable with correlated subqueries, common table expressions, conditionals, custom functions and what not and create the API around that. Because that's where APIs usually really fall apart completely. 12:40
ribasushi this. 12:41
12:42 bin_005 left 12:44 xinming left
dalek ast: 6543aed | lizmat++ | S02-types/WHICH.t:
Somehow we messed up with the last commit
12:45
cdc_ m: so 2 == 2 & True
camelia ( no output )
cdc_ m: say so 2 == 2 & True
camelia rakudo-moar cbff68: OUTPUT«False␤»
lizmat .o( me, myself and I )
cdc_ hello #perl6, is this expected: ^^
lizmat m: say (2 & True).perl 12:46
camelia rakudo-moar cbff68: OUTPUT«all(2, Bool::True)␤»
moritz m: say so (2 == 2) & True
camelia rakudo-moar cbff68: OUTPUT«True␤»
moritz cdc_: looks pretty non-surprising to me
12:46 domidumont left
moritz & binds tigther than == 12:46
cdc_ oops, thanks! 12:47
moritz so you're checkint 2 == (2 & True), which autothreads to (2 == 2) & (True == 2)
which evaluates to True & False
which again collapses to False
cdc_ moritz: many thanks for the explanation :)
moritz cdc_: you're welcomew 12:48
s/w$//
12:49 domidumont joined 12:52 aborazmeh left
hoelzro (timotimo|lizmat)++ # p6weekly 12:54
12:59 zakharyas joined 13:05 abraxxa1 joined, abraxxa left 13:07 ShimmerFairy left
timotimo thanks :) 13:18
liz gets all the credit for lifting it off my shoulders for the last few weeks
or at least all my kudos 13:19
lizmat++ # good work on the p6weekly
smls moritz: I found a trick for reducing ./htmlify.p6 wait times: Temporarily prefix the filename of the doc you're working on with a 1, and use --sparse=5000. 13:20
13:21 ShimmerFairy joined
smls Maybe --sparse should use the last n modified files instead of the first n in alphabetical order? 13:21
moritz smls: I mostly use --sparse to check if a htmlify can run at all; I'm fine with changing its exact semantics 13:22
hoelzro timotimo: I wasn't sure who it was, but the writing style felt more like yours =) 13:25
lizmat all your writing styles are belong to us 13:26
commute to Amsterdam.PM& 13:27
13:27 lizmat left
timotimo hoelzro: the theme we're using makes the author name very hard to spot ;) 13:29
liz tends to end her posts with a section called "winding down", i usually just call the equivalent section in my texts whatever i feel like at that moment 13:30
13:32 zakharyas left 13:35 ShimmerFairy left 13:36 zakharyas joined 13:38 pullphinger15 joined
masak lizmat++ # p6weekly 13:39
13:39 pullphinger15 left 13:40 pullphinger joined 13:42 pullphinger left, pullphinger joined
hoelzro .say for %perl-typemap.kv # how do I get this to print each pair on a line given the new GLR changes? 13:43
13:43 zakharyas left
smls I think it never did 13:43
timotimo %perl-typemap.fmt("%s %s", "\n") 13:44
is my suggestion :)
smls maybe .pairs is what you want?
hoelzro really?
timotimo m: my %test = :1a, :2b, :3c; say %test.fmt("%s %s", "\n")
camelia rakudo-moar cbff68: OUTPUT«a 1␤c 3␤b 2␤»
timotimo ^- fmt is beautiful
hoelzro I swear it used to do that, but then again, most of the Perl 6 I've written until recently is actually NQP =/
smls m: for {:1a, :2b, :3c}.kv -> $k, $v { say $k, $v } 13:45
camelia rakudo-moar cbff68: OUTPUT«a1␤c3␤b2␤»
smls m: for {:1a, :2b, :3c}.pairs { say .key, .value }
camelia rakudo-moar cbff68: OUTPUT«a1␤c3␤b2␤»
smls m: for {:1a, :2b, :3c} { say .key, .value } 13:46
camelia rakudo-moar cbff68: OUTPUT«Method 'key' not found for invocant of class 'Hash'␤ in block <unit> at /tmp/qFIYuV25O3:1␤␤»
RabidGravy m: my %f = Foo => 1, Bar => 2; %f.pairs>>.say
camelia rakudo-moar cbff68: OUTPUT«Bar => 2␤Foo => 1␤»
smls m: for {:1a, :2b, :3c}<> { say .key, .value }
camelia rakudo-moar cbff68: OUTPUT«a1␤c3␤b2␤»
ribasushi nwc10: ping - see magnet-side pm when time permits 13:47
smls Oh, looks like RPerl (rperl.org) has had its 1.0 release
nice
It compiles a magic-free subset of Perl 5 to C++, compiles it, and wraps it up in XS so it can be used from Perl 5 again 13:48
leont Yeah, it's so little of perl5 that no real codebase can use it, IMO 13:49
smls it is?
:(
leont It was last time I looked, but I have to admit I haven't looked at it in a while
smls But maybe porting from Perl 5 -> RPerl code will still be more pleasant that porting to C/C++ by hand?
PerlJam I wondered what "magic-free subset of Perl 5" really meant when I saw that last night. They'd help their cause greatly by explaining that. 13:50
IMHO
leont There is an explanation somewhere 13:51
geekosaur doesn't "magic" have a specific meaning in the context of perl 5?
smls leont: Also, I think it's meant to be used on performance-critical parts, not on whole code-bases
moritz yes
13:52 brrt left, pullphinger left 13:53 pullphinger joined
timotimo MoarVM's profiler can now individually measure how much time is spent in native called routines 13:53
13:54 zoosha left
smls PerlJam: This seems to be sort of an explanation: rperl.org/the_low_magic_perl_commandments.html 13:56
13:57 lucasb joined, Celelibi_ joined
leont Documentation on what it does is disappointingly little 13:57
smls yeah 13:58
hoelzro is there a way to get information from Grammar.parse on how far it got before failing to match? 13:59
PerlJam hoelzro: maybe if you use Grammar::Tracer 14:00
hoelzro PerlJam: I'd like to be able to give feedback to a user without having to print everything, though
timotimo for rakudo's perl6 grammar, it implements its own thing with the high water marks
it's a sort of difficult thing, really 14:01
smls hoelzro: Add a || { die $/.to } at the right spot?
timotimo with such a "high water mark", it's easy to get confusing results
backtracking etc can really screw you over
PerlJam hoelzro: maybe modify Grammar::Tracer to markup the AST instead of printing?
hoelzro smls: that would work, except for backtracking and a lot of manual work =/ 14:02
I think I can use smls' idea to achieve what I want for the most part, though
I can at least present a line number 14:03
14:04 skids joined, larion left, larion joined, zoosha joined
smls hoelzro: I've used something like that in rosettacode.org/wiki/Dinesman%27s_m...lem#Perl_6 14:04
although I show the line that failed to match, instead of justs its line number 14:05
wait, no 14:06
just the number actually
14:08 mr-foobar left
oha got something a bit weird using HTTP::Client, INTERNAL ERROR: X::Numeric::Confused.new(what => ["5ae"]<>) 14:10
smls HTTP::Client didn't work at all last time I tried it 14:11
oha I understand moarvm precompile the pm files, so i'm not sure how to debug this
smls ended up using HTTP::UserAgent instead
oha smls, no no, it did so far
smls hm ok
oha smls, but if it is not maintained, i can do the same
smls Doesn't seem to be very maintained judging from supernovus' comment here: github.com/supernovus/perl6-http-c...t/issues/7 14:13
oha right, so HTTP::UserAgent is
RabidGravy quick sanity check, if I wanted to pass (FILE *)NULL in NativeCall is just using the CPointer type object enough? 14:16
nine yes 14:19
14:21 xinming joined 14:26 pullphinger left, pullphinger joined, [Sno] left, [Sno] joined
RabidGravy perfect 14:31
14:32 skids left
oha but... HTML::UserAgent follow automatically redirects (and fails anyway, but for a different reason... there must be something very wrong with this website) 14:32
tadzik oha: HTTP::UserAgent is The THing 14:35
not perfect, but what imho we should be trying to make perfect
14:36 grondilu left
RabidGravy must remember to finish up the changes I've got for it 14:37
ugexe fwiw i've worked a lot on github.com/ugexe/zef/blob/master/l...Client.pm6 14:38
RabidGravy the more the merrier! 14:39
14:41 khw joined
RabidGravy we can have an http client deathmatch when it gets too quiet around here ;-) 14:41
ugexe bout time for some 2.0 clients anyway 14:42
14:46 gcole left 14:48 vendethiel left, abraxxa joined 14:49 itz joined 14:50 vendethiel joined, abraxxa1 left 14:52 gcole joined
dalek line-Perl5: 0b6b575 | (Stefan Seifert)++ | / (5 files):
Add support for mapping P5 scalar references to P6 Captures

Perl 6 \("foo") will be converted to \"foo" in Perl 5 and vice versa. This is needed for supporting APIs like SQL::Abstract where "foo" and
  \"foo" mean different things.
15:00
15:03 amurf joined 15:08 amurf left, [TuxCM] left 15:16 Celelibi_ is now known as Celelibi 15:17 diana_olhovik_ left 15:18 g4 left 15:19 FROGGS left 15:29 larion left 15:31 raiph joined 15:33 pRiVi left, pRiVi_ joined
itz_ do any of the http clients handle incorrectly encoded web pages I wonder? :) 15:33
ugexe as far as i know they can all give you the raw output which you can encode/decode as you please 15:34
virtualsue "no" 15:36
15:41 leont left 15:44 pullphinger left 15:46 danstone1 left, FROGGS joined 15:47 danstoner joined
ugexe the secret to handling incorrectly encoded web pages is to use .encode('latin-1') or .unpack('A*') 16:00
16:00 pullphinger joined, pullphinger left
ugexe its just a possible security risk. or something 16:01
16:01 dj_goku left
smls you mean s/encode/decode/ ? 16:01
16:01 tinyblak left 16:02 diana_olhovik_ joined 16:03 pullphinger joined
ugexe heh, yeah that would work even better 16:04
16:04 dakkar left 16:13 domidumont left, dakkar joined 16:14 abraxxa left 16:15 skids joined 16:18 raiph left 16:20 raiph joined 16:22 uncleyear left 16:23 davido___ left 16:24 davido___ joined, uncleyear joined
smls masak: I'm working on the new /language/indexing.html doc page we were briefly talking about. 16:31
But now I'm wondering if "indexing" is really a good umbrella term for what the .[] and .{} postfix operators do.
The word is more associated with the positioanl variety, isn't it?
i.e. "indexing" vs "hashing" in database terms 16:32
Maybe "subscripting" would be a better title for the page?
It will sound weird to non-Perl people though.
^^ others may weigh in too, not just masak :P
lucasb IMO, "subscripts" is good 16:33
smls I'm leaning towards the gerund ("-ing") form, because I'm also imagining an hypothetical /language/iterating.html doc page, and then the two would go quite nicely together 16:35
And between the two, cover most of what there is to know about Perl 6 data structure handling 16:36
16:37 rindolf left
ggoebel regarding jnthn's grant funding running out at the end of this month... the grant proposal amount requested is $10K - $40/h for 50% of jnthn's time from April to December. How much additional funding is needed to reach the $10K goal? 16:37
smls Though the 'iterating' one will have to be written after the GLR :P 16:38
^^ moritz?
JimmyZ ggoebel: www.perlfoundation.org/perl_6_core_...pment_fund 16:41
ggoebel: news.perlfoundation.org/2015/04/gra...lease.html # this one is not from April to December :) 16:43
16:43 rindolf joined
ggoebel JimmyZ: if you read the url you referenced. "I have arranged with my employer to drop to 50% of full-time hours for the period April through December 2015" 16:44
JimmyZ: neither of the urls referenced show how much of the grant has been funded beyond lizmat++'s initial seed investment 16:45
16:45 Foxcool_ joined
JimmyZ yeah, that is for the first 3 months 16:46
it said, "Funding is being requested for an initial 3 month period"
16:46 spider-mario joined
JimmyZ www.perlfoundation.org/perl_6_core_...pment_fund # said total 25K 16:47
thus 15K to be needed :)
ggoebel JimmyZ: Hmm... makes sense 16:48
16:48 Foxcool left, domidumont joined
ggoebel I didn't understand how $10K could cover 50% time for 8-9 months 16:48
so we would need to raise $3K/m for 5 months 16:49
dalek rl6-roast-data: aa650a9 | coke++ | / (9 files):
today (automated commit)
JimmyZ me either, but the plan is about total 25K
ggoebel I'll talk with the wife tonight and negotiate carving out a piece of our annual charitable contributions budget 16:51
16:52 nys joined
JimmyZ That would be nice, thank you! :) 16:54
16:54 andreoss joined
PerlJam ggoebel++ 16:54
andreoss itz: seems that examples.perl6.org is completely ruined by Text::VimColour 16:55
ggoebel It would be nice if there were a perl6 core development fund webpage which listed supporters (and support levels if that is relevant) and a regular note in the p6weekly giving a status update on whether or not we are making progress toward our monthly and annual fund raising goals
andreoss examples are not even shown now
itz andreoss: yes I will revert now :( it's very odd works on all the systems I have access too 16:56
ggoebel I could care less about my name showing up on a list. But I'd like to be able to see a growing list of names
smls yeah, would be nice
andreoss itz: it doesn't not work wirhout proper .vimrc, with .vimrc i got from vim-perl it works okay 16:57
itz: do you have ssh access to this box? 16:58
itz no
I will change in git anyway
I suppose I could point the command at a version of .vimrc shipped inside the module 16:59
17:02 diana_olhovik_ left
smls Is there a way to donate to the Perl 6 development fund via simple PayPal or so? 17:02
The webpage wants me to sign up for an account with a million requiered form fields... 17:03
dalek pan style="color: #395be5">perl6-examples: c616ed1 | (Steve Mynott)++ | / (2 files):
revert Text::VimColour use
andreoss itz: the code for highlighting from main site might be borrowed, but i hesitate doing so since it's in python 17:04
JimmyZ ggoebel: me too.
itz andreoss: I'm sure its possible to get Vim working .. it's just tricker than expected .. I will look at it again tomorrow UK time 17:05
and have the Vim Colour support as a command line option (off by default)
17:06 berekuk joined 17:07 dakkar left
JimmyZ smls: I don't know, maybe lizmat++ knows :) 17:08
17:10 rindolf left
hoelzro colomon: are you in charge of rolling out the SmokeResults application to smoke.perl6.org? 17:10
colomon hoelzro: er, I guess
hoelzro colomon: would you mind rolling out the change I submitted last week? it would be cool to start seeing which distributions have warnings =) 17:11
colomon hoelzro: I think I already have
In order to start seeing changes, we actually have to get a complete smoke run.
which only happened twice in June, and hasn’t happened yet in July. 17:12
hmm, except the banner was supposed to change, wasn’t it.
hoelzro colomon: I don't see the GH banner, or the warnings category in the legend
yup 17:13
colomon hoelzro: I think I updated in the wrong account
17:15 rindolf joined, ab6tract joined
raiph How does one coerce (or at least convert) a (known to be suitably small value) Int to an int? 17:18
RabidGravy any reason why we can't have a "can-ok" in Test? I keep typing it only to find it isn't there
colomon hoelzro: will have it up in a moment... 17:19
RabidGravy I'll make it and everything
17:19 domidumont left
smls RabidGravy: you mean as a shortcut for ok $obj.^can("method") ? 17:20
RabidGravy yeah
colomon hoelzro: huh. updated elsewhere, still no improvement. moritz?
hoelzro colomon: cool, thanks! 17:21
smls would that really gain much though?
not much less to type
PerlJam smls: we have isa-ok
smls yes, because that allowes much better failure messages
oh, you wrote *isa* 17:22
hm
colomon hoelzro: third time’s the charm?
RabidGravy yeah by the same token you could just take away all of Test except for ok()
;-)
smls nah
is allows it to show what was expected and what was found, in case of failure 17:23
colomon hoelzro: FOURTH time is the charm!
smls ok can only report "eep, the expression was false"
colomon hoelzro: still no useful information for you, though.
smls I guess isa-ok can also show the expected vs found value
hoelzro colomon: that's fine 17:24
is the lack of warnings why it's not showing up in the legend?
colomon hoelzro: that I cannot tell you.
PerlJam RabidGravy: write it and see what happens ;)
smls can-ok would not be able to show more info than ok would though, right?
so maybe that's why it doesn't exist
colomon hoelzro: I need to triage smoking and get it to skip the modules that break it completely (like DateTime::TimeZone) 17:25
PerlJam smls: or ... maybe no one got around to implementing it yet
hoelzro colomon: alright, thanks for pushing that out!
RabidGravy well more info than "defined $obj && defined $obj.HOW and $obj.^can ...."
smls PerlJam: I was talking conceptually
because what is there to report in case of failure, oither than "nope the method does not exist"? 17:26
PerlJam well ... it conceptually already exists ... in Perl 5's Test::More
smls Wouldn't really be shorter either: ok $obj.^can("method") vs can-ok $obj, "method" 17:27
though nicer to write I suppose
RabidGravy and the thing is actually a valid invocant and so on and so forth
smls RabidGravy: *Should* it implicitly check 'defined $obj' though inb Perl 6? 17:28
RabidGravy it's in Test::More - I've been writing tests with Test::More for more than ten years, so have a lot of people. It's a convenience, a comfort thing
smls checking a method on a type object is not so unusual I think. 17:29
RabidGravy probably
smls in Perl it makes sense, because definedness is different there 17:30
RabidGravy you know the amount of typing we just did, I could have implemented it and sent the PR?
smls well-designed API > big API 17:31
PerlJam smls: TMTOWTDI! ;)
raiph m: use nqp; say nqp::decont(10, int) # How does one coerce (or at least convert) a (known to be suitably small value) Int to an int, without using NQP? 17:32
camelia rakudo-moar cbff68: OUTPUT«(int)␤»
17:32 Sqirrel joined
PerlJam personally, I see no compelling reason NOT to include it, nor do I have a compelling reason TO include it, other than RabidGravy (and possibly others) would find it useful. Ergo, for me, the balance tips towards having it. 17:32
ab6tract howdy #perl6 17:34
RabidGravy erp
PerlJam raiph: why the "without nqp" restriction? 17:35
ab6tract So I've gotten what appears to be a pretty complete version of an overlaps-with check for ranges
My only problem with it so far is that it was arrived at entirely via ballistic programming. I would be curious to hear what others think: gist.github.com/ab5tract/73bf6ca1663073b33e71 17:36
obviously, were it added to ranges via core-settings, it would have optimizations for returning early for easier to test cases 17:37
anyway, it's been passing all the ranges I've been throwing at it. I wonder if someone can break it. 17:39
17:40 davido___ left 17:41 davido___ joined
JimmyZ m: my Int $i = 10; my int $j = int($i); say $j; 17:42
camelia rakudo-moar cbff68: OUTPUT«Cannot invoke this object (REPR: P6int, cs = 0)␤ in block <unit> at /tmp/aVPUHRBkxt:1␤␤»
JimmyZ m: my Int $i = 10; my int $j = $i; say $j; 17:43
camelia rakudo-moar cbff68: OUTPUT«10␤»
JimmyZ raiph: ^^ ?
[Coke] having just done some range checking for dates at work, isn't it (r1.max >= r2.min AND r1.min <=r2.max) # this doesn't deal with endpoints. 17:45
for ab6tract
ab6tract [Coke]: it's precisely the endpoints that my implementation is designed to account for 17:46
because otherwise someone is going to have to handroll the overlaps check themselves, or suffer from the subtle yet important bug of ignoring end point exclusions 17:47
timotimo raiph: int will only survive in native vars "my int $foo", native attributes "has int $.foo", native arrays "my int @foo", and parameters for calls
moritz www.python.org/dev/peps/pep-0485/ food for thought for our is_approx implementation
17:48 espadrine left
timotimo raiph: however, for sufficiently small int values we actually do not store full big int structures in the Int object 17:48
raiph: and many big int ops can handle those "small big ints"
PerlJam ab6tract: Then isn't it what Coke said, but subtract the numeric .excludes_max and .excludes_min as appropriate? 17:49
ab6tract PerlJam: No, because the excluded-6 is not 5
flussence m: unit sub MAIN(); # I like that it allows unit here for consistency, but is this meant to work?
camelia ( no output )
ab6tract sorry, that's a confusing way to say it. PerlJam, I invite you to plug in such a solution 17:50
5^..^6 needs to return true for any floating point value that exists between 5 and 6 17:52
17:52 telex left
ab6tract overlaps-with( 5^..^6, 5.5^..^5.6 ) 17:53
PerlJam oh, good poitn.
17:54 telex joined
lucasb m: unit enum X <a b c>; unit constant C = 42; unit subset Foo; say 'ok' 17:54
camelia rakudo-moar cbff68: OUTPUT«ok␤»
lucasb flussence: It doesn't seem to be intentional 17:55
ab6tract ah, I found a case where the current expression fails.. overlaps-with( 5^..^6, 5.5^..6 ) 17:57
17:59 cdc_ is now known as cdc 18:02 WABF3FZ joined
dalek pan style="color: #395be5">perl6-examples: a018c56 | andreoss++ | / (2 files):
[euler] problem 97
18:10
18:11 smls left
lucasb I don't think I can see Captures and P5 references as similar things. (Are they?) Sure, both can be used to hold references to other things, it's fine if that helps solve some problem as a work-around. 18:12
18:13 Begi joined
Begi Hey ! I'd like use the Twitter API with Perl6. Which module can I use ? i've try HTTP::Client, but it doesn't support the HTTPS protocol 18:14
nine lucasb: if you have a different suggestion, it's not too late to change it 18:16
18:17 uncleyear left, uncleyear joined
ugexe HTTP::UserAgent + IO::Socket::SSL 18:17
Begi ugexe : I'll saw that. Thanks 18:18
raiph m: my Int $i = 10; my int $j = $i; say $j ~~ int; # JimmyZ
camelia rakudo-moar cbff68: OUTPUT«False␤» 18:19
PerlJam ab6tract: I gave up playing with your overlaps code, but I converted it to use tests. You might find that useful. See gist.github.com/perlpilot/091488db934dd4b3d9da
raiph m: sub foo (int $i) { say $i; $i }; say (foo(10**19) ~~ int) # timotimo
camelia rakudo-moar cbff68: OUTPUT«-8446744073709551616␤False␤»
raiph PerlJam: Mostly curiosity; I was thinking there'd be a way to get from an Int to an int without using NQP -- also see the lines just above (that mention JimmyZ, timotimo)
18:19 lizmat joined
ab6tract PerlJam: thanks man! That was definitely necessary 18:20
timotimo raiph: the ~~ operator boxes the int into an Int for your convenience 18:22
raiph timotimo: ah 18:23
andreoss is there a function composition in Perl 6?
lizmat good *, #perl6! 18:25
re irclog.perlgeek.de/perl6/2015-07-07#i_10861628 : there's the donate button on the perlfoundation site that takes you to secure.donor.com/pf012/give 18:27
andreoss m: sub x {}; &x.^methods».gist.grep(/compose/)
camelia ( no output )
lizmat for which you indeed need to create a login :-(
raiph andreoss: irclog.perlgeek.de/perl6/2015-03-13#i_10271727
[Coke] threw a small amount into the pot. 18:28
lizmat smls: I wish there were a Paypal account
ab6tract PerlJam: thank you very much indeed. I was delaying converting to tests as long as possible. I've forked your version and changed the logic so that the edge cases I've found this evening are accounted for: gist.github.com/ab5tract/ef4190612d84f49decc2 18:29
lizmat [Coke]++
timotimo in general, pretty much every method call on an int, num or str will create a box for you 18:30
[Coke] found a perler in NYC to dine with tomorrow. 18:31
18:32 larion joined
lucasb m: say(|\a=>1) 18:35
camelia rakudo-moar cbff68: OUTPUT«a => 1␤»
lucasb m: say(|\'a'=>1)
camelia rakudo-moar cbff68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Z49awGCf8x␤Variable '&prefix:<|>' is not declared␤at /tmp/Z49awGCf8x:1␤------> 3say(7⏏5|\'a'=>1)␤»
lucasb Trying to understand how I ended up with a variable '&prefix:<|>' 18:36
masak lucasb: that's how operators are named. 18:40
18:40 andreoss left, amurf joined, baest_ joined
masak m: sub infix:<+++>($l, $r) { "OH HAI" }; say "nice" +++ "greeting"; say &infix:<+++> 18:41
camelia rakudo-moar cbff68: OUTPUT«OH HAI␤sub infix:<+++> ($l, $r) { #`(Sub+{Precedence}|44130160) ... }␤»
masak m: sub infix:<+++>($l, $r) { "OH HAI" }; say "nice" +++ "greeting"; say &infix:<+++>.name
camelia rakudo-moar cbff68: OUTPUT«OH HAI␤infix:<+++>␤»
18:42 baest left 18:45 amurf left
raiph m: my int $i = 10; use nqp; say nqp::istype($i, int); say nqp::istype($i, Int); # timotimo: do you know of any way to get an int (without using nqp::decont or other nqp op)? 18:53
camelia rakudo-moar cbff68: OUTPUT«0␤1␤»
18:56 ab6tract left 18:58 larion left 19:00 Begi left 19:01 AlexDaniel joined 19:04 lolisa joined
dalek kudo/nom: 1c3b559 | RabidGravy++ | lib/Test.pm:
Add can-ok subroutine
19:07
kudo/nom: 3899982 | lizmat++ | lib/Test.pm:
Merge pull request #464 from jonathanstowe/can-ok

Add can-ok subroutine
19:08 spintronic left 19:09 dams_ left
lucasb m: say { 'a' R=> 1 } 19:09
camelia rakudo-moar cbff68: OUTPUT«1 => a␤»
lucasb m: say { 'a' RR=> 1 }
camelia rakudo-moar cbff68: OUTPUT«-> (;; $_? is parcel) { #`(Block|50977024) ... }␤»
lizmat m: say { 'a' RRR=> 1 } # just checking 19:10
camelia rakudo-moar cbff68: OUTPUT«-> (;; $_? is parcel) { #`(Block|39475696) ... }␤»
RabidGravy and just as I was typing "ok($obj.^can($param), $obj.WHAT.perl ~ " can $param")
lizmat RabidGravy: what then? 19:12
RabidGravy ;) I'll rebuild rakudo instead 19:13
cheers!
lizmat it'll be quick, only lib/Test.pm :-)
19:17 itz left
lizmat raiph: I have no answer for you, I hope jnthn will 19:22
19:36 khw left
masak m: my Int @a = 1, 2, 3; @a.push("4"); say @a 19:42
camelia rakudo-moar 389998: OUTPUT«Type check failed in assignment to '@a'; expected 'Int' but got 'Str'␤ in block <unit> at /tmp/oPoDdGSzQs:1␤␤»
masak m: my Int @a = 1, 2, 4; @a.splice(2, 0, "3"); say @a
camelia rakudo-moar 389998: OUTPUT«1 2 3 4␤»
masak submits rakudobug
*grin*
lizmat grrrr
19:43 [TuxCM] joined
moritz that's the disadvantage of the implementation not using its own API 19:45
19:47 bin_005 joined 19:50 rurban left
timotimo raiph: not sure; what exactly are you trying to do? 19:52
m: my int $foo = 10; say nqp::objprimspec($foo); my Int $bar = 20; say nqp::objprimspec($bar) 20:00
camelia rakudo-moar 389998: OUTPUT«===============================================================================␤The use of nqp::operations has been deprecated for non-CORE code. Please␤change your code to not use these non-portable functions. If you really want␤to keep using nqp:…»
timotimo m: use nqp; my int $foo = 10; say nqp::objprimspec($foo); my Int $bar = 20; say nqp::objprimspec($bar)
camelia rakudo-moar 389998: OUTPUT«0␤0␤»
timotimo oh, huh.
20:00 rurban joined
dalek ast: 9379577 | (Nick Logan)++ | S32-io/IO-Socket-Async.t:
fix flapping(?) test. indent cleanup

Passes all tests, including supposed previously flapping test.
Convert mix of tabs+spaces to all space indentation. Corrected the binary server code to actually work. Passes previously flapping test RT 122318? (Not sure if this is fixed or not. The RT has 0 information so its impossible to know)
I was not able to reproduce a flapping test before or after this PR so you may wish to un-skip the final test and close the ticket. Before this PR, it was simply FAILING the final test after some 10k iterations.
  
   nickl@localhost:~/perl6/rakudo$ prove -v -e './perl6 -Ilib' t/spec/S32-io/IO-Socket-Async.t
   t/spec/S32-io/IO-Socket-Async.t ..
   1..6
   ok 1 - Async listen on bogus hostname
   ok 2 - Async connect to unavailable server breaks promise
   ok 3 - Async connect to available server keeps promise
   ok 4 - Echo server
   ok 5 - Discard server
   ok 6 - bytes_supply
   ok
20:01
20:05 ab6tract joined 20:07 FROGGS left 20:08 lizmat left
ab6tract PerlJam: I think I've nailed it gist.github.com/ab5tract/ef4190612d84f49decc2 20:10
It is also look much more symmetric, which was one thing that made me uncomfortable about it before. Doing the commutative test is important. Thanks (once again!) for the testing setup. 20:11
20:12 [TuxCM] left 20:13 darutoko left
timotimo ab6tract: only for numerical ranges, though? :) 20:14
ab6tract timotimo: :( 20:20
20:22 diakopter left
ab6tract timotimo: how many other forms of ranges do we support? 20:23
masak it's kind of open-ended. anything that supports .succ, basically
to give two examples, Str and Date 20:24
m: say "f".succ
camelia rakudo-moar 389998: OUTPUT«g␤»
masak m: say Date.today.succ
camelia rakudo-moar 389998: OUTPUT«2015-07-08␤»
masak m: say "f" ..^ "m"
camelia rakudo-moar 389998: OUTPUT«"f"..^"m"␤»
masak m: say Date.today ..^ Date.today.later(:5days)
camelia rakudo-moar 389998: OUTPUT«Date.new(2015, 7, 7)..^Date.new(2015, 7, 12)␤»
labster m: say Date.today ~~ "🎋" 20:26
camelia rakudo-moar 389998: OUTPUT«False␤»
labster We obviously need a unidate function. 20:27
20:28 [TuxCM] joined
ugexe which method returns the number of seconds until the heat death of the universe? 20:30
dalek ast: bc052ef | usev6++ | S32-list/map.t:
Unfudge last test for RT #125207; skids++
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125207
20:31 berekuk left, smls joined 20:33 lucasb left
ab6tract masak: ah, that does clarify things. 20:37
fortunately, I think the excludes logic should be simpler for non-numeric cases
masak it's simpler for discrete domains, yes. 20:38
20:40 gtbjj joined
smls jnthn, lizmat: It looks like @a[0..3] calls @a.list to find out which of the requested elements exist, and then calls @a.AT-POS for each of the existing ones. 20:41
Is that intentional? 20:42
If so, that's yet another gotcha for people trying to implement the postcircumfix [] interace for a custom type... :/ 20:43
m: my @a = 5, 10; dd @a[1, 10]; dd @a[1..10] 20:46
camelia rakudo-moar 389998: OUTPUT«(10, Any)␤(10,)␤»
smls ^^ and is this different behavior of list vs range subscripts by design? 20:47
skids Ranges autotruncate inside .[]
smls ok
skids As long as they don't start with a negative (or well, off the left side of whatever your indexes are)
But lizmat++ recently noted that: 20:48
smls shouldn't they be calling .elems or .end to find out where to truncate though?
skids m: my @a = 5, 10; dd @a[1, 1..10]
camelia rakudo-moar 389998: OUTPUT«(10, 10, Any, Any, Any, Any, Any, Any, Any, Any, Any)␤»
smls instead of .list
skids Which looks borken.
masak yeah, that feels inconsistent.
smls yeah
skids The problem with calling .elems is when you are dealing with a lazy list. 20:49
smls also, didn't TimToady/pmichaud_ say that subscript arguments flatten?
20:49 khw joined
skids Yes it is noted in the GLR notes now that .[] is a flattening context. 20:49
Though the range behavior makes it more special than just that. 20:50
smls ETOOMUCHMAGIC
skids I think the GLR has deigns on, instead of just A) Iterating the list, or B) calling elems, a third option of C) chunking negotiation will be in play. 20:52
*designs
But that's just me guessing.
smls couldn't the auto-truncating be restricted to range subscripts of the form 4..* ?
since I'm guessing that's the motivation for having them? 20:53
20:53 pullphinger left, pullphinger15 joined
skids No actually, they are usful in general. 20:53
20:54 [TuxCM] left
skids Now if another behavior like throwing an OOR exception is desired a lot, how to make that happen is a good question. 20:55
One way, of course, would be to use ... instead of .. 20:56
20:57 raiph left
skids
.oO(Ranges form an interesting algebra in that they are not closed under subtraction even when overlapping)
21:00
smls skids: For the auto-truncating, it could also simply do $range.map({ @a.EXISTS-POS ?? @a.AT-POS !! Empty })
skids Yeah I don't know why .list is invoked.
smls well, gotta handle infinite ranges, but you get the idea
skids I always have the impression when wading into that area that there's someone with a firm grip on the corner of the rug ready to give it a good pull :-) 21:02
.oO(A closed algebra on ranges would have two addition and two subtraction operators each returning the upper and lower range, or same if only one resulted.)
21:04
21:07 VinceDee left 21:10 gtbjj1 joined 21:11 kaare_ left, kaare_ joined 21:13 gtbjj left
smls FYI this is what I use for testing this stuff: gist.github.com/smls/7e1835a2e581cceaaf6a 21:14
21:17 gtbjj joined, gtbjj1 left, ab6tract left 21:18 skids left, lucasb joined 21:19 beastd joined, gtbjj1 joined 21:21 gtbjj left
lucasb m: my &prefix:<|> = { 'oh hai' }; say |1=>1 21:22
camelia rakudo-moar 389998: OUTPUT«oh hai => 1␤»
21:24 gtbjj1 left 21:28 kurahaupo joined, shmibs joined 21:33 shmibs left 21:34 shmibs joined 21:37 lucasb left 21:43 pRiVi_ left 21:45 pRiVi joined 21:49 pullphinger15 left 21:54 spider-mario left
smls m: my %hash; my $val := %hash<foo><bar>; dd %hash 21:57
camelia rakudo-moar 389998: OUTPUT«%hash = {}<>␤»
smls ^^ S09 claims this would autovivify
masak m: my %hash; my $val := %hash<foo><bar>; $val = 42; dd %hash 21:58
camelia rakudo-moar 389998: OUTPUT«%hash = {:foo({:bar(42)})}<>␤»
21:59 lolisa left
smls yes, but it claims that the binding itself autovivifies 21:59
masak I haven't checked S09, but it makes intuitive sense that it wouldn't autovivify *before* you assign to it.
smls "Autovivification will only happen if the vivifiable path is bound to a read-write container."
and it gives that example as one that does
masak so I don't know what reason S09 has, but the way Rakudo has it feels quite straightforward.
22:01 rindolf left
smls But then again, S09 does seems to consist mostly of fossils, NYI stuff, and things where it's not clear whether it's a fossil or NYI... :S 22:01
22:03 ab6tract joined 22:05 ab6tract left 22:07 beastd left
smls m: my @array; foo(@array[0][0]); sub foo ($obj is rw) { dd $obj }; dd @array 22:09
camelia rakudo-moar 389998: OUTPUT«$v = Any␤@array = []<>␤»
smls yeah, looks like Raduko and design docs fundamentally disagree here 22:10
So in Rakudo, assignment to the container returned by .[] or .{} is the only condiditon that will cause auto-vivification? 22:11
That does seem simpler, though I wonder what the reasoning behind the 09 design was. 22:12
22:12 [particle]1 joined 22:15 [particle] left 22:17 itz joined 22:18 amurf joined 22:19 bin_005 left 22:22 pRiVi left 22:23 amurf left 22:25 ggoebel left 22:27 raiph joined 22:28 pRiVi joined 22:33 ShimmerFairy joined 22:40 ggoebel joined 22:43 lizmat joined 22:52 skids joined 23:15 TEttinger joined, RabidGravy left 23:20 smls left 23:22 amurf joined 23:34 itz left 23:40 roguelazer joined 23:41 virtualsue left
roguelazer Hello; does anyone know if there’s a convenient way to make $*IN.lines() behave as a Supply? 23:44
or, I suppose, to otherwise make stdin interact nicely with all of the promise-based async stuff 23:45
$*IN.get() never seems to return if it’s inside a start { } block 23:48