»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
00:02 kurahaupo left
psch sleeps & 00:19
00:19 psch left 00:33 KCL joined 00:36 KCL_ left 00:42 kurahaupo joined 00:47 PZt left 01:03 atroxaper joined 01:09 atroxaper left, kurahaupo left 01:13 BenGoldberg joined 01:17 nickpatch is now known as xopatch 01:18 ab5tract left 01:20 tinyblak left
dalek ecs: f03e922 | TimToady++ | S99-glossary.pod:
shortname and longname are compounded already
01:21
01:21 tinyblak joined 01:25 tinyblak left, dylanwh joined 01:27 danaj_ joined 01:36 tinyblak joined 01:38 tinyblak left, tinyblak_ joined 01:39 tinyblak_ left, tinyblak joined 01:40 dylanwh left 01:41 dylanwh joined 01:43 kst joined 01:56 dayangkun joined
tony-o anyone else have an issue with the rakudo 2014.11 tag building with openjdk 1.7? 02:04
02:09 Vlavv joined 02:12 rmgk_ joined, rmgk is now known as Guest94446, Guest94446 left, rmgk_ is now known as rmgk 02:15 tinyblak left 02:16 tinyblak joined 02:21 perturbation left 02:22 chenryn joined 02:26 tinyblak_ joined 02:28 tinyblak_ left, tinyblak_ joined, tinyblak left 02:55 atroxaper joined 02:56 novice666 left 02:59 atroxaper left 03:03 ab5tract joined 03:05 jimmy2 joined, jimmy2 is now known as JimmyZ_ 03:08 ab5tract left 03:10 noganex_ joined 03:14 noganex left 03:15 risou is now known as risou_awy, risou_awy is now known as risou 03:20 oetiker joined 03:23 aborazmeh left
[Coke] perl6advent.wordpress.com/2014/12/1...erability/ - might be missing an escape for the <> on $ perl6-j -e'use Bar:from; ? 03:32
03:43 chenryn left 03:45 kaare_ joined 03:56 KCL left 04:05 kurahaupo joined, aborazmeh joined
colomon_ Ah, crap. Tried to fix the typo [Coke] found, fixed it but made everything else worse. Stupid wordpress. 04:07
04:08 tinyblak joined 04:12 tinyblak_ left
colomon_ Damn damn damn damn 04:15
japhb
.oO( Take off and nuke it from orbit. It's the only way to be sure. )
04:19
colomon_ Somehow editing one line in there changed every < to &lt; and so on 04:20
japhb EWWW
colomon_ And even when I tell it to restore peschwa's version, it still happens.
so i've completely borked the code in the post, and I cannot figure out any way to fix it. 04:21
what's really awesome is it keeps adding on. So now &lt; has become &amp;lt; 04:22
xiaomiao colomon_: escaping is hard to do ;) 04:24
04:32 colomon joined, colomon_ left 04:34 m_athias left, m_athias joined 04:35 kaleem joined, dayangkun left 04:36 dylanwh left 04:44 chenryn joined 04:47 kaleem left 04:48 molaf joined, BenGoldberg left 04:51 ab5tract joined 04:56 ab5tract left 05:00 rurban joined 05:04 kaleem joined 05:15 ab5tract joined 05:16 dylanwh joined 05:21 ab5tract left 05:29 ptc_p6 joined 05:37 kaleem left, chenryn left 05:42 kurahaupo left 05:49 ptc_p6 left 05:52 chenryn joined
JimmyZ_ 早上好 05:53
06:07 xinming left, xinming joined 06:16 kaare_ left 06:18 konsolebox left 06:33 atroxaper joined 06:38 aborazmeh left 06:39 atroxaper left 06:40 bjz joined 06:41 aborazmeh joined 06:49 telex left, kaare_ joined 06:50 telex joined 06:54 mr-foobar left 06:57 kaleem joined 07:03 Isp-sec joined 07:13 dayangkun joined 07:22 FROGGS joined 07:23 chenryn left 07:29 anaeem1_ joined, dayangkun left 07:34 rurban left 07:35 tinyblak_ joined 07:38 konsolebox joined 07:39 tinyblak left 07:40 kaleem left 07:48 chenryn joined 07:54 vti joined 08:05 anaeem1__ joined 08:07 Util_ joined 08:08 JimmyZ_ left 08:09 Brock joined, perlpilot joined 08:11 jimmy2 joined, Foxcool left, jimmy2 is now known as JimmyZ_ 08:12 [Sno] left 08:13 sftp_ joined 08:14 anaeem1_ left, Util left, PerlJam left, Alina-malina left, awwaiid left, sftp_ is now known as sftp 08:15 Alina-malina joined, JimmyZ_ left 08:16 jimmy_ joined 08:22 jimmy_ left 08:23 darutoko joined 08:25 zakharyas joined 08:27 rurban joined 08:30 jimmy_ joined 08:35 rurban left 08:40 rurban joined 08:47 sqirrel_ joined, tinyblak_ left 08:48 tinyblak joined 08:49 jimmy_ left, jimmy_ joined 08:51 tinyblak left, tinyblak joined, konsolebox left 08:52 atroxaper joined 08:54 rurban left 08:57 atroxaper left
dalek c: b7adf34 | (Joji Antony)++ | bin/p6doc:
Fix issue #31
08:57
c: 6b46eaf | moritz++ | bin/p6doc:
Merge pull request #32 from simula67/windows_doc_fix

Fix issue #31
08:58 tinyblak left, tinyblak joined 09:00 tinyblak_ joined 09:04 tinyblak left 09:05 molaf_ joined 09:06 ab5tract joined, tinyblak joined 09:07 Isp-sec left 09:08 molaf left 09:09 tinyblak_ left 09:10 ab5tract left, konsolebox joined 09:12 fhelmberger joined, abraxxa joined 09:20 kaleem joined 09:25 Rounin joined 09:27 rurban joined 09:28 [Sno] joined 09:30 sqirrel_ left 09:37 ab5tract joined 09:38 Sqirrel left 09:39 ab5tract left 09:42 prevost joined 09:44 sqirrel_ joined 09:50 eternaleye left 09:56 chenryn left 10:00 zakharyas left, zakharyas joined 10:04 prevost left
sergot m: class A { }; my $a = A.new; die $a.WHAT; 10:04
camelia rakudo-moar 3fa1bd: OUTPUT«use of uninitialized value of type A in string context in block <unit> at /tmp/xJ1iW2vZSP:1␤␤Error while creating error string: No exception handler located for warn␤»
sergot wait, what? 10:05
m: class A { }; my $a = A.new; say $a.WHAT;
camelia rakudo-moar 3fa1bd: OUTPUT«(A)␤»
sergot m: class A { }; my $a = A.new; die $a.WHAT;
camelia rakudo-moar 3fa1bd: OUTPUT«use of uninitialized value of type A in string context in block <unit> at /tmp/D6MlaJm4AW:1␤␤Error while creating error string: No exception handler located for warn␤»
tadzik hmm
10:08 rurban_ joined
moritz sergot: die $a.^name 10:09
sergot: that gives you the type name. .WHAT gives the type *object* back
jnthn morning, #perl6
moritz sergot: and say() uses .gist on the type object, but die() uses .Str
\o jnthn
jimmy_ moarning, jnthn
sergot hi jnthn 10:10
moritz++ thanks!
10:26 eternaleye joined 10:28 prevost joined 10:29 jimmy_ left, anaeem1 joined 10:30 rurban left 10:31 eternaleye left 10:32 rindolf joined 10:33 dalek left, anaeem1__ left, dalek joined, ChanServ sets mode: +v dalek 10:35 rurban joined 10:38 eternaleye joined, rurban left 10:40 rurban joined 10:42 atroxaper joined 10:43 rurban1 joined 10:45 rurban left 10:47 Alula left 10:48 atroxaper left 10:49 Alula joined 10:52 anaeem1 left, anaeem1 joined 11:00 sqirrel_ left 11:01 anaeem1__ joined 11:05 anaeem1 left 11:28 rurban1 left 11:30 rurban1 joined 11:37 rurban joined 11:38 rurban left 11:40 rurban1 left 11:48 |Tux| left 11:52 denis_boyun_ joined 11:55 TuxCM joined, vti left 11:58 Akagi201_ left 11:59 ptc_p6 joined 12:04 vti joined, andreoss joined 12:07 denis_boyun___ joined, |Tux| joined, TuxCM left, denis_boyun_ left 12:16 brrt joined
brrt \o 12:16
jnthn++ for yesterdays p6advent calendar :-)
jnthn :-) 12:25
12:25 ptc_p6 left
andreoss how do i prevent flattening here without loosing the sigil? # my @a = 1,2 Z -1,-2; # (1,-1),(2,-2) 12:27
jnthn Hm, binding it instead of assigning seems to do it 12:30
m: my @a := (1,2 Z -1,-2); say @a[1]
camelia rakudo-moar 3fa1bd: OUTPUT«2 -2␤»
12:30 abraxxa left
jnthn oops, didn't need the parens there 12:30
m: my @a := 1,2 Z -1,-2; say @a[1]
camelia rakudo-moar 3fa1bd: OUTPUT«2 -2␤»
12:31 mvuets joined 12:32 denis_boyun___ left 12:33 denis_boyun joined, JimmyZ_ joined
JimmyZ_ jnthn++ indeed # very much promising post :) 12:34
12:35 kaleem left, anaeem1__ left 12:38 smls joined 12:39 |Tux| is now known as TuxCM, TuxCM left, TuxCM joined
smls colomon: re introducing escaping/formatting errors by editing a wordpress post: Did you maybe use the visual (WYSIWYG) editor? Because I've noticed that switching to the visual editor after writing a post in the raw (HTML) editor, tends to break things. 12:42
colomon I think when I opened up the post it was in the "new" editor and then I switched to the "classic" editor. 12:44
12:47 rurban_ left 12:52 anaeem1_ joined 12:53 rurban joined 12:56 anaeem1_ left 12:58 vti left 13:05 vti joined 13:10 denis_boyun left, denis_boyun joined 13:12 aborazmeh left
dalek ast: c1cfc1c | jnthn++ | S12-meta/primitives.t:
Tests for new Metamodel::Primitives.
13:18
13:26 prevost left
dalek kudo/nom: 7432d62 | jnthn++ | / (4 files):
Expose some MOP primitives for Perl 6 programmers.

Now the 6model API has been stable for a while, we should expose some key aspects of it. So far, short of using nqp::ops, it has not been possible for a Perl 6 meta-programmer to totally create their own kinds of type from scratch; customizing existing ones has been the only way. Custom publishing of method caches has also not been on offer, and some modules could certainly make use of it. Now it will be possible.
13:31
kudo/nom: 9cb09a5 | jnthn++ | src/vm/moar/Perl6/Ops.nqp:
Fix missing decont with .REPR implementation.
13:32
kudo/nom: b197c61 | jnthn++ | t/spectest.data:
Run S12-meta/primitives.t.
13:33 atroxaper joined 13:38 prevost joined 13:42 jluis left
FROGGS does a meta programmer program programmers? 13:42
JimmyZ_ so Is there a rule about -/_ when it is used in me-thod/me_thod ? 13:43
in the core setting 13:44
colomon JimmyZ_: I think "we" decided years ago to prefer - in sub and method names
but it's never been consistent in the core.
FROGGS yes, we prefer - over _ 13:45
JimmyZ_ yeah, I just find it's not consistent
FROGGS JimmyZ_: internally, or are you talking about exposed methods/subs? 13:46
JimmyZ_ FROGGS: exposed
FROGGS ohh, that's not good
JimmyZ_ .tell lizmat ^^ how do you think it? 13:47
yoleaux JimmyZ_: I'll pass your message to lizmat.
13:48 rurban1 joined
jnthn Well, it started with .is-prime, which I asked to make is_prime for consistency with the rest, and then once there was one case, we of course started getting many more :/ 13:48
colomon jnthn: as I remember it, the "decision" predated is-prime by years, but we never came even vaguely close to being consistent about it. :) 13:49
jnthn That was the first one I remember actually making it into core with a - 13:50
masak seems DNS is very unstable right now... 13:52
jnthn I agree - looks nicer, but I'd prefer consistency in CORE.setting over "occasionally something looks pretty" :/
masak: Maybe it's the stormy weather?
.oO( "We decided to pre-emptively cancel some DNS lookups, just like we did with the trains" )
13:53
smls jnthn: Although the built-in Perl 6 sub/method names are not consistent, there is sort of a pattern: "Every-day", user-facing ones like «is-prime» tend to use the dash, while "low-level"/"under the hood" ones like «at_pos» tend to use an underscore
lizmat computer: messages 13:54
yoleaux 13:47Z <JimmyZ_> lizmat: ^^ how do you think it?
jnthn smls: I suspect that's a blury enough distinction that it devolves into a "list of things to remember"
smls then change them all to dash! :P
lizmat fwiw, I think all public API from the core, would need to be consistent
13:54 lucas__ joined
lizmat and my consistency goes toward kebab-case 13:54
lucas__ Well, since you people touched the subject of dashes vs. underscore... Let me remind you of the Range excludes-{min,max} methods! :D 13:55
lizmat anything internal to the implementation (like at_pos, at_key) I don't care much about
smls are those really implementation specific? 13:56
lizmat actually, I prefer them to have underscores as a sort of indicator that they're not part of the public API
smls I thought they were the recommended way to provide postcircumfix:<[ ]> for your custom classes
jnthn lizmat: But at_pos *is* the thing you implement for...what smls++ said
lizmat at_pos / at_key are not mentioned in the synopses: that should be an indication
ah, good point 13:57
this is a fallout of the method -> sub transformation
hmmm....
I guess we should either upgrade at_pos / at_key to proper public API (as at-pos and at-key, probably) 13:58
or we should provide another way for classes to implement postcircumfixL<[]>
jnthn lizmat: I think they are mentioned in the synopses.
And I'm fairly sure they show up in the spectests
lizmat at_pos does, as part of IO-Socket-INET 13:59
jnthn But classes *don't* implement that, we changed that so we have a hope of getting native array accesses to compile into something nice.
lizmat at_key does not
smls Well they're still different in the sense that from the point of view of script writers, they're not supposed to be *called*, they're supposed to be *defined* (in custom classes). 14:00
jnthn Oh, the typecasting-long.t tests were just skipped instead of updated :(
smls So that might be a potential line to draw for different naming schemes
14:02 rurban1 left
smls To discourage people from writing @foo.at-pos(3) in normal code... L) 14:02
dalek ast: 1c69e62 | (Elizabeth Mattijsen)++ | S32-io/IO-Socket-INET.pl:
Properly do []
14:03
ast: da9a349 | (Elizabeth Mattijsen)++ | S32-io/IO-Socket-INET.t:
Make sure test runs on OS X (again)
lizmat jnthn: fwiw, I don't see any mention of at_pos/key in specs or roast anymore 14:04
jnthn Arrrghh *sigh* 14:05
Dammit.
lizmat what, that it is not mentioned ?
jnthn Yes, and not tested.
And that the tests we did have for doing this type of thing were just skipped.
colomon Let's fix that. (And let jnthn work on the hard stuff. :) 14:06
jnthn Well, the hard stuff will be right in this area soon, since I'll be adding postcircumfix:<[ ]> candidates for native arrays... :) 14:07
But yes, please let's salvage those tests.
Hm, this month's release is next week. 14:09
lizmat yes 14:10
jnthn OK. I'll probably have a branch for moving towards 6pe by then, and starting to prepare for the native arrays. But won't be mergable by that point. 14:11
I'm doing various bits of non-disruptive groundwork in nom, though. 14:13
lizmat $ ack -l 'METHOD TO SUB CASUALTY' t/spec
t/spec/S02-names-vars/varnames.t
t/spec/S12-methods/parallel-dispatch.t
t/spec/S13-overloading/operators.t
t/spec/S13-overloading/typecasting-long.t
t/spec/S13-overloading/typecasting-mixed.t
t/spec/S13-overloading/typecasting-short.t
t/spec/S14-roles/parameterized-type.t
files that contain similar problematic bits 14:14
jnthn eek
Quite a few.
lizmat I just remembered marked them when doing the method to sub migration
*marking
jnthn Well, good that they're marked and easily findable, at least. 14:15
lizmat that's what I figured :-)
14:18 konsolebox left
JimmyZ_ I'm very +1 to ALL to kebab-case :) 14:18
14:18 PZt joined
masak m: foo(); macro foo() { say "OH HAI" }; BEGIN { say "switching to runtime" } 14:19
camelia rakudo-moar 3fa1bd: OUTPUT«switching to runtime␤OH HAI␤»
jnthn masak: If you write CHECK instead you can put it anywhere. :) 14:20
masak TimToady: what should the semantics be of a macro that's called before its declaration? error at CHECK time?
14:20 kaare_ left
jnthn (the BEGIN block I mean) 14:20
masak m: CHECK { say "doing what jnthn says" }; foo(); macro foo() { say "OH HAI" }
camelia rakudo-moar 3fa1bd: OUTPUT«doing what jnthn says␤OH HAI␤»
jnthn And yeah, that makes it very clear it runs after compilation. 14:21
masak TimToady: I think the above semantics is basically an emergent accident, and should be fixed.
it's too surprising that the exact same statement might meant two wildly different things depending on whether it comes before or after its definition.
jnthn masak: I'm inclined to agree 14:22
masak ok, that's good enough for me.
spec clarification coming up.
jnthn m: say A; class A { } 14:24
camelia rakudo-moar 3fa1bd: OUTPUT«===SORRY!=== Error while compiling /tmp/5iWGahghKE␤Illegally post-declared type:␤ A used at line 1␤␤»
masak yeah.
jnthn I think given a macro is als something effective at compile time, we can argue it along the same lines as this
And maybe even implement it using the same mechanism.
dalek ecs: 272d12f | masak++ | S06-routines.pod:
clarify that macros can't be called before they're defined
14:25
masak ...and because it's now spec... :) 14:26
masak submits rakudobug
14:30 anaeem1 joined, lucas__ left 14:31 anaeem1 left, onebitboy left
[Coke] oh thank goodness I didn't volunteer for this release. :) 14:32
14:32 rindolf left
[Coke] (skips) we have a lot of tests that were skipped out of t/spectest.data pre-some-other release that were not re-enabled post-release. 14:33
(flappers)
andreoss is there a way to cancel a promise inside start {} block ? 14:34
lizmat andreoss: you mean the one that was returned by start ?
also: what do you mean by "cancel" ?
14:34 onebitboy joined
lizmat if you want to break the promise, a simple "die" inside the start code will do 14:34
*started 14:35
andreoss cancel like it never happened
14:35 onebitboy left
jnthn I tend to use a Promise to convey cancellation. 14:35
lizmat define "it" in this context, please?
14:35 onebitboy joined
jnthn Have the thing I want to be able to cancel close over it, and poll it at appropriate points. 14:35
And then if I want to cancel, just keep it. 14:36
We may want to make it a little more convenient, but the mechanism - at least for CPU-bound work - is about right. 14:37
14:37 anaeem1 joined
perlpilot good * #perl6 14:38
14:38 perlpilot is now known as PerlJam
masak perlpilo^WPerlJam! \o/ 14:39
jnthn o/ PerlJam
14:41 anaeem1_ joined
andreoss jnthn: your workaround with redefining $*SCHEDULER works yesterday, but today it throws 'Cannot modify an immutable ThreadPoolScheduler' 14:41
jnthn m: my $*SCHEDULER = ThreadPoolScheduler.new 14:42
camelia ( no output )
FROGGS andreoss: forgot the 'my' ?
m: $*SCHEDULER = ThreadPoolScheduler.new
camelia rakudo-moar 3fa1bd: OUTPUT«Cannot modify an immutable ThreadPoolScheduler␤ in block <unit> at /tmp/8qPgoeTLbE:1␤␤»
dalek kudo/newio: 8b85116 | usev6++ | src/core/operators.pm:
Allow chained sequences with closures
rakudo/newio: 5f64944 | (Tobias Leich)++ | src/core/operators.pm:
14:42 dalek left
masak probably remembered the 'my' yesterday :P 14:42
lizmat (sorry Dalek)
jnthn Yes, forgotten "my" is most likely :)
14:43 dalek joined, ChanServ sets mode: +v dalek
andreoss it worked without my. 14:43
14:43 anaeem1 left
FROGGS lizmat: btw, did you see my messages about panda/eleven a week ago? 14:43
andreoss: but you really want to declare your own scheduler 14:44
timotimo FROGGS: www.youtube.com/watch?v=5FFRoYhTJQQ
lizmat FROGGS: I may have missed them... haven't been backlogging very precisely, I must admit :-(
FROGGS here it comes: 14:45
lizmat: I can rebootstrap panda/eleven into a json blob using that config: gist.github.com/FR​OGGS/e9ef49b8fd8aab1a1149
lizmat: now I try to unborke installing a module
lizmat: I can install modules now with panda/eleven
lizmat aaaah, cool!
FROGGS :o)
lizmat FROGGS++
14:45 anaeem1_ left
FROGGS timotimo: I think I've sen that one :o) 14:45
seen*
14:47 onebitboy left
jnthn TimToady: The second bit of perlcabal.org/syn/S12.html#Class_methods talks about method ^foo() { } 14:49
TimToady: However, it's not really consistent with the current semantics of .^ calls, which pass the object as an argument. 14:50
TimToady: I'd been looking at implementing the method ^foo() { } thing as providing a per-type way to override something a meta-object does (meaning Array can simply have a method ^parameterize(...) { ... } which will work out rather nicely with the upcoming parametricity changes). 14:51
TimToady: If it really did just work as "create a role with this method in and mix it into the meta-object", it's probably easy enough. But the spec seems to want a forwarder method on the class too, which would I guess need to do some magic with the args, and the example in S12 would need to take an arg to work today. 14:52
TimToady: Thoughts welcome. :)
14:53 rurban1 joined 14:57 rurban1 left 14:58 rurban1 joined 15:00 kaleem joined 15:01 kaare_ joined 15:05 mvuets left
pmichaud good morning #perl6 15:07
I thought I'd add some historical commentary on the API-ness of at_pos and at_key
masak pmichaud! \o/ 15:09
pmichaud prior to at_pos and at_key, most people expected user-defined classes to overload postcircumfix:<[]> directly. But that ends up meaning that user-defined classes also have to handle slicing, whatever-ness, etc.
so, as an implementation detail (and to point the way I thought would be "more correct"), I introduced at_pos and at_key to provide the underlying single-element accessor, with slicing and overloads in the postcircumfix 15:10
so, they've never been officially blessed or spec'd in Perl 6, which is why they've continued to have underscores 15:11
at one time we even considered AT_POS and AT_KEY to highlight their "this is an implementation detail"
but, I still think that having a underlying "here's how to retrieve a single element" method is the way to go, and that it should become part of the official api/spec
history ends 15:12
smls pmichaud++ # history
pmichaud: How should user-defined classes handle things like $foo{bar}:delete and $foo[42]:exists though? 15:13
15:13 rurban1 left
masak excellent question. 15:13
PerlJam jnthn: maybe declaring the method as ^foo automagically adds the appropriate object parameter to the signature? Then the forwarder could just fill-in that value with an appropriate object. 15:14
15:14 rurban1 joined
smls Are all adverbs passed along to «at_pos» or is there a need for additional «exists_pos» and «delete_pos» variants? 15:14
PerlJam pmichaud: greetings! :) 15:15
hoelzro o/ #perl6
masak \o hoelzro 15:16
hoelzro o/ masak
pmichaud I had generally expected there to be an exists_pos and delete_pos variants, I think. 15:26
I wouldn't want them to be adverbial to at_pos.
More generally, at_pos really wants to be fast.
15:27 onebitboy joined, [Sno] left
JimmyZ_ m: Metamodel::.keys 15:28
camelia ( no output )
JimmyZ_ m: say Metamodel::.keys
camelia rakudo-moar 3fa1bd: OUTPUT«Archetypes Naming Documenting Stashing Versioning TypePretense MethodDelegation BoolificationProtocol PackageHOW ModuleHOW GenericHOW AttributeContainer Finalization MethodContainer PrivateMethodContainer MultiMethodContainer RoleContainer MultipleInherita…»
lizmat smls: exists_pos, delete_pos, assign_pos and bind_pos are part of this set as well
pmichaud ...assign pos?
JimmyZ_ hmm, why Metamodel::Primitives is in the core setting, and others are not? 15:29
smls ok
lizmat pmichaud: there is a candidate in postcircumfix:<[ ]> for that
see array_slice.pm
pmichaud I'll have to investigate it later.
I need to rush off again -- have to prepare for competition tomorrow 15:30
bb next week
lizmat cu then!
PerlJam pmichaud: good luck!
masak bye pmichaud, and good luck!
PerlJam finds it oddly funny that we're wish pmichaud luck when it's really the kids that need the luck (or just skill :) 15:31
*wishing 15:32
pmichaud coaches need luck too... sometimes more than the kids :)
jnthn PerlJam: Yeah, but you may well want to talk about the argument :) 15:35
smls, pmichaud: I believe today it's already done as delete_pos, exists_pos, and the similar _key things.
smls yeah, makes sense 15:36
jnthn Oh, lizmat already answered that :)
smls But you don't *have* to implement all of them, do you?
e.g. if you don't want your elments to be deletable
jnthn smls: Well, if you miss one out that :exists and :delete just wouldn't work. :)
s/that/then/
smls Also, is anyone actually using 'delete' on arrays? 15:37
In Perl 5 it is deprecated and almost never used
lizmat m: class A { method at_pos($a) { $a + 1 }; method exists_pos($a) { $a == 42 } }; say A.new[42]; say A.new[42]:exists; say A.new[43]:exists
camelia rakudo-moar 3fa1bd: OUTPUT«43␤True␤False␤»
smls And when it is, it's usually considered a design smell
I think a :remove with splice semantics would be much more useful. 15:38
15:38 atroxaper left
smls Because splice is one of those functions where I always need to go to the documentation and look up what each argument means, when I haven't used it for a while. 15:38
@foo[42]:remove otoh would be easy to remember :) 15:39
lizmat fwiw, I wouldn't be against that
PerlJam smls: at first blush, I like it
lizmat @foo[42..50] = @bar[1,2,3] # would also be nice 15:40
smls I'd even go so far as deprecating :delete completely, and providing only :remove for both arrays and hashes.
(For hashes, it would do exactly what delete does now, but having the same name is nice for consistency.)
m: my @a; @a[10] = "foo"; say @a.elems; 15:41
camelia rakudo-moar 3fa1bd: OUTPUT«11␤»
smls ^^ In a language where this would print 1, delete would make sense 15:42
But as it is, it adds weird "arrays with holes" semantics that seem out of place with everything else that arrays do.
lizmat m: my @a = ^5; @a[3]:delete; .say for @a # perhaps it should skip element #3 15:43
camelia rakudo-moar 3fa1bd: OUTPUT«0␤1␤2␤(Any)␤4␤»
dalek rl6-roast-data: 6e59a1b | coke++ | / (5 files):
today (automated commit)
PerlJam smls: except that shaped array promise the ability for arrays with holes.
jnthn It's useful for sparse arrays also 15:45
Which ours aren't by default
But modules could certainly implement them in various ways.
Certain problems tend to want them.
15:45 telex left
smls jnthn: What do they tend to create a full array first, and the 'delete' individual elements? 15:45
*But 15:46
15:46 telex joined
smls PerlJam: Is the shaped arrays support the same thing though? 15:47
jnthn smls: More normally you only ever set a small number of the elements compared to the overall size, so a more typical representation would be more tree-like...
smls PerlJam: I thought that was just a way to use non-custom names for your indexes.
JimmyZ_ jnthn: I see almost all method is Metamodel:: namespace is using underscore, is it fine to change to dash finally? 15:48
smls *non-standard
jnthn: Do those hypothetical specialized data structures need to do all of that through postcircumfix:<[ ]> though? 15:49
It seems odd that it provides an adverb for something that is not useful for normal built-in arrays, while not providing one for remove semantics that *would* be very useful for them. 15:51
jnthn smls: It'd be pretty un-Perl 6-ish to not be able to handle alternative storage strategies using the same API.
m: my @a = 1..4; say @a[2]:exists; @a[2]:delete; say @a[2]:exists;
camelia rakudo-moar 3fa1bd: OUTPUT«True␤False␤»
smls jnthn: What if a module author comes up with yet another thing that could be done through .[] for specialized arrays?
jnthn smls: Then...nice for that module author, I guess? :) 15:52
smls well, except that no adverb is provided for it
PerlJam smls: the onus would be on the module author then.
jnthn So define it.
Uh, so the module author would define it, I mean.
smls by overloading postcircumfix:<[ ]> after all?
And why can't module authors also define :delete then? 15:53
jnthn m: multi postcircumfix:<[ ]>(@array, $idx, :$remove!) { @array.splice($idx, 1); }; my @a = 1..4; @a[2]:remove; say @a.perl 15:54
camelia rakudo-moar 3fa1bd: OUTPUT«Array.new(1, 2, 4)␤»
jnthn smls: You're behaving like :exists and :delete don't actually do anything on Array today. They do. I just showed you they do.
And "is it there" vs "does it have a value" can be a quite useful distinction.
lizmat jnthn: but fwiw, I think a deleted array element should return Mu rather than Any 15:55
smls a distinction that auto-vivification blurs.
jnthn Granted we use it a lot more on hashes.
smls I get the feeling that delete on arrays is one of those things that Perl 6 just carried over from Perl 5 by default in its earlier years, and never got the memo when the Perl 5 community figured out it was a mistake and deprecated it... 15:56
jnthn lizmat: It should behave like any other non-existing element, no? 15:57
lizmat m: my @a is default(42) = ^5; @a[3]:delete; say @a[3]; .say for @a # bug with for, something for GLR 15:58
camelia rakudo-moar 3fa1bd: OUTPUT«42␤0␤1␤2␤(Any)␤4␤»
lizmat jnthn: well, that is the question :-)
should we make a difference between no container and an container containing (Any) ?
PerlJam smls: maybe :delete just needs a different name because it currently implies more than it delivers. Something like :reset or :undefine or ... idk (or maybe, as you say, it should go away) 15:59
lizmat hmmm... don't we have anybody for tomorrow's advent post yet ? 16:00
PerlJam I was thinking of doing one on what comes "out of the box" with Rakudo (mostly a survey of src/core) but I haven't really got much time for writing. 16:01
16:03 FROGGS left
smls How about: 16:06
%a{foo}:remove and @a[42]:remove for splicing out an element.
@a[42]:unset (with no equivalent for postcircumfix:<{ }>) for making a hole in a positional data structures that want to support it (of whichy built-in arrays don't need to be one, imo).
the name 'remove' has the benefit of making it clear that it is not like Perl 5's delete, and also sounds appropriate for something that is technically merely a "side-effect" of indexing an element. 16:08
Btw. one reason why delete was deprecated in Perl 5 is that newbies who were told to use it on hashes, often also use it on arrays thinking it splices out elements, leading to strange bugs. 16:10
remove vs unset would make it very clear what's going on.
.tell TimToady ^^ 16:12
yoleaux smls: I'll pass your message to TimToady.
PerlJam smls: like he isn't already going to backlog :)
16:13 denis_boyun left 16:19 prevost left
smls to expand on "of which built-in arrays don't need to be one": jnthn's defense of delete has convinced me that adding holes would be useful for a custom class that implements sparse arrays, but he hasn't convinved me at all that it should be supported by the same built-in array class that autovivifies elements, because those two features don't make much sense together. 16:19
16:20 mvuets joined
mvuets new take on text camelia: ƸöƷ 16:21
JimmyZ_ oh 16:24
jnthn away for a bit 16:27
smls With more distinct antennae: Ƹo̎Ʒ
16:27 andreoss left 16:28 brrt left
lizmat is considering a small advent post about interpolation 16:29
smls And with legs: Ƹo􏿽xCC􏿽x8E􏿽xCC􏿽xA4􏿽xC6􏿽xB7 16:30
lizmat for tomorrow, unless someone else has a better idea and the time to do it before 0:00 UTC
16:32 dj_goku left 16:36 rindolf joined
lizmat smls: if we ever need a 'camelia' operator, we have the non-texan version now :-) 16:37
m: my %h = a=>42,b=>666; say "%h[]" # feels awkward 16:38
camelia rakudo-moar 3fa1bd: OUTPUT«a 42 b 666␤»
lizmat m: my %h = a=>42,b=>666; say "%h[0]" # logic, to an extent
camelia rakudo-moar 3fa1bd: OUTPUT«a 42 b 666␤»
masak lizmat: interpolation sounds great. go for it.
16:39 atroxaper joined
lizmat so what would be a good definition of the Zen slice ? 16:39
it is mentioned a few times in the spec, but nowhere defined, really (only by example)
(oops, I acked for "Zen" rather than "zen")
masak lizmat: a zen slice of something like @a always gives @a. that's the definition. 16:40
lizmat: I always read it as being "Zen" because it's empty, and yet it has meaning.
PerlJam lizmat: sounds like something that should go in S99 if it's not already there
lizmat PerlJam: doing that right now
m: my $a = 42; say "$a[]" # it even works on scalars 16:41
camelia rakudo-moar 3fa1bd: OUTPUT«42␤»
16:42 andreoss joined
dalek ecs: 9222ac6 | (Elizabeth Mattijsen)++ | S99-glossary.pod:
Add "Zen slice" lemma
16:44
16:44 beastd joined 16:45 atroxaper left, kaleem left, zakarias joined 16:46 dj_goku joined 16:47 mr-foobar joined
dalek : e398180 | (Elizabeth Mattijsen)++ | misc/perl6advent-2014/schedule:
Day #13: Interpolation and the Art of Zen Slicing
16:48
16:49 JimmyZ_ left
lizmat hmmm.... 16:49
dalek : e1bfbf8 | (Elizabeth Mattijsen)++ | misc/perl6advent-2014/schedule:
Make that "String Interpolation"
16:50
16:53 treehug88 joined
lizmat m: my $args = \3; say @$args; say Array($args) # S02:2302 claims they should return the same 16:53
synopsebot Link: perlcabal.org/syn/S02.html#line_2302
camelia rakudo-moar 3fa1bd: OUTPUT«3␤\(3)␤»
mr-foobar any nqp/rules tutorial ? 16:55
lizmat m: my $args = \a=>42; say %$args; say Hash($args) # same here, at S02:2303 (and .Hash seems to be NYI)
synopsebot Link: perlcabal.org/syn/S02.html#line_2303
camelia rakudo-moar 3fa1bd: OUTPUT«EnumMap.new("a", 42, )␤Cannot find method 'Hash'␤ in block <unit> at /tmp/5aSEYoHhd7:1␤␤»
16:56 Rounin left 17:00 FROGGS joined
smls .tell psch «In our case this means “a method called update which takes a primitive byte and returns void“» --is this still correct after you updated to example to use 'method/update/(I)V'? 17:02
yoleaux smls: I'll pass your message to psch.
17:05 tinyblak left, tinyblak joined 17:07 raiph joined 17:10 tinyblak left 17:14 BenGoldberg joined
raiph mr-foobar: have you read edumentab.github.io/rakudo-and-nqp-...als-course ? 17:15
BenGoldberg m: say [,] 1..5; say [R,] 1..5;
camelia rakudo-moar 3fa1bd: OUTPUT«1 2 3 4 5␤Too many positionals passed; expected 2 arguments but got 5␤ in block at src/gen/m-CORE.setting:19659␤ in sub at src/gen/m-CORE.setting:19809␤ in block <unit> at /tmp/t6bfFFS49C:1␤␤»
mr-foobar raiph: reading thx ! 17:16
TimToady arguably, reversing a list associative operator should reverse the entire list and then call the N-ary function with it 17:18
yoleaux 16:12Z <smls> TimToady: ^^
BenGoldberg Regardless of what it should *do*, it definitely *shouldn't* throw an error like that. 17:19
:)
Hmm, would it be too strange to suggest that R do multi-dispatch, based on whether it's argument is a list operator? 17:20
raiph mr-foobar: yw. I note sections "NQP language" (p20 of first day) and "The regex and grammar engine" (p73 of second day) 17:21
mr-foobar raiph: There’s more than one way to get “Permanent head Damage” :D
colomon TimToady: sounds like a nop bug? 17:22
*Rop
brain
moritz \o 17:23
17:23 zakarias left
moritz idly wonders if there's any use building a p2p network that warns about malicious traffic from certain IPs 17:24
colomon o/ 17:25
17:26 andreoss left
colomon m: say 1 R, 2 R, 3 R, 4 17:26
camelia rakudo-moar 3fa1bd: OUTPUT«2 1␤»
colomon :\
[Coke] moritz: need a way to defend against malicious reports of malicious traffic. 17:28
TimToady hopes that was not a malicious report... 17:29
moritz [Coke]: I know; my first mental draft has signed reports, and leaves the decision of whom to trust outside the scope 17:31
[Coke]: which means I'd only trust reports from people I know well enough
[Coke] seems legit. 17:32
17:33 PZt left
Diederich ~~~ 17:37
TimToady BenGoldberg: that makes me wonder whether associativity should be reflected in the type of the operator, to avoid the overhead of constraint checking or introspection 17:40
m: say &infix:<,>.WHAT 17:42
camelia rakudo-moar 3fa1bd: OUTPUT«(Sub+{<anon>}+{Precedence})␤»
TimToady huh, looks like precedence is already mixed in
but you can't name a type with anonymous mixins... 17:43
looks like the current system forces us to do introspection, which is probably a design smell of some sort 17:45
17:45 xinming_ joined
TimToady maybe if we mix in a role we can use the role name without naming the whole type 17:47
17:48 xinming left 17:49 mvuets left
TimToady m: my $i = &infix:<,> but role ListAssoc { }; multi foo(&op) { say "oh" }; multi foo(ListAssoc &op) { say "ah" }; foo($i) 17:50
camelia rakudo-moar 3fa1bd: OUTPUT«oh␤»
TimToady drat
seems like that oughta work
m: my $i = &infix:<,> but role ListAssoc { }; say $i.WHAT 17:51
camelia rakudo-moar 3fa1bd: OUTPUT«(Sub+{<anon>}+{Precedence}+{ListAssoc})␤»
TimToady m: my $i = &infix:<,> but role ListAssoc { }; say $i ~~ ListAssoc 17:52
camelia rakudo-moar 3fa1bd: OUTPUT«True␤»
TimToady oh, doopf
17:52 zakharyas left
TimToady m: my $i = &infix:<,> but role ListAssoc { }; multi foo($op) { say "oh" }; multi foo(ListAssoc $op) { say "ah" }; foo($i) 17:52
camelia rakudo-moar 3fa1bd: OUTPUT«ah␤»
TimToady there we go 17:53
lizmat m: my @a; say @a<> # TimToady: is this a valid zen slice?
camelia rakudo-moar 3fa1bd: OUTPUT«␤»
lizmat m: my @a = ^10; say @a<> # TimToady: is this a valid zen slice?
camelia rakudo-moar 3fa1bd: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
TimToady so we could mix in the associativity and multi dispatch on it
lizmat or is the validity of @a<> being a zen slice, an implementation artefact ?
TimToady std: my @a; say @a<> 17:54
camelia std 76ccee1: OUTPUT«ok 00:00 138m␤»
TimToady hmm
std: say :a<>
camelia std 76ccee1: OUTPUT«Potential difficulties:␤ Pair with <> really means an empty list, not null string; use :a('') to represent the null string,␤ or :a() to represent the empty list more accurately at /tmp/k3s_JJ5F_W line 1:␤------> say :a<>⏏<EOL>␤ok 00…»
TimToady maybe we could carry that over 17:55
lizmat ok, so @a<> is not a good way to a Zen slice on an array 17:56
m: my %h = a => 42; say %h<> # more natural on hashes ?
camelia rakudo-moar 3fa1bd: OUTPUT«"a" => 42␤»
TimToady it's probably harmless, unless they think they're saying @a[''] 17:57
which doesn't make a lot of sense
Er, but <> is {}
they might well think they're trying to look up %h{''}
lizmat m: my @a = ^10; say @a{}
camelia rakudo-moar 3fa1bd: OUTPUT«0 1 2 3 4 5 6 7 8 9␤»
TimToady that should probably blow up, unless @a is declared to have {} keys 17:58
and <> should probably be warned on, just as :a<> does
there's no reason not to use [] as the zen slicer of an array 17:59
lizmat agree... 18:00
TimToady m: my @a = <nested brackets>; say qq[It should even work for @a[] and such];
camelia rakudo-moar 3fa1bd: OUTPUT«It should even work for nested brackets and such␤»
TimToady and for hashes, %h<> is the same braino as :x<>, namely, mistaking <> for '' rather that qw// 18:02
lizmat hmmm.. was @a interpolation in Perl 5 a 5.0 thing, or later ?
TimToady an easy mistake, since <foo> is equivalent to 'foo' but <foo bar> is not equiv to 'foo bar' 18:03
earlier, I think
lizmat so you're saying that %h<foo bar> is not equivalent to %h{ <foo bar } ?
TimToady no, I'm saying %h<foo bar> is not equivalent to %h{ 'foo bar' } 18:04
18:05 fhelmberger left
lizmat but %h<> feels as much as a Zen slice to me as %h{} 18:05
TimToady but people will think erroneously that %h<> is equivalent ot %h{ '' } when it is not, just as they think :x<> means x => '' when it really means x => (
()
lizmat hmmm.... I've always interpreted <> as qw() 18:06
and %h<...> as a welcome shortcut
TimToady and again, there's no reason they can't use {} for a Zen slice, so we don't need <> esp. since it's confusing
lizmat true
but <> types a lot easier, especially on non-US keyboards 18:07
but ok, point taken :-)
Maybe we need a bit of clarification in synopses on what a Zen slice is (and how to specify it) 18:08
18:08 FROGGS left 18:09 [Sno] joined
moritz tadzik: does panda now use the new API location? If yes, github.com/tadzik/panda/issues/120 can be closed 18:26
18:28 raiph left 18:30 grettis joined
masak for once, I don't mind outlawing %h<> 18:31
since if it were allowed it would be exactly identical in semantics to %h{}
only more confusing.
I can see how some day I *might* regret that if I decide to store '' keys in some hashes. 18:32
lizmat I guess our minds work differently: I see <foo> always as a slice
because <quoted words>
so %h<foo> is a 1 element slice
(I even think it works like that internally
) 18:33
masak yes, then our minds work differently on that point.
lizmat so %h<foo> is not equivalent to %h{'foo'}
masak my brain goes "<foo> is a string, <foo bar> is a list"
m: say <foo>.WHAT; say <foo bar>.WHAT
camelia rakudo-moar 3fa1bd: OUTPUT«(Str)␤(Parcel)␤»
lizmat but rather is equivalent to %h{ <foo> }
masak m: my %h = foo => 42; say %h<foo>.WHAT; say %h{ <foo> }.WHAT 18:34
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤(Int)␤»
lizmat hmmm..
18:34 d4l3k2_ joined
lizmat hmmm.... 18:34
I hadn't realized that <foo> is really 'foo' 18:35
18:35 d4l3k2_ left
lizmat that feels like something that is as hard to explain as @a $a[0] in perl 5 18:35
18:35 dalek_p6c joined
lizmat to newbies 18:35
18:35 kurahaupo joined 18:36 dalek_p6c left
TimToady it's the same as 'foo' vs 'foo','bar' 18:36
that's all
lizmat makes mental note 18:37
18:37 dalek_p6c joined
masak ooh, I hadn't thought of that reason it is the way it is. 18:38
lizmat
.oO( war of the daleks )
18:39
dinner&
18:41 dalek2 left
moritz has decimated a dalek 18:41
masak reducing it to 0.9 daleks? 18:42
moritz more like 0.01 daleks 18:44
masak m: say log(0.01) / log(0.9) 18:45
camelia rakudo-moar 3fa1bd: OUTPUT«43.7086906535657␤»
masak you would need to decimate it 44 times to get down to that low level of dalek. 18:46
m: say 0.9 ** 43.7
camelia rakudo-moar 3fa1bd: OUTPUT«0.0100091607107812␤»
18:47 rurban1 left
masak knew grokking logarithms would come in handy some day! o/ 18:47
18:48 atroxaper joined
dalek_p6c on: 00c41c2 | (Moritz Lenz)++ | README:
[README] add a synopsis
18:51
18:52 molaf_ left, wolv left 18:56 vendethiel left 18:59 gfldex joined 19:00 raiph joined
tadzik moritz: yeah, I wanted to wait a bit for feedback first :) 19:03
19:03 FROGGS joined
dalek : 4c48a51 | moritz++ | misc/dalek-start.txt:
[dalek-start]: oops, removed the wrong instruction
19:09
: d6abcff | moritz++ | misc/dalek- (2 files):
Update dalek instructions to new server
19:09 FROGGS_ joined
moritz everybody, please use the the new dalek push URL in your github hooks: hack.p6c.org:80880/dalek?t=freenode,perl6 19:10
gtodd lizmat: I got off to a good start with perl5 and *instantly* grokked stuff ike @arr = qw/a 1 b 2 c 3/; say $arr[0]; %hsh = (qw/a 1 b 2 c 3/) ; say $hsh{b}; say @hsh{qw/a b c/} ... then about 10 minutes later I hit a plateau ;-)
raydiak moritz: bad link...80880 eh? :) 19:11
moritz raydiak: sorry, 8088 19:12
dalek : 5c165e7 | moritz++ | misc/dalek-push.txt:
dalek-push.txt: fix port numbers
19:13 FROGGS left
raydiak good to know, I kinda wondered how dalek decided which repos to listen to or not 19:14
(and \o g'mornin while I'm at it) 19:15
19:16 beck_ joined 19:17 anaeem1 joined 19:18 vendethiel joined 19:19 anaeem1 left 19:20 rindolf left
dalek_p6c : 774ada3 | (Moritz Lenz)++ | misc/dalek-push.txt:
remove outdate information from dalek-push.txt
19:20
ecs: 368ac72 | (Bruce Gray)++ | S (2 files):
Fix typos and tenses.
19:23
ecs: 3890f88 | (Bruce Gray)++ | S32-setting-library/IO.pod:
Fix Unicode property `Zl` (Separator, Line); was listed as `ZI`.
19:24 anaeem1_ joined
TimToady wonders how much code out there depends on s/// returning the string rather than the successful matches 19:29
masak as an anecdotal data point: I never use that return value, because (a) I'm never sure what it does, and (b) I'm pretty sure it's been different over time and across Rakudo/Niecza 19:30
some implementation used to return a Bool 19:31
I think at some point the original string was returned? who knows
TimToady n: $_ = "foo"; say s/oo/ox/
camelia niecza v24-109-g48a8de3: OUTPUT«True␤»
masak right.
TimToady pugs: $_ = "foo"; say s/oo/ox/
camelia pugs: OUTPUT«sh: /home/camelia/.cabal/bin/pugs: No such file or directory␤»
TimToady aww
19:32 anaeem1_ left
moritz jnthn, arnsholt: please update the webhook URL in your github repos to hack.p6c.org:8088/dalek?t=freenode,perl6 (for zvolaj and snake, and potentially others if you have more with push notifications) 19:33
TimToady I think it's just going to return the list of matches, since we already have that handy
moritz +1 19:34
masak worksforme 19:35
fwiw, the rationale for the Bool result was a use case like `while s/x/y/ { ... }`
but list-of-matches would fullfil that too, methinks 19:36
19:36 anaeem1_ joined
vendethiel thinks about the s//r he proposed to TimToady++ at the apw 19:36
raydiak vendethiel: like P5's /r? 19:37
moritz the problem is that all our modifies go to the front, and s:r:/// already has another meaning 19:38
raydiak well yeah we'd have to call it something else...but ".subst" is kinda verbose :)
moritz having that one go to at the end would be highly inconsistent
raydiak: yes, but what to call it? 19:39
vendethiel raydiak: yes
moritz: yes.
raydiak goes to find the list of existing modifiers to consider collisions
vendethiel raydiak: yes again. .subst is very verbose
19:39 denis_boyun joined
moritz wonders if :keep / :k for "keep the original around" might work 19:41
raydiak I thought about that, it kinda sorta parallels with \K in intent for a stretch of analogy :)
oh wait I'm back in P5 land, we don't have \K here I don't think
moritz there's no \K in perl 6.
raydiak too bad c for copy is taken 19:43
:d/:duplicate?
19:44 dalek_p6c left, dalek_p6c joined
raydiak I think I like k more than the others I've considered so far... 19:45
hoelzro I feel like this was discussed before
hoelzro searches logs
moritz hoelzro: it was, but none of the proposals stuck with me
[Coke] u for su[bst]
moritz but s/// already stands for subst :-) 19:46
PerlJam If we're voting, I like :k(eep)
raydiak more than one person I don't know hit on this issue in recent days, between directly asking it and trying to golf around it 19:47
moritz the thing I don't like about :keep and :duplicate is that it kinda focuses on the wrong aspect
raydiak what is the right aspect? 19:48
hoelzro I think :keep was what was proposed, and I liked it
moritz to me, returning the substituted version is more important than keeping the original around
TimToady \K is <( I think
hoelzro yup, July 30th
irclog.perlgeek.de/perl6/2014-07-30#i_9105854 19:49
moritz TimToady: yes 19:50
19:50 denis_boyun left
[Coke] moritz++ dalek work 19:50
raydiak hmm good point...so "return the string itself" and "don't mangle the string" are two distinct concepts
and this adverb does both, right?
moritz aye
19:50 denis_boyun joined
TimToady doesn't like any of the solutions yet 19:51
19:52 beck_ left
moritz I feel it would be more six-ish if s/// returned the modified copy by default, and special action would be necssary to make it mutating 19:52
~~= or s=/// or so 19:53
the fact that we haven't found a good name yet might imply that we've been looking for a solution to the wrong problem
TimToady which, of course, will confuse P5 programmers completely 19:54
PerlJam TimToady: is that a good thing or a bad thing? ;)
TimToady Ja.
PerlJam touche 19:55
19:57 ptc_p6 joined
smls TimToady: Well, s///r is popular in Perl 5 now too, so you could say it simply became the default (like /x also did) 19:58
20:03 denis_boyun___ joined 20:04 denis_boyun left 20:06 Isp-sec joined
TimToady hah, Test.pm apparently depends on s/// returning the value, because every test blows up 20:10
raydiak smls: but then the boolness of the default result would be mostly useless
unless it had a messy "but True" or something attached to it 20:11
lizmat TimToady: Test.pm could be easily fixed :-)
m: my @a = <foo bar baz>; say <<zip zop "@a[]">> # feels like there is a space missing between zop and foo 20:12
camelia rakudo-moar 3fa1bd: OUTPUT«zip zopfoo bar baz␤»
lizmat m: my @a = <foo bar baz>; (<<zip zop "@a[]">>).perl.say # some clarification 20:13
camelia rakudo-moar 3fa1bd: OUTPUT«(("zip", "zop"), "foo bar baz")␤»
lizmat I guess I would have expected ("zip", "zop", "foo bar baz") there
feels like a rakudobug to me 20:14
20:15 denis_boyun___ left 20:18 denis_boyun joined
jnthn back from dinner, IPA 20:19
dalek_p6c frastructure-doc: 319507a | moritz_++ | hosts/hack.p6c.org.pod:
[hack.p6c.org] document some services
TimToady well, we could have r///, but then we'd need to rename .subst to .replacing or so
dalek_p6c frastructure-doc: 34de188 | moritz_++ | hosts/hack.p6c.org.pod:
Fix header level
20:20
smls raydiak: You could still check the bolean value of $/ afterwards though right?
TimToady that doesn't help with smartmatching much
jnthn moritz: I updated it for Zavolaj 20:21
moritz: How about MoarVM?
moritz jnthn: that too, please
jnthn Done 20:25
20:26 darutoko left
moritz is anybody aware of any website of service that runs on perl6.org that doesn't yet run on p6c.org too? 20:27
or asked another way, any reason not do the DNS switchover now? 20:28
20:29 denis_boyun___ joined
TimToady hears a feather dropping 20:29
20:31 denis_boyun left 20:34 anaeem1_ left, denis_boyun_ joined, anaeem1_ joined, woolfy left, denis_boyun___ left
jnthn moritz: After pondering for a few minutes, I can't think of any. 20:35
colomon moritz++
carlin m: try { say chr 56000; CATCH { say 'oh no' } }; say 'alive' 20:37
camelia rakudo-moar 3fa1bd: OUTPUT«oh no␤Iteration past end of grapheme iterator␤ in method print at src/gen/m-CORE.setting:15859␤ in sub say at src/gen/m-CORE.setting:16559␤ in block <unit> at /tmp/3BYslhptK7:1␤␤»
20:38 denis_boyun joined
jnthn m: say chr 56000; 20:39
camelia rakudo-moar 3fa1bd: OUTPUT«Iteration past end of grapheme iterator␤ in method print at src/gen/m-CORE.setting:15859␤ in sub say at src/gen/m-CORE.setting:16559␤ in block <unit> at /tmp/Pp0PQY7D4V:1␤␤»
jnthn m: say (chr 56000).chars;
camelia rakudo-moar 3fa1bd: OUTPUT«1␤»
jnthn m: say (chr 56000).perl;
camelia rakudo-moar 3fa1bd: OUTPUT«Error encoding UTF-8 string near grapheme position 0 with codepoint 34␤ in method print at src/gen/m-CORE.setting:15859␤ in sub say at src/gen/m-CORE.setting:16559␤ in block <unit> at /tmp/vPB_onjHSO:1␤␤»
20:39 denis_boyun_ left
jnthn Innerestin. 20:40
m: say (chr 56000).ord;
camelia rakudo-moar 3fa1bd: OUTPUT«56000␤»
20:42 denis_boyun left 20:43 denis_boyun joined 20:44 woolfy joined
dalek_p6c blets: 6a80105 | moritz_++ | docs/build-html.pl:
html generation: configurable output dir
20:45
blets: b581d6b | moritz_++ | docs/build-html.pl:
Avoid experimental smartmatch
raydiak smls: you mean "if do { s///; $/ }"? I'd rather be forced to type :gimme-a-match on all my s/// than that line noise :) 20:46
20:46 ab5tract joined
raydiak not that the current hoops to emulate the non-existant :k are any better... 20:46
20:46 kurahaupo1 joined
dalek_p6c blets: 82332bb | moritz_++ | docs/build-html.pl:
also copy CSS
20:48
20:50 denis_boyun__ joined 20:53 denis_boyun left 20:55 denis_boyun__ left
timotimo moritz: may i ask what went wrong with the KVM stuff before? 20:56
moritz timotimo: the debian testing installer hung 20:57
timotimo: I "solved" by installing debian stable, and upgraded
timotimo and how you fixed it?
mhh
oh well. could have been worse
20:57 denis_boyun_ joined 20:58 smls left
dalek_p6c : 34d0642 | lizmat++ | misc/perl6advent-2014/schedule:
Day 16: Quoting on Steroids
20:58
lizmat seems I got too much material for one advent post
21:02 anaeem1_ left, anaeem1_ joined 21:04 denis_boyun_ left 21:07 vendethiel- joined 21:08 vendethiel left 21:09 denis_boyun__ joined 21:11 raiph left 21:13 denis_boyun___ joined
jnthn lizmat: Well, nicer problem than too little ;) 21:13
21:14 denis_boyun__ left
ab5tract when a C library is asking for a `uint32_t *unicode_char`, what can be a strategy for giving it what it wants? 21:18
lizmat draft for tomorrow's advent blog: perl6advent.wordpress.com/?p=2414&a...ew_id=2414
timotimo Str is encoded('ucs32')?
ab5tract .encode('UTF-8') causes a type error
timotimo: thanks I will give that a try
moritz ab5tract: sounds like you want utf-32 21:19
ab5tract moritz: fair point ;)
timotimo lizmat: You will have to make sure that you use the right quoting symbols for the type of variable that you’re interpolating.
sounds like you're refering to [] vs {}, but that doesn't strike me as the right term: "quoting symbols"
lizmat so what should I use there ? 21:20
timotimo hmm
ab5tract the API of termbox uses tb_utf8_* as a prefix for it's handrolled conversion functions <-> char github.com/nsf/termbox/blob/master.../termbox.h 21:21
21:21 atroxaper left
masak 'night, #perl6 21:21
21:21 denis_boyun__ joined
timotimo gnite masak 21:22
21:23 denis_boyun___ left 21:27 treehug88 left
lizmat m: say Int{} === Int # how's that for a Zen slice :-) 21:29
camelia rakudo-moar 3fa1bd: OUTPUT«True␤»
lizmat m: say 42{} === 42 # should we even allow these ? 21:30
camelia rakudo-moar 3fa1bd: OUTPUT«True␤»
21:31 Rounin joined
timotimo a single item pretends to be a list, or apparently also a hash? 21:32
lizmat I think it goes deeper: the parser sees a zen slice of any type, and assumes we need to return the same thing
m: say 42<> === 42 # should we even allow these ?
camelia rakudo-moar 3fa1bd: OUTPUT«True␤»
lizmat m: say 42[] === 42 # should we even allow these ? 21:33
camelia rakudo-moar 3fa1bd: OUTPUT«False␤»
lizmat huh?
m: say 42[].WHAT.say
camelia rakudo-moar 3fa1bd: OUTPUT«(List)␤True␤»
lizmat m: say 42[].say
camelia rakudo-moar 3fa1bd: OUTPUT«42␤True␤»
jnthn m: say 42<>.WHaT 21:34
camelia rakudo-moar 3fa1bd: OUTPUT«No such method 'WHaT' for invocant of type 'Int'␤ in block <unit> at /tmp/O3X003MO8e:1␤␤»
jnthn m: say 42<>.WHAT
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤»
jnthn Hmm
m: say 42{}.WHAT
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤»
lizmat m: say 42[].WHAT
camelia rakudo-moar 3fa1bd: OUTPUT«(List)␤»
jnthn Yeah, I'm a bit surprised at the <> and {} there
21:34 mr-foobar left
jnthn m: say 42.hash.perl 21:34
camelia rakudo-moar 3fa1bd: OUTPUT«Odd number of elements found where hash initializer expected␤ in method STORE at src/gen/m-CORE.setting:10248␤ in method hash at src/gen/m-CORE.setting:1642␤ in block <unit> at /tmp/ASYHWHOvZ8:1␤␤»
moritz seems there's a thing in Any that simply returns self for empty slices 21:35
no matter what that self is
jnthn Ah, it's nothing to do with the parser
# %h{}
multi sub postcircumfix:<{ }>( \SELF ) is rw { SELF;
}
Yes, what moritz++ said
lizmat: I just call [], {}, and <> "indexers" 21:36
Note that 21:37
# @a[]
multi sub postcircumfix:<[ ]>( \SELF ) is rw { SELF.list;
}
Does a coercion
Thus the discrepancy
lizmat huh? but that would imply that @a[] is not a true Zen slice? 21:38
[Coke] [A
moritz m: my $a = (1, 2, 3); .say for $a[];
camelia rakudo-moar 3fa1bd: OUTPUT«1␤2␤3␤»
lizmat ah, but for any, yes
21:39 kurahaupo1 left
lizmat m: my $a = (1,2,3); .WHAT.say for $a[] 21:39
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤(Int)␤(Int)␤»
lizmat m: my $a = (1,2,3); .WHAT.say for $a{}
camelia rakudo-moar 3fa1bd: OUTPUT«(Parcel)␤»
lizmat hmmm....
m: my @a = 1,2,3; .WHAT.say for @a[] 21:40
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤(Int)␤(Int)␤»
lizmat m: my @a = 1,2,3; .WHAT.say for @a{}
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤(Int)␤(Int)␤»
jnthn I don't know what the right answers are, but I know the inconsistency ain't good ;)
lizmat m: my @a = 1,2,3; given @a[] { .WHAT.say } 21:41
camelia rakudo-moar 3fa1bd: OUTPUT«(Array)␤»
lizmat m: my @a = 1,2,3; given @a{} { .WHAT.say }
camelia rakudo-moar 3fa1bd: OUTPUT«(Array)␤»
lizmat I guess it is "for" messing up things there
jnthn lizmat: Where was something messed up? 21:42
m: my $a = (1,2,3); .WHAT.say for $a[] # the slice does .list, which flattens, so for should iterate 3 things 21:43
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤(Int)␤(Int)␤»
lizmat m: my $a = (1,2,3); .WHAT.say for $a[] # sort of expected (Array) here
camelia rakudo-moar 3fa1bd: OUTPUT«(Int)␤(Int)␤(Int)␤»
jnthn OK, but for is doing the right thing
It's that the zen slice is doing .list on the thing it gets
Thus flattening it
lizmat huh? The Zen slice is supposed to return the object, unaldulterated
jnthn lizmat: Well, currently it doesn't; see array_slice.pm 21:44
lizmat ah?
hmmm....
jnthn git blame says you added that line, but you may have moved it from somewhere else... 21:45
f51a00ba fwiw
lizmat it probably came from somewhere else, as I didn't really understood the difference between Zen and Whatever slices then
jnthn Aha
lizmat seems like an error to me.... fixing 21:46
jnthn Trying to verify with the spec 21:47
But S02 doesn't mention zen slices and S09 says little...
lizmat the spec is pretty vague about Zen slices, apart from S99 (which I did today) 21:48
TimToady [] is a .list sometimes
lizmat so, [] is not a Zen slice sometimes ? 21:49
TimToady it must at least remove scalarness
but I think we rely on it for .list sometimes 21:50
$/[] returns the listy bits of the match
jnthn What does $/{} do?
Uh, *should*...
Return the hash bit?
TimToady supposes
jnthn That means that 42<> is gonna become an "odd number of elements" error 21:51
(Which is fine, given I dunno why you'd ever do it)
lizmat indeed... :-)
TimToady we already talked about warning on <>
21:51 ab5tract left
jnthn ah, yes 21:52
So, seems it's the {} zen that wants fixing.
21:52 Sqirrel joined
jnthn And [] is correct 21:52
TimToady: Any reactions to my method ^foo() { } question earlier, or is it a case of "don't care, just don't make that mean something utterly insane"? :) 21:54
I somewhat suspect that bit of spec pre-dates SMOP, which iirc was when $obj.^foo started meaning $obj.HOW.foo($obj) instead of just $obj.HOW.foo. 21:55
TimToady it's a case of haven't actually got to the backlog yet...
jnthn Oh, sorry. :)
TimToady S03:5231 and following talks a bit about [] 21:56
synopsebot Link: perlcabal.org/syn/S03.html#line_5231
lizmat the only spectest failure after making @a[] return SELF: for (<a b c> Z <X Y Z>).tree[]
jnthn lizmat: Yes, but I think it actually wants to self.list due to $/[]. That probably means we're missing tests. ))
TimToady [] was correct before, afaict 21:58
jnthn Yeah. It's {} that ain't
TimToady m: my $a = [1,2,3]; $a[] = 4,5,6; say $a 21:59
camelia rakudo-moar 3fa1bd: OUTPUT«4 5 6␤»
TimToady m: my $a = [1,2,3]; $a[] = 4,5,6,7; say $a
camelia rakudo-moar 3fa1bd: OUTPUT«4 5 6 7␤»
TimToady m: my $a = [1,2,3]; $a.list = 4,5,6,7; say $a 22:00
camelia rakudo-moar 3fa1bd: OUTPUT«4 5 6 7␤»
TimToady didn't actually expect that to work
TimToady is ok with it, though
jnthn Why? .list just returns identitty (mminus a Scalar) on Array and List, afaik... 22:01
TimToady is normally unutterably stupid, in case you hadn't noticed yet 22:02
TimToady just keeps his mouth shut most of the time, so people think he's smart...
22:02 kurahaupo1 joined
vendethiel- is still convinced he's pretty smart... 22:03
lizmat m: class A {}; say (A.new[]).WHAT; say (A.new[]).WHAT # this should both be List ? 22:07
camelia rakudo-moar 3fa1bd: OUTPUT«(List)␤(List)␤»
lizmat m: class A {}; say (A.new[]).WHAT; say (A.new{}).WHAT # this should both be List ? 22:08
camelia rakudo-moar 3fa1bd: OUTPUT«(List)␤(A)␤»
22:09 denis_boyun___ joined 22:10 denis_boyun__ left 22:11 denis_boyun__ joined
lizmat making {} return SELF.list, does not break any spectest 22:12
so maybe that's the right thing to do at this moment?
22:13 denis_boyun___ left 22:14 raiph joined
dalek_p6c kudo/nom: 8e76f01 | lizmat++ | src/core/hash_slice.pm:
Make foo[] and foo{} consistent
22:15
22:15 denis_boyun___ joined, rurban1 joined 22:16 rurban1 left, rurban1 joined 22:17 denis_boyun__ left, ab5tract joined 22:19 telex left, denis_boyun__ joined 22:20 telex joined, denis_boyun___ left
lizmat advent post scheduled for 0:01 UTC 22:21
vendethiel- lizmat++ # amazing
22:21 atroxaper joined
lizmat yes, rakudo is :-) 22:21
jnthn lizmat: oh, I expected SELF.hash 22:24
dalek_p6c kudo/newio: 8e76f01 | lizmat++ | src/core/hash_slice.pm:
Make foo[] and foo{} consistent
kudo/newio: f004534 | lizmat++ | src/core/hash_slice.pm:
Merge branch 'nom' into newio
kudo/newio: a2a81a1 | lizmat++ | src/core/IO (2 files):
Make IOU also consumer of IO::Locally
lizmat jnthn: hmmm.... that also makes sense :-) 22:25
jnthn lizmat: Well, it means that $/{} will do the right thing, for example :)
lizmat builds and runs spectest
jnthn (return the hash part of th Match)
*the
lizmat yup
will it? we'll see :-)
22:26 denis_boyun__ left
jnthn I very much hope so :) 22:26
lizmat $ 6 'class A {}; say (A.new{}).WHAT'
Odd number of elements found where hash initializer expected
I guess that was only true when we had the old, fuzzy way of accepting .hash values
22:27 SHODAN joined, SHODAN left, SHODAN joined
lizmat jnthn: ^^^ after making it SELF.hash 22:28
22:28 atroxaper left 22:29 kaare_ left
jnthn lizmat: I don't think I have a problem with that result. 22:30
lizmat you mean, if that's a problem for class A, it would need top provide her own .hash method ? 22:32
jnthn Yes
lizmat $ 6 'class A { method hash { self } }; say (A.new{}).WHAT' 22:33
(A)
22:34 pecastro left
TimToady jnthn: I'm okay with you stealing ^foo, and we don't need forwarders 22:38
jnthn TimToady: \o/
I'll have a look at it tomorrow :)
22:46 denis_boyun joined 22:49 raiph left
lizmat jnthn: when returning SELF.hash for {}, I get breakage in t/spec/S32-str/numeric 22:49
not sure what's going on there, but it looks like something in the bowels
lizmat is calling it a day now
will be offline for the weekend
22:51 denis_boyun___ joined 22:53 denis_boyun left 22:59 denis_boyun_ joined
jnthn lizmat: OK, mebbe I'll take a look over the weekend 22:59
lizmat: Have a good weekend! 23:00
23:01 denis_boyun___ left 23:02 denis_boyun__ joined
arnsholt date 23:04
Er, that wasn't the window I was looking for =D
raydiak Fri Dec 12 23:04:31 UTC 2014 :)
arnsholt Thanks =D
23:04 denis_boyun_ left
ab5tract decides maybe it is more interesting to write a "termgui" library in PP than to NativeCall a C one 23:06
23:07 denis_boyun__ left
ab5tract the only thing i'm unsure about is whether 'say $back-buffer;' is a good enough blit path 23:07
23:07 treehug88 joined 23:08 konsolebox joined
ab5tract this is where the matrix golf has taken me already, TimToady :P 23:08
23:10 ptc_p6 left 23:12 rurban left, Isp-sec left 23:15 Sqirrel left
raydiak timotimo: ghosts from the clog: "catui" :) 23:19
23:40 treehug88 left 23:43 vti left