»ö« 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 < 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 < has become &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:1Error 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:1Error 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 runtimeOH 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 saysOH 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/5iWGahghKEIllegally 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/FROGGS/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«43TrueFalse» | ||
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«012(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«TrueFalse» | ||
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«42012(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: ƸoxCCx8ExCCxA4xC6xB7 | 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 5Too 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 |