»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend! Set by sorear on 4 February 2011. |
|||
00:08
ggoebel left
00:13
ggoebel joined
00:22
thou left
|
|||
[Coke] | phenny: tell ravendii about github.com/petdance/vim-perl | 00:28 | |
phenny | [Coke]: I'll pass that on when ravendii is around. | ||
00:28
thou joined
|
|||
benabik | [Coke]: I'm pretty sure that's what I'm using, and I see the oddities with $s as well. | 00:29 | |
00:30
lestrrat left
00:32
lestrrat joined
00:38
benabik left
00:40
PacoAir left
00:52
Chillance left
00:58
molaf left,
thou left
00:59
xeneg joined
01:01
xeneg left
|
|||
[Coke] | b: say 19373 - 19349 # 01/24/2012 - niecza at 99.87% | 01:01 | |
p6eval | b 1b7dd1: OUTPUT«24» | ||
[Coke] | ARGH. | ||
01:04
tokuhirom left
01:05
tokuhirom joined
01:09
tokuhirom left
01:11
replore_ joined
01:13
molaf joined
|
|||
colomon | I'm semi-on-the-job tonight, [Coke] | 01:23 | |
rjbs- | TimToady: /me just sent you an email! | 01:26 | |
01:26
rjbs- is now known as rjbs,
rjbs left,
rjbs joined
|
|||
colomon | rakudo: say "a" ![!eq] "a" | 01:32 | |
p6eval | rakudo b7cce8: OUTPUT«Bool::True» | ||
dalek | ast: 9fb6dac | (Solomon Foster)++ | S03-metaops/not.t: Three tests based on irclog.perlgeek.de/perl6/2012-01-24#i_5045770. |
01:36 | |
[Coke] | colomon: sweet. | 01:39 | |
sorear | good * #perl6 | 01:40 | |
colomon | o/ | 01:41 | |
niecza: multi sub infix:<[**]>() { 1; }; say [**] (); say [**] 1, 2, 3; | 01:42 | ||
p6eval | niecza v13-344-gf9b5518: OUTPUT«Potential difficulties: &infix:<[**]> is declared but not used at /tmp/xFO76LU__r line 1:------> multi sub infix:<[**]>⏏() { 1; }; say [**] (); say [**] 1, 2, 301» | ||
colomon | niecza: multi sub infix:<[*]>() { 1; }; say [*] (); say [*] 1, 2, 3; | ||
p6eval | niecza v13-344-gf9b5518: OUTPUT«Potential difficulties: &infix:<[*]> is declared but not used at /tmp/0GYtNKI_1K line 1:------> multi sub infix:<[*]>⏏() { 1; }; say [*] (); say [*] 1, 2, 3;06» | ||
colomon | niecza: say [*] 1, 2, 3; multi sub infix:<[*]>() { 1; }; say [*] (); say [*] 1, 2, 3; | 01:43 | |
p6eval | niecza v13-344-gf9b5518: OUTPUT«Potential difficulties: &infix:<[*]> is declared but not used at /tmp/8DwdhJ2P4O line 1:------> say [*] 1, 2, 3; multi sub infix:<[*]>⏏() { 1; }; say [*] (); say [*] 1, 2, 3;606» | ||
colomon | niecza: say [*] 1, 2, 3; multi sub prefix:<[*]>() { 1; }; say [*] (); say [*] 1, 2, 3; | ||
p6eval | niecza v13-344-gf9b5518: OUTPUT«6Unhandled exception: No candidates for dispatch to &prefix:<[*]>; candidates are:  at /tmp/C4IspXeXvK line 1 (mainline @ 4)  at /home/p6eval/niecza/lib/CORE.setting line 3424 (ANON @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 3425 (modul… | ||
colomon | niecza: say [*] 1, 2, 3; multi sub prefix:<[*]>() { 1; }; my @a; say [*] @a; say [*] 1, 2, 3; | 01:44 | |
p6eval | niecza v13-344-gf9b5518: OUTPUT«6Unhandled exception: No candidates for dispatch to &prefix:<[*]>; candidates are:  at /tmp/BvsWKc585C line 1 (mainline @ 4)  at /home/p6eval/niecza/lib/CORE.setting line 3424 (ANON @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 3425 (modul… | ||
sorear | it's not going to work | ||
[Coke]: Whyfore ARGH? | 01:46 | ||
rjbs | shift @ARGH | 01:52 | |
01:59
REPLeffect left
|
|||
colomon | I'm looking at S16-filehandles/chmod.t | 02:04 | |
It creates a temp file, then uses chmod to change permissions to 0o000, skips most of the tests because $*EUID is not defined / not true, and then tries to delete the temp file | 02:07 | ||
but if the file permission was correctly set to 0o000, you can't delete it! | |||
sorear | Why not? | 02:08 | |
/ What do you mean? | 02:09 | ||
colomon | no write permission on the file | ||
that's what 0o000 means | |||
sorear | you don't need write permission on a file to delete it | ||
colomon | are you sure? | ||
sorear | on UNIX anyway | ||
colomon | you do on OS X | ||
sorear | you need write permission on the *enclosing directory* | ||
colomon | rm frip | 02:10 | |
rm: remove write-protected regular empty file `frip'? | |||
sorear | rm -f frip | ||
rm stats the file first and prompts you if it's write-protected, unless -f is given | 02:11 | ||
colomon | I'm not saying the file is forever unremovable -- but I can promise you that niecza dies with System.UnauthorizedAccessException: Access to the path "temp_1327456824.112535" is denied. | 02:14 | |
on OS X at least, when you try to remove it. | |||
colomon realizes he hasn't tried niecza on Linux in months... | |||
sorear | I bet Mono is trying to emulate the Windows semantics here | 02:15 | |
colomon | seems quite possible | 02:16 | |
02:16
Yary joined
|
|||
Yary | Hi all, think I have a small Rakudo issue that's not in RT | 02:17 | |
From S06, using "sub MAIN ($directory);" with the semicolon at the end | |||
sorear | nobody implements that form yet | 02:18 | |
02:18
whiteknight joined
|
|||
colomon | sorear: oh, right, the reason I haven't messed around with niecza on linux is that I had issues getting a decent mono up and running on it. | 02:18 | |
abercrombie | Hi perl6, a quick question: how do I apply ? to 'something' * 2..** to force minimum match? | ||
Yary | OK | ||
sorear | You have your stars backward | 02:19 | |
'something ** 2..* | |||
'something' ** 2..* | |||
abercrombie | yes, my typo, sorry. | ||
sorear | I think it's: 'something' **? 2..* | ||
abercrombie | ok, I will try it | ||
sorear | although this is the reason ** is deprecated | ||
wait, nvm | 02:20 | ||
abercrombie | that's right, thanks. | 02:21 | |
02:22
wolfman2000 joined
02:35
thou joined
03:03
whiteknight left
03:24
orafu left,
orafu joined
03:25
lutok left
03:36
wolfman2000 left
03:41
Patterner left
03:43
Psyche^ joined,
Psyche^ is now known as Patterner
|
|||
colomon | TimToady: ping? | 03:45 | |
TimToady | yes? | 03:48 | |
dalek | ecza: 93f71df | sorear++ | src/ (2 files): Initial pass at importing STD changes Sigilless \ and | things aren't actually supported yet, and there are still ripple effects of the <initializer> change that need to occur. |
||
colomon | TimToady: I'm looking at getting your Set.pm working in niecza, and running it through the existing tests in set.t. | 03:49 | |
TimToady: and I'm getting zillions of failures, and I need to work out whether they are code failures, niecza failures, or bad tests. | |||
so I could use a consult. | 03:50 | ||
sorear | TimToady: How bad is it if $a.WHICH eq $b.WHICH occasionally gives false positives? | ||
TimToady: I can make $a.WHICH === $b.WHICH work reliably, but stringification creates problems | |||
by "occasionally" I mean "about 2**-29 chance" | 03:51 | ||
TimToady | well, hopefully we'll have real object keys someday, so it's probably not too bad for a temporary solution till then | ||
the main concern of using the stringification is security; if too many different keys can be forced to hash to the same bucket, you can get a DoS attack | 03:53 | ||
03:54
kcwu left
|
|||
TimToady | to start with, I'm happy if only the sets of strings work reliably | 03:55 | |
colomon | TimToady: for instance, given my $s = set <a b foo>; does "is $s<santa>, False" make sense? | ||
TimToady | I'm mostly interested in getting the API baked in soonish | ||
yes, it does | 03:56 | ||
to the extent that a set is treated as a hash, it behaves as a hash returning boolean | |||
colomon | the spec says "Hash of True" | ||
TimToady | of course a set can only return True | ||
so, I guess it doesn't necessarily make sense | 03:57 | ||
well, it'll make sense someday when we have defaults | |||
colomon | why? | ||
(defaults why?) | |||
TimToady | because Sets will default to False | ||
and Bags will default to 0 | |||
currently we can only get a default of Any, because it's hardwired | 03:58 | ||
colomon | but you can't add to a Set anyway, so what difference does it make what the default is? | ||
TimToady | API | ||
and the guarantee of returning a defined value | 03:59 | ||
colomon | So, should I change postcircumfix:<{ }> with an // False, or should I remove the test? | ||
TimToady | we can do // False for now | ||
colomon | k | 04:00 | |
TimToady | it's not like a real Set type isn't going to hardwire that one way or another | ||
there's not even any guarantee that it must be implemented with a hash | |||
colomon | Next failure is dies_ok { $s<a> = True } | 04:01 | |
TimToady | it merely fits into the API of Associative with a defined default value | ||
colomon | apparently method postcircumfix:<{ }> ($k) { %!elems{$k} // False } is all you need to modify values in %!elems. | 04:02 | |
TimToady | and y'know, I don't think we even really need to define a default for every hash or array; it might be sufficient for the default value to be attached to the type | 04:03 | |
colomon | In this case I'm sure the code is wrong, but don't know whether it's a Set.pm issue or a niecza issue. | ||
TimToady | at worst, if you really want different hashes with different values, you have to do a mixin for each | ||
is the proto defined "is rw"? | 04:04 | ||
colomon | no | 04:05 | |
TimToady | normally %!elems{$k} should decontainerize when it returns so you can't assign to it | ||
colomon | oh, that's interesting | 04:06 | |
TimToady | in the original nom code I stole from masak++, there's a method !STORE that dies | ||
but I think that's only for the set as a shole | |||
colomon | I changed it to method postcircumfix:<{ }> (*@k) { %!elems{|@k} // False } | 04:07 | |
TimToady | *whole | ||
colomon | in an effort to handle $set<a b> as a test, and now assignment does fail | ||
but multiple-element access still fails. | |||
TimToady | well, it's probably supposed to be a \keys really anyway | 04:08 | |
try \@k there maybe | |||
colomon | that doesn't work in my copy of niecza (though I haven't upgraded to sorear++'s latest yet) | ||
TimToady | \k parses but isn't implemented yet | ||
colomon | nope, I get a Unable to resolve method Capture in class Str when I try to use it | 04:09 | |
I guess I should be brave and upgrade, I'm not going to manage to finish this before bed anyway. :) | |||
04:10
raiph left
|
|||
TimToady | probably wants something more like map -> $k { %!elems{$k} // False }, @k | 04:10 | |
or maybe just map -> $k { so %!elems{$k} }, @k | 04:12 | ||
ultimately, subscripts want to have something more like ** semantics, but we don't lol much yet | 04:13 | ||
colomon | TimToady++ # map was a noticeable improvement | 04:14 | |
TimToady | I think just putting each lookup in boolean context should work | 04:15 | |
colomon | now the only remaining failures I get are the ones that assume type is preserved in the set | ||
which is expected as long as hash keys are always strings, right? | 04:16 | ||
TimToady | which we might possibly work around by storing the real value as part of the value, as long as we can guarantee it always returns true | ||
(in boolen context) | 04:17 | ||
04:17
DarthGandalf left
|
|||
TimToady | but I'd rather have real === hashes | 04:17 | |
hmm | 04:18 | ||
perl6: say so True => False | |||
p6eval | rakudo b7cce8, niecza v13-345-g93f71df: OUTPUT«Bool::True» | ||
..pugs b927740: OUTPUT«*** No such subroutine: "&so" at /tmp/bOd4oC7lPZ line 1, column 5 - line 2, column 1» | |||
TimToady | so if instead of storing True in the value we store True => $object, we could get $object back at need | 04:19 | |
it's a hack, of course | |||
sorear | TimToady: What I'm trying to ask is, "is WHICH stringification required to be reliable"? | 04:21 | |
TimToady: of course === shouldn't use Str | |||
04:23
replore_ left
|
|||
TimToady | is your question really whether WHICH should form the basis of a reliable hash function? | 04:24 | |
dalek | ast: a2e9f04 | (Solomon Foster)++ | S02-types/set.t: Fudge for niecza. |
||
TimToady | it can be argued that turning an object's WHICH into a string merely to hash it is wasted energy | ||
so maybe we need a HASH that can override the default that hashes WHICH.Str | 04:25 | ||
so a compound object could merely, say hash together the hashes returned by each of its compotnents | |||
*pone | 04:26 | ||
I think that WHICH itself must be unique when compared with === or eqv, but the stringification could be (a little) lossy | 04:27 | ||
a few bits leakage here or there is not a problem for DoS attacks, but if there are a large set of values that can map to the same hash function, you can be attacked | 04:29 | ||
sorear | TimToady: I repeat, I am not planning to hash the stringificaiton in any official code | 04:30 | |
TimToady | for example, if the WHICH of a 64-bit floater only represented 32-bits worth, you can load 4 billion entries or so into the same hash slot | ||
sorear | this is only for the sake of users silly enough to write $a.WHICH eq $b.WHICH | ||
TimToady | I'm fine with probabalistic for that | ||
sorear | ok | ||
TimToady | after all, the whole of git runs on assuming no collisions in the hash space, though it's a pretty big hash space, as these things go... | 04:32 | |
04:33
xinming left
04:39
birdwindupbird joined
|
|||
dalek | ecza: 314664d | (Solomon Foster)++ | lib/CORE.setting: Import version of TimToady++'s Set class. Alas, the operators are all commented out for the moment. |
04:42 | |
ecza: c347cd0 | (Solomon Foster)++ | t/spectest.data: Turn on S02-types/set.t. |
|||
colomon | TimToady: thanks for your help | 04:46 | |
sorear: you might want to take a look at t/spec/S03-metaops/hyper.t, it's failing after your last patch. (Or maybe because of set, but I cannot imagine how.) | 04:47 | ||
'night, all. | |||
TimToady | o/ | 04:48 | |
04:59
thou left
05:01
DarthGandalf joined
05:10
thou joined
05:21
Radvendii joined
|
|||
Radvendii | nom: say <a b>.grep('a' !~~ /$_/) | 05:22 | |
p6eval | nom b7cce8: OUTPUT«» | ||
Radvendii | ?? | ||
nom: <a b>.grep(say $_) | 05:23 | ||
p6eval | nom b7cce8: OUTPUT«Any()» | ||
Radvendii | nom: <a b>.grep(say *) | ||
p6eval | nom b7cce8: OUTPUT«*» | ||
Radvendii | nom: <a b>.grep(7say) | 05:24 | |
p6eval | nom b7cce8: OUTPUT«===SORRY!===Confused at line 1, near "<a b>.grep"» | ||
Radvendii | nom: <a b>.grep(&say) | ||
p6eval | nom b7cce8: ( no output ) | ||
Radvendii | nom: <a b>.grep: {say $_} | ||
p6eval | nom b7cce8: ( no output ) | ||
sorear | Radvendii: you need to delay the evaluation somehow | ||
.grep('a' !~~ /$_/) evaluates the expression before calling grep | |||
Radvendii | which evaluation? | ||
why would it do that? | 05:25 | ||
doesn't it need to know what $_ is? | |||
TimToady | it needs to know *when* $_ is | ||
sorear | because Perl 6 uses something called "applicative order evaluation", whereby the arguments to functions are evalled before the function is called | ||
as opposed to Haskell, which is pretty much the only "mainstream" language that uses the alternative, "normal order evaluation" | 05:26 | ||
TimToady | I'm a bit surprised that your {say $_} didn't work | ||
Radvendii | then how does .map: {} work? | ||
sorear | {anything} evaluates to itself | ||
Radvendii | ah | ||
TimToady | nom: eager <a b>.grep: {say $_} | 05:27 | |
p6eval | nom b7cce8: OUTPUT«ab» | ||
TimToady | that's your problem | ||
Radvendii | it's lazy evaluating? | ||
hwo does that even make sense? | |||
TimToady | it's not doing eager evalation by default | ||
nom: eager <a b>.grep: *.say | |||
p6eval | nom b7cce8: OUTPUT«ab» | ||
TimToady | nom: sink <a b>.grep: *.say | 05:28 | |
cxreg | SPUG says hi | ||
p6eval | nom b7cce8: OUTPUT«ab» | ||
Radvendii | sink? | ||
sorear | hello, SPUG | ||
Who is SPUG? | |||
TimToady waves at SPUG | |||
Radvendii | and why would it make a difference if it is lazy evaluating | ||
cxreg | seattle.pm, particle is here | ||
TimToady | if it never has any demand for the list of values, it never calls say | ||
05:29
xinming joined
|
|||
sorear | particle's cool | 05:29 | |
TimToady | you guys still on Mercer Island? | ||
Radvendii | nom: say <a b>.grep: *.say | ||
p6eval | nom b7cce8: OUTPUT«aba b» | ||
Radvendii | ah | ||
cxreg | TimToady: no, downtown | ||
TimToady | lemme guess, Amazon... | 05:30 | |
cxreg | nope, marchex | ||
but today we're at a bar | |||
TimToady | well that's...traditional... :) | ||
cxreg | :-) | ||
sorear wonders if there's any chance cxreg knows the Perl programmer friend of eirs who moved to Seattle years ago | 05:31 | ||
cxreg | good chance of it, who? | ||
TimToady has a number of ancient acquaintances in seattle... | 05:32 | ||
Radvendii | nom: say <a b>.grep: {'a' ~~ *} | ||
TimToady | plus 2 daughters and a grandson :) | ||
p6eval | nom b7cce8: OUTPUT«a b» | ||
Radvendii | as far as i know, 'a' ~~ 'b' evaluates to False | 05:33 | |
nom: say ?('a' ~~ 'b') | |||
p6eval | nom b7cce8: OUTPUT«Bool::False» | ||
Radvendii | yup | ||
so why is it evaluating to true in the grep? | |||
TimToady | because * is special to ~~ | ||
it means match anything | |||
cxreg | TimToady: well, you can be our next speaker then :D | ||
05:33
koban joined
|
|||
Radvendii | oh. GAH. Splat means too much!! | 05:33 | |
TimToady | I've sworn off travel for this past while | ||
Radvendii | nom: say <a b>.grep: {'a' ~~ $_} | 05:34 | |
p6eval | nom b7cce8: OUTPUT«a b» | ||
sorear | cxreg: TimToady does not presently live in Seattle | ||
cxreg | TimToady: well, come up soon :) | ||
Radvendii | ha. why that? | ||
05:34
koban left
|
|||
cxreg | yeah i know | 05:34 | |
TimToady | did too much last year, and crashed physically, so I'm taking it easy this year | ||
cxreg | cool, good plan | ||
TimToady | Radvendii: because the left side of ~~ *sets* $_ as a topicalizer | 05:35 | |
nom: say <a b>.grep: -> $x { 'a' ~~ $x } | |||
p6eval | nom b7cce8: OUTPUT«a» | ||
TimToady | that's what you're looking for | ||
05:35
thou left
|
|||
Radvendii | grumble grumble grumble | 05:35 | |
:P | |||
thanks | |||
06:09
kaleem joined
06:30
odoacre joined
06:31
fsergot2 left
|
|||
sorear | niecza: <a b> <<~>> <c d> | 06:35 | |
p6eval | niecza v13-347-gc347cd0: OUTPUT«Use of uninitialized value in string context at /home/p6eval/niecza/boot/lib/CORE.setting line 806 (warn @ 2)  at /home/p6eval/niecza/boot/lib/CORE.setting line 170 (Mu.Str @ 9)  at <unknown> line 0 (ExitRunloop @ 0)  at /home/p6eval/niecza/src/ST… | 06:36 | |
sorear | std: <a b> <<~>> <c d> | ||
p6eval | std b808250: OUTPUT«ok 00:01 109m» | ||
06:51
wtw joined
|
|||
dalek | ecza: 6b3961c | sorear++ | src/STD.pm6: Fix Texas hypers with list-assoc operators (how does this fix work? why did it not fail before?) |
06:53 | |
06:54
kcwu joined
07:10
Khisanth left
|
|||
sorear | niecza: constant @foo = gather { take 1; take $_+1 for @foo }; say @foo[^12] | 07:11 | |
p6eval | niecza v13-348-g6b3961c: OUTPUT«Rebuild in progress» | ||
sorear | niecza: constant @foo = gather { take 1; take $_+1 for @foo }; say @foo[^12] | 07:14 | |
p6eval | niecza v13-348-g6b3961c: OUTPUT«===SORRY!===Variable @foo is not predeclared at /tmp/d8gOyTNv4P line 1:------> t @foo = gather { take 1; take $_+1 for ⏏@foo }; say @foo[^12]Unhandled exception: Check failed at /home/p6eval/niecza/boot/lib/COR… | ||
sorear | niecza: my ($x) = $x; | 07:15 | |
p6eval | niecza v13-348-g6b3961c: ( no output ) | ||
07:24
Khisanth joined
|
|||
sorear | std: my \term:<∞> = Inf; say ∞ | 07:28 | |
p6eval | std b808250: OUTPUT«===SORRY!===Term definition requires an initializer at /tmp/psLRf4C6xT line 1:------> my \term⏏:<∞> = Inf; say ∞Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument a… | ||
sorear | phenny: tell TimToady my \term:<∞> = Inf; still doesn't work because <identifier> won't parse past the colon. What's the best fix here? | 07:29 | |
phenny | sorear: I'll pass that on when TimToady is around. | ||
dalek | ecza: 552a38b | sorear++ | src/ (2 files): Fix self-referential constants; add my \foo = ... syntax |
07:30 | |
07:32
Radvendii left
07:38
lutok joined
|
|||
sorear | nom: say ((5 but True) === (5 but False)) | 07:44 | |
p6eval | nom b7cce8: OUTPUT«Bool::True» | ||
sorear | ^^^ interesting infelecity | ||
nom: my $a = do { role Moo { method x() { True } }; 5 but Moo }; my $b = do { role Moo { method x() { False } }; 5 but Moo }; say $a.x; say $b.x; say $a.WHICH; say $b.WHICH; say $a === $b | 07:45 | ||
p6eval | nom b7cce8: OUTPUT«None of the parametric role variants for 'Moo' matched the arguments supplied.Ambiguous dispatch to multi '_block1400'. Ambiguous candidates had signatures::(Mu ):(Mu ) in specialize at src/gen/Metamodel.pm:1818 in <anon> at src/gen/Metamodel.pm:2075 in <ano… | ||
sorear | nom: my $a = do { my role Moo { method x() { True } }; 5 but Moo }; my $b = do { my role Moo { method x() { False } }; 5 but Moo }; say $a.x; say $b.x; say $a.WHICH; say $b.WHICH; say $a === $b | ||
p6eval | nom b7cce8: OUTPUT«Bool::TrueBool::FalseInt+{Moo}|5Int+{Moo}|5Bool::True» | ||
sorear | ^^^ longer version which will thwart jnthn's attempt at an easy fix for the short version | 07:46 | |
I think what's really up here is that the WHICH return needs to include .HOW.WHICH, and that needs to incude a WHERE descriminant | 07:47 | ||
std: :(\foo) | 07:50 | ||
p6eval | std b808250: OUTPUT«Can't call method "Str" on unblessed reference at STD.pm line 40751.FAILED 00:01 109m» | ||
sorear | std: sub (\foo) {} | ||
p6eval | std b808250: OUTPUT«Can't call method "Str" on unblessed reference at STD.pm line 40751.FAILED 00:01 109m» | ||
sorear | std: sub (:\foo) {} | 07:51 | |
p6eval | std b808250: OUTPUT«ok 00:01 109m» | ||
sorear | std: sub (:cow(\foo)) {} | ||
p6eval | std b808250: OUTPUT«===SORRY!===Malformed parameter at /tmp/0VT0S9Egof line 1:------> sub (:cow(⏏\foo)) {} expecting any of: name named_param parameter routine_def signatureParse failedFAILED 00:01 109m» | ||
sorear | phenny: tell TimToady sub (:\foo) is accepted but sub (:foo(\bar)) is rejected. Shouldn't param_var accept \bar ? | 07:52 | |
phenny | sorear: I'll pass that on when TimToady is around. | ||
sorear | phenny: tell TimToady STD croaks on sub (\foo) {} with an unblessed reference error | ||
phenny | sorear: I'll pass that on when TimToady is around. | ||
08:10
sudokode left
08:11
sudokode joined
|
|||
moritz | nom: push @*INC, $@*INC | 08:15 | |
p6eval | nom b7cce8: OUTPUT«===SORRY!===Unsupported use of $@ variable as eval error; in Perl 6 please use $! at line 1, near "*INC"» | ||
sorear | phenny: tell TimToady There are a few places in Niecza that use method foo(\$: ...) { } to force 'self' to be bound as a parcel. What should be written now? | 08:16 | |
phenny | sorear: I'll pass that on when TimToady is around. | ||
dalek | ecza: 69a1984 | sorear++ | / (2 files): Implement \foo and |foo parameter forms, use them in setting where possible |
08:17 | |
moritz | o/ | 08:18 | |
sorear | /o | ||
08:23
mikemol left
|
|||
sorear | hmm, perhaps WHICH should only include class info for immutable types | 08:24 | |
08:24
mikemol joined
|
|||
sorear | with a mutable type, you can use 'does' on it | 08:25 | |
moritz | sorear: fwiw I don't believe that WHICH can or should be a macro | ||
sorear | and my thought is that WHICH for an object should never change )except in the case where you mix in a role that overrides WHICH) | ||
moritz | so you think that (3 but SomeRole) === 3 should be true? | 08:26 | |
sorear | no | ||
moritz | so all roles override WHICH? | 08:27 | |
sorear | but isn't a mutator | ||
what I'm saying is that my $a = MyClass.new; say $a.WHICH; $a does MyRole; say $a.WHICH; # shouldn't change | 08:28 | ||
Int.WHICH can get away with including the type because Int subclasses can't change type | |||
3 does MyRole # forbidden! | |||
moritz | "subclasses can't change type"? | 08:29 | |
sorear | on the other hand, Int.WHICH *has* to include the type, because of the example you just gave | ||
moritz | subclassing is a type change, no? | ||
sorear | no | ||
subclassing creates a new type | |||
subclassing does not magically cause existing objects to change type | |||
moritz | right | 08:30 | |
sorear | [instances of (subclasses of Int)] cannot (change type) | ||
moritz | nom: class A { }; role B { }; my $x = A.new; say $x.WHICH; $x does B; say $x.WHICH | ||
p6eval | nom b7cce8: OUTPUT«A|-8491906571934514453A+{B}|-8491906571934514453» | ||
sorear | niecza: my $obj = 5; $obj does role { } | 08:31 | |
p6eval | niecza v13-349-g552a38b: OUTPUT«Unhandled exception: Cannot use 'does' operator with an immutable object at /home/p6eval/niecza/lib/CORE.setting line 1303 (die @ 3)  at /home/p6eval/niecza/lib/CORE.setting line 1242 (infix:<does> @ 6)  at /tmp/xE_E2vA9xi line 1 (mainline @ 2)  a… | ||
08:43
_twitch joined
08:45
robinsmidsrod left
|
|||
sorear -> sleep | 08:45 | ||
08:48
rsimoes1 left
08:49
rsimoes1 joined
08:51
robinsmidsrod joined
09:12
grondilu joined
|
|||
masak | morning, #perl6 | 09:12 | |
moritz | \o masak | ||
masak | 6-peeps, only four days remain until the final p6cc deadline! | 09:13 | |
09:21
grondilu left
|
|||
dalek | kudo/nom: 1cce955 | moritz++ | src/ (2 files): typed exception for "Cannot use bind operator with this LHS" |
09:32 | |
kudo/nom: 5cf8452 | moritz++ | src/ (2 files): typed error for binding to native types |
|||
kudo/nom: 27a5dd3 | moritz++ | src/Perl6/Actions.pm: more binding exception fixes |
|||
09:32
daxim joined
09:33
Alias left
|
|||
dalek | ast: a824698 | moritz++ | S32-exceptions/misc.t: typed binding excpetions |
09:33 | |
09:33
Alias joined
09:35
preflex left
09:37
preflex joined,
Bucciarati left,
pomysl left
09:38
pomysl joined
|
|||
jnthn | mornin' | 09:39 | |
moritz | \o | 09:40 | |
masak | jnthn! \o/ | 09:41 | |
moritz | in arguments to rules, what slang is used? | ||
ie / <.panic: HERE> / | |||
09:42
Bucciarati joined
|
|||
moritz | that's nqp regexes, fwiw | 09:43 | |
masak | well, S05 has an example <.gather { take foo($¢,1,2,3) }> | 09:45 | |
which leads me to think that it's mainline p6 slang. | |||
if that makes any sense. | |||
jnthn | moritz: Re-enters <LANG('MAIN', ...> or so iirc | 09:46 | |
moritz | ok | ||
masak | right. | ||
moritz | I was thinking about the best way to throw typed exceptions from the grammar | ||
jnthn | token arglist { | ||
<arglist=.LANG('MAIN','arglist')> | |||
} | |||
masak | though S05 doesn't even mention the <.foo: |@arglist> syntax; only the <.foo(|@arglist)> syntax. | 09:47 | |
jnthn | masak: Sure I saw that syntax on a recent pass through S05... | ||
masak | then I missed it. | ||
jnthn | moritz: $*W is available in the grammar. | ||
moritz | replacing <.panic: 'Malformed Regex'> with { $*W.throw($/, ['X', 'Syntax', 'Regex']) } is possible | 09:48 | |
but a bit ugly | |||
I could make another panicy wrapper that looks like | |||
<.typed_panic: 'X::Syntax::Regex'> | |||
jnthn | moritz: That's be preferable | ||
moritz | when then simply redispatches the latter | ||
s/when/which/ | 09:49 | ||
would that simply be a method in Perl6::Grammar? | 09:50 | ||
nom: /=/ | |||
p6eval | nom b7cce8: OUTPUT«===SORRY!===Unrecognized regex metacharacter (must be quoted to match literally) at line 1, near "/"» | ||
jnthn | moritz: Writing a method for it would work, yes | ||
moritz | jnthn: and in that method, how do I get a $/ ? | 09:51 | |
jnthn | moritz: Why do you need $/? | ||
moritz: Or better asked: what info do you really need? | |||
moritz: If you do $/.CURSOR.pos() or so, then you can just do self.pos() in your method | 09:52 | ||
tadzik | 'morning | ||
moritz | jnthn: well, I want to pass it to Perl6::World.throw, which calls $/.from, $/.orig and $/.CUROSR.panic | ||
(the latter as a fallback while compiling the setting) | 09:53 | ||
jnthn | moritz: Ah. If you were passing the cursor rather than the match object to Perl6::World.throw it woulda been easier here :) | 09:54 | |
moritz: Well, you can always get a $/ by writing it as a token instead of a method, then putting a codeblock inside. | |||
moritz: oh | |||
moritz | jnthn: well, then I have to write $/.CURSOR in Actions.pm everywhere | ||
how does the token get the match object? | 09:55 | ||
something as simple as self.MATCH? | |||
jnthn | oh, yeah | ||
You can do that :) | |||
moritz | or self.CURSOR.MATCH? | ||
jnthn | If you write a method foo() { } in a grammar, self is a Cursor | ||
moritz | ok | 09:56 | |
jnthn | So just self.MATCH() | ||
09:57
dakkar joined
10:18
_twitch left
10:29
Yary left
10:36
_twitch joined
10:37
xinming left
10:41
GlitchMr joined
10:45
_twitch left
10:51
xinming joined
|
|||
bbkr | rakudo: say so \() ~~ :(); # bug or NYI? IMO it should return true | 11:07 | |
p6eval | rakudo 27a5dd: OUTPUT«Bool::False» | ||
11:07
Chillance joined
|
|||
jnthn | NYI | 11:10 | |
moritz | nom: for (1; 1; 1) { } | 11:17 | |
p6eval | nom 27a5dd: OUTPUT«===SORRY!===Unsupported use of C-style "for (;;)" loop; in Perl 6 please use "loop (;;)" at line 1, near "(1; 1; 1) "» | ||
11:45
Alias_ joined
11:46
Alias left
11:49
bbkr2 left
11:55
xinming left
12:06
Grrrr joined
12:13
bkolera joined
12:22
mtk joined,
mtk left,
mtk joined
12:31
MayDaniel joined
|
|||
daxim | perlmonks.org/index.pl?node_id=949890 | 12:31 | |
12:32
MayDaniel left
12:35
mj41 left
12:37
bluescreen10 joined
12:40
kaleem left
12:44
benabik joined
|
|||
masak | on the Perl course I gave these last two days, I finished off with a Perl 6 section. | 12:49 | |
12:49
skids joined
|
|||
masak | reaction seems to have been a mix of "ok, so I'm definitely gonna learn Perl 6 now" and "hm, this is nothing that I think I need for what I do" | 12:49 | |
which is fine. | |||
12:50
mj41 joined
|
|||
masak | got the question "so when will it be, you know, here?" to which I answered "both major compilers make releases each month. each one more stable and featureful than the last." | 12:50 | |
to which the reaction was something like "oh!" | |||
then I added "the the speed, memory leanness, and stability we deliver may not be within your required range yet. there's no conduit to CPAN beyond Blizkost." | 12:51 | ||
to which the reaction was something like "oh :/" | |||
12:54
am0c joined
|
|||
skids looking forward to trying out Zavolaj when he gets the time, psyched to see work in this area. jnthn++ | 12:56 | ||
Was wondering if endian-reversed representations were on the TODO list. | 12:58 | ||
moritz | why would you want such a thing? | 12:59 | |
for NCI? | 13:00 | ||
skids | moritz: network packet buffer processing | 13:02 | |
moritz | skids: sounds more like a job for pack/unpack than for reprs | ||
skids | I beg to differ. | 13:03 | |
moritz | how so? | ||
skids | No reason an IP header should not be a viable object. | ||
moritz | well, for IP headers you'd need a custom, bit-packed repr anyway, no? | 13:04 | |
masak | right. let's keep separate "values of the attributes" of an IP header object, and "serialization format" of same. | 13:05 | |
that's what reprs are for :) | |||
moritz | well, not exactly | ||
that's what serialization formats are for | 13:06 | ||
masak | hm, yes. | ||
it's three different things. | |||
moritz | of course you *can* create a custom REPR that happens to have the same storage format as the serialization | ||
masak | nod | ||
13:07
_twitch joined
|
|||
skids | I kinda cringe when I hear "serialization format" because it sort of implies bounce-buffer semantics, when I could very well want to work on a live register set mmio region. | 13:07 | |
flussence wants a struct() or something, that takes a single pack() format and returns an object with .pack(*@values) and .unpack(Buf) methods | |||
skids wants same, but regex-based :-) | 13:08 | ||
Anyway I'm sure it's all doable, just need to find the tiime to learn enough guts to do it. | 13:10 | ||
benabik | Is it possible to send information from the class definition to the REPR? I.E. class IPPacket is REPR(EndianREPR) { ...; has int16 $.length is endianness(NetworkByteOrder); ... } | ||
jnthn | Well, the point of doing NCI with REPR stuff is that it stores the data as it needs to be in native land. | ||
masak | a repr would be perfect for something like libxml, where the objects coming in from C already have a given format. so we want to pass those objects around in Perl 6 without converting them, but they should behave like real Perl 6 obejcts. | ||
...jnthn said it much shorter than I did :) | 13:11 | ||
jnthn | masak: No, you don't need a custom REPR for that. You just declare a class XmlThingy is repr('Struct') { } | ||
And then in that class declare the attributes as the elements of the structure | |||
A REPR tends to correspond to a world view on arranging stuff in memory. C structures *in general* therefore are a candidate for being a representation. | 13:12 | ||
masak | jnthn: oh! | 13:16 | |
even better. | |||
benabik | jnthn: Do REPRs receive any information on the annotations attached to attributes? Could you say `has int32 $!val is NetworkByteOrder` and get it to DTRT? | ||
masak | still, reprs are involved somehow... :) | ||
13:16
GlitchMr left
|
|||
[Coke] | sorear: argh because only down by 25 tests yesterday. so close. | 13:16 | |
masak | benabik: an excellent question. | ||
jnthn | masak: Yeah, people just have a tendancy to think "oh, I need a custom REPR for X" way too often :) | 13:17 | |
skids | benabik: more or less precisely what I was wondering. | ||
jnthn | benabik, skids: When you declare a new type, the REPR's type_object_for is called. It receives the meta-object for the type in question. | 13:18 | |
That can (though you'd best wait until declaration is done with) be used to get at the meta-attributes, which in turn mean you can get at the attribute type, plus if any traits were mixed in you can get at the values from those too. | |||
So basically, yes, though there's no explicit passing mechanism, it's just that all such information about a type is reachable through its meta-object somehow. :) | 13:19 | ||
That's how CStruct and P6opaque compute memory layouts. | |||
13:20
_twitch left
|
|||
[Coke] | (4 days left until p6cc deadline). Guess I'm losing! ;) | 13:22 | |
masak | depends how you spend those 4 days... :) | 13:24 | |
benabik | jnthn: (poking through src/6model) It looks like P6opaque is lazy about calculating its size, and only does so when it really needs it (via compute_allocation_strategy), right? | ||
jnthn | benabik: Correct, though there is a little more to it than that (more) | ||
type_object_for is called too early for you to do the compuation. | 13:25 | ||
colomon | perl6: my $a := 1, 2; say $a | ||
p6eval | pugs b927740, niecza v13-350-g69a1984: OUTPUT«1» | ||
..rakudo 27a5dd: OUTPUT«1 2» | |||
13:26
fdgbch456 joined
|
|||
masak | colomon: "The binding operator parses as a list assignment, so it is reasonable to | 13:27 | |
generate a list on the right without parens" | |||
moritz | rakudo++ | ||
masak | S03:2299 | ||
fdgbch456 | hi | ||
masak | fdgbch456: hello! | ||
colomon | masak: niecza's handling of that changed sometime in the last two days. | 13:28 | |
benabik | jnthn: The REPR is initialized (more or less) at the beginning of the class, right? (NQPClassHOW.new_type). Is there a reason it couldn't be delayed until compose()? It seems like it would be very difficult to determine how much memory you need before then. | ||
fdgbch456 | i'm following the instructions on rakudo.org/how-to-get-rakudo/ and it says i need to install "the ICU library." So i'm downloading "icu4c-4_8_1_1-src.tgz", is it correct ? | 13:29 | |
moritz | fdgbch456: what operating system are you using? | ||
fdgbch456: and how do your pronounce your nick name? | 13:30 | ||
jnthn | benabik: We need the type object right away | ||
fdgbch456 | i figured i don't need icu4J (?) | ||
i'm using Ubuntu 11.10 | |||
moritz | fdgbch456: there should be a libicu-dev package that you can install with your package manager | ||
jnthn | nom: class A { method m() { say 'oh lol' }; BEGIN { A.m } } | ||
p6eval | nom 27a5dd: OUTPUT«oh lol» | ||
moritz | fdgbch456: which is much easier for you | ||
fdgbch456 | lol...oh, its just a random ncik | ||
ok, will try ap-get then... | 13:31 | ||
jnthn | benabik: See ^ | ||
moritz | fdgbch456: at leat it's called libicu-dev on debian, and usually the package names are the same | ||
benabik | jnthn: I don't (immediately) see how that works. Is it composing it mid-class? | 13:32 | |
13:33
xinming joined
|
|||
jnthn | benabik: It's not composed yet | 13:34 | |
(at the time the method is called) | |||
13:36
timotimo joined
|
|||
timotimo | hello, i'm trying to build rakudo-nom, but at the Configure.pl --gen-parrot step i get a failure with no obvious error message | 13:37 | |
masak | timotimo: could you nopaste it to gist.github.com? | 13:38 | |
benabik | jnthn: Oh. An NQPClassHOW class couldn't do that because it uses @!mro which is calculated at compose time... But Perl6::ClassHOW is smarter. | ||
timotimo | yes, i will | ||
benabik | jnthn: Sorry if I'm bothering you, I just find this stuff fascinating. | 13:39 | |
jnthn | benabik: Yeah, NQPClassHOW is decidedly simpler. That's deliberate. I wanted classes for implementing Perl 6's classes, but they didn't need to do everything Perl 6 classes do :) | ||
timotimo | sprunge.us/VBJH <- there you go | 13:41 | |
benabik | jnthn: It seems like if you try to create an object before declaring all of it's attributes the REPR would get confused. Also, many (most?) REPRs will need to be lazy about allocation information because they'll want the attribute information. Shouldn't they be notified on compose so they have a chance to do it without all the `if(!alloc) calc_alloc()` ? | ||
moritz | timotimo: that's weird | 13:42 | |
timotimo: what platform is this? | |||
timotimo | i agree :) | ||
debian sid on a 64 bit intel | |||
jnthn | benabik: I have considered giving the REPR API a compose hook. | 13:43 | |
benabik: Just means every meta-object needs to remember to call it, but maybe that's not such a burden. | 13:44 | ||
moritz | timotimo: do you have any env variables set that could affect the compilation? | ||
(something like concurrency options or so) | |||
jnthn | moritz: Do you even see the actual error in that output? I'm missing it if it's there... | ||
benabik | jnthn: Depends on if you want every meta-object to remember to call repr_compose or every repr to remember to calculate the allocation any place they may need it. :-D | ||
timotimo | apparently i have MAKEFLAGS= j2 j2 j2 j2, interesting | ||
moritz | timotimo: please try clearing it | 13:45 | |
jnthn: make[1]: *** read jobs pipe: Is a directory. Stop. | |||
jnthn: a quick google tells me that that happens when one launches a sub-make in a parallalized build with 'make' instead of $(MAKE) | |||
jnthn | moritz: hm. Note: | ||
cd 3rdparty/dyncall && BUILD_DIR=. make | |||
moritz | jnthn: it seems that GNU make wants some kind of control over its child processes | ||
jnthn | cd 3rdparty/dyncall && BUILD_DIR=. make | ||
moritz: It does it twice or some such... | 13:46 | ||
moritz | weird | ||
that's why I asked about concurrency options | |||
timotimo | the environment was at fault, indeed | ||
thank you. i hopefully also identified and removed the culprit | |||
moritz | timotimo: curiously, a simple 'make -j3' works for me in nqp | 13:47 | |
timotimo | another question: i have never written any perl5 and am new to perl6. is there a tutorial written for people like me? | 13:48 | |
moritz | timotimo: the "Using Perl 6" book is meant for people who know other programming languages, but not necessarily perl 5 | 13:49 | |
timotimo | i've drooled over a couple of examples from perl6advent, but i'd like a more thorough approach | ||
moritz | github.com/perl6/book/downloads | 13:50 | |
timotimo | sounds good. my prior experience consists mostly of c++ and python | ||
moritz | if you find anything unclear in the book (it's under development), feel free to ask | 13:51 | |
most of the authors hang out here | |||
timotimo | sure, thanks! | ||
benabik | jnthn: Oh. A.new doesn't work in BEGIN inside a class (method 'new' not found), so the allocation strategy can't get goofed. Is that deliberate? | ||
moritz | well, the .new comes in through inheritance, which is resolved at compose time, iirc | 13:52 | |
and compose time is when the class' final } is parsed | |||
benabik | moritz: Makes sense. | 13:53 | |
jnthn | moritz: Yeah, that does offer some protection here. :) | ||
moritz | one can still nqp::create :-) | ||
jnthn | I'm tempted to do the compose hook anyway at some point | 13:54 | |
Well, time to dig back into $dayjob stuffs... | 13:55 | ||
benabik | I'm still somewhat worried about more general usage of 6model... Having a repr compose would let it at least know if what's going on is a bad idea... | ||
Although I guess the HOW should yell about creating an uncomposed class. | |||
jnthn | benabik: Yeah, the more I ponder it, the more I think it's worth adding. | 13:57 | |
benabik digs into how objects are created. | |||
Yeah, looks like creation bypasses the HOW. So the REPR really has no way to check if the class is composed or not. | 14:02 | ||
ANYway... | |||
moritz | on what level? :-) | ||
jnthn | nqp::create is a REPR op, not a HOW-related one, yes. | 14:03 | |
benabik should probably spend this time on $work or $thesis, not random 6model digging. | |||
jnthn: BTW, 6model is an excellent piece of work. And thanks for helping me understand it. | 14:06 | ||
jnthn++ | |||
masak | timotimo: if you go to strangelyconsistent.org/blog/list-of-posts and search on that page for "June 1 2011", you'll get to the start of a 30-day intro course to Perl 6. that might be something for you. | 14:09 | |
benabik | It seems like we have more and more people showing up going "how do I get this working" and "how do I use this". I like this trend. | 14:12 | |
14:13
dhs227 joined,
dhs227 left
|
|||
PerlJam | guten Morgen meine Freunde | 14:14 | |
moritz | \o PerlJam | 14:15 | |
fdgbch456 | so i have reached the step "To run a Perl 6 program with Rakudo, include the install directory in your system PATH variable", but there are two "perl6" executables, one in ~/rakudo/ and one in ~/rakudo/install/bin/ | 14:27 | |
which one do i include? | |||
flussence | the install/ one | ||
moritz | it even says "include the *install* directory" :-) | 14:28 | |
fdgbch456 | the page rakudo.org/how-to-get-rakudo/ says, "This will build and install a “perl6″ or “perl6.exe” executable, by default in the parrot_install/bin/ subdirectory of the rakudo build directory." | ||
moritz | oh, that's outdated | ||
fdgbch456 | & there is no "parrot_install" directory | ||
PerlJam | fdgbch456: you could nuke everything else, as long as you keep that install directory around, you can run rakudo | ||
fdgbch456 | moritz: oh | 14:29 | |
moritz | it's now just named 'install/', not 'parrot_install/' | ||
fdgbch456: rakudo.org/how-to-get-rakudo-nom/ is probably more interesting for you | |||
once we have release a nom-based star, which should remove the old instruction page | 14:30 | ||
PerlJam watches some really dark clouds move in and hopes that "tornado watch" doesn't turn into a "tornado warning" | 14:41 | ||
jnthn | That'd suck. | 14:42 | |
TimToady wonders if OZ has any internetses... | 14:43 | ||
phenny | TimToady: 07:29Z <sorear> tell TimToady my \term:<∞> = Inf; still doesn't work because <identifier> won't parse past the colon. What's the best fix here? | ||
TimToady: 07:52Z <sorear> tell TimToady sub (:\foo) is accepted but sub (:foo(\bar)) is rejected. Shouldn't param_var accept \bar ? | |||
TimToady: 07:52Z <sorear> tell TimToady STD croaks on sub (\foo) {} with an unblessed reference error | |||
TimToady: 08:16Z <sorear> tell TimToady There are a few places in Niecza that use method foo(\$: ...) { } to force 'self' to be bound as a parcel. What should be written now? | |||
TimToady | oh, and jnthn++ for the terrible pun | 14:44 | |
masak | we let jnthn work on Rakudo just so he can provide us with bad puns all the time. ;) | 14:46 | |
TimToady | gah, I really hate it when ^O takes me to a different file in vim. Is there a way to reverse and/or block that? | 14:47 | |
masak | sounds like Unity's new behavior of Alt-Tabbing to a different workspace :( | 14:49 | |
jasonmay | ^I is the reverse | ||
benabik | TimToady: Jumplists are per window, so I think you'd have to open a new window for each file. <Tab> should also bring you forward again quickly. | ||
14:50
PacoAir joined
14:52
fdgbch456 left
|
|||
TimToady | thanks | 14:53 | |
14:55
birdwindupbird left
|
|||
dalek | d: 655cc68 | larry++ | STD.pm6: := and ::= must parse RHS as list assignment prec The operator forms do that, but the initializer forms falsely generalized from = parsing. |
15:00 | |
TimToady | phenny: ask sorear Would (\self:) work? | 15:04 | |
phenny | TimToady: I'll pass that on when sorear is around. | ||
moritz | eeks. | 15:06 | |
jnthn | hmm...in Rakudo I'd have to take care to suppress auto-generation/binding of self. | 15:07 | |
Oh | |||
It'd cause a further problem. | |||
I rely on self being decontainerized. | |||
For attribute lookup | |||
So a naive patch to make the above work would break attribute lookups in any method that did that. | 15:08 | ||
Which I guess I could work around but ew. | |||
moritz | also wouldn't that bind self to a parcel rather than to an object of the method you're currently in? | ||
jnthn | moritz: "is parcel" doesn't mean that. | ||
moritz: It means "leave the thing exactly at is without re-containerization" | 15:09 | ||
*as | |||
Or context. | |||
(The context-ignoring part being why we don't want the sigils on there.) | |||
Hmm, what if you do method foo(\self) { ... } also. Then you get a self which is the wrong thing. | 15:13 | ||
moritz | then you get a redeclaration error? | ||
because there's one declaration for the implicit self, and another for one you just declared | 15:14 | ||
and if you do method foo($other_self: \self), well, then screw you. | |||
jnthn | moritz: Yes, but iiuc TimToady was suggesting we might end up suppressing declaration for implicit self | 15:15 | |
moritz: Writing method foo($other_self:) { } does not mean you don't get self too | |||
moritz | ah right | 15:16 | |
15:19
kcwu left
15:24
xinming left,
cognominal_ left
15:25
xinming joined,
cognominal joined
15:32
wtw left
15:34
mj41 left,
phenny left,
krunen_ left,
arnsholt left,
timotimo left,
bkolera left,
Alias_ left,
lestrrat left,
charsbar___ left,
felher left,
huf left,
Yappoko___ left,
drbean left,
dukeleto left,
sirhc left,
tokuhirom3 left,
Khisanth left,
kshannon left,
aloha left,
rsimoes left,
Maddingue left,
groky left,
[Coke] left,
jnthn left,
bacek_at_work left,
pomysl left,
ruoso left,
Trashlord left,
yeltzooo left,
araujo left,
Vlavv` left,
mls left,
c1sung left,
LoRe left,
silug left,
Lorn left
15:37
drbean joined
15:38
kaare_ joined,
xinming left
15:39
ranguard joined,
krunen joined,
timotimo joined,
arnsholt joined,
kshannon joined
15:40
[Coke] joined
15:42
xinming joined,
aloha joined,
bacek_at_work joined
15:44
doy joined,
Maddingue joined
|
|||
masak | <Radvendii> ǧis al čiuj! | 15:47 | |
Radvendii: your funny hats are upside down. | 15:48 | ||
15:48
TimToady joined
|
|||
TimToady | whew, just discovered how to recover from a bad netsplit with /reconnect | 15:49 | |
15:50
phenny joined,
jnthn joined
|
|||
TimToady | a /reconnect is a lot easier than restarting irssi... | 15:50 | |
rjbs | restarting irssi always feels like an admission of failure to me | ||
and I always forget to rejoin at least 1d6 channels | |||
moritz | doesn't irssi reconnect automatically? | 15:51 | |
rjbs | It tries to, but it's imperfect. | ||
jnthn | It did for me, but I ended up on a server with, er, 6 of the channel's inhabitants. | ||
A /reconnect got me back to a better connected one :) | |||
TimToady | hah, my orphan server had 7 inhabitants, nyaa nyaa nyaa | 15:52 | |
15:52
am0c left
|
|||
TimToady blames solar storms | 15:52 | ||
15:53
mj41 joined,
kcwu joined,
bkolera joined,
Alias_ joined,
lestrrat joined,
charsbar___ joined,
felher joined,
huf joined,
Timbus joined
15:54
rsimoes joined,
cxreg joined,
pmurias joined,
Yappoko___ joined,
dukeleto joined,
sirhc joined,
tokuhirom3 joined
15:55
kaleem joined,
amkrankruleuen joined,
pomysl joined,
ruoso joined,
Trashlord joined,
yeltzooo joined,
araujo joined,
Vlavv` joined,
mls joined,
c1sung joined,
LoRe joined,
silug joined,
Lorn joined,
hillu joined,
awwaiid joined,
mathw joined
|
|||
moritz | TimToady: that does sound a bit like an BOfH excuse :-) | 15:55 | |
timotimo | when i find spelling mistakes etc in the perl6 book, is it ok to fork+edit+pullrequest them? | 15:56 | |
moritz | timotimo: or just commit them directly; what's your gitub ID? | ||
timotimo | of course i could do that, too :p - it's "timo" | 15:57 | |
moritz | timotimo: you have commit access now. Have fun! | ||
timotimo: note that the PDF might be slightly out of sync with the sources, so some typos might already be corrected | |||
timotimo | wow, i hope i won't disappoint you by not working hard enough ;) | ||
yes, i've made sure to look into the code first | 15:58 | ||
pmichaud | good morning, #perl6 | ||
phenny | pmichaud: 24 Jan 19:32Z <sorear> tell pmichaud At some point I'd like an overview of how LoL, $obj.lol, **@foo, etc work and fit together in Rakudo | ||
moritz | good am, pm | ||
colomon | pmichaud: good morning! | ||
moritz | (I've missed that bad joke) | ||
dalek | d: afb775b | larry++ | STD.pm6: allow bare \ and \term:<your-ad-here> forms |
15:59 | |
15:59
groky joined
16:00
Khisanth joined
|
|||
masak | pmichaud! \o/ | 16:00 | |
jnthn | o/ pmichaud | ||
TimToady | you just missed the great netsplits this morning | 16:01 | |
masak | \term:<your-ad-here> -- oh man. | ||
masak imagines term:<this spec commit was brought to you by Pepsi> | |||
jnthn hoped that the solar storm might mean he saw the aurora this far south, but I didn't see much... | 16:03 | ||
TimToady | evalbot rebuild std | ||
p6eval | OK (started asynchronously) | ||
[Coke] glares at masak. | |||
16:04
groky left
|
|||
dalek | Rebuild of std complete. | 16:05 | |
TimToady | std: my \term:<∞> = 42; say ∞; | ||
p6eval | std afb775b: OUTPUT«ok 00:01 113m» | ||
[Coke] | why is dalek announcing the rebuild is complete? | ||
TimToady | so we can know when to torment it again? | 16:06 | |
[Coke] | (as opposed to p6eval) | ||
TimToady | less noise the failed tries | ||
*than | |||
oh | |||
dalek | ok: eb5b12d | timo++ | src/basics.pod: Removed stale references to " vs " in table tennis data |
||
TimToady | std: constant term:<∅> = set(); | 16:07 | |
p6eval | std afb775b: OUTPUT«ok 00:01 109m» | ||
TimToady | \o/ | ||
std: constant \term:<∅> = set(); | |||
p6eval | std afb775b: OUTPUT«ok 00:01 109m» | ||
16:07
Khisanth is now known as Guest20598
|
|||
TimToady | (the \ is optional in constants) | 16:07 | |
masak | timotimo++ | 16:08 | |
TimToady | std: sub (\foo) {} | 16:11 | |
p6eval | std afb775b: OUTPUT«ok 00:01 109m» | ||
skids | jnthn: WRT github.com/perl6/specs/pull/10 now that I read S02:1776 and S02:1917 it appears :: is both en-passant type capture and class predeclarator simultaneously. So I should undo that pull request, or have there been decisions in this area not reflected in S02? Or am I totally misunderstanding something? | 16:14 | |
dalek | ecza: 7bfcbe7 | (Solomon Foster)++ | lib/CORE.setting: Add Bag modeled after Set. |
||
ecza: 6694950 | (Solomon Foster)++ | t/spectest.data: Turn on S02-types/bag.t. |
|||
timotimo | masak: :) | 16:15 | |
colomon notes that both set.t and bag.t could use quite a few more tests.... | |||
masak | skids: no, you're correct. | ||
skids: it's a way to refer to undeclared classes outside of signatures, and en-passant capture inside of them. | 16:16 | ||
jnthn | Yup. Looks like a good clarification. | ||
skids | But the S02 fragments say it predeclares the class as well inside a signature... ? | 16:17 | |
jnthn | :S | 16:18 | |
It never pre-declares anything. It just defers lookup until runtime. | |||
Thus why it can't be used in declarative contexts, which need to know stuff at compile time. | |||
16:19
am0c joined
|
|||
skids | Well, OK, my vocabulary is off... S02 says: "Within a signature or other declaration, the :: pseudo-sigil followed by an identifier marks a type variable that also declares the visibility of a package/type name without the sigil within the scope of the declaration" | 16:20 | |
So that's what's re-confusing me. | |||
16:21
rsimoes left
|
|||
masak | means you do ::Foo in a signature, and then you can talk about Foo in that scope. | 16:22 | |
jnthn | It just means...what masak said. Could be clearer though | 16:23 | |
16:25
rsimoes joined
|
|||
pmichaud | Rakudo 2012.01 is using Parrot 3.11.0 ? (just checking) | 16:25 | |
masak | skids: however, Foo is not a class, or even really a type. it's just a type variable. | 16:26 | |
16:28
colomon left
|
|||
lumi___ | Does that mean that "my (::T $x) = 5" (or so) means that T is Int for the containing scope? | 16:28 | |
jnthn | pmichaud: Yeah. The Rakudo compiler release went out with that, more by accident than anything. But next to nothing happened between 3.11.0 and 4.0.0 so it didn't seem worth doing a point release to correct. | ||
PerlJam | nom: my (::T $x, T $y) = (1,"foo"); # and should this fail? | ||
p6eval | nom 27a5dd: ( no output ) | ||
pmichaud | okay. One minor difference may be that packagers won't package a 3.11 Parrot release | ||
PerlJam | std: my (::T $x, T $y) = (1,"foo"); | ||
p6eval | std afb775b: OUTPUT«ok 00:01 115m» | ||
skids | Ah, comprehension dawns. Maybe I'll try to work on that S02 verbiage as well. | 16:29 | |
jnthn | I suspect it should moan about the signature being too complex to turn that into a parcel of ($x, $y) and do list assignment in that case. | ||
benabik hopes packagers would build rakudo with their packaged parrot, rather than --gen-parrot | |||
pmichaud | benabik: oh, that's a good point. | 16:30 | |
jnthn | pmichaud: Hm, and a release that requires a 3.11 won't build against and installed 4.0? | ||
pmichaud | it should work against a 4.0, yes. | ||
jnthn forgets the exact rules...I know a later commit is OK. | |||
OK. | |||
benabik has had no problem with NQP/Rakudo on 4.0.0-devel | |||
pmichaud | it just seemed odd to me | ||
masak | PerlJam: of course, STD allows that because STD doesn't typecheck. | 16:31 | |
jnthn | pmichaud: We could fix it, it just means issuing point compiler releases of NQP and Rakudo. | ||
PerlJam | yeah, I just wanted to see if there was something std noticed that I didn't | ||
16:31
kaleem_ joined
|
|||
masak | nom: sub foo(::T $a, T $b) { say "OH HAI" }; foo 5, 42 | 16:31 | |
p6eval | nom 27a5dd: OUTPUT«OH HAI» | ||
pmichaud | jnthn: I'm fine with leaving it as-is for this release, if you are. | ||
masak | nom: sub foo(::T $a, T $b) { say "OH HAI" }; foo 5, "wrong" | ||
p6eval | nom 27a5dd: OUTPUT«Nominal type check failed for parameter '$b'; expected Int but got Str instead in sub foo at /tmp/4fWEnqFA3Y:1 in block <anon> at /tmp/4fWEnqFA3Y:1 in <anon> at /tmp/4fWEnqFA3Y:1» | ||
jnthn | pmichaud: Yeah, I'm fine with it. | ||
16:32
am0c left
|
|||
masak | jnthn: will we ever be able to catch the above at compile-time? :) | 16:32 | |
16:32
colomon joined
|
|||
dalek | d: b5dc271 | larry++ | STD.pm6: new rule to handle what can go inside param :x() |
16:32 | |
[Coke] tries to find more Set & Bag tests to unfudge for colomon. | |||
masak | jnthn: with one of those "will never work" errors... | ||
jnthn | masak: Yeah, it'd need patches to compile time bind analysis in bind.c. | 16:33 | |
TimToady | evalbot rebuild std | ||
p6eval | OK (started asynchronously) | ||
jnthn | masak: It's not particularly tricky to catch the above case. | ||
masak: Oh, wait...it does get a bit tricky as compile time binding analysis doesn't currently have something to hand to serve as the type environment. | 16:34 | ||
masak: But even that's not hard to solve. | |||
16:34
kaleem left
|
|||
dalek | Rebuild of std complete. | 16:34 | |
masak | jnthn: cool. | 16:35 | |
I think it's kinda cute that p6eval says "OK" and dalek comes back and says "complete". | |||
dalek | ast: a45df5f | coke++ | S0 (3 files): niecza autounfudge |
||
masak | makes it look like the bots are one big family :) | 16:36 | |
[Coke] | colomon: there's 5 more on top. ;) | ||
tadzik | it could say LOL DONE | ||
[Coke] | er, 8! | 16:37 | |
TimToady | std: sub foo (:x(:y(\z))) { ... } | ||
p6eval | std b5dc271: OUTPUT«ok 00:01 110m» | 16:38 | |
benabik | std: sub foo (:\z) { ... } | ||
p6eval | std b5dc271: OUTPUT«ok 00:01 109m» | ||
TimToady | phenny: tell sorear I think all your concerns are addressed now; bare \ is now allowed for the invocant | ||
phenny | TimToady: I'll pass that on when sorear is around. | ||
TimToady | std: method (\:) {} | 16:39 | |
p6eval | std b5dc271: OUTPUT«ok 00:01 109m» | ||
TimToady | std: sub foo (:x(:y(\term:<※>))) { say ※ } | 16:40 | |
p6eval | std b5dc271: OUTPUT«ok 00:01 114m» | ||
16:43
kaleem_ left
16:48
wamba joined
16:49
wamba left
|
|||
masak decommutes | 17:00 | ||
17:08
MayDaniel joined
|
|||
pmichaud | time for lunch here, and I need to think a bit more about star configure/build | 17:11 | |
17:12
MayDaniel left
|
|||
pmichaud | bbiaw | 17:12 | |
flussence | yay! github.com/flussence/specgraphs/bl.../impls.png | 17:16 | |
flussence & | |||
17:20
mj41 left
|
|||
timotimo | in the perl6 book, I'm about to change "say @a === @a; # 1" to "say @a === @a; # Bool:True", is that OK? | 17:30 | |
uh, Bool::True, of course | |||
moritz | timotimo: yes | 17:31 | |
dalek | ok: 850c094 | timo++ | src/operators.pod: say @a === @a outputs Bool::True rather than 1. |
||
timotimo | oh, there's more | ||
moritz | timotimo++ | 17:32 | |
timotimo | for the example say 3 == '3b'; i get "No applicable candidates found to dispatch to for 'Numeric'." rather than a 1. what to do with that? | 17:33 | |
moritz | hm, that's a failure by new numifying spec | 17:34 | |
(and rakudo doesn't do well in propagating the failure through ==) | |||
timotimo: either add '# fails' or leave a TODO comment | 17:35 | ||
dalek | ok: e8cc91e | timo++ | src/operators.pod: changed more 0 and 1 into True/False. Note, that 3 == '3b' fails. |
17:36 | |
timotimo | why does it say "timo++" in there? | 17:37 | |
17:39
jaldhar left
|
|||
timotimo | oh, also in the text it claims, that perl will use 0 if there's no way to turn the string into a numeric value. is that also false as of the new numifying spec? | 17:40 | |
Util | #ps time, 10m ago | 17:41 | |
timotimo: It is using your GitHub ID. | 17:42 | ||
timotimo | but my github id is timo, not timo++ | ||
Util | The ++ is kept track of by a "karma" bot on this channel. You get a ++ when you do something good. | 17:43 | |
timotimo | ah, all right | ||
Util | Like a few mintes ago, when moritz did it to you. | ||
karma timo | |||
aloha | timo has karma of 0. | ||
Util | karma timotimo | ||
aloha | timotimo has karma of 2. | ||
timotimo | yup, i was aware of the karma thing, it just confused me to see it in the bots output | 17:44 | |
where would i put feedback like "in chapter 3, the sort example drops new syntax onto the reader out of nowhere without a deeper explanation"? | |||
Util | Commits are "something good" :) | ||
timotimo | would an issue in the tracker be the right thing? | ||
Util | Yes. | ||
and that is an excellent issue to raise | 17:45 | ||
sorear | good * #perl6 | 17:46 | |
phenny | sorear: 15:04Z <TimToady> ask sorear Would (\self:) work? | ||
sorear: 16:38Z <TimToady> tell sorear I think all your concerns are addressed now; bare \ is now allowed for the invocant | |||
moritz | it's #phasers time | 17:49 | |
sorear | [Coke]: (dalek reporting end) Convenience, mostly | ||
17:56
dakkar left
18:04
tarski joined
18:06
Radvendii joined
|
|||
Radvendii | hey, guys? Y'know how the zip operator truncates the smaller list? is there a way to make it instead repeat the smaller list? | 18:07 | |
TimToady | (list) xx * | 18:08 | |
or use the dwimmy hyper | 18:09 | ||
@a »op» @b # repeats @b | |||
18:10
daxim left
|
|||
TimToady | perl6: say ('a'..'z') »~» (1,2,3) | 18:10 | |
p6eval | rakudo 27a5dd, niecza v13-352-g6694950: OUTPUT«a1 b2 c3 d1 e2 f3 g1 h2 i3 j1 k2 l3 m1 n2 o3 p1 q2 r3 s1 t2 u3 v1 w2 x3 y1 z2» | ||
..pugs b927740: OUTPUT«decodeUTF8': bad data: '\187'decodeUTF8': bad data: '\187'***  Unexpected "\187~\187" expecting operator, ":" or "," at /tmp/_Cx0CnH2Ml line 1, column 16» | |||
TimToady | perl6: say 'a'..'z' X~ (1,2,3) xx * | 18:11 | |
p6eval | rakudo 27a5dd, niecza v13-352-g6694950: OUTPUT«(timeout)» | ||
..pugs b927740: OUTPUT«abcdefghijklmnopqrstuvwxyz» | |||
TimToady | perl6: say 'a'..'z' Z~ (1,2,3) xx * | ||
p6eval | rakudo 27a5dd, niecza v13-352-g6694950: OUTPUT«a1 b2 c3 d1 e2 f3 g1 h2 i3 j1 k2 l3 m1 n2 o3 p1 q2 r3 s1 t2 u3 v1 w2 x3 y1 z2» | ||
..pugs b927740: OUTPUT«abcdefghijklmnopqrstuvwxyz» | |||
TimToady | perl6: say 'a'...* Z~ (1,2,3) xx * | 18:12 | |
p6eval | rakudo 27a5dd: OUTPUT«Decrement out of range in method Str at src/gen/CORE.setting:7212 in method Stringy at src/gen/CORE.setting:678 in sub infix:<eq> at src/gen/CORE.setting:977 in method ACCEPTS at src/gen/CORE.setting:3230 in sub coro at src/gen/CORE.setting:4618 in meth… | 18:13 | |
..niecza v13-352-g6694950: OUTPUT«===SORRY!==="..." and "Z~" are non-associative and require parens at /tmp/3lZ7_j1rh_ line 1:------> say 'a'...* Z~ ⏏(1,2,3) xx *Unhandled exception: Check failed at /home/p6eval/niecza/boot/lib/CORE.setting lin… | |||
..pugs b927740: OUTPUT«*** No such subroutine: "&Z" at /tmp/HbJ57Pupn4 line 1, column 5 - line 2, column 1» | |||
TimToady | perl6: say ('a'...*) Z~ (1,2,3) xx * | ||
p6eval | niecza v13-352-g6694950: OUTPUT«(timeout)» | ||
..rakudo 27a5dd: OUTPUT«Decrement out of range in method Str at src/gen/CORE.setting:7212 in method Stringy at src/gen/CORE.setting:678 in sub infix:<~> at src/gen/CORE.setting:965 in sub <anon> at src/gen/CORE.setting:9024 in sub coro at src/gen/CORE.setting:4618 in method re… | |||
..pugs b927740: OUTPUT«***  Unexpected " Z" at /tmp/BsbWzeI54C line 1, column 14» | |||
TimToady | perl6: .say for ('a'...*) Z~ (1,2,3) xx * | ||
jnthn | ...decrement? :) | ||
p6eval | rakudo 27a5dd: OUTPUT«Decrement out of range in method Str at src/gen/CORE.setting:7212 in method Stringy at src/gen/CORE.setting:678 in sub infix:<~> at src/gen/CORE.setting:965 in sub <anon> at src/gen/CORE.setting:9024 in sub coro at src/gen/CORE.setting:4618 in method re… | 18:14 | |
..niecza v13-352-g6694950: OUTPUT«(timeout)a1b2c3d1e2f3g1h2i3j1k2l3m1n2o3p1q2r3s1t2u3v1w2x3y1z2aa3ab1ac2ad3ae1af2ag3ah1ai2aj3ak1al2am3an1ao2ap3aq1ar2as3at1au2av3aw1ax2ay3az1ba2bb3bc1bd2be3bf1bg2bh3bi1bj2bk3bl1bm2bn3bo1bp2xE2x80 | |||
..pugs b927740: OUTPUT«***  Unexpected " Z" at /tmp/9eNfrh7inL line 1, column 19» | |||
TimToady | rakudo is suffering from increment whether | ||
jnthn | *groan* | 18:15 | |
18:15
fsergot joined
|
|||
Radvendii | isn't »op» act like X? | 18:15 | |
dalek | d: 47c76b3 | larry++ | STD.pm6: change <initializer> to category for extensibility |
18:16 | |
TimToady | no, only if there's exactly one thing on the right | ||
in which case, either construct repeats it | |||
well, multiple things can repeat too, I guess | 18:17 | ||
perl6: say 'a'..'z' X~ 1,2,3 | |||
p6eval | rakudo 27a5dd, niecza v13-352-g6694950: OUTPUT«a1 a2 a3 b1 b2 b3 c1 c2 c3 d1 d2 d3 e1 e2 e3 f1 f2 f3 g1 g2 g3 h1 h2 h3 i1 i2 i3 j1 j2 j3 k1 k2 k3 l1 l2 l3 m1 m2 m3 n1 n2 n3 o1 o2 o3 p1 p2 p3 q1 q2 q3 r1 r2 r3 s1 s2 s3 t1 t2 t3 u1 u2 u3 v1 v2 v3 w1 w2 w3 x1 x2 x3 y1 y2 y3 z1 z2 z3» | ||
..pugs b927740: OUTPUT«abcdefghijklmnopqrstuvwxyz» | |||
TimToady | so yes, you are correct about that | ||
[Coke] | flussence++ | 18:18 | |
TimToady | note, however, that X is lazy, while hyper is eager, so only X or Z can deal with infinite lists | ||
Radvendii | right... | ||
nom: say <a b> Z 1,2,3 | |||
p6eval | nom 27a5dd: OUTPUT«a 1 b 2» | ||
TimToady | and X can only deal with an infinite list on its left | 18:19 | |
Radvendii | nom: say <a b> »~» 1,2,3 | ||
p6eval | nom 27a5dd: OUTPUT«a1 b123» | ||
TimToady | precedence | ||
hypers are also scalar ops, not list ops | |||
hypers expect to run on an object, not a list | |||
Radvendii | nom: say <a b> »~» (1,2,3) | 18:20 | |
p6eval | nom 27a5dd: OUTPUT«a1 b2» | ||
sorear reads the last few STD commits | |||
Radvendii | ah. the issue is i have a list on either side and i dont know which one is going to be infinite. | ||
sorry | |||
which one is going to be bigger | |||
TimToady | if you want the shorter to repeat in any case, use «op» | 18:21 | |
Radvendii | nom: say <a b> «~» (1,2,3) | ||
p6eval | nom 27a5dd: OUTPUT«a1 b2 a3» | ||
Radvendii | i see | ||
benabik ponders what infix:<op> should do... | |||
sorear | I was wondering earlier if anyone had any use whatsoever for the "repeat either" semantics of «op» | ||
Radvendii | haha. i do! | 18:22 | |
oh wait. i dont want them concatenated though | |||
[Coke] wonders if we think perl6 will suffer from the same issues being discussed on p5p today in regards to distributions and "what is perl". /me suspects he will just use perlbrew if it comes to that. (esp. nice to have a perl6brew given we have different perls to start with.) | |||
TimToady | then use a different op | ||
Radvendii | nom: say <a b> «,» (1,2,3) | ||
p6eval | nom 27a5dd: OUTPUT«a 1 b 2 a 3» | ||
Radvendii | there we go | ||
sorear | minor problem being that niecza doesn't use 'add_name' and patch isn't thrilled by the fact that niecza's context lines are lacking { $ċ.add_name... | 18:24 | |
Radvendii | [Coke]: here's my question: why are we splitting our efforts between different (compilers?) of perl (e.g. niecza, rakudo) | 18:25 | |
sorear | because I'm a pathetic wretch who doesn't work well with others | 18:26 | |
TimToady | because efforts are not a zero-sum game | ||
Radvendii | sorear: :P | ||
TimToady | because when two different implementations agree on how something should work, it's a pretty good indication that it's probably how it should be in the spec | 18:27 | |
Radvendii | that seems like a pretty secondary goal but that's just IMO, and i'm pretty new to this. | 18:28 | |
TimToady | the primary goal is to produce a better language, however long it takes | ||
the secondary goal is that we want it now :) | |||
Radvendii | i suppose... | ||
sorear | There isn't actually a *splitting* of effort involved. | 18:29 | |
Radvendii | sorear: no? | ||
sorear | After I determined that I was mental-health-ily incapable of contributing to Rakudo, my choices were starting Niecza or not contributing at all | ||
std: sub (\foo) { } | 18:30 | ||
p6eval | std b5dc271: OUTPUT«ok 00:01 109m» | ||
Radvendii | Okay... | ||
TimToady | Radvendii: I strongly suggest reading S01 for all about this meta-project-stuff | ||
Radvendii | TimToady: okay | ||
18:31
bluescreen10 left
|
|||
Radvendii | nom: sub a {say "in"; return True}; say [||] (a xx 3) | 18:33 | |
p6eval | nom 27a5dd: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&xx' called (line 1)» | ||
Radvendii | nom: say 1 xx 3 | 18:34 | |
p6eval | nom 27a5dd: OUTPUT«1 1 1» | ||
sorear decides to try editing the patch before applying it | |||
jnthn | std: sub a {say "in"; return True}; say [||] (a xx 3) | ||
p6eval | std b5dc271: OUTPUT«===SORRY!===Undeclared routine: 'xx' used at line 1Check failedFAILED 00:01 111m» | ||
sorear | perl6: say rand xx 3 | ||
jnthn | Radvendii: I think you need a() there | ||
p6eval | pugs b927740: OUTPUT«*** No such subroutine: "&xx" at /tmp/QT0oWEDtGH line 1, column 5 - line 2, column 1» | ||
..niecza v13-352-g6694950: OUTPUT«0.11041774186790816 0.80917691244239776 0.39022010303578342» | |||
..rakudo 27a5dd: OUTPUT«0.36751254841602 0.36751254841602 0.36751254841602» | |||
Radvendii | nom: sub a {say "in"; return True}; say [||] (a() xx 3) | ||
p6eval | nom 27a5dd: OUTPUT«inBool::True» | ||
jnthn goes to find something to eat | |||
18:34
bluescreen10 joined
|
|||
Radvendii | nom: sub a {say "in"; return True}; say [||] <a b c>.map: {a()} | 18:35 | |
p6eval | nom 27a5dd: OUTPUT«inininBool::True» | ||
Radvendii | so .map isn't lazy | ||
[Coke] | Radvendii: same question for "why perl6? why not just work on perl5!" | ||
volunteer time isn't completely fungible. | |||
moritz | Radvendii: wrong conclusion | ||
Radvendii | [Coke]: good question. well, actually my question would be why perl5? | ||
moritz: how so? | 18:36 | ||
moritz | nom: sub a {say "in"; return True}; say <a b c>.map(&in).[0] | ||
p6eval | nom 27a5dd: OUTPUT«===SORRY!===Symbol '&in' not predeclared in <anonymous> (/tmp/XG9pl3TIhD:1)» | ||
sorear | patch: **** malformed patch at line 36 | ||
TimToady | Radvendii: that's a polite way of saying you're wrong | ||
moritz | nom: sub a {say "in"; return True}; say <a b c>.map(&a).[0] | ||
p6eval | nom 27a5dd: OUTPUT«Too many positional parameters passed; got 1 but expected 0 in sub a at /tmp/5a_WhVnDb5:1 in method reify at src/gen/CORE.setting:4471 in method reify at src/gen/CORE.setting:4376 in method gimme at src/gen/CORE.setting:4740 in method exists at src/gen/CORE.… | ||
moritz | nom: sub a($) {say "in"; return True}; say <a b c>.map(&a).[0] | ||
p6eval | nom 27a5dd: OUTPUT«inBool::True» | ||
moritz | Radvendii: see? if map were eager, you'd see three 'in' | ||
Radvendii | but when i try to [||] it... | 18:37 | |
nom: sub a {say "in"; return True}; say any( <a b c>.map: {a()} ) | |||
p6eval | nom 27a5dd: OUTPUT«inininany(Bool::True, Bool::True, Bool::True)» | ||
18:37
bluescreen10 left
|
|||
Radvendii | oh right, any does something else | 18:37 | |
nom: sub a {say "in"; return True}; say ?any( <a b c>.map: {a()} ) | |||
p6eval | nom 27a5dd: OUTPUT«inininBool::True» | ||
timotimo | huh, in the perl6 book, out of nowhere it says :type<<double-beef>>. my rakudo-nom shows no difference between :type<double-beef> and the one with <</>> | 18:39 | |
sorear | hmm | 18:41 | |
Radvendii | nom: say <a b c>.map: {$_}.map: {$_} | ||
p6eval | nom 27a5dd: OUTPUT«Method 'count' not found for invocant of class 'List' in method reify at src/gen/CORE.setting:4471 in method reify at src/gen/CORE.setting:4376 in method reify at src/gen/CORE.setting:4376 in method gimme at src/gen/CORE.setting:4740 in method eager at src/g… | ||
sorear | timotimo: Double angles interpolate like double quotes | ||
Radvendii | nom: say (<a b c>.map: {$_}).map: {$_} | ||
p6eval | nom 27a5dd: OUTPUT«a b c» | ||
sorear | patch doesn't seem to like it when I delete individual lines from a unidiff | 18:42 | |
18:42
GlitchMr joined
|
|||
timotimo | sorear: so i could do things like :types<<rakudo-$currentbranch niecza>> and it would, for instance, give me "rakudo-nom", "niecza"? | 18:43 | |
sorear | yes | ||
timotimo | well, "types" => (rak...) | ||
neat | |||
doy | sorear: you also need to update the line counts in the hunk header | ||
sorear wonders how the line counts are defined | 18:44 | ||
doy | it's a pain, and usually less effort to just regenerate the patch after fixing it in the actual source | 18:45 | |
timotimo | another thing that confused me (maybe i should write a ticket for that as well?) is that in the dance moves example, the subs in the moves hash are called like this: %moves{$move}.(); - why is the . needed there? | ||
moritz | timotimo: feel free to ticket it | ||
(it's not needed, just a matter of style preference) | |||
timotimo | well, the example has a "todo: find a different example", so maybe it's not needed after all | 18:47 | |
Radvendii | nom: say ?('wK' !~~ 'b') | ||
p6eval | nom 27a5dd: OUTPUT«Bool::True» | ||
Radvendii | nom: say ?('wK' !~~ 'w') | 18:48 | |
p6eval | nom 27a5dd: OUTPUT«Bool::True» | ||
Radvendii | nom: say ?('wK' !~~ /w/) | ||
p6eval | nom 27a5dd: OUTPUT«Bool::False» | ||
18:49
lichtkind joined
|
|||
lichtkind | cheers o/ | 18:51 | |
moritz | nom: say pir::perl6ize_type(1).WHAT | ||
p6eval | nom 27a5dd: OUTPUT«use of uninitialized value of type Mu in string contextuse of uninitialized value of type Mu in string context===SORRY!===error:imcc:The opcode 'perl6ize_type_p' (perl6ize_type<1>) was not found. Check the type and number of the arguments in file '(file unknown)' … | ||
sorear | o/ lichtkind | ||
moritz | nom: say pir::perl6ize_type__(1).WHAT | 18:52 | |
p6eval | nom 27a5dd: OUTPUT«===SORRY!===rtype not set» | ||
moritz | nom: say pir::perl6ize_type__PP(1).WHAT | ||
p6eval | nom 27a5dd: OUTPUT«Int()» | ||
moritz | nom: say pir::perl6ize_type__PP('1').WHAT | ||
p6eval | nom 27a5dd: OUTPUT«Str()» | ||
dalek | ecza: 32dcbb0 | coke++ | t/spectest.data: run S03-smartmatch/any-type.t |
||
jnthn | moritz: Not convinced that's testing what you want it to :) | 18:53 | |
moritz | nom: say pir::perl6ize_type__PP(nqp::unbox_s '1').WHAT | ||
p6eval | nom 27a5dd: OUTPUT«Str()» | ||
jnthn | That's more like it :) | 18:54 | |
jnthn goes to cook stuff | |||
dalek | ok: 40b1d5d | timo++ | src/subs-n-sigs.pod: in MAIN, limit sides to Numeric, update the usage output to also include --sum |
18:55 | |
lichtkind | jnthn: goof om | ||
i just come from it | |||
i mean nom | |||
Radvendii | nom: $_ = 'wK'; say "yay" if 1== /w/ ?? 1 !! 2 | 19:00 | |
p6eval | nom 27a5dd: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are::(Mu:U \$v, Mu %_!) in method Numeric at src/gen/CORE.setting:649 in sub infix:<==> at src/gen/CORE.setting:2276 in block <anon> at /tmp/3qPRgCHe_G:1 in <anon> at /tmp/3qPR… | ||
Radvendii | nom: $_ = 'wK'; say "yay" if 1== (/w/ ?? 1 !! 2) | ||
p6eval | nom 27a5dd: OUTPUT«yay» | ||
Radvendii | nom: say "yup" if 1==2|1 | 19:01 | |
p6eval | nom 27a5dd: OUTPUT«yup» | ||
Radvendii | is there a Bool !! else ?? if syntax? | 19:02 | |
reversing the if and the else, kind of like an "unless" | 19:03 | ||
moritz | no | ||
Radvendii | okay | ||
moritz | jnthn: gist.github.com/1677947 that's where I'm currently stuck (includes patch and backtrace) | 19:08 | |
OOOH, I know what's wrong | |||
unstuck | |||
don't call an attribute $.new | |||
Radvendii | haha | ||
moritz | it generates an accessor which overrwrites the constructor | ||
Radvendii | good idea | ||
[Coke] | moritz, masak: can you tell me how many people have submitted anything? (I know i haven't submitted anything yet.) | 19:09 | |
Radvendii | is there a way to overwrite variables as they are being passed into a subroutine? | 19:10 | |
like a default value, except that it is applied to the value they pass in | 19:11 | ||
[Coke] | ... you mean, can you ignore the value they pass in? | ||
that seems dubious. | |||
Radvendii | nom: sub a($a=$a+1){say $a}; a(3) | 19:12 | |
p6eval | nom 27a5dd: OUTPUT«3» | ||
Radvendii | except in what i am talking about that would be 4... | ||
nom: sub a($a+1){say $a}; a(3) | |||
p6eval | nom 27a5dd: OUTPUT«===SORRY!===Malformed block at line 1, near "($a+1){say"» | ||
Radvendii | nom: sub a($a+=1){say $a}; a(3) | 19:13 | |
p6eval | nom 27a5dd: OUTPUT«===SORRY!===Malformed block at line 1, near "($a+=1){sa"» | ||
moritz | nom: sub a($a is copy) { $a++; say $a } | ||
p6eval | nom 27a5dd: ( no output ) | ||
moritz | nom: sub a($a is copy) { $a++; say $a }; a(3) | ||
p6eval | nom 27a5dd: OUTPUT«4» | ||
19:13
alester joined
|
|||
moritz | signatures are for matching and binding, not for computations | 19:13 | |
Radvendii | i guess... | ||
[Coke] | there's already a perfectly good place to write code, in the body. ;) | 19:14 | |
Radvendii | haha. i know. it just seems more clear to have all of the variable processing in the signature | ||
moritz | no. | ||
the signature is part of the public API | |||
Radvendii | nom: sub a($tmp, :$a=$tmp+1){say $a}; a(3) | 19:15 | |
moritz | how you treat it internally isn't part of the API | ||
p6eval | nom 27a5dd: OUTPUT«4» | ||
TimToady | sorear: often a context diff will do better than a unidiff, if there is mismatched context in the middle of a unidiff | ||
Radvendii | moritz: understood. | ||
skids | nom: sub a($a, :$b? = $a + 1) { say $b; }; a(3); # but then you have the :b named parameter publicly available even if you do not want it. | ||
p6eval | nom 27a5dd: OUTPUT«4» | ||
benabik | Radvendii: Would you want to write `my $a + 1 = 3` and have $a = 4? | ||
moritz | .oO( let's integrate an algebraic equation solver in p6... ) |
19:16 | |
Radvendii | no... | ||
moritz: agreed | |||
moritz | in the multi dispatcher! jnthn, we look at you! (jk) | ||
Radvendii | what's the perl6 equivalent to Javas toString() method? | 19:21 | |
benabik | .Str | ||
Radvendii | and that's what say will call? | ||
moritz | .gist | ||
benabik | IIUC, "$a" and print $a will call $a.Str. say $a will call $a.gist | 19:22 | |
[Coke] | (that is going to cause so much trouble. :P | ||
Radvendii | why are they different? | ||
shouldn't they do exactly the same thing? | 19:23 | ||
moritz | then we wouldn't need different methods :-) | ||
skids | say is for programmers. Print is for users. | ||
moritz | aye | ||
Radvendii | oh. | ||
but for thingsl like ints, it's going to do the same | 19:24 | ||
moritz | aye | ||
Radvendii | haha. i've been pronouncing gist in my head with a hard g, so i was confused as to it's meaning. now i'm confused as to how it relates to string conversions... | 19:25 | |
TimToady | and I used to pronounce zavolaj with an affricate on the end until I thought about it... | 19:27 | |
Radvendii | . . . | 19:29 | |
pmichaud | back from lunch | ||
huf | what's an affricate? | ||
i mean in this context | |||
TimToady | a stop plus its associated fricative, in this case j as in judge | ||
huf | oh, so zavoladj when it should be zavolay? | 19:30 | |
19:31
birdwindupbird joined
|
|||
timotimo | is foo() and foo always equivalent? | 19:31 | |
TimToady | well, zah voe lie in English | ||
pmichaud | timotimo: no | ||
TimToady | (I suspect) | ||
moritz | nom: sub f(*@a) { say @a.join }; f() + 1; f + 1 | ||
p6eval | nom 27a5dd: OUTPUT«1» | ||
moritz | a case where it's not equivalent | 19:32 | |
huf | TimToady: got it. | ||
moritz | gah, tim<tab> can now result in 3 different nicks :/ | 19:33 | |
huf | TimToady: btw, what was the mnemonic (or the idea behind) calling bless bless in p5? | ||
benabik | moritz: It's parsing that as f ( +1 ) ? | ||
TimToady | it's asking your boss to bless your proposed project | ||
skids | .oO("fricative" sounds like it should mean "an almost dirty word") |
||
huf | well _now_ i'm confused. | 19:34 | |
Radvendii | moritz: why did your gah, ... comment make the bloop sound that usually asociates someone "Radvendii:"ing me | ||
TimToady | huf: it's extending Official Recognition to the fact that a particular thing is in a particular category | 19:35 | |
Radvendii | nom: $a = "hi"; say $a.length; | ||
p6eval | nom 27a5dd: OUTPUT«===SORRY!===Variable $a is not predeclared at line 1, near " = \"hi\"; s"» | ||
Radvendii | nom: my $a = "hi"; say $a.length; | ||
p6eval | nom 27a5dd: OUTPUT«Method 'length' not found for invocant of class 'Str' in block <anon> at /tmp/lBerofVIYp:1 in <anon> at /tmp/lBerofVIYp:1» | ||
skids | nom: my $a = "hi"; say $a.chars; | 19:36 | |
p6eval | nom 27a5dd: OUTPUT«2» | ||
Radvendii | ah | ||
nom: my $a = "hi"; say $a.bytes; | 19:37 | ||
skids | length is now ambiguous what with unicode/charset support. | ||
p6eval | nom 27a5dd: OUTPUT«2» | ||
huf | TimToady: so bless as in sanctify? (as in "admit to the list of saints") | ||
Radvendii | so what's the difference betwixt .chars and .bytes? | ||
skids | if your charset is 8-bit, nothing. | ||
benabik | Radvendii: One returns the number of characters, the other the number of bytes. ;-P | ||
TimToady | huf: yes, there's some of that meaning too | ||
Radvendii | nom: my $a = "āł"; say $a.bytes; | 19:38 | |
p6eval | nom 27a5dd: OUTPUT«4» | ||
TimToady | a constructor looks at the arguments and decides whether they make a sheep or a goat | ||
Radvendii | i see | ||
huf | TimToady: i am not familiar with this meaning of bless | ||
should've spent more time in church, i guess | |||
or reading bookses or somethjing | |||
skids | Actually it's a secret conspiracy to rhyme with "dress", which will be revealed in an exceptionally bad limerick in 2015. | 19:39 | |
huf | that'd be really really great | ||
pmichaud | skids: does that make it a revealing dress? ;-) | ||
Radvendii | groan... | 19:40 | |
TimToady | I doubt we can make skids fess | ||
Radvendii meant that in the way-you're-supposed-to-react-to-puns way | |||
dalek | kudo/nom: 3670b71 | moritz++ | src/ (2 files): <.obs> in the grammar now throws X::Obsolete objects also provides a small piece of infrastructure for easily throwing typed exceptions from the grammar |
||
pmichaud | TimToady: You're probably right, I guess. | 19:41 | |
TimToady | no less! :) | ||
dalek | ast: dc765eb | moritz++ | S32-exceptions/misc.t: tests for typed exceptions |
||
huf | Radvendii: this channel would sound like the zombie apocalypse if everyone groaned everytime someone made a pun :D | ||
Radvendii | huf: haha | ||
pmichaud | phenny: tell jnthn I'm working on the star configure, but will likely need at least one more day to finish it. | 19:42 | |
phenny | pmichaud: I'll pass that on when jnthn is around. | ||
Radvendii | nom: $a = 1,2,3; .say for $a | 19:43 | |
p6eval | nom 27a5dd: OUTPUT«===SORRY!===Variable $a is not predeclared at line 1, near " = 1,2,3; "» | ||
Radvendii | nom: my $a = 1,2,3; .say for $a | ||
p6eval | nom 27a5dd: OUTPUT«1» | ||
Radvendii | nom: my $a = (1,2,3); .say for $a | ||
p6eval | nom 27a5dd: OUTPUT«1 2 3» | ||
Radvendii | nom: my $a = (1,2,3); .say for @$a | ||
p6eval | nom 27a5dd: OUTPUT«123» | ||
Radvendii | nom: my $a=1; my $b=$a.clone; $b=2; say $a; | 19:46 | |
p6eval | nom 27a5dd: OUTPUT«1» | ||
benabik | nom: my $a = 1; my $b = $a; $b = 2; say $a | ||
p6eval | nom 27a5dd: OUTPUT«1» | ||
benabik | nom: my $a = 1; my $b := $a; $b = 2; say $a | ||
p6eval | nom 27a5dd: OUTPUT«2» | ||
benabik | nom: my $a = 1; my $b := $a.clone; $b = 2; say $a | ||
p6eval | nom 27a5dd: OUTPUT«Cannot assign to a non-container in block <anon> at /tmp/ufOuNPBTWL:1 in <anon> at /tmp/ufOuNPBTWL:1» | ||
benabik | awh. | ||
Radvendii | ;P almost | 19:47 | |
nom: my $a=\1; my $b=$a.clone; $b=\2; say $a; | |||
p6eval | nom 27a5dd: OUTPUT«1» | ||
Radvendii | \ is still the way to create references right? | ||
nom: my $a=(1,2,3); my $b=$a.clone; $b[0]='a'; say $a; | |||
p6eval | nom 27a5dd: OUTPUT«Cannot assign to a non-container in block <anon> at /tmp/BdgBWrzT0O:1 in <anon> at /tmp/BdgBWrzT0O:1» | ||
Radvendii | nom: my @a=(1,2,3); my $b=@a.clone; $b[0]='a'; say @a; | 19:48 | |
p6eval | nom 27a5dd: OUTPUT«elements() not implemented in class 'Mu' in method REIFY at src/gen/CORE.setting:4952 in method REIFY at src/gen/CORE.setting:5186 in method reify at src/gen/CORE.setting:4376 in method gimme at src/gen/CORE.setting:4740 in method exists at src/gen/CORE.sett… | ||
benabik | Radvendii: I do not think that's doing what you think it's doing. | 19:49 | |
Radvendii | it appears not. | ||
timotimo | raw.github.com/perl6/book/master/s...bjects.pod ← the line $some-task === any(@!dependencies) in "method depends-on" seems useless. its return value isn't used, is it? i suppose the intent was to make it the implicit return value, so adding an or in between the lines would fix it? | ||
Radvendii | what is .clone doing? | ||
moritz | Radvendii: see S12 | 19:50 | |
Radvendii | clone should create an identical copy right? but it should be it's own variable, so when i modify it the original is untouched? | 19:51 | |
pmichaud | clone is typically for values, not containers | 19:52 | |
so "it should be its own variable" reads kind of wrongish there | |||
nom: my @a = 1,2,3; my $b = @a.clone; say $b.perl; | 19:53 | ||
p6eval | nom 27a5dd: OUTPUT«elements() not implemented in class 'Mu' in method REIFY at src/gen/CORE.setting:4952 in method REIFY at src/gen/CORE.setting:5186 in method reify at src/gen/CORE.setting:4376 in method reify at src/gen/CORE.setting:4376 in method gimme at src/gen/CORE.setti… | ||
benabik | I think that Array.clone has problems. | ||
pmichaud | that looks buggy-ish | ||
I agree; I think Array.clone is broken | |||
jnthn | Array.clone is just doing whatever Mu.clone is doing. That's almost certainly inappropriate. | 19:54 | |
phenny | jnthn: 19:42Z <pmichaud> tell jnthn I'm working on the star configure, but will likely need at least one more day to finish it. | ||
pmichaud | it's probably defaulting to Mu..... what jnthn++ said | ||
jnthn | Array likely needs its own .clone but I dunno what it should look like | ||
(esp. with regard to what it does with the unreified bits) | |||
pmichaud | Whoever is responsible for the Array and List implementation really nee.... er. Hmm. | 19:55 | |
Radvendii | okay. but I am cloning an object i made, modifying the clone, and the original is modified as well... | ||
jnthn | pmichaud: ;) | ||
moritz | Radvendii: it's not doing a deep clone | ||
jnthn | Mu.clone does something sane with scalar containers. If you've got an array or hash in there, it won't be doing much about that at the moment. | 19:56 | |
TimToady | unreified bits should generally be assumed to be idempotent, I think | ||
Radvendii | so .clone is not very well implimented yet... | ||
understood | |||
pmichaud | since iterators/cursors are considered immutable, the cloned array probably shares that part | ||
19:57
bluescreen10 joined
|
|||
jnthn | Sounds sane. | 19:57 | |
pmichaud: (one more day) as in, might be done tomorrow, or at earliest Friday? | |||
pmichaud | might be done tomorrow | 19:58 | |
jnthn | OK. | ||
jnthn crosses fingers for that :) | |||
pmichaud | I could push it through today, but I'd be taking a couple of shortcuts that we'd have to clean up later | 19:59 | |
having an extra evening to reflect on it a bit will give a better impl | |||
jnthn | pmichaud: So long as we get it released this week, I'm happy enough. | ||
pmichaud | (this week) as in "before Saturday" or ...? | 20:02 | |
jnthn | Yeah | 20:03 | |
Radvendii | something about .gist is printing out TrueTrueTrueTrueTrueTrue at the end of what i print | ||
well, 8 true's... | |||
which is the size of my array | 20:04 | ||
pmichaud | I suspect you may be printing the result of say() | 20:05 | |
nom: say say say "what you want" | |||
p6eval | nom 3670b7: OUTPUT«what you wantBool::TrueBool::True» | ||
Radvendii | oh | ||
yes i am | |||
thanks | |||
20:06
GlitchMr left
|
|||
pmichaud | nom: take take take "what you need" | 20:07 | |
p6eval | nom 3670b7: OUTPUT«stray take statement in block <anon> at /tmp/1VT3DvTK9K:1 in <anon> at /tmp/1VT3DvTK9K:1» | ||
pmichaud wonders if anyone recognizes the reference. :-) | |||
skids | Steppenwolf? | ||
pmichaud | en.wikipedia.org/wiki/Say_Say_Say | 20:08 | |
Radvendii got that there was a reference | 20:09 | ||
pmichaud | do we have a "pray" function yet? ;-) ( pray pray pray "everyday" ) | 20:10 | |
Radvendii | we should... and make it have something to do with bless... | 20:11 | |
jnthn | pmichaud: I didn't, but having looked at the page I realized that the reference is older than I am. ;-) | ||
skids considers golfing Janis Joplin "Piece of My Heart" lyrics until they parse. | |||
pmichaud | jnthn: yeah, I was afraid I now fall into the "Oldies" genre. :-) | 20:12 | |
Radvendii | this is quite odd... | ||
jnthn | pmichaud: Having just listened to a clip of the song, I am pretty sure I've heard it before, however. :) | ||
20:13
Guest20598 is now known as Khisanth
|
|||
skids | .oO(it isn't that you're an oldie if you like songs made before you were born. In that case you're an archivist, not an oldie.) |
20:13 | |
Radvendii | i run $a = ThisClass.new; $a.b = self.b; $a[0]=1; and suddenly self[0] is 1! (@.b handles array) | ||
20:14
ksi joined
|
|||
pmichaud | I was in high school when that song came out, so I don't fall in the "song made before I was born" category, though. :-/ | 20:14 | |
timotimo | niecza: multi barf($) { "meep" }; only sub barf(Int $a) { $a + 5 }; barf("a") | 20:17 | |
p6eval | niecza v13-352-g6694950: OUTPUT«===SORRY!===Illegal redeclaration of routine 'barf' (see line 1) at /tmp/S5VBAvFAVi line 1:------> multi barf($) { "meep" }; only sub barf⏏(Int $a) { $a + 5 }; barf("a")Unhandled exception: Check failed at /hom… | ||
timotimo | pugs: multi barf($) { "meep" }; only sub barf(Int $a) { $a + 5 }; barf("a") | ||
p6eval | pugs b927740: OUTPUT«***  Unexpected "$)" expecting formal parameter or ")" at /tmp/5TBV_NF__4 line 1, column 12» | ||
20:19
birdwindupbird left
|
|||
Radvendii | nom: Class A {has @.b=1,2,3; method c { my $a = A.new; $a.b=self.b; $a.b[0]=4; self.b.say;}}; my $x = A.new; A.c; | 20:20 | |
p6eval | nom 3670b7: OUTPUT«===SORRY!===You can't declare an attribute here; maybe you'd like a class or a role? at line 1, near "=1,2,3; me"» | ||
Radvendii | nom: Class A {has @.b = (1,2,3); method c { my $a = A.new; $a.b=self.b; $a.b[0]=4; self.b.say;}}; my $x = A.new; A.c; | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===You can't declare an attribute here; maybe you'd like a class or a role? at line 1, near " = (1,2,3)"» | ||
jnthn | Radvendii: wRONG CASE | ||
dalek | ok: c6ccbe3 | timo++ | src/multi-dispatch.pod: Rakudo implements "only sub YourSub", niecza and pugs still don't. |
20:21 | |
Radvendii | nom: class A {has @.b = (1,2,3); method c { my $a = A.new; $a.b=self.b; $a.b[0]=4; self.b.say;}}; my $x = A.new; A.c; | ||
p6eval | nom 3670b7: OUTPUT«Cannot look up attributes in a type object in method b at src/gen/CORE.setting:1384 in method c at /tmp/gWyM3qRy6m:1 in block <anon> at /tmp/gWyM3qRy6m:1 in <anon> at /tmp/gWyM3qRy6m:1» | ||
Radvendii | jnthn: thanks | ||
i dont get the error... | 20:23 | ||
what attribute am i look up in which type object? | |||
pmichaud | self.b from inside of A.c | 20:24 | |
Radvendii | why is that a problem? | ||
pmichaud | because A is a type object | ||
Radvendii | nom: class A {has @.b = (1,2,3); method c { my $a = A.new; $a.b=@.b; $a.b[0]=4; @.b.say;}}; my $x = A.new; A.c; | ||
p6eval | nom 3670b7: OUTPUT«Cannot look up attributes in a type object in method b at src/gen/CORE.setting:1384 in method c at /tmp/LgYglK6jPj:1 in block <anon> at /tmp/LgYglK6jPj:1 in <anon> at /tmp/LgYglK6jPj:1» | ||
Radvendii | oh | ||
that doesnt help | |||
what does type object mean? | 20:25 | ||
pmichaud | A is the object that represents the class | ||
jnthn | Radvendii: Did you meant to call $x.c at the end? | ||
Radvendii | ah | ||
yes | |||
nom: class A {has @.b = (1,2,3); method c { my $a = A.new; $a.b=@.b; $a.b[0]=4; @.b.say;}}; my $x = A.new; $x.c; | |||
p6eval | nom 3670b7: OUTPUT«1 2 3» | ||
pmichaud | so when you have A.c at the end, you're invoking the 'c' method on the type object, instead of an instance of the type object | ||
Radvendii | right | ||
that makes sense | |||
i thought it was something i was doing within the c method | |||
nom: class A {has @.b = (1,2,3); method c { my $a = A.new; $a.b=@.b; $a.b[0]=4; @.b.say; $a.b.say}}; my $x = A.new; $x.c; | 20:26 | ||
p6eval | nom 3670b7: OUTPUT«1 2 34 2 3» | ||
20:27
tokuhirom joined
|
|||
pmichaud | afk again for a while... probably won't be back until tomorrow morning | 20:28 | |
Radvendii | o/ | ||
jnthn | o/ | ||
Radvendii | nom: say <a b c>.map({$_}) | 20:33 | |
p6eval | nom 3670b7: OUTPUT«a b c» | ||
20:34
skids left
20:42
bbkr1 joined
|
|||
masak | nom: class A { our method foo { say "OH HAI" unless self.^name eq "A"; return &foo } }; class B is A { method bar(&c) { self.&c } }; B.bar(A.foo) | 20:45 | |
p6eval | nom 3670b7: OUTPUT«OH HAI» | ||
masak | \o/ | ||
that's... sick :) | |||
niecza: class A { our method foo { say "OH HAI" unless self.^name eq "A"; return &foo } }; class B is A { method bar(&c) { self.&c } }; B.bar(A.foo) | |||
p6eval | niecza v13-352-g6694950: OUTPUT«OH HAI» | 20:46 | |
masak | \o/ | ||
niecza: class A { our method foo { say "OH HAI" unless self.^name eq "A"; return &foo } }; class B { method bar(&c) { self.&c } }; B.bar(A.foo) | |||
p6eval | niecza v13-352-g6694950: OUTPUT«Unhandled exception: Nominal type check failed in binding self in A.foo; got B, needed A at /tmp/cS5Pj7J_Fl line 0 (A.foo @ 1)  at /tmp/cS5Pj7J_Fl line 1 (B.bar @ 3)  at /tmp/cS5Pj7J_Fl line 1 (mainline @ 5)  at /home/p6eval/niecza/lib/CORE.settin… | ||
masak | indeed. | ||
jnthn | masak: Why the "our"? :) | 20:47 | |
bbkr1 | What is the best practice to define attribute default value in child class? Let's say I have class A { has Str $.id }. Now I can write class B is A { has $.id = 8 } which is not good as it redeclares type. Or I can write class B is A { submethod BUILD { $.id = 8 } } which is also not good as this is slow runtime assignment and it has to be repeated in every BUILD method. | 20:48 | |
jnthn | You shouldn't be doing $.id in BUILD anyway | ||
20:48
ggoebel left
|
|||
jnthn | BUILD submethod should always refer directly to the storage slot ($!id) | 20:49 | |
bbkr1 | I know, that's why i search for better solution | ||
masak | jnthn: so that the method gets registered in the namespace of class A, so that I can return &foo from it :) | 20:51 | |
jnthn | masak: ah, I see | ||
bbkr1 | for example P5-ism from Moose was: has '+id' => ('default' => 8 ); | ||
masak | jnthn: I bet there's an easier way to return a routine from itself... :) | ||
jnthn | Guess you could return &?ROUTINE | ||
nom: sub foo() { say "hi"; return &?ROUTINE; }; my $x = foo(); $x() | 20:52 | ||
p6eval | nom 3670b7: OUTPUT«hihi» | ||
20:52
fsergot left
20:53
ggoebel joined
20:54
MayDaniel joined
|
|||
timotimo | rakudo: my %foo = 1 => "one", 2 => "two"; say %foo[1] | 21:01 | |
p6eval | rakudo 3670b7: OUTPUT«Failure.new(exception => Exception.new())» | ||
timotimo | i must be very confused. why doesn't that work? | ||
jnthn | Because you're doing array indexing, not hash indexing. :) | ||
rakudo: my %foo = 1 => "one", 2 => "two"; say %foo{1} | 21:02 | ||
p6eval | rakudo 3670b7: OUTPUT«one» | ||
timotimo | oooooooooh, duh! | ||
21:02
mj41 joined
|
|||
Radvendii | nom: say ?('wK' !~~ 'b') | 21:02 | |
p6eval | nom 3670b7: OUTPUT«Bool::True» | ||
Radvendii | nom: say ?('wK' !~~ 'w') | 21:03 | |
p6eval | nom 3670b7: OUTPUT«Bool::True» | ||
Radvendii | nom: say ?('wK' !~~ /w/) | ||
p6eval | nom 3670b7: OUTPUT«Bool::False» | ||
[Coke] | nom: say ?('wK' !~~ /'w'/) | ||
p6eval | nom 3670b7: OUTPUT«Bool::False» | ||
Radvendii | <w b>.grep: -> $x {'wK' !~~ /$x/} | 21:04 | |
nom: say <w b>.grep: -> $x {'wK' !~~ /$x/} | |||
p6eval | nom 3670b7: OUTPUT«b» | ||
Radvendii | nom: sub a($l) { <w b>.grep: -> $x {$l !~~ /$x/} }; a('wK'); | 21:05 | |
p6eval | nom 3670b7: ( no output ) | ||
Radvendii | nom: sub a($l) { <w b>.grep: -> $x {$l !~~ /$x/} }; say a('wK'); | ||
p6eval | nom 3670b7: OUTPUT«b» | ||
Radvendii | nom: sub a($l, $c = (<w b>.grep: -> $x {$l !~~ /$x/}) { say $c }; a('wK'); | 21:06 | |
p6eval | nom 3670b7: OUTPUT«===SORRY!===Malformed block at line 1, near "($l, $c = "» | ||
Radvendii | nom: sub a($l, $c = (<w b>.grep: -> $x {$l !~~ /$x/})) { say $c }; a('wK'); | ||
p6eval | nom 3670b7: OUTPUT«b» | ||
Radvendii | ugh. lazy evaluating is so annoying sometimes! | 21:08 | |
21:09
molaf left
|
|||
Radvendii | is there any way to 'require' evaluation, without printing out the results? | 21:09 | |
jnthn | Radvendii: eager | ||
Radvendii | can i just say eager $a;? | 21:10 | |
jnthn | Think so | ||
Radvendii | nom: my $a=1; my @a = $a xx *; eager @a; $a=2; say @a[0]; | 21:11 | |
p6eval | nom 3670b7: OUTPUT«2» | ||
Radvendii | nope | ||
nom: my $a=1; my @a = $a xx *; @a; $a=2; say @a[0]; | 21:12 | ||
p6eval | nom 3670b7: OUTPUT«2» | ||
Radvendii | nom: my $a=0; my @a = $a xx *; while $a++ < 5 {say @a[$a]} | 21:14 | |
p6eval | nom 3670b7: OUTPUT«12345» | ||
Radvendii | tee hee | ||
PerlJam | nom: my $a=1; my @a = eager $a xx *; $a=2; say @a[0]; | ||
p6eval | nom 3670b7: OUTPUT«2» | ||
Radvendii | nom: my $a=1; eager my @a = $a xx *; $a=2; say @a[0]; | 21:15 | |
p6eval | nom 3670b7: OUTPUT«2» | ||
[Coke] | I think when you say lazy you're not meaning what perl 6 lazy means. | ||
I think you're confused about container semantics. | |||
Radvendii | maybe? | ||
nom: sub a($b is copy,$c=$b+1) {$b++; say $c}; a(1) | 21:17 | ||
p6eval | nom 3670b7: OUTPUT«2» | ||
Radvendii | nom: sub a($b is copy,$c=$b+1) {$b=3; say $c}; a(1) | 21:18 | |
p6eval | nom 3670b7: OUTPUT«2» | ||
Radvendii | that's not happening for me... | ||
well, not in that exact form, but close enough | |||
nom: sub a($b is copy,$c=(<w b>.grep: -> $x { $l !~~ /$x/})) {$b='b'; say $c}; a('w') | 21:19 | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Variable $l is not predeclared at line 1, near " !~~ /$x/}"» | ||
Radvendii | nom: sub a($b is copy,$c=(<w b>.grep: -> $x { $b !~~ /$x/})) {$b='b'; say $c}; a('w') | 21:20 | |
p6eval | nom 3670b7: OUTPUT«w» | ||
Radvendii | see? | ||
nom: sub a($b is copy,$c=(<w b>.grep: -> $x { $b !~~ /$x/})) {say $c;$b='b';}; a('w') | |||
p6eval | nom 3670b7: OUTPUT«b» | ||
Radvendii | it's the .grep that's lazy | 21:21 | |
moritz | that's because grep is lazy | ||
right | |||
nom: sub a($b is copy, @c = (<w b>.grep({ !/$x/})) { $b = 'b'; say @c }; a('w') | 21:22 | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Variable $x is not predeclared at line 1, near "/})) { $b "» | ||
moritz | nom: sub a($b is copy, @c = (<w b>.grep(-> $x { !/$x/})) { $b = 'b'; say @c }; a('w') | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Malformed block at line 1, near "($b is cop"» | ||
moritz too tired to code | 21:23 | ||
Radvendii | ;) go to bed | 21:24 | |
moritz | I will. | 21:25 | |
Radvendii | why does "say" return 1 or 0 and not what it said... | 21:29 | |
moritz | why should it? | ||
21:30
ggoebel left
|
|||
Radvendii | because it's always more useful to get back what it said than it's success | 21:30 | |
masak | I disagree. | 21:32 | |
moritz | well, it's certainly p5ish to return the success status | ||
masak | though I never use the return value of &say in any form whatsoever. | ||
yeah, was just going to say that :) | |||
moritz | I'd expect it die violently if it fails | 21:33 | |
benabik | What is said may also be larger than you really want to keep a string around for. | ||
masak | IIRC, Rakudo simply returns True always. | ||
moritz | benabik: that would have been my next point to make | ||
benabik | moritz: GMTA | ||
21:33
mj41 left
|
|||
masak | benabik: well, a sink context optimizer would take care of that... | 21:33 | |
moritz | benabik: fsvo'G' | 21:34 | |
:-) | |||
21:34
alester left
|
|||
masak | doing it with the other letters are worse insults :P | 21:34 | |
moritz | std: #` | ||
p6eval | std 47c76b3: OUTPUT«===SORRY!===Opening bracket is required for #` comment at /tmp/WjGbkadWON line 1:------> #`⏏<EOL>Parse failedFAILED 00:01 96m» | ||
21:35
ggoebel joined
21:37
molaf joined
|
|||
Radvendii | that's just my point, always returning true isn't helpful, and when i want to throw a say in to see what a function is returning, the return then stops returning what i want... | 21:39 | |
prammer | sounds like you want something like Dwarn (p5) metacpan.org/module/Devel::Dwarn | 21:43 | |
21:44
MayDaniel left
|
|||
Radvendii | yes, unfortunately that's only for perl _5_ . also, it still doesn't make sense to me that say would return a boolean at all. it's just not helpful. or intuitive. | 21:45 | |
nom: say print "a" | |||
p6eval | nom 3670b7: OUTPUT«aBool::True» | ||
bbkr1 | rakudo: class A { has Int $.id; }; class B is A { submethod BUILD ( :$!id = 10 ) { } }; B.new' | 21:51 | |
p6eval | rakudo 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "B.new'"» | ||
bbkr1 | rakudo: class A { has Int $.id; }; class B is A { submethod BUILD ( :$!id = 10 ) { } }; B.new | ||
p6eval | rakudo 3670b7: OUTPUT«Null PMC access in get_pmc_keyed_str() in submethod BUILD at /tmp/NGnaIv23u2:1 in method BUILDALL at src/gen/CORE.setting:583 in method bless at src/gen/CORE.setting:573 in method new at src/gen/CORE.setting:558 in block <anon> at /tmp/NGnaIv23u2:1 in <… | ||
bbkr1 | known bug? it only happens on inherited attributes. | ||
another variation | 21:52 | ||
rakudo: class A { has Int $.id; }; class B is A { submethod BUILD ( $!id? ) { } }; B.new | |||
p6eval | rakudo 3670b7: OUTPUT«Null PMC access in get_pmc_keyed_str() in submethod BUILD at /tmp/qLZGBlS5WY:1 in method BUILDALL at src/gen/CORE.setting:583 in method bless at src/gen/CORE.setting:573 in method new at src/gen/CORE.setting:558 in block <anon> at /tmp/qLZGBlS5WY:1 in <… | ||
jnthn | bbkr1: That attribute ain't visible there. | 21:54 | |
Why it doesn't explode is a bit mysterious though... | |||
masak | nom: class A { has Int $.id; }; class B is A { submethod BUILD ( $!id ) { } }; B.new | ||
p6eval | nom 3670b7: OUTPUT«Not enough positional parameters passed; got 1 but expected 2 in submethod BUILD at /tmp/8FMWmEVmBd:1 in method BUILDALL at src/gen/CORE.setting:583 in method bless at src/gen/CORE.setting:573 in method new at src/gen/CORE.setting:558 in block <anon> at /tmp… | ||
masak | aha! | ||
jnthn | Of course, we can catch that one at compile time. | ||
masak | yeah, but what about the error above? | 21:55 | |
jnthn | masak: The error above is "right" though we should really catch the other one at compile time. | ||
masak: I mean, we'd not make it to runtime there. | |||
Radvendii | nom: say 1 ^...^ 4 | 21:56 | |
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "say 1 ^..."» | ||
Radvendii | ..? | ||
[Coke] | nom: sub llog(*@a) { .say for @a ; return @a}; foo($a,$b) { return llog $a+$b}; foo(3,4); | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Variable $a is not predeclared at line 1, near ",$b) { ret"» | ||
Radvendii | shouldn't that produce 2,3? | ||
colomon | ^,,,^ doesn't exist | ||
^...^, I mean | |||
[Coke] | nom: sub llog(*@a) { .say for @a ; return @a}; sub foo($a,$b) { return llog $a+$b}; foo(3,4); | ||
p6eval | nom 3670b7: OUTPUT«7» | ||
bbkr1 reports LTA message in this BUILD example | 21:57 | ||
[Coke] | nom: sub llog(*@a) { .say for @a ; return @a}; sub foo($a,$b) { return llog $a+$b}; say "foo(3,4) is" + foo(3,4); | ||
p6eval | nom 3670b7: OUTPUT«71» | ||
[Coke] | nom: sub llog(*@a) { .say for @a ; return @a}; sub foo($a,$b) { return llog $a+$b}; say "foo(3,4) is" ~ foo(3,4); | ||
p6eval | nom 3670b7: OUTPUT«7foo(3,4) is7» | ||
Radvendii | i thought ^ at one end excluded the endpoint there | ||
[Coke] | Radvendii: there you go. | ||
jnthn | bbkr1: Thanks. I'm done with $dayjob tasks, had a stroll and have a few tuits, so may see if I can improve that now. But do file the ticket, so we can get test coverage. ;) | 21:58 | |
colomon | Radvendii: that's true for Range, not true for sequence | ||
Radvendii | but isn't ... also used if you dont know which side is larger? | ||
nom: say 5..3 | |||
p6eval | nom 3670b7: OUTPUT«5..3» | ||
Radvendii | nom: say (5..3).list | 21:59 | |
p6eval | nom 3670b7: OUTPUT«» | ||
Radvendii | nom: say (5...3).list | ||
p6eval | nom 3670b7: OUTPUT«5 4 3» | ||
PerlJam | Radvendii: note that ... and ^... and ...^ and ^...^ would all be separate operators if they all existed. | ||
Radvendii | PerlJam: why? there's no way to make that a meta-op? | ||
PerlJam | perhaps with macros | 22:00 | |
22:00
bluescreen10 left
|
|||
colomon | The idea of using ... if you don't know which side is larger is very dangerous in general | 22:00 | |
.. and ... are very different | 22:01 | ||
Radvendii | how so... | 22:02 | |
[Coke] | grok .. | ||
is the grokbot still about? | 22:03 | ||
masak | nope. | ||
[Coke] | .u sad | ||
phenny | U+0635 ARABIC LETTER SAD (ص) | ||
22:05
chee joined
|
|||
colomon | Radvendii: .. creates a Range object, which (if numeric) represents a portion of the real line. ... creates a sequence of numbers. | 22:06 | |
for instance: | |||
nom: say 4..5.5; | |||
p6eval | nom 3670b7: OUTPUT«4..11/2» | ||
colomon | nom: say 4...5.5 | 22:07 | |
p6eval | nom 3670b7: OUTPUT«(timeout)» | ||
colomon | timeout because 4...5.5 is the infinite sequence 4, 5, 6, 7... | ||
another example: | |||
nom: say 4.1 ~~ 4..5.5 | 22:08 | ||
p6eval | nom 3670b7: OUTPUT«Bool::True» | ||
colomon | nom: say 4.1 ~~ 4...6 | ||
p6eval | nom 3670b7: OUTPUT«(timeout)» | ||
colomon | errr... not sure why that one blows up | ||
Radvendii | ah... | ||
:P | 22:09 | ||
colomon | if you want a Range from $a to $b, but you don't know which is bigger, you can say | ||
nom: my $a = rand; my $b = rand; say $a ~ " " ~ $b; say ($a, $b).minmax.perl | |||
p6eval | nom 3670b7: OUTPUT«0.0948716237480802 0.2576182844090620.0948716237480802e0..0.257618284409062e0» | ||
colomon | nom: my $a = rand; my $b = rand; say $a ~ " " ~ $b; say ($a, $b).minmax.perl | ||
p6eval | nom 3670b7: OUTPUT«0.357001702374877 0.5879499356701390.357001702374877e0..0.587949935670139e0» | ||
Radvendii | that seems like a bit much for such an operation... | 22:11 | |
colomon | ? | ||
($a, $b).minmax is too much work for you? | |||
Radvendii | oh | 22:12 | |
i just realized that the rest of it wasn't part of the actual operation | |||
colomon | you can also say it $a minmax $b | ||
Radvendii | :P | ||
PerlJam | minmax++ | ||
Radvendii | and minmax does the same thing as .. except orders them first? | 22:13 | |
wait... | |||
benabik | nom: say 2..1; say 2 minmax 1 | ||
p6eval | nom 3670b7: OUTPUT«2..11..2» | ||
Radvendii | nom: say 5 ^minmax^ 1 | ||
p6eval | nom 3670b7: OUTPUT«one(5, Inf..-Inf, 1)» | 22:14 | |
colomon | no, minmax orders them and then makes a Range (ie ..) | ||
cognominal | nom: say Signature.^methods[0].WHAT' | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "say Signat"» | ||
Radvendii | colomon: that's what i said... | ||
PerlJam | colomon: 4.1 ~~ 4...6 blows up because it means (4.1 ~~ 4) ... 6, or False ... 6 | ||
cognominal | nom: say Signature.^methods[0].WHAT | ||
p6eval | nom 3670b7: OUTPUT«Can only use get_what on a SixModelObject in block <anon> at /tmp/S_ZupZj2K4:1 in <anon> at /tmp/S_ZupZj2K4:1» | ||
cognominal | this probably explains rt.perl.org/rt3//Public/Bug/Displa...?id=108968 | ||
colomon | PerlJam++: ah! thanks! | ||
cognominal | nom: say Int.^methods[0].WHAT | ||
p6eval | nom 3670b7: OUTPUT«Method()» | 22:15 | |
Radvendii | PerlJam: shouldn't False evaluate to 0 in numerical context? | ||
colomon | who said ... was numerical context? | ||
Radvendii | oh right... | 22:16 | |
22:16
kaare_ left
|
|||
PerlJam | Radvendii: ... is deep and powerful magic :) | 22:16 | |
Radvendii | nom: say 5 ^minmax 1 | ||
p6eval | nom 3670b7: OUTPUT«one(5, 1..1)» | ||
Radvendii cocks an eyebrow | |||
oh | |||
colomon | nom: say (True, * ^^ True ... *)[10] | 22:17 | |
p6eval | nom 3670b7: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2» | ||
Radvendii | i see what it's doing | ||
colomon | you can't use ^ with minmax like you can with Range | ||
std: say 5 ^minmax 1 | |||
Radvendii | colomon: so then it doesn't solve my original problem. and why not? | ||
masak | colomon: you have control chars in your programs again. | ||
p6eval | std 47c76b3: OUTPUT«ok 00:01 109m» | ||
22:18
ksi left
|
|||
colomon | nom: say (True, * ^^ True ... *)[10] | 22:18 | |
p6eval | nom 3670b7: OUTPUT«Bool::False» | ||
colomon | doh! | ||
nom: say (True, !* ... *)[10] | |||
p6eval | nom 3670b7: OUTPUT«Bool::True» | ||
colomon | nom: say !True | ||
p6eval | nom 3670b7: OUTPUT«Bool::False» | ||
colomon | hmmm, I don't remember False stopping sequences | 22:19 | |
Radvendii: I don | |||
t | |||
Radvendii: I don't think anyone ever thought of adding ^minmax | 22:20 | ||
PerlJam | I'm not sure what ^minmax would even mean | ||
Radvendii | PerlJam: minmax, except not including the operand on that side? | ||
colomon | so 10 ^minmax 1 would be 1 ..^ 10 | 22:21 | |
Radvendii | yeah. | ||
or it could be that 10 ^minmax 1 would be 1 ^.. 10 | |||
and by the way, i do want ... | |||
[Coke] | if part of the point of minmax is that you might not know the order ahead of time, that seems iffy. | ||
Radvendii | because i am doing something like: | 22:22 | |
colomon | I'd think the first explanation makes a lot more sense | ||
Radvendii | nom: ((10 ... 1) «,» 3).map -> $i, $j { say $i, ", ", $j } | 22:23 | |
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "((10 ... 1"» | ||
Radvendii | ...? | 22:24 | |
nom: (10 ... 1 «,» 3).map -> $i, $j { say $i, ", ", $j } | 22:25 | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "(10 ... 1 "» | ||
Radvendii | nom: (10 ... 1 »,» 3).map -> $i, $j { say $i, ", ", $j } | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "(10 ... 1 "» | ||
PerlJam | Radvendii: so ... what would @a ^minmax @b mean? | 22:27 | |
Basically the ^ there would just exclude the end point on that side? | 22:28 | ||
Radvendii | i thought it would make more sense if it excluded it on the lesser side | 22:29 | |
cognominal | jnthn, in BOOTSTRAP.pm I think the added method should be put in a container so as not to later trigger a bug. What it the nqp:: sub for that? | ||
Radvendii | because you wouldn't use minmax if you knew which side that was | ||
PerlJam | so if @a minmax @b == $a..$b, then @a ^minmax @b == $a^..@b (and presumably @a minmax^ @b == $a..^$b) ? | ||
cognominal | nom: say Proxy.^methods[0].WHAT | 22:30 | |
p6eval | nom 3670b7: OUTPUT«Can only use get_what on a SixModelObject in block <anon> at /tmp/5EqRkdDmEM:1 in <anon> at /tmp/5EqRkdDmEM:1» | ||
jnthn | cognominal: Well, probably need to re-arrange things a little in there to make sure Method etc exists. | ||
Radvendii | yeah. i think so | ||
jnthn | cognominal: And they probably want some kinda signature object piecing together too | ||
cognominal | all the classes that uses the HOW.add_method have the problem. | ||
jnthn | cognominal: Yeah. | ||
cognominal: The problem is that they're adding a Parrot sub. | 22:31 | ||
(more) | |||
Radvendii | nom: say (1..4).map(&say) | ||
p6eval | nom 3670b7: OUTPUT«1234True True True True» | ||
Radvendii | :P | ||
jnthn | That could be resolved by wrapping them all in Perl 6 Methods. Alternatively, NQP may be about to get code objects too. | ||
PerlJam | Radvendii: I'm dubious of the utility, but otherwise it seems okay | 22:32 | |
cognominal | ok | ||
Radvendii | because right now i need a ^minmax^ operator | ||
well... what i really need is ^...^ | |||
PerlJam | Radvendii: that's another kettle of fish though | ||
Radvendii | why? | ||
nom: say 1...^10 | 22:33 | ||
p6eval | nom 3670b7: OUTPUT«1 2 3 4 5 6 7 8 9» | ||
Radvendii | nom: say 1^...20 | ||
p6eval | nom 3670b7: OUTPUT«1^..1/5» | ||
Radvendii | nom: say 1^...10 | ||
p6eval | nom 3670b7: OUTPUT«1^..1/10» | ||
Radvendii | nom: say 1(^...)10 | ||
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "say 1(^..."» | ||
Radvendii | nom: say 1 ^... 10 | 22:34 | |
p6eval | nom 3670b7: OUTPUT«===SORRY!===Confused at line 1, near "say 1 ^..."» | ||
Radvendii | what is going on? | ||
PerlJam | ^... is probably not implemented? | ||
Radvendii | right | ||
oh... | 22:35 | ||
that's because... | |||
nope | |||
can't think of a reason | |||
colomon | because it would mean "drop the first element of your sequence" | ||
Radvendii | yeah... | ||
PerlJam | btw, I think there's either a spec bug or a rakudo bug. Compare the text at S03:1721 with the output of my @a = 1..^10; my @b = 5..7; @a minmax @b | 22:36 | |
nom: my @a = 1..^10; my @b = 5..7; @a minmax @b | |||
p6eval | nom 3670b7: ( no output ) | ||
PerlJam | nom: my @a = 1..^10; my @b = 5..7; say @a minmax @b | ||
p6eval | nom 3670b7: OUTPUT«1..9» | ||
Radvendii | that makes sense at least... | ||
PerlJam | the spec says "...except that if the corresponding C<excludes> flag is set in Range, the excludes flag is also set in the returned C<Range>." | 22:37 | |
which means it should be 1..^10 | |||
colomon | nom: my @a = 1..^10; say @a.WHAT | ||
p6eval | nom 3670b7: OUTPUT«Array()» | ||
Radvendii | PerlJam: ah. | ||
colomon | it's not a Range | ||
PerlJam | oh. | ||
There's a PerlJam bug then :) | |||
colomon | nom: say (1..^10) minmax (5..7) | 22:38 | |
p6eval | nom 3670b7: OUTPUT«1..9» | ||
colomon | that, on the other hand, looks more like a bug | ||
Radvendii | :P | ||
colomon | hmmm... | ||
nom: (1..^10, 5..7).minmax.say | |||
Radvendii | (1..^10).WHAT | ||
p6eval | nom 3670b7: OUTPUT«1..9» | ||
Radvendii | nom: say (1..^10).WHAT | ||
PerlJam | yeah, there you go | ||
p6eval | nom 3670b7: OUTPUT«Range()» | ||
Radvendii | good catch | 22:39 | |
colomon | nom: my $a = 1..^10; my $b = 5..7; say ($a, $b).minmax | ||
p6eval | nom 3670b7: OUTPUT«1..^10..5..7» | ||
colomon | that's a bug for sure | ||
PerlJam | heh! | ||
indeed | |||
Radvendii | haha | ||
colomon | niecza: my $a = 1..^10; my $b = 5..7; say ($a, $b).minmax | ||
p6eval | niecza v13-352-g6694950: OUTPUT«5..7..1..^10» | ||
colomon | blast | ||
Radvendii | ouch | ||
colomon | well, spectests to be added, bugs to be fixed... | ||
ng: my $a = 1..^10; my $b = 5..7; say ($a, $b).minmax | 22:40 | ||
Radvendii | colomon: i still dont get why ^... wouldn't make sense | ||
colomon | b: my $a = 1..^10; my $b = 5..7; say ($a, $b).minmax | ||
p6eval | b 1b7dd1: OUTPUT«123456789» | ||
Radvendii | std: my $a = 1..^10; my $b = 5..7; say ($a, $b).minmax | ||
p6eval | std 47c76b3: OUTPUT«ok 00:01 113m» | ||
Radvendii | i take it std is not a perl6 implementation... | 22:41 | |
colomon could have sworn he had minmax working properly at one point back in the days of b. :( | 22:42 | ||
PerlJam | Radvendii: not one that has a runtime, no. | ||
Radvendii | PerlJam: understood | ||
PerlJam | Radvendii: std is basically a perl 6 syntax checker | ||
Radvendii | PerlJam: got it. and std is for standard? | ||
PerlJam | aye | ||
dalek | kudo/nom: 12f3505 | jnthn++ | src/Perl6/Metamodel/MethodContainer.pm: Parentheticize a remark in an error. |
22:44 | |
kudo/nom: f9d635c | jnthn++ | src/Perl6/Actions.pm: Catch undeclared attributes mentions in signatures. |
|||
Radvendii | still, what's wrong with ^...? | ||
colomon | Radvendii: because $a ^... $b would be exactly equivalent to $a+1 ... $b -- just less clear | 22:46 | |
Radvendii | nope | ||
5 ^... 1 would not be the same as 6 ... 1 | |||
PerlJam | colomon: would it? $a would just be omitted wouldn't it? | ||
5 ^... 1 --> 4 3 2 1, 'a'^...'d' --> 'b', 'c', 'd' | 22:47 | ||
jnthn | phenny: tell moritz Things that use $*W.throw(...) (e.g. sub foo($x! = 42) { }) gives an error in -e or when run in a file, but the error is never shown in the REPL - it seems to swallow them. | 22:48 | |
colomon | sure, if it's a decreasing sequence it's $a-1..$b | ||
phenny | jnthn: I'll pass that on when moritz is around. | ||
PerlJam | Radvendii: the problem for me is when it's like 1, 3, 5 ^... 13 Is tha the same as 3, 5, 7, 9, 11, 13 ? | 22:49 | |
Radvendii | yes, but the whole _point_ is that i dont know whether it's bigger or not | ||
if i did, i would use ^.. | |||
22:49
phenny left
|
|||
benabik | Radvendii: Use minmax to sort out the size, _then_ use ^.. | 22:49 | |
Radvendii | PerlJam: yes, why wouldn't it be? | ||
benabik: i could, but that doesn't sound a little silly to you? | 22:50 | ||
PerlJam | just seems weird is all | ||
Radvendii | PerlJam: why? it's non-inclusive | ||
22:50
phenny joined
|
|||
benabik | "Non-inclusive" and "series" don't go together in my head | 22:51 | |
Radvendii: Given the potential confusions with what you're excluding with ^minmax, it doesn't seem silly at all. | |||
Radvendii | benabik: why not? how else would i do $a, $b ^... $c without knowing what $a and $b are? | ||
22:52
overrosy left
|
|||
benabik | Non-inclusive series... "I need a set of numbers defined by these numbers that excludes one of them" | 22:52 | |
Radvendii | i could do ($a, $b ... $c)[1..*-1] | ||
rather ($a, $b ... $c)[1..*] | 22:53 | ||
22:53
benabik left
|
|||
Radvendii | benabik: that's true, if you know what all of those numbers are. | 22:53 | |
22:53
overrosy joined
|
|||
PerlJam | nom: | 22:54 | |
nom: 1,3,5 ...^ 13,16,27 | |||
colomon | In general, if you don't know what the numbers $a, $b. and $c are, then $a, $b ... $c will almost certainly be an infinite sequence | ||
p6eval | nom 3670b7: ( no output ) | ||
PerlJam | blah | ||
nom: say 1,3,5 ...^ 13,16,27 | 22:55 | ||
p6eval | nom 3670b7: OUTPUT«1 3 5 7 9 11 16 27» | ||
PerlJam | I can't concile that with the proposed ^... | ||
colomon | Radvendii: I think this is when sorear++ would quite sensibly say, can you please tell us what you are actually trying to do, rather than the way you think it ought to be done? | ||
Radvendii | colomon: uless you know they are all integers | ||
PerlJam | Radvendii: eh? | ||
Radvendii | that was at his previous point | 22:56 | |
colomon | Radvendii: not even then, unless you know that $c % ($b - $a) == 0 | ||
errr, ($c - $a) % ($b - $a) == 0, I mean | |||
Radvendii | what i want to do is $a ... $b except not include $a or $b. without knowing which is bigger | 22:57 | |
PerlJam | Radvendii: you forgot "... in one operation" because you can certainly do that in multiple steps :) | 22:58 | |
(that ... was just an ellipsis) | 22:59 | ||
Radvendii | yes. but that seems like the kind of thing that should be doable, considering that ... doesn't care about order and ^..^ exists | ||
doesn't it just seem like the task involves putting those two together? | |||
colomon | and you're sure $a and $b are integers? | ||
Radvendii | yes | 23:00 | |
they are coordinates | |||
so yeah | |||
(on a grid) | |||
or, more appropriately, they are indicies | |||
it's just as much of a problem to say @a[$b] | 23:01 | ||
because $b might be 1.5 | |||
hm... | |||
colomon | @a[1.5] is perfectly legal | ||
Radvendii | nom: my @a = <a b c>; say @a[1.5] | ||
p6eval | nom 3670b7: OUTPUT«b» | ||
Radvendii | wth? | ||
dalek | p/bs: 36df449 | jnthn++ | t/serialization/01-basic.t: Tests for P6num and P6str serialization. |
||
p/bs: fd071cc | jnthn++ | src/6model/reprs/P6 (2 files): Implement serialize and deserialize for P6num and P6str representations. |
|||
Radvendii | that's bizzare | ||
it just truncates | 23:02 | ||
but reguardless, yes. i knwo they are integers. | |||
masak | that's not bizarre. | ||
that's Perl. | |||
colomon | it floors, actually, I believe | ||
masak | right. | ||
PerlJam | That's just Perl since it was born | ||
jnthn | .oO( That's totally floored! ) |
||
Radvendii | colomon: isn't floor and truncate the same? | ||
masak | probably rounds towards 0 :) | ||
colomon: it's impossible to tell since negative numbers are no longer allowed. | 23:03 | ||
colomon | Radvendii: not for negative numbers. | ||
Radvendii | also, when would i ever want to access @a[1.5] and _not_ be confused | ||
masak | good night, #perl6 | ||
colomon | can't you (at least hypothetically) create an array with negative indices? | ||
Radvendii | o/ | ||
masak | colomon: yes, when S09 is implemented. | ||
masak sleeps | 23:04 | ||
Radvendii | nom: my @a; @a[-4]=3; say @a; | ||
p6eval | nom f9d635: OUTPUT«Cannot assign to a non-container in block <anon> at /tmp/jBVoKsOCl7:1 in <anon> at /tmp/jBVoKsOCl7:1» | ||
colomon | Radvendii: @a[@a.elems / 2] where there are three elements in the array | ||
PerlJam | Radvendii: have a look at gist.github.com/21bbf1da86d0e495408b Are those the semantics you think should exist? | ||
Radvendii | indeed | 23:05 | |
23:05
slavik left
|
|||
PerlJam | the asymmetry bothers me | 23:07 | |
Radvendii | yeah, i would also prefer it if the 19 were removed | ||
but | |||
i understand why that cannot be | |||
PerlJam | I could make a case for 1,3,5 ^...^ 13,16,19 --> 1 3 7 9 11 16 19 | ||
:-) | |||
Radvendii | just think of it as (1,3,5 ^...^ 13),16,19 | 23:08 | |
because that's what it is | |||
23:08
slavik joined
|
|||
PerlJam | Radvendii: convince TimToady and you're done modulo the implementation :) | 23:11 | |
23:11
zamolxes left
|
|||
Radvendii | modulo the implementation? | 23:11 | |
oh | |||
got it | |||
it can't be too hard... 1,3,5 ^... 13 is exactly the same as (1,3,5 ... 13)[1..*] | 23:12 | ||
jnthn | ugh, tired...'night o/ | ||
Radvendii | jnthn: \o | ||
o> <--- check out his muscles | 23:14 | ||
PerlJam: am i wrong? ^^ up there? | 23:15 | ||
23:16
xinming left
|
|||
Radvendii | nom: say (1,3,5 ... 13)[1..* | 23:18 | |
p6eval | nom f9d635: OUTPUT«===SORRY!===Unable to parse postcircumfix:sym<[ ]>, couldn't find final ']' at line 2» | ||
Radvendii | nom: say (1,3,5 ... 13)[1..*] | ||
p6eval | nom f9d635: OUTPUT«3 5 7 9 11 13» | ||
23:18
xinming joined
|
|||
Radvendii | nom: say (13...4)[1..*] | 23:18 | |
p6eval | nom f9d635: OUTPUT«12 11 10 9 8 7 6 5 4» | ||
Radvendii | yup | ||
nom: say (13...^4)[1..*] | |||
p6eval | nom f9d635: OUTPUT«12 11 10 9 8 7 6 5» | ||
Radvendii | nom: say (4...^4)[1..*] | 23:22 | |
p6eval | nom f9d635: OUTPUT«» | ||
Radvendii | nom: say (4...^4) | 23:23 | |
p6eval | nom f9d635: OUTPUT«» | ||
Radvendii | nom: say (4...4) | ||
p6eval | nom f9d635: OUTPUT«4» | ||
Radvendii | nom: say (4...4)[1..*] | ||
p6eval | nom f9d635: OUTPUT«» | ||
Radvendii | nom: say <a b c> «,» () | 23:24 | |
p6eval | nom f9d635: OUTPUT«(timeout)» | ||
Radvendii | nom: say 'a' ~~ 0 | 23:25 | |
p6eval | nom f9d635: OUTPUT«Bool::True» | ||
Radvendii | so why does it convert the 'a' into a number and not the 0 into a string? | 23:26 | |
Timbus | 0.ACCEPTS('a') makes sense to me | 23:28 | |
Radvendii | oh. is that what ~~ calls? | 23:31 | |
Timbus | yeah. | 23:32 | |
Radvendii | so what about 'a' ~~ /0/. does that do /0/.ACCEPTS('a') ? | ||
or is that something else... | |||
Timbus | i think that's what it does, but there's been a few issues regarding that | 23:33 | |
Radvendii | oh | ||
Timbus | nom: say /0/.ACCEPTS('a') | ||
p6eval | nom f9d635: OUTPUT«#<failed match>» | ||
Radvendii | apparently | ||
Timbus | nom: say /\w/.ACCEPTS('a') | 23:34 | |
p6eval | nom f9d635: OUTPUT«=> <a>» | ||
Timbus | so yeah thats how it works | ||
Radvendii | o-oh | ||
so it's easy to overload ~~ | 23:35 | ||
Timbus | yes | ||
Radvendii | clever | ||
:P | |||
Timbus | the problem with ~~ and matches is that $_ is overridden during the match, but sometimes people use magical values in their matches and submatches | ||
Radvendii | magical values? | 23:36 | |
Timbus | theres also the issue of how ~~ and substitution matches should work (i think they should not work at all) | ||
Radvendii | i think it should return the string after substitution | ||
Timbus | yes, like previous match values and the like | ||
Radvendii | ah | 23:37 | |
Timbus | anything tied to $_ i guess.. | ||
moritz wrote a blog entry about it but I can't find it | |||
Radvendii | but yeah, i hardly ever want to modify the string itself. and if i did i could use ~~= | 23:38 | |
yeah, i experienced recently when i wanted to do .grep: {$i !~~ $_} or something like that | |||
nom: say (one(<a b c>) ~~ /a/) | 23:41 | ||
p6eval | nom f9d635: OUTPUT«This type cannot unbox to a native string in <anon> at src/gen/Metamodel.pm:2686 in !cursor_init at src/stage2/QRegex.nqp:878 in method ACCEPTS at src/gen/CORE.setting:7559 in block <anon> at /tmp/Z4I_FuY25p:1 in <anon> at /tmp/Z4I_FuY25p:1» | ||
Radvendii | nom: say ((one(<a b c>) ~~ /a/).perl) | ||
p6eval | nom f9d635: OUTPUT«This type cannot unbox to a native string in <anon> at src/gen/Metamodel.pm:2686 in !cursor_init at src/stage2/QRegex.nqp:878 in method ACCEPTS at src/gen/CORE.setting:7559 in block <anon> at /tmp/aSMmL4cfBj:1 in <anon> at /tmp/aSMmL4cfBj:1» | ||
Radvendii | nom: say ?(one(<a b c>) ~~ /a/) | 23:42 | |
p6eval | nom f9d635: OUTPUT«This type cannot unbox to a native string in <anon> at src/gen/Metamodel.pm:2686 in !cursor_init at src/stage2/QRegex.nqp:878 in method ACCEPTS at src/gen/CORE.setting:7559 in block <anon> at /tmp/4XUoXuhjMY:1 in <anon> at /tmp/4XUoXuhjMY:1» | ||
Radvendii | nom: say ?(one(<a b c>) eq 'a') | ||
p6eval | nom f9d635: OUTPUT«Bool::True» | ||
Radvendii | nom: say (one(<a b c>) eq 'a') | ||
p6eval | nom f9d635: OUTPUT«one(Bool::True, Bool::False, Bool::False)» | ||
Radvendii | is there any way to find out which of them was the 'one'? | 23:43 | |
nom: say (a ^^ 0) | 23:45 | ||
p6eval | nom f9d635: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&a' called (line 1)» | ||
Radvendii | nom: say ('a' ^^ 0) | ||
p6eval | nom f9d635: OUTPUT«a» | ||
23:46
molaf left,
bbkr1 left,
colomon left
|
|||
Radvendii | nom: 4 ...^ 4 | 23:47 | |
p6eval | nom f9d635: ( no output ) | ||
Radvendii | nom: say 4 ...^ 4 | ||
p6eval | nom f9d635: OUTPUT«» | ||
Radvendii | nom: say qx[pwd] | ||
p6eval | nom f9d635: OUTPUT«qx, qqx is disallowed in safe mode in sub restricted at src/SAFE.setting:2 in sub QX at src/SAFE.setting:9 in block <anon> at /tmp/wiLcIEXBe3:1 in <anon> at /tmp/wiLcIEXBe3:1» | ||
Radvendii | figured :P | 23:48 | |
nom: say one(5,0) | 23:49 | ||
p6eval | nom f9d635: OUTPUT«one(5, 0)» | ||
Radvendii | nom: say +one(5,0) | ||
p6eval | nom f9d635: OUTPUT«one(5, 0)» | ||
Radvendii | nom: say ?one(5,0) | ||
p6eval | nom f9d635: OUTPUT«Bool::True» | ||
Radvendii | nom: say =one(5,0) | ||
p6eval | nom f9d635: OUTPUT«===SORRY!===Preceding context expects a term, but found infix = instead at line 1, near "one(5,0)"» | ||
Radvendii | nom: say -one(5,0) | ||
p6eval | nom f9d635: OUTPUT«one(-5, 0)» | ||
Radvendii | nom: say -(1,2,3) | ||
p6eval | nom f9d635: OUTPUT«-3» | 23:50 | |
Radvendii | nom: say -« (1,2,3) | ||
p6eval | nom f9d635: OUTPUT«-1 -2 -3» | ||
Radvendii | Woah! | 23:53 | |
23:53
bbkr1 joined
|
|||
Radvendii | nom: say ?(one(0,0) !== 0) | 23:53 | |
p6eval | nom f9d635: OUTPUT«Bool::True» | ||
23:53
baest_ joined
|
|||
Radvendii | uh | 23:53 | |
what?? | |||
nom: say ?(one(0,0) != 0) | |||
p6eval | nom f9d635: OUTPUT«Bool::False» | ||
Radvendii | so somehow !== is different from != | ||
and != is more correct | 23:54 | ||
23:55
baest left
23:56
molaf joined
|
|||
Radvendii | o-oh | 23:57 | |
is it that $a !== $b is the same as !($a == $b) | |||
i think that's it | |||
i dont know if that's good in this case... |