»ö« 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. |
|||
Timbus | nom: say ?(one(0,0) == 0) | 00:00 | |
p6eval | nom f9d635: OUTPUT«Bool::False» | ||
Timbus | nom: say ?(one(0,0) != 0) | ||
p6eval | nom f9d635: OUTPUT«Bool::False» | ||
Timbus | and this is the correct answer? | ||
uh | |||
00:00
colomon joined
|
|||
Radvendii | yes | 00:03 | |
because one(0,0) == 0 means one(0==0,0==0) | |||
and one(0,0) != 0 means one(0!=0,0!=0) | 00:04 | ||
both evaluate to false | |||
it's one of those things to watch out for, that 0 != 0^0 is not the same as !(0==0^0) | 00:05 | ||
Timbus | i guess i was getting hung up more on the contrived construct more than anything. im sure theres a more likely case where its a problem | 00:09 | |
[Coke] | "I know, I'll use Junctions!" | ||
Radvendii | [Coke]: are you saying that about yourself, or quoting it... | 00:10 | |
Timbus | if you have a problem and think, 'hey maybe i should use threads', you now have two problems. if you have a problem and think 'hey maybe i should use junctions', you now have 1|2 problems | 00:11 | |
Radvendii | nice | ||
nom: 5 «,» () # this dies rather ungracefully | 00:13 | ||
p6eval | nom f9d635: OUTPUT«(timeout)» | ||
Radvendii | why not just return an empty list? | 00:14 | |
Timbus | technically didn't die :v | ||
Radvendii | :P even less graceful | ||
nom: say 5 Z, () | 00:16 | ||
p6eval | nom f9d635: OUTPUT«» | ||
Radvendii | oh, because 5 «,» () tries to repeat () until it has one element in it | 00:17 | |
which it never will | |||
nom: say ("ab" | "a").chars | 00:19 | ||
p6eval | nom f9d635: OUTPUT«any(2, 1)» | ||
Radvendii | sweet | ||
00:20
PacoAir left
|
|||
Radvendii | niecza: say ?(0^0 !== 0) | 00:23 | |
p6eval | niecza v13-352-g6694950: OUTPUT«Bool::True» | ||
00:36
Chillance left
|
|||
Radvendii | nom: say (<a b c> Z... <d e f>)[0] | 00:36 | |
p6eval | nom f9d635: OUTPUT«a» | ||
Radvendii | nom: .say for (<a b c> Z... <d e f>) | 00:37 | |
p6eval | nom f9d635: OUTPUT«abcdbcdecdef» | ||
Radvendii | it doesn't split them into separate sublists... | ||
00:40
lestrrat left
|
|||
colomon | std: .say for (<a b c> Z... <d e f>) | 00:40 | |
p6eval | std 47c76b3: OUTPUT«ok 00:01 110m» | ||
00:40
lestrrat joined
|
|||
Radvendii | niecza: .say for (<a b c> Z... <d e f>) | 00:43 | |
p6eval | niecza v13-352-g6694950: OUTPUT«abcdbcdecdef» | ||
Radvendii | &[Z...]([1,2,3],[4,5,6]) | 00:44 | |
nom: say &[Z...]([1,2,3],[4,5,6]) | |||
p6eval | nom f9d635: OUTPUT«Could not find sub &infix:<Z...> in block <anon> at /tmp/jUeKFWcjAl:1 in <anon> at /tmp/jUeKFWcjAl:1» | 00:45 | |
Radvendii | nom: say &[Z](&[...],[1,2,3],[4,5,6]) | ||
p6eval | nom f9d635: OUTPUT«infix:<...> 1 4» | ||
Radvendii | nom: say &[Z]...([1,2,3],[4,5,6]) | ||
p6eval | nom f9d635: OUTPUT«(timeout)» | ||
Radvendii | nom: say &[Z[...]]([1,2,3],[4,5,6]) | ||
p6eval | nom f9d635: OUTPUT«Could not find sub &infix:<Z[...]> in block <anon> at /tmp/7Bd803C0rz:1 in <anon> at /tmp/7Bd803C0rz:1» | ||
Radvendii | nom: say &[Z&[...]]([1,2,3],[4,5,6]) | 00:46 | |
p6eval | nom f9d635: OUTPUT«===SORRY!===Unable to parse variable, couldn't find final ']' at line 2» | ||
timotimo | can i do anything with Mu? | ||
Radvendii | nom: say &[«,»]([1,2,3],[4,5,6]) | ||
p6eval | nom f9d635: OUTPUT«Could not find sub &infix:<«,»> in block <anon> at /tmp/xfzE538N2Q:1 in <anon> at /tmp/xfzE538N2Q:1» | ||
Radvendii | timotimo: what do you mean "do anything with"? | ||
is there any way to use meta-ops as prefixes? | 00:47 | ||
timotimo | Radvendii: i dunno. call it, instantiate it, derive from it, use it as a role, i have no idea. i don't even know what it is | 00:54 | |
00:55
molaf_ joined
00:58
molaf left
01:02
pmurias left
|
|||
sorear | good * #perl6 | 01:06 | |
timotimo | what's the difference between /foo|bar/ and /foo||bar/? | 01:07 | |
sorear | none | 01:09 | |
Radvendii | timotimo: @your earlier question, Mu is a class, from which everything else comes. so an Int is also a Mu, as is a Junction | 01:10 | |
nom: my $i; say $i.WHAT | |||
p6eval | nom f9d635: OUTPUT«Any()» | ||
Radvendii | hm... | 01:11 | |
nom: my $i = 'a' | 'b'; say $i.WHAT | |||
p6eval | nom f9d635: OUTPUT«Junction()» | ||
01:11
lichtkind left
|
|||
timotimo | :) | 01:13 | |
i'm kind of missing the simple introspection that i'm used to from python. is there some equivalent to the help function or dir function that list all methods of an object? | 01:14 | ||
sorear | nom: say 5.^methods | 01:15 | |
p6eval | nom f9d635: OUTPUT«Int Num Rat abs Bridge chr succ pred sqrt base floor round ceiling WHICH perl Bool Str Rat abs sign conjugate sqrt sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh asinh cosh acosh tanh atanh sech asech cosech acosech cotanh acotanh floor ceili… | ||
timotimo | any way to get at the documentation? i hear POD is pretty awesome, so it would be sensible to be able to introspect it? | 01:16 | |
or maybe i'm just too spoiled by pythons docstrings ;) | 01:19 | ||
01:21
bkolera left
|
|||
sorear | you can introspect POD | 01:21 | |
I don't think there's any POD in the setting though | |||
timotimo | "setting"? | 01:22 | |
bbl | 01:24 | ||
dalek | ecza: 931be35 | sorear++ | src/ (2 files): Import latest STD changes, various tweaks to make my \term:<∞> work... |
01:25 | |
ecza: dceb6f3 | sorear++ | lib/CORE.setting: Consistantly use \: in setting |
|||
01:27
arlinius left
01:29
replore joined
01:31
benabik joined
01:33
arlinius joined
01:36
bkolera joined
01:38
tokuhirom left,
rjbs left,
tokuhirom joined
01:40
replore left
01:42
tokuhirom left
|
|||
Radvendii | timotimo: yo | 01:43 | |
sorear | pmichaud: ping | 01:45 | |
[Coke] | aloha: seen pmichaud? | 01:46 | |
aloha | [Coke]: pmichaud was last seen in #perl6 5 hours 18 mins ago saying "afk again for a while... probably won't be back until tomorrow morning". | ||
sorear | mm | 01:47 | |
sorear makes ffffy noises because :D in signatures is broken *again* | |||
01:47
whiteknight joined
|
|||
Radvendii | aloha: seen [Coke]? | 01:53 | |
aloha | Radvendii: [Coke] was last seen in #perl6 6 mins 30 seconds ago saying "seen pmichaud?". | ||
Radvendii | woah... | ||
that's crazy | |||
sorear | what is? | ||
Radvendii | is that available on all channels? | ||
sorear | no | ||
Radvendii | aww... | ||
what else does aloha do? | 01:54 | ||
aloha: help | |||
aloha | Radvendii: Ask me for help about: seen, karma (say 'help <modulename>'). | ||
Radvendii | aloha: help panda | ||
aloha | Radvendii: I don't know anything about 'panda'. | ||
sorear | aloha's original reason was so that bacek could tab-complete his normal greeting | ||
Radvendii | haha | 01:55 | |
really? :P | |||
sorear | "panda" wasn't even on the list | ||
really | |||
Radvendii | aloha: help niecza | ||
aloha | Radvendii: I don't know anything about 'niecza'. | ||
sorear | what makes you think 'help niecza' will do anything? | ||
Radvendii | aloha: help karma | ||
aloha | Radvendii: Gives karma for or against a particular thing. Usage: <thing>++ # comment, <thing>-- # comment, karma <thing>, explain <thing>. | ||
Radvendii | i dont know... we're on the perl6 channel... | ||
sorear | 17:54 < aloha> Radvendii: Ask me for help about: seen, karma (say 'help <modulename>'). | 01:56 | |
Radvendii | o-oh | ||
i get it now | |||
wait, so karma doesn't work on all channels? i thought it was an IRC thing... | 01:57 | ||
[Coke] | no, you need a bot to track it. | ||
Radvendii | question: How does one apply a meta-operator on a list of two arguments? | 01:58 | |
besides doing @a[0] op @a[1] | |||
sorear | Radvendii: what do you mean by a "meta-operator"? | 01:59 | |
I think you may have a term wrong - meta-operators cannot be applied to arguments | |||
[Coke] | [op] @a ? | ||
sorear | meta-operators, like »«, can only be applied to other operators | ||
[Coke] | my @a = 1,2,3; say [+] @a; | ||
Radvendii | nom: say &[Z~]([<a b>],[<c d>]) | ||
p6eval | nom f9d635: OUTPUT«Could not find sub &infix:<Z~> in block <anon> at /tmp/H6G_tnuq2n:1 in <anon> at /tmp/H6G_tnuq2n:1» | ||
Radvendii | nom: say [Z~]([<a b>],[<c d>]) | 02:00 | |
p6eval | nom f9d635: OUTPUT«ac bd» | ||
Radvendii | oh | ||
i see | |||
that makes sense | |||
dalek | ecza: 253de26 | sorear++ | src/NieczaActions.pm6: Fix :D ...again |
02:04 | |
timotimo | sorear: what's "the setting"? (re: POD introspection) | 02:11 | |
flussence | the setting is all the code (default subs etc.) that gets loaded before your script does | 02:13 | |
02:17
tarski left
|
|||
timotimo | ah, like what is called Prelude in haskell? | 02:20 | |
sorear | sort of, yes | 02:41 | |
02:42
abercrombie left
02:43
abercrombie joined
02:44
wolfman2000 joined
02:50
jaldhar joined
|
|||
Radvendii | is there a way to force @a Z... @b to return a list of lists, or a list of references to lists? | 02:56 | |
02:58
whiteknight left
|
|||
Radvendii | nom: say ((1,2,3) Z (4,5,6)).map(&[...]) | 02:59 | |
p6eval | nom f9d635: OUTPUT«No applicable candidates found to dispatch to for 'infix:<...>'. Available candidates are::(Any $a, Any $b) in sub infix:<...> at src/gen/CORE.setting:8861 in method reify at src/gen/CORE.setting:4471 in method reify at src/gen/CORE.setting:4376 in method re… | ||
Radvendii | nom: say ((1,2,3) Z (4,5,6)).map: {[...]@$_} | ||
p6eval | nom f9d635: OUTPUT«No applicable candidates found to dispatch to for 'infix:<...>'. Available candidates are::(Any $a, Any $b) in sub infix:<...> at src/gen/CORE.setting:8861 in sub <anon> at src/gen/CORE.setting:9023 in block <anon> at /tmp/6hz8tkEA0X:1 in method reify at src… | ||
Radvendii | nom: say ((1,2,3) Z (4,5,6)).map: {$_[0] [...] $_[1]} | 03:00 | |
p6eval | nom f9d635: 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 sub infix:<cmp> at src/gen/CORE.setting:1218 in sub coro… | ||
Radvendii | nom: say ((1,2,3) Z (4,5,6)).map: {.say} | ||
p6eval | nom f9d635: OUTPUT«142536True True True True True True» | ||
Radvendii | oh. so Z in general flattens the lists... | 03:01 | |
nom: say ((1,2,3) »,« (4,5,6)).map: {.say} | 03:02 | ||
p6eval | nom f9d635: OUTPUT«142536True True True True True True» | ||
Radvendii | nom: say ((1,2,3) »,« (4,5,6)) | 03:03 | |
p6eval | nom f9d635: OUTPUT«1 4 2 5 3 6» | ||
Radvendii | nom: say ((1,2,3) »,« (4,5,6)).perl | ||
p6eval | nom f9d635: OUTPUT«((1, 4), (2, 5), (3, 6)).list» | ||
03:03
arlinius left
|
|||
Radvendii | so why doesn't .map loop over the first order list | 03:04 | |
? | |||
timotimo | nom: say ((1, 2, 3),) >>,<< ((4, 5, 6),) | 03:05 | |
like that? | |||
p6eval | nom f9d635: OUTPUT«1 4 2 5 3 6» | ||
Radvendii cocks an eyebrow | 03:06 | ||
as in, why, when i do @multidimensionallist.map: {.say} does it ignore the multi-dimensionality | 03:07 | ||
nom: (((1,2,3), ) »,« ((4,5,6), )).perl | |||
p6eval | nom f9d635: ( no output ) | ||
timotimo | hm, automatic flattening? | ||
Radvendii | yeah, that's what i thought. but it's kind of silly | 03:08 | |
timotimo | mhm | ||
Radvendii | for (<a b c>,<d e f>) {.say} | ||
nom: for (<a b c>,<d e f>) {.say} | 03:09 | ||
p6eval | nom f9d635: OUTPUT«abcdef» | ||
Radvendii | nom: for (<a b c>,<d e f>).list {.say} | ||
p6eval | nom f9d635: OUTPUT«abcdef» | ||
timotimo | ah | ||
i think i might see what the problem is | |||
when you say a multidim list, it will be flattened | |||
Radvendii | yeah? | ||
what do you mean? | 03:10 | ||
timotimo | nom: say ([[1, 2, 3], [4, 5, 6]] >>,<< [[9, 8, 7], [7, 8, 9]]).perl | ||
p6eval | nom f9d635: OUTPUT«([1, 9, 2, 8, 3, 7], [4, 7, 5, 8, 6, 9]).list» | ||
Radvendii | right. i know one can do it with references | ||
the problem is that @a Z @b returns something of the form ((a,b),(a,b)(a,b)) | |||
nom: say ((1,2,3) Z... (4,5,6)).perl | 03:11 | ||
p6eval | nom f9d635: OUTPUT«(1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5, 6).list» | ||
Radvendii | and Z... flattens it already | ||
timotimo | nom: say ([[1, 2, 3], [4, 5, 6]] Z [[9, 8, 7], [7, 8, 9]]).perl | ||
p6eval | nom f9d635: OUTPUT«(([1, 2, 3], [9, 8, 7]), ([4, 5, 6], [7, 8, 9])).list» | 03:12 | |
[Coke] | b: say 19409-19357; # 01/25/2012 - niecza at 100.26% | ||
timotimo | i'm confused | ||
p6eval | b 1b7dd1: OUTPUT«52» | ||
Radvendii | oh yeah | ||
that is confusing | |||
[Coke] | niecza has 20 new failures | ||
Radvendii | :-( | ||
timotimo | well, i don't know exactly what you want to end up with, also i just started with perl6 today :) | ||
Radvendii | oh, congratz! | 03:13 | |
welcome to the club | |||
it's lots of fun | |||
timotimo | hah, i can see how much fun you're having :)) | ||
03:13
am0c joined
|
|||
Radvendii | :P | 03:13 | |
at times it can be frustrating that things are NYI (not yet implimented), but overall it's a great language | |||
nom: (([1, 2, 3], [9, 8, 7]), ([4, 5, 6], [7, 8, 9])).list | 03:16 | ||
p6eval | nom f9d635: ( no output ) | ||
Radvendii | nom: say (([1, 2, 3], [9, 8, 7]), ([4, 5, 6], [7, 8, 9])).list | ||
p6eval | nom f9d635: OUTPUT«1 2 3 9 8 7 4 5 6 7 8 9» | ||
Radvendii | nom: say (([1, 2, 3], [9, 8, 7]), ([4, 5, 6], [7, 8, 9])).list.perl | ||
p6eval | nom f9d635: OUTPUT«(([1, 2, 3], [9, 8, 7]), ([4, 5, 6], [7, 8, 9])).list» | ||
Radvendii | nom: say (([1, 2, 3], [9, 8, 7]), ([4, 5, 6], [7, 8, 9])).list.map: {.say} | ||
p6eval | nom f9d635: OUTPUT«1 2 39 8 74 5 67 8 9True True True True» | ||
Radvendii | grrr | ||
stupid flattening | |||
nom: say ([[1, 2, 3], [4, 5, 6]] Z [[9, 8, 7], [7, 8, 9]]).map: {.say} | 03:17 | ||
p6eval | nom f9d635: OUTPUT«1 2 39 8 74 5 67 8 9True True True True» | ||
Radvendii | WHAT?? | ||
oh | |||
oops | |||
didn't see the Zip :P | |||
sorear | [Coke]: last time you posted a test_summary log, I was able to find the failing tests by grepping it for 'not ok' | 03:18 | |
Radvendii | nom: say ([[1, 2, 3], [4, 5, 6]], [[9, 8, 7], [7, 8, 9]]).map: {.say} | ||
p6eval | nom f9d635: OUTPUT«1 2 3 4 5 69 8 7 7 8 9True True» | ||
Radvendii | that's what it should be doing... | ||
nom: say ([[1, 2, 3], [4, 5, 6]], [[9, 8, 7], [7, 8, 9]]).perl | 03:19 | ||
p6eval | nom f9d635: OUTPUT«([[1, 2, 3], [4, 5, 6]], [[9, 8, 7], [7, 8, 9]])» | ||
[Coke] | updated feather.perl6.nl/~coke | ||
Radvendii | it's just the Zip operator that's flattening lists | ||
[Coke] | S02-types/bag.t, S04-declarations/state.niecza | ||
sorear wonders when it would be appropriate to update roast to use foo and |foo | 03:21 | ||
03:26
raiph joined,
orafu left
|
|||
Radvendii | std: [«,»]((1,2,3) Z... (4,5,6)) | 03:26 | |
p6eval | std 47c76b3: OUTPUT«ok 00:01 111m» | ||
Radvendii | nom: [«,»]((1,2,3) Z... (4,5,6)) | ||
p6eval | nom f9d635: OUTPUT«Nominal type check failed for parameter '$op'; expected Any but got Mu instead in sub METAOP_REDUCE at src/gen/CORE.setting:9009 in block <anon> at /tmp/abwdNl2Tc3:1 in <anon> at /tmp/abwdNl2Tc3:1» | ||
Radvendii | i dont see the problem... | 03:27 | |
03:28
orafu joined
|
|||
Radvendii | std: [Z,]((1,2,3) Z... (4,5,6)) | 03:28 | |
p6eval | std 47c76b3: OUTPUT«ok 00:01 111m» | ||
Radvendii | nom: [Z,]((1,2,3) Z... (4,5,6)) | ||
p6eval | nom f9d635: ( no output ) | ||
Radvendii | nom: say [Z,]((1,2,3) Z... (4,5,6)) | ||
p6eval | nom f9d635: OUTPUT«1 6» | ||
raiph | hi. i'm reading perl6/book; "Perl is community (perl5-porters, perl6-language)"; suggest s/perl6-language/#perl6/; maybe it's time for me to learn to use github | 03:29 | |
Radvendii | bye guys, I might be back later tonight or tomorrow | 03:30 | |
colomon | o/ | ||
Radvendii | o/ | ||
03:30
Radvendii left
|
|||
[Coke] | raiph: perl6-language is the mailing list. | 03:31 | |
[email@hidden.address] | 03:32 | ||
03:38
Psyche^ joined
03:39
zamolxes joined
03:42
Patterner left,
Psyche^ is now known as Patterner
|
|||
sorear | o/ colomon | 03:46 | |
colomon | \o | ||
how's it going? | |||
sorear | ok | 03:47 | |
raiph | [Coke]: right, but it doesn't seem to represent the community near as much as #perl6 | ||
sorear | [Coke] says that bag.t is failing all over | ||
colomon | really? it's fine here. | ||
colomon just did a spec test, failures are in lexical-array-in-inner-block.t, error-reporting.t, env.t, and state.t | 03:48 | ||
sorear | I'm looking at the state.t failures now | 03:49 | |
the others passed for [Coke] | |||
see feather.perl6.nl/~coke/niecza_summary.out | 03:50 | ||
colomon | hmmm.... my fudges aren't there in roast | 03:51 | |
dalek | ast: de474dc | (Solomon Foster)++ | S (4 files): Merge branch 'master' of github.com:perl6/roast |
03:52 | |
colomon | huh. don't know what's up with that being the only commit announced, but that got my fudging in there. | 03:53 | |
[Coke]: apologies for the slip-up. that's what I get for trying to do a quick patch before my whistle lesson. :) | 03:54 | ||
sorear | Whistle lesson? | ||
Util | nom: say ((1,2,3) Z (4,5,6)).map({[$^x, $^y]}).perl; | ||
p6eval | nom f9d635: OUTPUT«([1, 4], [2, 5], [3, 6]).list» | ||
Util | Radvendii: Is that what you were trying to do? | 03:55 | |
sorear | niecza: my ($x = 5) | 03:56 | |
p6eval | niecza v13-356-g253de26: OUTPUT«Potential difficulties: $x is declared but not used at /tmp/QhOhrGz9QM line 1:------> my ⏏($x = 5)» | ||
sorear | niecza: my ($x = 5); say $x | ||
p6eval | niecza v13-356-g253de26: OUTPUT«Any()» | ||
colomon | sorear: I skype with Gerry Strong from Newfoundland and pick up a couple of tunes from him once a month or so. personainternet.com/gstrong/ | ||
03:59
birdwindupbird joined
|
|||
colomon | 'night | 03:59 | |
sorear | 'night | 04:01 | |
[Coke] | colomon: no worries, we' | 04:03 | |
'll get them back in tomorrow's ru. | |||
n. | |||
*sheesh* | |||
dalek | ecza: 9374d97 | sorear++ | src/STD.pm6: Allow whitespace before state-variable initializers |
04:06 | |
sorear | phenny: tell TimToady RFC on github.com/sorear/niecza/commit/9374d970bf | ||
phenny | sorear: I'll pass that on when TimToady is around. | ||
04:09
lutok left
|
|||
sorear | [Coke]: I have a plan for WHICH/ObjAt now but it's enough different from Rakudo's ObjAt that you won't be able to just copy Temporal.WHICH | 04:42 | |
05:08
kcwu left
05:10
s1n left
05:13
kcwu joined
05:14
Khisanth left
05:34
Khisanth joined
05:37
koban joined,
koban left
|
|||
moritz | \o | 06:01 | |
phenny | moritz: 25 Jan 22:48Z <jnthn> 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. | ||
moritz | that's nasty :/ | 06:02 | |
06:09
birdwindupbird left
06:20
lestrrat left
06:21
lestrrat joined
|
|||
moritz | ah, i might have an idea what's going on | 06:31 | |
nqp's REPL method just prints ~$! | 06:33 | ||
but rakudo "hides" the error message in $!<payload>.message | 06:35 | ||
06:35
autark left
07:01
wtw joined
07:08
am0c left
07:18
lutok joined
07:23
benabik left
07:24
benabik joined
|
|||
dalek | kudo/nom: 2e1c5d1 | moritz++ | src/core/Exception.pm: fix printing of typed exceptions in the REPL |
07:32 | |
kudo/nom: 88c330c | moritz++ | src/ (2 files): throw X::Syntax::Name::NotNull from Grammar.pm |
|||
ast: 03faea7 | moritz++ | S32-exceptions/misc.t: X::Syntax::Name::NotNull |
|||
moritz | commute & | 07:33 | |
07:52
am0c^ joined
07:57
mj41 joined
08:05
nornagest left
|
|||
moritz | jnthn: fixed exception printing in the REPL, and made rakudo exceptions a bit more friendly for HLL interop | 08:06 | |
nom: class A { has Int $.id; }; class B is A { submethod BUILD ( :$!id = 10 ) { } }; B.new | |||
p6eval | nom 88c330: OUTPUT«===SORRY!===Attribute $!id not declared in class Bat /tmp/rWRXNc46HN:1» | ||
08:19
Trashlord left
08:23
baest_ is now known as baest
08:36
drbean left
08:38
drbean joined
09:09
baest left
09:12
am0c^ left
|
|||
jnthn | morning, #perl6 | 09:16 | |
moritz++ | |||
09:17
dakkar joined
09:18
baest joined
|
|||
jnthn | sorear: (update spectest for \ and | changes) I don't plan to leave it much longer before getting them in to Rakudo. Probably will have tuits at le weekend. | 09:21 | |
09:22
GlitchMr joined
09:26
robinsmidsrod left
09:32
robinsmidsrod joined
09:34
robinsmidsrod left
09:35
kshannon left,
robinsmidsrod joined
09:36
kshannon joined
|
|||
moritz | nqp: my %h; %h<a> := 'a'; %h<b> := 'x'; for %h -> $x { $x.value := nqp::uc($x.value) }; say %h<a> | 09:47 | |
p6eval | nqp: OUTPUT«rtype not setcurrent instr.: 'parrot;PCT;HLLCompiler;panic' pc 154 (compilers/pct/src/PCT/HLLCompiler.pir:111)» | ||
moritz | nqp: my %h; %h<a> := 'a'; %h<b> := 'x'; for %h -> $x { %h{$x.key} := nqp::uc($x.value) }; say(%h<a>) | ||
p6eval | nqp: OUTPUT«A» | ||
09:48
bacek joined,
grondilu joined
|
|||
grondilu | With rakudo I tried to create a module in ~/.perl6/lib, I run "use MyModule;" with no error, but then when I call a function MyModule::foo, I get a "could not find symbol MyModule::&foo". ?? | 09:50 | |
jnthn | grondilu: subs are lexically scoped by default | ||
moritz | grondilu: did you write 'our sub foo'? | 09:51 | |
grondilu | I tried 'our sub ...' with same result | ||
jnthn | grondilu: You need to explicitly label it "our sub ..." for that to work. Just just add "is export" to export it. | ||
grondilu: I assume your module has a declaration "module MyModule;" at the top or some such? | |||
moritz | grondilu: did you put it into a module MyModule { .. }? | ||
grondilu | I don't want to export it | ||
hang on | |||
moritz | jnthn: it seems we have the same ideas nearly at the same time | 09:52 | |
grondilu | pastebin.com/rJRey0pn is my Foo test module | ||
moritz | uhm, did you check that paste URL? | ||
grondilu | no | ||
moritz | it wants a captcha | ||
grondilu | hang on again | ||
09:53
raiph left
|
|||
jnthn | moritz: Are you thinking of having bacon for lunch also? ;) | 09:53 | |
grondilu | s0.barwen.ch/~grondilu/Foo.pm6 | ||
moritz | jnthn: I'm going to some canteen, so I don't have much choice | ||
grondilu | It's really basic: just module Foo; sub talk { say "hi" } | 09:54 | |
s/sub /our sub/ | 09:55 | ||
jnthn | moritz: Heh...seems out sharedthought just extends to Perl 6 things then :) | ||
grondilu | so? | ||
jnthn | > use Foo; Foo::talk() | ||
hi | |||
Hm, works here. | 09:56 | ||
grondilu | oh indeed | ||
jnthn | grondilu: I'd ask what Rakudo version you're using but... | ||
moritz | works here too | ||
jnthn | ...I can't imagine one in a while where this didn't work. :) But may as wel ask. | ||
grondilu | but why does it work only when the call is on the same line??? | ||
moritz | grondilu: are you in the REPL? | 09:57 | |
grondilu doesn't know what REPL is | |||
jnthn | oh, I see | ||
moritz | the interactive Read-Evaluate-Print-Loop | ||
grondilu | yes | ||
jnthn | moritz: If you do "use Foo" then hit enter then "Foo::talk()" then it is fail. | ||
grondilu is using "This is perl6 version 2012.01-24-g27a5dd3 built on parrot 3.11.0 revision RELEASE_3_11_0" | 09:58 | ||
this is a bug, right? | |||
moritz | grondilu: it's worth mentioning that in error reports, since the interactive env is less reliable then the "normal" compiler | ||
grondilu | ok | ||
jnthn | grondilu: Yes. It's specific to the interactive mode, it seems. | ||
moritz | jnthn: new GLOBAL for each line? | ||
jnthn | moritz: Yeah, precisely. I fixed eval to share the caller's GLOBAL recently, but guess the REPL needs fixing too. | 09:59 | |
grondilu | anyway I'll try to rely less on the REPL from now on. Thanks. | ||
rakudo: my int $n = 0; | 10:01 | ||
p6eval | rakudo 88c330: ( no output ) | ||
grondilu | rakudo: say my int $n = 0; | ||
p6eval | rakudo 88c330: OUTPUT«0» | ||
grondilu | this was an other thing that didn't work with REPL (native ints) | 10:02 | |
s/didn't/doesn't/ | |||
moritz | I know; there's a ticket for that | ||
grondilu | ok | ||
is there an equivalent to 'pack' with perl6 ? | 10:03 | ||
moritz | not yet; masak++ is occasionally working on that | ||
grondilu | ok, I'll wait | ||
jnthn | heh, masak++ is about to arrive at my place. I'll harrass him about it :D | 10:04 | |
moritz | nom: try eval 'class A { }; subset A of Str where *;'; say $!.WHAT | ||
p6eval | nom 88c330: OUTPUT«Exception()» | ||
moritz | nom: try eval 'class A { }; class A { }'; say $!.WHAT | 10:05 | |
p6eval | nom 88c330: OUTPUT«Exception()» | ||
moritz | nom: try eval 'sub A { }; sub A { }'; say $!.WHAT | ||
p6eval | nom 88c330: OUTPUT«X::Redeclaration()» | ||
grondilu | gotta go, keep on the good work guys :) | ||
10:05
grondilu left
|
|||
moritz | that's kind of a problem for testing | 10:05 | |
it'd be nice to have tests for those that are different codepaths | |||
but that's compiler dependent, of course | |||
jnthn | moritz: Earlier you added X::Syntax::Name::NotNull. But the problem is that the name *is* Null, not that it's not null :) | 10:06 | |
Wondering if just X::Syntax::Name::Null works better. | 10:07 | ||
moritz | jnthn: I noticed that I have some inconsistency in the naming, sometimes the error class describes the error, and sometimes how it should be instead | ||
jnthn | moritz: Yeah. I think I prefer describing the error. | ||
moritz | I should probably stick to the first class | ||
std: subset A; | 10:09 | ||
p6eval | std 47c76b3: OUTPUT«ok 00:01 107m» | ||
10:12
fasad joined
|
|||
dalek | kudo/nom: 16f7623 | moritz++ | src/Perl6/Grammar.pm: more typed redeclaration errors |
10:13 | |
fasad | i really like the "loop" keyword, does exactly what i mean, OTOH "last" it has potential for confusion, why was it chosen? (see strangelyconsistent.org/blog/june-4-2011-loops , masak needs to clear the confusion) | 10:18 | |
moritz | it makes the current iteration the last one | ||
10:19
tokuhirom joined
|
|||
fasad | no it does not make the current iteration the last one, i quote from the same page "it doesn't just mean "after we're finished with this round of the loop, we won't do any more". It really means "stop doing the loop right now, and continue after it"" | 10:20 | |
btw, it's the last but one paragraph | 10:24 | ||
masak | fasad: yes, it's confusing in that way. | 10:30 | |
fasad: that's why I felt the need to clarify it :) | 10:31 | ||
jnthn | Maybe we should call it "gtfo" | ||
masak | fasad: it helps knowing that all of those, next/redo/last, are immediate in effect. | ||
fasad: if you want some delayed effect, you're really looking for a phaser, like END or LAST. | |||
fasad | masak: "break" from C is unambiguous (?) | 10:36 | |
one can even think of it as break(out of the loop) | |||
10:36
abercrombie left
|
|||
masak | fasad: there's a reason next/redo/last are all 4 letters long. | 10:41 | |
('cus they're swearwords) :P | |||
it's because they line up nicely, and they're supposed to be short. | 10:42 | ||
break in C does too many things. in Perl 6 parlance, it does both "last" and "succeed". | |||
10:43
daxim joined
|
|||
masak | ("succeed" takes you out of a "when" block, Perl 6's variant of a "case" statement) | 10:45 | |
dalek | kudo/nom: 569f9d0 | moritz++ | src/ (3 files): rename exception classes jnthn++ noted some inconsistency. Now all the names describe the error condition (and not some how it should be) |
10:47 | |
ast: 4aeddd7 | moritz++ | S06-signature/errors.t: test for RT #109064 |
10:48 | ||
ast: a97dc2a | moritz++ | S32-exceptions/misc.t: track change of error class names; add some more redeclaration tests |
|||
11:04
Trashlord joined
|
|||
masak | fasad: I'm happy to hear you're reading the tutorial. let me know if other questions arise -- I'll gladly provide fixes/explanations. | 11:05 | |
11:20
tokuhirom left,
tokuhirom joined
11:24
tokuhirom left
|
|||
moritz | nom: say pir::perl6ize_type__PP(pir::set__PS('foo')) | 11:26 | |
p6eval | nom 569f9d: OUTPUT«Null PMC access in set_string_native() in block <anon> at /tmp/Mr4vzV41YS:1 in <anon> at /tmp/Mr4vzV41YS:1» | ||
moritz | nom: say pir::perl6ize_type__PP(Q:PIR { $S0 = 'foo'%r = box $s}) | 11:27 | |
p6eval | nom 569f9d: OUTPUT«use of uninitialized value of type Mu in string contextuse of uninitialized value of type Mu in string context===SORRY!===error:imcc:'$s' is not a valid register name in file '(file unknown)' line 39839790» | ||
moritz | nom: say pir::perl6ize_type__PP(Q:PIR { $S0 = 'foo'%r = box $S0}) | 11:28 | |
p6eval | nom 569f9d: OUTPUT«foo» | ||
11:29
mj41 left
|
|||
jnthn | moritz: pir::box__Ps('foo') # btw | 11:32 | |
11:45
mj41 joined
11:47
tokuhirom joined
11:51
tokuhirom left
11:52
Trashlord left,
tokuhir__ joined,
fasad left
11:56
tokuhir__ left,
birdwindupbird joined
11:59
fsergot joined
12:18
orafu left,
bkolera left,
DarthGandalf left
12:23
orafu joined,
bkolera joined,
DarthGandalf joined
|
|||
moritz | nqp: my $a; my $b; $a := nqp::isnull($b) ?? 'foo' !! 'bar; say($a) | 12:34 | |
p6eval | nqp: OUTPUT«Confused at line 1, near "$a := nqp:"current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)» | ||
moritz | nqp: my $a; my $b; $a := nqp::isnull($b) ?? 'foo' !! 'bar'; say($a) | ||
p6eval | nqp: OUTPUT«bar» | ||
moritz | locally I'm trying to do all the boxing to p6 types in method throw | 12:35 | |
so that I don't have to clutter up actions.pm and grammar.pm with the boxing | |||
now curiously, all the tests passed, but when I tried if some exceptions where still printed correctly, I got "Cannot assign a non-Perl 6 value to a Perl 6 container" | 12:36 | ||
the backtrace indicating that it came from $ex.new call inside throw | 12:37 | ||
fsergot | nom: class Abc { has $.name is rw; method create( Str $name ){ return self.new(:name($name)); } } | ||
p6eval | nom 569f9d: ( no output ) | ||
moritz | and it drove me mad; why do the tests still pass? | ||
then I noticed that when running from a file, I don't get an error. Running anything from -e failed | |||
(I mean, running from a file I got those error messages that I expected) | 12:38 | ||
fsergot | nom: class Abc { has $.name is rw; method create( Str $name ){ return self.new(:name($name)); } } my $abc = Abc.create('abc'); say $abc.name; | ||
p6eval | nom 569f9d: OUTPUT«===SORRY!===Confused at line 1, near "class Abc "» | ||
fsergot | nom: class Abc { has $.name is rw; method create( Str $name ){ return self.new(:name($name)); } } ; my $abc = Abc.create('abc'); say $abc.name; | ||
moritz | which mostly solves the mystery: I have probably messed up boxing the file name | ||
p6eval | nom 569f9d: OUTPUT«abc» | ||
moritz | I can't see where i messed it up, but at least it's a lead | ||
fsergot | nom: class Abc { has $!test is rw = 'test'; method new { callsame; say $!test; } } Abc.new; | 12:52 | |
p6eval | nom 569f9d: OUTPUT«===SORRY!===Confused at line 1, near "class Abc "» | ||
fsergot | nom: class Abc { has $!test is rw = 'test'; method new { callsame; say $!test; } }; Abc.new; | ||
p6eval | nom 569f9d: OUTPUT«Cannot look up attributes in a type object in method new at /tmp/rXxLeaVaDu:1 in block <anon> at /tmp/rXxLeaVaDu:1 in <anon> at /tmp/rXxLeaVaDu:1» | ||
fsergot | nom: class Abc { has $!test is rw = 'test'; method new { callsame; say $self!test; } }; Abc.new; | 12:53 | |
p6eval | nom 569f9d: OUTPUT«===SORRY!===Variable $self is not predeclared at line 1, near "!test; } }"» | ||
fsergot | How to use private variable in methods? :) | 12:54 | |
tadzik | new may be too early | ||
nom: class A { has $!a = "foo"; method b { $!a } }; A.new.b.say | 12:55 | ||
p6eval | nom 569f9d: OUTPUT«foo» | ||
masak | fsergot: method m { $!p } | ||
fsergot | Even if it has 'default' value? | ||
masak | what does that have to do with anything? | 12:56 | |
tadzik | fsergot: what are you trying to do? | 12:57 | |
fsergot | I want to make dir (using makedir() ) after. new.. And make thir dir in $!path. :) | 12:59 | |
s/makedir/mkdir/ | |||
12:59
jevenus joined
|
|||
tadzik | ah, my favourite "do something after new" problem :) | 13:01 | |
masak | usually goes in BUILD, no? | ||
fsergot | :) | ||
13:01
jevenus left
|
|||
tadzik | shh, or TimToady will shoult | 13:01 | |
I guess write your own new(), which does bless() and then do stuff | 13:02 | ||
moritz | well, BUILD does work | ||
13:03
bluescreen10 joined
|
|||
fsergot | gist.github.com/1682667 | 13:03 | |
What is the easiest way to solve this? :) | 13:04 | ||
masak | tadzik: the only thing TimToady doesn't want to do is repeat the error of Moose in that regard. | 13:05 | |
fsergot | Line 10 is problematic. :) | 13:06 | |
13:07
bacek left
13:38
shinobicl_ joined
|
|||
PerlJam | greetings! | 13:49 | |
flussence | speaking of Moose, yesterday I found out about its BUILDARGS method, which probably would've fixed that problem I had with a lack of simple way to have new() take positional args. | ||
13:58
Trashlord joined
|
|||
cosimo | masak: what's the problem with that? excuse my ignorance | 14:06 | |
masak | cosimo: I don't quite remember; I confess to not having grokked this issue 100% | 14:07 | |
TimToady usually talks about performance with this, though. | |||
cosimo: I bet you'll find loads if you grep for tadzik/BUILD in the IR clogs. | |||
14:10
raiph joined
14:11
benabik left
|
|||
raiph | hi. next/redo/last. the ambiguity of last has tricked me too. next/redo/done would wfm. | 14:15 | |
PerlJam | raiph: what abiguity? | 14:16 | |
raiph | PerlJam: s/ambiguity/misguidance/ | ||
PerlJam: last suggests your in the last time around the loop, but it really means done, now | 14:17 | ||
PerlJam | raiph: Ah, I see. | ||
I guess I'm just too used to Perl to notice that sublty | |||
raiph | it made me wonder once. i noticed fasad's comment earlier | 14:19 | |
flussence | .oO( whee, I just got Devel::Dwarn to hang on 5.14 and segfault on 5.12 at $dayjob... ) |
14:20 | |
14:20
mj41 left
|
|||
raiph | in www.modernperlbooks.com/mt/2011/08/ chromatic mentions "my list of requirements to use Rakudo for practical purposes" | 14:20 | |
links it to ttjjss.wordpress.com/2011/08/24/wha...comment-92 | 14:21 | ||
is Rakudo Star meant to meet those requirements? | 14:22 | ||
PerlJam | raiph: not quite. | 14:23 | |
flussence | (that Str.indent I wrote for rakudo-b seems to have passed all those tests :) | ||
raiph | PerlJam: is it meant to fully meet some of them, but not others? or not quite match up to any of them? or...? | 14:24 | |
PerlJam | raiph: it is and it isn't. R* is just meant to be something useful enough that people will use it, that it happens to meet any of chromatic's "requirements" is somewhat happenstance. | ||
flussence | perl6: say " a\n b\n c".indent(*).perl | 14:25 | |
raiph | PerlJam: so no commitments, might happen if all goes well from one R* to next? | ||
p6eval | pugs b927740: OUTPUT«*** No such method in class Str: "&indent" at /tmp/gJhsd5NP1y line 1, column 5 - line 2, column 1» | ||
..niecza v13-357-g9374d97: OUTPUT«"a\n b\n c"» | |||
..rakudo 569f9d: OUTPUT«Method 'indent' not found for invocant of class 'Str' in block <anon> at /tmp/dEh5o0I7qf:1 in <anon> at /tmp/dEh5o0I7qf:1» | |||
14:25
tokuhirom joined
|
|||
PerlJam | raiph: something like that. | 14:25 | |
raiph | PerlJam: thanks. that's what i thought. (perlmonks.org/?node_id=950041) | 14:26 | |
PerlJam | raiph: once R* has been vetted a little bit (there have been several releases and we've gotten some feedback about the pain points) chromatic's requirements will fall out naturally I think. | 14:28 | |
[Coke] | It's not like chromatic hangs out on channel or list to provide feedback on these things. | 14:29 | |
PerlJam | raiph: blah ... now you've got me looking at perlmonks again | 14:32 | |
raiph | PerlJam: sorry. it and i got ugly. | 14:34 | |
14:34
packetknife joined
|
|||
PerlJam | I can see that. | 14:34 | |
14:34
packetknife left,
mj41 joined
|
|||
PerlJam | I used to think that chromatic was chaotic-good or maybe chaotic-neutral, but now I'm not so sure anymore. | 14:35 | |
raiph | i wondered if r* could/should/would consider what it would take to meet chaotic-bad chromatic on some level | 14:37 | |
or rather, find the good bits among the bad moments | 14:38 | ||
14:38
jaldhar left
|
|||
PerlJam | chromatic says regarding speed optimizations, "Yes, and several of them I identified years ago. A few of them I volunteered to fix ages ago too, but they turned me down." | 14:42 | |
Does anyone know to what he is referring? | |||
(me take is that chromatic is conflating Rakudo and Parrot because I don't recall any such discussion wrt Rakudo, but I do remember some wrt Parrot) | 14:43 | ||
s/me/my/ | |||
14:48
PacoAir joined
|
|||
raiph | that's what i think he meant. i think he thinks changes like 6model were a mistake, an avoidable disastrous delay | 14:50 | |
PerlJam | raiph: only if we're omniscient or have perfect knowledge. | 14:51 | |
jnthn | Well, yeah, you can always avoid solving the real problems. :) | 14:53 | |
I don't think one has to be omniscient to know that ignoring deep issues will end nowhere good, though. | |||
raiph | jnthn: right. Whiteknight, current Parrot lead dev: "6model is far superior to what Parrot provides now" | 14:57 | |
[Coke] | eh. parrot has had a LOT of sunk costs. I think rakudo is going forward just fine with what parrot is providing now. | 14:59 | |
jnthn | If us Rakudo devs had perfect knowledge we'd have known to build 6model a couple of years before we did, known to factor the compiler as Grammar/Actions/World instead of just Grammar/Actions, and known which Parrot primitives were badly mis-matched and not even tried to build things on them in the first place, and known what better ones should replace them. I, for one, have far from perfect knowledge though. | ||
15:04
rsimoes left
15:05
fsergot left
|
|||
raiph | jnthn: right. action is art, knowledge science. | 15:06 | |
the science bit is that you can absolutely know if something's wrong, but not if it's right | |||
the art bit is you can know you've got to act to tear out mistakes, but not that anything you're currently doing may turn out to be a mistake | 15:07 | ||
15:07
tokuhirom left
|
|||
raiph | er. i know what i meant. ;) anyway, thanks for your explanations. bas. | 15:12 | |
jnthn | :) | 15:15 | |
Time for $dayjob evening event, back in a few hours & | 15:17 | ||
15:21
fasad joined
15:26
wtw left
|
|||
dalek | kudo/nom: 052cc6a | moritz++ | src/Perl6/ (3 files): moving boxing of error arguments to Perl6::World previously they were scattered all over Actions.pm and Grammar.pm, and annoyed me to no end. Now it happens centrally No visible functional changes. |
15:37 | |
15:38
shinobicl_ left
15:40
fsergot joined
|
|||
pmichaud | good morning, #perl6 | 15:44 | |
15:44
kaare_ joined
|
|||
moritz | good am, pm | 15:45 | |
nom: /<foo: 'positional', key => 'value'>/ | |||
p6eval | nom 569f9d: ( no output ) | ||
moritz | nqp: /<foo: 'positional', key => 'value'>/ | ||
p6eval | nqp: OUTPUT«regex assertion not terminated by angle bracket at line 1, near ", key => '"current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)» | ||
moritz | nqp: /<foo: 'positional', :key('value')/ | ||
p6eval | nqp: OUTPUT«regex assertion not terminated by angle bracket at line 1, near ", :key('va"current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)» | ||
moritz | that is inconvenient | 15:46 | |
15:53
arlinius joined
|
|||
PerlJam | pmichaud: greets! | 15:56 | |
15:58
fsergot left
15:59
benabik joined
|
|||
pmichaud | PerlJam: o/ | 16:02 | |
16:02
fasad left
16:16
shinobicl_ joined
16:17
zipf joined
16:19
zipf left
16:20
fsergot joined
16:21
GlitchMr left
16:25
GlitchMr joined
16:26
shinobicl_ left
16:43
fsergot left
16:45
mj41 left
16:53
Trashlord left
17:01
birdwindupbird left
17:03
wolfman2000 left
17:25
fsergot joined
17:28
shinobicl__ joined
|
|||
fsergot | how to check if file exists using .IO. ?::) | 17:38 | |
benabik | 'file'.IO.e | 17:39 | |
I think there's another way, but I don't recall it. | |||
PerlJam | stat is still an option isn't it? | 17:40 | |
(I mean calling stat directly) | |||
fsergot | benabin++ thanks | ||
benabik++ | |||
17:45
bluescreen10 left
|
|||
TimToady | hello phenny | 18:04 | |
phenny | Hey TimToady | ||
TimToady: 04:06Z <sorear> tell TimToady RFC on github.com/sorear/niecza/commit/9374d970bf | |||
TimToady | sorear: initializers are already endsym<ws> | ||
so the cleaner fix is to make dottyopish into a rule, I think | 18:09 | ||
(well, if we actually followed current sigspace spec, many tokens could turn into rules | |||
) | |||
18:10
bluescreen10 joined
18:11
jaldhar joined
18:12
dakkar left
|
|||
TimToady | actually, dottyopish doens't need a fix either, it already works since the EXPR parsing the declarator/initializer will eat any final space | 18:15 | |
I fooled myself by testing with "my $x .= 42 ;" which failed with an LTA error | 18:16 | ||
18:19
Trashlord joined
18:26
mj41 joined,
Radvendii joined
|
|||
Radvendii | how does one report errors in perl6? $! seems to be lexically scoped | 18:27 | |
nom: sub err {$!="testing"}; err; say $!; | 18:28 | ||
p6eval | nom 052cc6: OUTPUT«Any()» | ||
Radvendii | nom: sub err {$!="testing"; say $!}; err; say $!; | ||
p6eval | nom 052cc6: OUTPUT«testingAny()» | ||
Radvendii | mhmm | ||
so what to do? | |||
TimToady | generally, use 'fail' | ||
or 'die' if you are inclined to be violent | |||
Radvendii | nom: sub err {fail "testing";}; err; say $!; | 18:29 | |
p6eval | nom 052cc6: OUTPUT«Any()» | ||
doy | global flags are a particularly bad way to report errors | ||
benabik | $! is connected to the exception system | ||
Radvendii | TimToady: what does 'fail' do? | ||
benabik | nom: sub err { fail "testing"; }; say err | 18:30 | |
p6eval | nom 052cc6: OUTPUT«Failure.new(exception => Exception.new())» | ||
TimToady | returns an unthrown exception | ||
benabik | nom: sub err { fail "testing"; }; say ~err | ||
p6eval | nom 052cc6: OUTPUT«testing in method Str at src/gen/CORE.setting:7215 in method Stringy at src/gen/CORE.setting:678 in sub prefix:<~> at src/gen/CORE.setting:961 in block <anon> at /tmp/Gw4TU7S2td:1 in <anon> at /tmp/Gw4TU7S2td:1» | ||
TimToady | which is supposed to get thrown if you ignore it | ||
Radvendii | doy: it's not really errors, so much as information i need outside as to why i returned false... | ||
TimToady | nom: sub err {fail "testing";}; err // die "Exception: $!" | ||
p6eval | nom 052cc6: OUTPUT«===SORRY!===Null regex not allowed at line 1, near " die \"Exce"» | ||
doy | Radvendii: global flags are a bad choice for that too | ||
(: | |||
Radvendii | can i return different things depending on the context i call it in? | 18:31 | |
TimToady | nom: sub err {fail "testing";}; err() // die "Exception: $!" | ||
p6eval | nom 052cc6: OUTPUT«use of uninitialized value of type Any in string contextException:  in block <anon> at /tmp/O9tenxTTgd:1 in <anon> at /tmp/O9tenxTTgd:1» | ||
TimToady | that seems like a bug | ||
Radvendii | oh! | 18:32 | |
i now | |||
know* | |||
i'll return "string blah blah" but False | |||
:D | |||
TimToady | I believe that would be classified as a hack :) | ||
Radvendii | wait... is that a good thing or a bad thing? | 18:33 | |
TimToady | s/or/and/ | ||
Radvendii | :P | ||
how so? | |||
doy | it's good that you are able to do it, it's bad that you think you need to(: | ||
Radvendii | nom: say ?(True but False) #just curious... | 18:34 | |
p6eval | nom 052cc6: OUTPUT«Bool::True» | ||
TimToady | and lying to other parts of your program is usually a code smell | ||
Radvendii | what do you mean lying? | ||
won | |||
if i call the function in string context, it'll return the string, and in Bool context, it'll return False | 18:35 | ||
doy | Radvendii: why are you not using exceptions? | ||
Radvendii | because it's not an error... | ||
it's a method that returns whether a move is legal or not, and I want to also return _why_ the move wasn't legal | 18:36 | ||
doy | why not just do that then? | ||
you're allowed to return multiple things from a function | |||
Radvendii | you are? | ||
doesn't return exit the subroutine? | 18:37 | ||
TimToady | doy means you can return a list | ||
doy | yeah, that | ||
TimToady | return 1,2 | ||
Radvendii | oh... but isn't this exactly what 'but' is for? | ||
TimToady | but is for lying | ||
Radvendii | how so... | ||
TimToady | it's a form of deceit | 18:38 | |
doy | it makes things more confusing | ||
Radvendii cocks an eyebrow | |||
TimToady | in general, mixins are kind of a bad idea if there's a better compile-time way to do the same thing | 18:39 | |
doy | you have to know you're receiving this special thing that does different things in string and boolean context | ||
TimToady | fail is supposed to be able to return interesting values of undef | ||
Radvendii | right... just like you would have to know you're recieving a list that contains a boolean and a string... | ||
doy | and you end up making mistakes like "my $err = $ret; ... <somewhere later in the code>; if ($err) { print $err }" and then get confused as to why it doesn't work | 18:40 | |
TimToady | the Failure type is already there to communicate failure plus why | ||
doy | you're breaking assumptions that people will be making without thinking about them | ||
which is a useful thing to be able to do when necessary, but really should be avoided if not | |||
18:40
pmurias joined
|
|||
pmurias | sorear: hi | 18:40 | |
Radvendii | okay... | 18:41 | |
how do i handle the exception once it's thrown? | |||
TimToady | mixins are like eval or BEGIN that way; these are 'big cannons' that let you swat a fly with an asteroid | ||
Radvendii | (from 'fail') | ||
TimToady | fail doesn't throw; use die to force a throw | 18:42 | |
doy | what's wrong with returning a list (or a Failure object)? | ||
if it's not an error, those seem like better options | |||
Radvendii | i just do: Failure.new("err_message") ? | ||
nom: say ~Failure.new("test") | 18:43 | ||
TimToady | you handle exceptions with try {...} or with a CATCH block | ||
p6eval | nom 052cc6: OUTPUT«Method 'throw' not found for invocant of class 'Str' in method Str at src/gen/CORE.setting:7215 in method Stringy at src/gen/CORE.setting:678 in sub prefix:<~> at src/gen/CORE.setting:961 in block <anon> at /tmp/KpRLKU5fEC:1 in <anon> at /tmp/KpRLKU5fEC:1»… | ||
TimToady | you handle failure (unthrown exception) by testing for definedness | ||
18:44
birdwindupbird joined
|
|||
Radvendii | huh? | 18:44 | |
im having a hard time working in the abstract, which sNUM is this in? | |||
TimToady | Failure is in many S's; grep is your friend | 18:45 | |
biab | 18:46 | ||
18:48
mj41 left
|
|||
cognominal | jnthn, thx for opening my eyes. Reading zavolaj and sixmodel code, I understand that messing with specialized array pmc would be a bad idea. | 18:50 | |
*specialized parrot array pmcs | |||
Radvendii | nom: say ?"test" #strings evaluate to... | 18:53 | |
p6eval | nom 052cc6: OUTPUT«Bool::True» | ||
Radvendii | nom: say ?"" #strings evaluate to... | ||
p6eval | nom 052cc6: OUTPUT«Bool::False» | ||
18:54
Chillance joined
|
|||
Radvendii | nom: say +(False but 5) ##Is this a bug?? | 18:56 | |
p6eval | nom 052cc6: OUTPUT«0» | ||
benabik | nom: say +(False but Int(5)) | 18:57 | |
p6eval | nom 052cc6: OUTPUT«Can only supply an initialization value for a role if it has a single public attribute in sub infix:<but> at src/gen/CORE.setting:8757 in block <anon> at /tmp/k_wRRhko1r:1 in <anon> at /tmp/k_wRRhko1r:1» | ||
benabik | Oh. Hm. | ||
I think but isn't fully implemented. I think it can mix-in roles, but not values. | |||
Radvendii | oh... | 18:58 | |
and 'but False' automatically makes a role with .BOOL returning Fals? | |||
False* | |||
benabik | I think it's suppose to? | ||
nom: say +(False but role { method Numeric { 5 } }) | 18:59 | ||
p6eval | nom 052cc6: OUTPUT«5» | ||
benabik | nom: say +(False but role { method Int { 5 } }) | ||
p6eval | nom 052cc6: OUTPUT«0» | ||
Radvendii | weird... | 19:00 | |
nom: say +(False but +(5)) | 19:01 | ||
p6eval | nom 052cc6: OUTPUT«0» | ||
Radvendii | nom: say +(False but 5.0) ##maybe with decimals? | ||
p6eval | nom 052cc6: OUTPUT«0» | ||
Radvendii | ##nope | ||
what about big numbers... those are 'Numeric' right? | 19:02 | ||
nom: say +(False but 1233543534634534) ## big numbers | |||
p6eval | nom 052cc6: OUTPUT«0» | ||
Radvendii | :P | ||
cognominal | nom: say +(False but 5) | ||
benabik | Ahh.... | ||
p6eval | nom 052cc6: OUTPUT«0» | ||
benabik | nom: say (False but 5).Int | ||
p6eval | nom 052cc6: OUTPUT«5» | ||
Radvendii | it's a problem with + not calling int | 19:03 | |
nom: say +(False but sqrt(5)) | |||
p6eval | nom 052cc6: OUTPUT«0» | ||
benabik | Yes. + looks for Numeric, which is a roll that Int, Num, etc implement. | ||
*role | |||
Radvendii | And Int's Numeric isn't returning the right value... | 19:04 | |
benabik | Bool has a .Numeric already, and the mixin isn't overriding it. | ||
Radvendii | ooooh | ||
right | |||
benabik | The mixing only overrides Int. | ||
Radvendii | I understand... | 19:05 | |
benabik | Which is interesting. Perhaps value mixin should override conversions for all roles that the mixed in value does but the original value doesn't. | ||
colomon | what should happen if you say +(5.0 but 6)? | 19:06 | |
benabik | In that scheme, 5.0 is already Numeric, so it would be 5.0... | ||
Radvendii cries | |||
colomon | nom: say Bool ~~ Numeric | 19:07 | |
Radvendii | who would do 5.0 but 6? | ||
p6eval | nom 052cc6: OUTPUT«Bool::False» | ||
Radvendii | say defined Bool.Numeric | ||
nom: say defined Bool.Numeric | |||
p6eval | nom 052cc6: OUTPUT«use of uninitialized value of type Bool in numeric contextBool::True» | ||
colomon | Who would do False but 5? ;) | ||
benabik | Oh. 5.0 isn't Numeric? | ||
Radvendii | colomon: well, that makes more sense, at least it's two different categories... | 19:08 | |
colomon | 5.0 is Numeric. According to spec, Bool is too | ||
benabik | nom: say Numeric ~~ 5.0.WHAT | ||
p6eval | nom 052cc6: OUTPUT«Bool::False» | 19:09 | |
[Coke] | nom: my $a="three" but "four"; say $a; | ||
p6eval | nom 052cc6: OUTPUT«three» | ||
[Coke] | nom: my $a="three" but "four"; say ~$a; | ||
p6eval | nom 052cc6: OUTPUT«three» | ||
[Coke] gives up. ;) | |||
benabik | but $value is a strange strange thing. | 19:10 | |
[Coke] wonders how much nicer nqp is than npq-rx | 19:11 | ||
Radvendii | npq? | ||
[Coke] | (and if it is worth switching partcl-nqp to use it insted) | ||
typo | |||
benabik | [Coke]: nqp has 6model and dyncall and a lot of framework that Rakudo uses, but the rest of Parrot uses. | 19:12 | |
*Parrot doesn't | |||
(That said, I find many of the things nqp added very interesting and probably useful. But they haven't been stolen back yet, which makes interaction interesting.) | |||
19:15
rsimoes joined
|
|||
Radvendii | nom: my $a = {say "test"}; $a(); | 19:18 | |
p6eval | nom 052cc6: OUTPUT«test» | ||
[Coke] | benabik: most of partcl-nqp is just nqp. There's as little PIR as I can get away with. | 19:19 | |
Radvendii | nom: my %a = {b => "b", c => (%a{b} ~ 'c')}; say %a<c> | ||
p6eval | nom 052cc6: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&b' called (lines 1, 1)» | ||
Radvendii | nom: my %a = {b => "b", c => (%a<b> ~ 'c')}; say %a<c> | 19:20 | |
p6eval | nom 052cc6: OUTPUT«use of uninitialized value of type Any in string contextc» | ||
benabik | [Coke]: NQP builds 6model objects. If you try to interact with non-6model parrot, it can be interesting. | ||
Radvendii | nom: my %a = {b => "b", c => {%a<b> ~ 'c'}}; say %a<c> | ||
p6eval | nom 052cc6: OUTPUT«Block.new()» | ||
Radvendii | nom: my %a = {b => "b", c => {%a<b> ~ 'c'}}; say %a<c>.eval | ||
p6eval | nom 052cc6: OUTPUT«Method 'eval' not found for invocant of class 'Block' in block <anon> at /tmp/Dr0eJoJ32k:1 in <anon> at /tmp/Dr0eJoJ32k:1» | ||
[Coke] | benabik: interacting with other things on parrot has never been stable, so that's not really an issue for me. | ||
Radvendii | nom: my %a = {b => "b", c => {%a<b> ~ 'c'}}; say %a<c>.try | ||
p6eval | nom 052cc6: OUTPUT«Method 'try' not found for invocant of class 'Block' in block <anon> at /tmp/5_iS2nVOAd:1 in <anon> at /tmp/5_iS2nVOAd:1» | ||
benabik | [Coke]: Fair enough. | 19:21 | |
[Coke] | it worked briefly thanks to... Tene? but it's not something that is regularly tested. at this point I'd be happy to be able to interact with rakudo, so that's fine. | ||
19:22
Transformer joined
19:24
Transformer left
|
|||
Radvendii | does "shaped variable declarations" (e.g. %{$b}) mean that there will be a hash named with whatever is inside $b? | 19:24 | |
Tene | [Coke]: I'm very sad about what happened with parrot hll interop. :( | 19:27 | |
19:31
spine joined
19:32
daxim left
19:41
pyrimidine joined
|
|||
[Coke] | Tene: me too. sorry. :( | 19:54 | |
[Coke] notes that nqp is not a drop in replacement for parrot-nqp | |||
any pointers on doing that cutover? | 19:56 | ||
moritz | at first glance, the two are pretty similar | 19:58 | |
nqp has a bit stricter parsing rules | |||
[Coke] | no HLL::Actions or HLL::Compiler, e.g. | ||
moritz | but if you don't emit 6modelish code, you don't have to use it much | ||
20:03
bluescreen10 left,
bluescreen10 joined
|
|||
pmichaud | nqp can have HLL::Actions and HLL::Compiler; you just have to be sure to "import" them, I think. | 20:03 | |
diakopter | ! | 20:04 | |
[Coke] | (this is the file I'm trying to update) github.com/partcl/partcl-nqp/blob/...Actions.pm | ||
pmichaud | certainly NQP uses HLL::Actions and HLL::Compiler | ||
[Coke] tries the import. | |||
pmichaud | see src/NQP/Actions.pm and src/NQP/Compiler.pm | ||
I'm not sure that NQP supports the semi-colon-terminated declaration form anymore | 20:05 | ||
might need curlies | |||
(or that might not be the problem) | |||
[Coke] | pmichaud: there's no import in src/NQP/Actions.pm | 20:06 | |
pmichaud | [Coke]: yeah, I just noticed that; so perhaps I'm mis-thinking about that. | ||
(probably) | |||
still, it shows that NQP itself is able to make use of HLL:: stuff somehow | 20:07 | ||
rakudo does it also | |||
[Coke] | nqp: class Foo is HLL::Actions {} | 20:08 | |
p6eval | nqp: OUTPUT«Could not find parent class 'HLL::Actions' at line 1, near ""current instr.: 'nqp;HLL;Grammar;panic' pc 23433 (src/stage2/gen/NQPHLL.pir:6734) (src/stage2/gen/NQPHLL.pm:329)» | ||
[Coke] | nqp: use HLL::Actions; class Foo is HLL::Actions {} | ||
p6eval | nqp: OUTPUT«"load_bytecode" couldn't find file 'HLL/Actions.pbc'current instr.: 'nqp;ModuleLoader;_block1104' pc 2314 (src/stage2/gen/module_loader.pir:1073) (src/ModuleLoader.pm:63)» | ||
Radvendii | i thought i rememberd, but can't find, there was a syntax for anonymous arguments or the like. the way it worked was something like @a.map: {$b ~ $c} and the compiler would know that you want two variables out of @a. Was this just in my imagination? | ||
pmichaud | Radvendii: placeholder variables, perhaps/ | 20:09 | |
? | |||
Radvendii | i know i can just do @a.map: -> $b,$c {$b ~ $c}, im wondering if there's a way to implicitly declare that | ||
pmichaud | { $^b ~ $^c } | ||
Radvendii | pmichaud: what does that look like? | ||
ah | |||
yes | |||
that's what i was missing | |||
thanks | |||
TimToady | -> [$a, $b] {...} | 20:10 | |
oh, you want them separate, nm | |||
Radvendii | but that's interesting... you can do patern matching in lambdas? | ||
pmichaud | Radvendii: yes. :-) | 20:11 | |
Radvendii | that's quite useful... | ||
pmichaud | [Coke]: src/NQP/World.pm does "use NQPP6Regex" | 20:12 | |
PerlJam | I know I asked this before, but I've since forgotten the answer ... does -> @foo[$a,$b] { ... } work to refer to the aggregate as @foo and the parts as $a and $b? | ||
[Coke] | nqp: use NQPP6Regex; class Foo is HLL::Actions {} | ||
p6eval | nqp: ( no output ) | ||
pmichaud | I think that brings in the HLL::* classes | ||
[Coke] | pmichaud: heh. I just found that. ;) | ||
pmichaud++ # thanks. | |||
TimToady | PerlJam: yes, but I would write it @foo [$a, $b] to make it clear it isn't subscripting | 20:13 | |
PerlJam | aye. good point. | ||
Radvendii | indeed, that confused me, | ||
nom: my $1 # numerical variables? | 20:14 | ||
p6eval | nom 052cc6: OUTPUT«===SORRY!===Cannot declare a numeric variable at line 1, near " # numeric"» | ||
Radvendii | D-: | ||
why not? | |||
colomon | std: my $1 | 20:15 | |
p6eval | std 47c76b3: OUTPUT«===SORRY!===Cannot declare a numeric variable at /tmp/Hl_YxxMVOn line 1:------> my $1⏏<EOL>Parse failedFAILED 00:01 108m» | ||
TimToady | $1 really means $/[1] | ||
Radvendii | oh right... | ||
std: my $1a | |||
p6eval | std 47c76b3: OUTPUT«===SORRY!===Cannot declare a numeric variable at /tmp/OcV5P40LHN line 1:------> my $1⏏aParse failedFAILED 00:01 108m» | ||
Radvendii | so it can't even start with a number eh? | 20:16 | |
TimToady | illegal identifier in any case | ||
std: $1a | 20:17 | ||
p6eval | std 47c76b3: OUTPUT«===SORRY!===Whitespace is required between alphanumeric tokens at /tmp/LnBf5lLTye line 1:------> $1⏏aTwo terms in a row at /tmp/LnBf5lLTye line 1:------> $1⏏a expecting any of: POST bracketed infix in… | ||
Radvendii | TimToady: Eh... it's resonable not to allow numbers at the beginning of variables, chances are you're making a mistake | 20:18 | |
TimToady | we don't allow them after - or ' either | ||
std: my $foo-bar; # ok | |||
p6eval | std 47c76b3: OUTPUT«ok 00:01 108m» | ||
TimToady | std: my $foo-1st; # not ok | 20:19 | |
p6eval | std 47c76b3: OUTPUT«===SORRY!===Whitespace is required between alphanumeric tokens at /tmp/bOZbmtTzc0 line 1:------> my $foo-1⏏st; # not okTwo terms in a row at /tmp/bOZbmtTzc0 line 1:------> my $foo-1⏏st; # not ok expectin… | ||
TimToady | it took it as $foo - 1st | ||
Radvendii | oh... | ||
that makes some sense | |||
TimToady | well $foo - 1 plus garbage | ||
Radvendii | nom: sub a-b {}; a_b(); #i've been curious... | 20:20 | |
p6eval | nom 052cc6: OUTPUT«===SORRY!===CHECK FAILED:Undefined routine '&a_b' called (line 1)» | ||
TimToady | we subtly discourge the use of variable names for indexing :) | ||
Radvendii | resonable, that's what arrays are for | ||
but how come sometimes people refer to at_pos and sometimes at-pos? | |||
TimToady | no, we don't canonicalize anything that is visually distinctive, and we're not sure about NFC vs NFD :) | ||
maybe rakudo and niecza have it different? | 20:21 | ||
Radvendii | NFC? NFD? | ||
TimToady | those functions are not part of the spec | ||
Radvendii | oh... that would be weird | ||
TimToady | Unicode normalization forms | ||
pmichaud | not *yet* part of the spec :) | ||
(we need to decide what part of the spec provides them :) | 20:22 | ||
benabik | Presumably it should actually be AT_POS, like most of the other magic methods. | ||
TimToady | anything both implementations agree on, and will not adversely affect future implementations, is fair game for the spec, if it's really a language-level issue | ||
20:23
ksi joined
|
|||
TimToady | pmichaud: I'd think this is S09 territory | 20:23 | |
pmichaud | could be S07 also | ||
(since S07 covers lists) | |||
TimToady | you guys might accidentally have implemented part of S09 already :P | ||
Radvendii | nom: $a=[<a b>]; say $a.WHAT | 20:24 | |
p6eval | nom 052cc6: OUTPUT«===SORRY!===Variable $a is not predeclared at line 1, near "=[<a b>]; "» | ||
Radvendii | nom: my $a=[<a b>]; say $a.WHAT | ||
p6eval | nom 052cc6: OUTPUT«Array()» | ||
TimToady | speaking of which, I've been leaning towards making shape declarations dynamic like in Algol, on the assumption that the compiler can recognize constants and optimize shapes known at compile time | 20:25 | |
Radvendii | but it's a reference... | ||
moritz | Radvendii: everything is a reference... well, except the things that aren't | ||
benabik | nom: my $a=[<a b>]; say $a.WHAT; say $a[0].WHAT | ||
p6eval | nom 052cc6: OUTPUT«Array()Str()» | ||
Radvendii | right, i know you can use it as an array... never mind | 20:26 | |
nom: say ([«,»]((<a b> Z <d e>).map: {[$^a...$^b]})).perl | |||
p6eval | nom 052cc6: OUTPUT«Nominal type check failed for parameter '$op'; expected Any but got Mu instead in sub METAOP_REDUCE at src/gen/CORE.setting:9018 in block <anon> at /tmp/jISdQrB1gU:1 in <anon> at /tmp/jISdQrB1gU:1» | ||
Radvendii | why's that? | ||
moritz | Radvendii: perl6advent.wordpress.com/2011/12/1...nces-gone/ | ||
Radvendii | it works if i use s/[«,»]/[Z]/ | ||
moritz: :P @ title | 20:27 | ||
moritz | wtf is «,» supposed to do? | ||
benabik | Can you use [«op»]? | ||
moritz | std: [«+»] | 20:28 | |
p6eval | std 47c76b3: OUTPUT«===SORRY!===Prefix requires an argument at /tmp/tPbnMVB5b4 line 1 (EOF):------> [«+»]⏏<EOL>Parse failedFAILED 00:01 108m» | ||
moritz | std: [«+»] 1, 2 | ||
p6eval | std 47c76b3: OUTPUT«ok 00:01 109m» | ||
moritz | benabik: in principle, yes | ||
Radvendii | I'm using it because in my actual code i dont know which one is longer | 20:29 | |
like: | |||
TimToady | basically, any container that is not declared to hold a native type is a reference | ||
which means, if you think about it, that a reference is just the default native type | |||
moritz | Some people, when faced with a problem, think "oh, I could solve that with three nested levels of meta operators". | ||
[Coke] | moritz+++++++ | 20:30 | |
Radvendii | :P | ||
it really is the best solution though. | |||
idealy | |||
i would say Z... | |||
but that fails, because the list flattnes | 20:31 | ||
flattens* | |||
TimToady | unfortunately, the end of that is "Now they have {(0..4).pick} problesm" | ||
Radvendii | TimToady: that doesnt use any meta-ops... | ||
TimToady | it was a meta-utterance already | 20:32 | |
[Coke] | should nqp support -o <foo>? (right now it seems to require the =) | ||
TimToady | or perhaps meta-meta- | ||
Radvendii | look. i have two arrays with two values each (indicies in a grid) i want to get all of the spaces in between them (the trajectory). you tell me how to do it without three meta-ops | 20:33 | |
[Coke] | er, I lied. -o=foo fails, but -o foo also dumps to std. | ||
moritz | [Coke]: oh, one more thing. the new nqp sometimes doesn't like upper-case targets | 20:34 | |
[Coke]: ie --target=pir instead of PIR | |||
it's supposed to be the same, but there seem to be one or two places where an lc() is missing | 20:35 | ||
20:36
birdwindupbird left
|
|||
dalek | p: 173935c | moritz++ | src/HLL/Compiler.pm: missing downcase for %adverbs<target> |
20:37 | |
moritz | not anymore, hopefully :-) | ||
[Coke] | moritz: how about this regex: token barechar { <-[\\\[*+?^$]> } | 20:44 | |
(it dies in nqp, works in nqp-rx) | 20:45 | ||
moritz | nqp: token barechar { <-[\ß\[*+?^$]> } | 20:51 | |
p6eval | nqp: ( no output ) | ||
moritz | nqp: token barechar { <-[\\\[*+?^$]> } | ||
p6eval | nqp: ( no output ) | ||
[Coke] | if I uncomment it from my grammar, I get: | 20:52 | |
ResizablePMCArray: Can't shift from an empty array! | |||
current instr.: 'nqp;PAST;Regex;prefix_enumcharlist' pc 532 (src/PAST/Regex.pir: | |||
257) | |||
[Coke] will get things mostly working in a branch of partcl-nqp and push and then beg for help on the remaining broken bits, but not not. | 20:56 | ||
not now. | |||
20:57
apesma joined
|
|||
[Coke] | moritz++ pmichaud++ | 20:58 | |
20:58
Trashlord left
|
|||
Radvendii | where can i report bugs? i understand that it's not very important because it's very infrequent that one needs [«,»], but it's probably good to know that it's broken, no? | 20:58 | |
colomon | [email@hidden.address] for rakudo bugs. | 21:01 | |
but are you really certain it's a bug? It's not at all clear to me that [«op»] makes any sense | |||
Radvendii | well, the alternative is @a[0] «,» @a[1] which seems like exactly what [op] is for | 21:02 | |
colomon | github.com/sorear/niecza/issues for niecza bugs | 21:03 | |
Radvendii | niecza: say ([«,»]((<a b> Z <d e>).map: {[$^a...$^b]})).perl | ||
p6eval | niecza v13-357-g9374d97: OUTPUT«[$("a", "b"), $("b", "c"), $("c", "d"), $("d", "e")].list» | ||
Radvendii | bam. it can't be on purpose, niecza allows it. | 21:04 | |
21:04
MayDaniel joined
21:06
GlitchMr left
|
|||
jnthn back | 21:06 | ||
mmm...birthday beer :) | 21:07 | ||
pmichaud | oh yeah! Happy birthday! | ||
jnthn | ;) | ||
pmichaud | I even had that on my calendar, but haven't checked my calendar yet. | ||
jnthn | pmichaud: Thanks! :) | ||
Radvendii | \o/ party on #perl6 time \o. | ||
jnthn | (Yes, I consuemd some beers) | ||
*consumed # wow, evidently sufficient :P | |||
pmichaud: How's the Star configure stuff coming along? | 21:08 | ||
pmichaud | I worked on it some more this morning but got a little sidetracked. I should be able to get most of it done tonight, however. | ||
tadzik | happy birthday jnthn! | ||
jnthn | pmichaud: yay :) | ||
pmichaud: Tomorrow I'll have tuits, though Perl 6 has to compete with writing a bunch of talks for next week. Next week is a bit away, though. :) | 21:09 | ||
tadzik: :) | |||
flussence | hb o/ | ||
Radvendii | the niecza website says 2.6.7 fails on mac os x, 2.6.4 is fine, but it says nothing about 2.8.2 or 2.10 (which it recomends) | 21:11 | |
which do i download? | |||
jnthn | [Coke]: I didn't backlog in detail, but if you have parrot-nqp to nqp migration issues still, let me know. | ||
Radvendii | and by niecza website i mean github | ||
jnthn | [Coke]: It's much stricter about needing "use" statements - it actually does separate compilation. :) | ||
colomon | Radvendii: I'm using mono version 2.10.2 on OS X 10.6. | ||
Radvendii | colomon: sweet. | 21:12 | |
do i have to download mono somewher else? | |||
benabik | Radvendii: www.go-mono.com/mono-downloads/download.html | 21:14 | |
colomon | benabik++ just beat me to it. | ||
hmmm, I'm .6 versions behind now, I see. :) | |||
Radvendii | sorry guys... you don't have to do that, you could just say "yes" | ||
benabik | I'm using niecza v13-193-g3edf7eb on mono 2.10.8.1 | 21:15 | |
Radvendii: It's not a big deal. Finding URLs in browser history is rather fast. | |||
masak back | |||
[Coke] | jnthn: my current problem is this line: | 21:16 | |
github.com/partcl/partcl-nqp/blob/...mar.pm#L27 | |||
Radvendii | benabik: okay... Someone just told me at some point not to ask questions i could just look up, (which is totally resonable) | ||
[Coke] | (the rest of the file was updated for the needed "use", and changed the grammar to use curlies instead of a ; declaration. | 21:17 | |
jnthn++ | |||
benabik | Radvendii: It's generally nice to look something up first, but grabbing the URL isn't much slower than saying yes for me. :-) | ||
Radvendii | benabik: okay. | ||
jnthn | [Coke]: Yes, those were pretty much the only two changes Rakudo's grammar/actions needed. | 21:18 | |
[Coke]: How's it failing? I'm a bit surprised about a failure there since nqp master still uses the old regex engine. If it were using QRegex I'd not be so surprised... | 21:19 | ||
[Coke] | gist.github.com/1685180 | 21:20 | |
If I comment out that line, no error. | |||
21:20
MayDaniel left
|
|||
masak | today only 3 days remain until we close p6cc for submissions! | 21:20 | |
tadzik | aw, snap | ||
21:22
Trashlord joined
|
|||
Radvendii | i'm assuming p6cc is not a chinese website with sexually explicit material | 21:22 | |
tadzik | it is! | ||
Radvendii | yes, but i assume that's not what you're refering to? | ||
jnthn | nqp: grammar g { token barechar { <-[\\\[*+?^$]> } } | 21:23 | |
p6eval | nqp: OUTPUT«ResizablePMCArray: Can't shift from an empty array!current instr.: 'nqp;PAST;Regex;prefix_enumcharlist' pc 532 (src/PAST/Regex.pir:257)» | ||
tadzik | ...there is something like this, seriously? | ||
No, don't link to it | |||
jnthn | o.O | ||
Radvendii | it's just p6cc.com | ||
aaaanyways... | 21:24 | ||
what's p6cc as far as you're concerned? | |||
jnthn | Perl 6 Coding Contest :) | ||
Radvendii | oh | 21:25 | |
that would make more sense | |||
masak | jnthn: heh -- you never harassed me about &pack as you were supposed to, according to les logs ;) | ||
pmichaud | perhaps he was harassing you with silence | 21:26 | |
masak | wait, p6cc is a what website? o.O | ||
21:26
y3llow_ joined
21:27
pothos_ joined
|
|||
masak | I suddenly feel like I should've checked this before choosing an acronym... | 21:27 | |
benabik | Whenever naming a project, remember to google it. | 21:28 | |
(With safe search off.) | |||
21:28
y3llow left
|
|||
Radvendii | :P indeed | 21:28 | |
masak | I'll keep that in mind. | ||
21:29
pothos left,
y3llow_ left
|
|||
masak | still, there's 3 days remaining in our contest which doesn't have a lot of sexually explicit material in it at all. | 21:29 | |
21:29
y3llow joined
21:30
pothos_ left,
pothos joined
|
|||
Radvendii | i wish i'd heard of this earlier, nonetheless i'll get to trying them out at some point, for or not for the contest | 21:31 | |
21:32
y3llow left,
y3llow joined
21:33
pothos left,
pothos joined
|
|||
masak | yeah, it's a bit late to sign up for them this time around. | 21:33 | |
but there will be another one next Christmas, I'm sure ;) | |||
21:34
y3llow left
|
|||
Radvendii | colomon: I can't find the mac executable for Niecza... | 21:34 | |
(v13) | |||
21:34
y3llow joined
|
|||
colomon | Radvendii: there is no such thing. there's just a single executable | 21:34 | |
Radvendii | .exe? | 21:35 | |
colomon | yes | ||
benabik | mono run/Niecza.exe | ||
Radvendii | that'll run on a mac? | ||
oh | |||
i see | |||
colomon | mono run/Niezc.... what benabik said | ||
benabik | colomon: :-D | ||
colomon | benabik++ # one step faster than me again | ||
benabik | colomon: Normally I don't get praised for interrupting. :-D | ||
colomon | benabik: we prefer to say answering. :) | 21:36 | |
jnthn | [Coke]: On the one hand, I can sorta see why it explodes. OTOH, the bit of code that does is unchanged since ages. | ||
21:36
y3llow left
21:37
y3llow joined
|
|||
Radvendii | oh! is there any way to niecza a file? | 21:37 | |
colomon | errr, what? | ||
you mean run a script with niecza? | |||
mono run/Niecza.exe mandelbrot.pl | 21:38 | ||
Radvendii | ah | ||
cool | |||
21:38
kaare_ left
|
|||
Radvendii | can i include the entire path to Niecza.exe and run it from anywhere? | 21:39 | |
like mono /path/to/Niecza.exe file.pl | |||
colomon | yes | ||
[Coke] | jnthn: so, is there a way to get that token without 'sploding? | 21:43 | |
jnthn | [Coke]: Well, my first attempt at a patch made NQP compilation explode... :) | 21:44 | |
[Coke] | WHEE! | 21:45 | |
Radvendii | Is there a way to get command history on niecza? (Like, i know CPAN offers it only after you download some module or something...) | ||
nor can I even go "back" in a line of code... | 21:46 | ||
jnthn | [Coke]: oh, looking again, it may just be an inverted conditional | 21:47 | |
[Coke]: gist.github.com/1685315 seems to help | 21:48 | ||
Radvendii | niecza: say (1,2,3)[*-2] | 21:49 | |
p6eval | niecza v13-357-g9374d97: OUTPUT«2» | 21:50 | |
jnthn | [Coke]: It passes tests so, pushing it. | ||
dalek | p: c9a8997 | jnthn++ | src/PAST/Regex.pir: Fix what appears to be an inverted condition in the old regex engine's charlist prefix computation. |
||
21:51
apesma left
|
|||
Radvendii | is there a way to use 'when{}' _without_ the break associated with it? to fall through to the other 'when's? | 21:56 | |
jnthn | Radvendii: use "proceed" | 21:57 | |
Radvendii | as the last statment? | 21:58 | |
well, duh :P | |||
masak | perl6: given 42 { say 1; succeed; say 2 }; say 3 | 21:59 | |
p6eval | niecza v13-357-g9374d97: OUTPUT«13» | 22:00 | |
..rakudo 052cc6: OUTPUT«1succeed without when clause in block <anon> at /tmp/Xpqe7jLGGp:1 in block <anon> at /tmp/Xpqe7jLGGp:1 in <anon> at /tmp/Xpqe7jLGGp:1» | |||
..pugs b927740: OUTPUT«1*** No such subroutine: "&succeed" at /tmp/zMqNV3st0l line 1, column 19-26» | |||
masak | I'm with Niecza here, but I haven't checked the spec. | ||
if Niecza is wrong, how does one break out of a 'given' block between 'when' statements? | |||
[Coke] | if I have src/A/B.pm that isa src/D/E.pm , how can I "use" that? do I need to muck with INC? | 22:02 | |
(nqp) | |||
tadzik | :) | ||
ww | |||
[Coke] | (use src::D::E; seems to work. ;) | 22:04 | |
Radvendii | masak: no no, i want to do a when statement without breaking out | ||
masak | Radvendii: got you. | ||
Radvendii: I just got to thinking about the above use case. | |||
Radvendii | oh | 22:05 | |
masak | since 'given' is not technically a loop, you can't 'last' out of it. | ||
so the question is, how *do* you get out of it? | |||
(maybe the correct answer is "you should do 'for 42', duh!". I dunno.) | |||
colomon | return! | 22:06 | |
jnthn | masak: leave! | ||
colomon | fly, you fools! | ||
Radvendii | :P | 22:07 | |
niecza: given 42 { when Int {say "test"; proceed}; when 42 {say "YAY!"}} | 22:09 | ||
p6eval | niecza v13-357-g9374d97: OUTPUT«testYAY!» | ||
Radvendii | niecza: say ?("5" but False || True) # precidence of 'but' test | 22:10 | |
p6eval | niecza v13-357-g9374d97: OUTPUT«Bool::True» | 22:11 | |
Radvendii | does niecza support :arg(value) syntax yet? | 22:15 | |
niecza: sub a(:$foo) { say $foo }; a(:foo("bar")); | |||
p6eval | niecza v13-357-g9374d97: OUTPUT«bar» | ||
masak | jnthn: oh! 'leave', of course. thanks :) | 22:16 | |
Radvendii | niecza: sub a(:$foo) { say $foo }; a(:foo(False)); | ||
p6eval | niecza v13-357-g9374d97: OUTPUT«Bool::False» | ||
[Coke] | jnthn: how do I get a hash-like class in nqp? | 22:17 | |
masak | sorear: S04 seems pretty clear about Niecza being too permissive with 'succeed' outside 'when'. | 22:18 | |
[Coke] | (before I could say "class TclArray is Hash") | ||
Radvendii | You guys wanna see meta-op overuse? gist.github.com/1685478 | 22:21 | |
PerlJam | Radvendii: if that works ... nice! ;) | 22:22 | |
Radvendii | yup. well... in niecza at least. in theory... i haven't actually gotten all the rest of my code to work in order to test it but i've tried similar things | ||
[Coke] | "and that's why people hate perl" | 22:23 | |
22:24
estrabd joined
|
|||
PerlJam | It's one of those waterbed things | 22:24 | |
and ... with great power comes great responsibility | |||
jnthn | [Coke]: Ah...yeah, you can't inherit from PMCs with 6model. What does "hash-like" actually mean here? | 22:26 | |
Radvendii | [Coke]: indeed. | 22:27 | |
[Coke] | something like my %foo = {}; but with methods ? | ||
er, using the right thing instead of curlies. | |||
jnthn | [Coke]: It should act like a hash, and just be able to have methods also? | 22:28 | |
[Coke] | yes. | ||
PerlJam | does Associative? | ||
[Coke] | ah. if it can't inherit from a PMC, it probably doesn't matter. | 22:29 | |
(since all I'm doing in TclArray is using hll_map | |||
ah, TclLexPad could benefit, though. | |||
jnthn | [Coke]: In that case, give it an attribute (has %!hash) and then use "is parrot_vtable_handler(...)" | ||
22:29
shinobicl__ left
|
|||
jnthn | [Coke]: See src/core/NQPCapture.pm | 22:30 | |
[Coke] | (and TclList for @arrays, TclString for strings...) | ||
PerlJam | [Coke]: are you updating partcl? | ||
22:30
ksi left
|
|||
Radvendii | what does niecza mean by "This macro cannot be used as a function" | 22:30 | |
jnthn | [Coke]: It's delegation rather than inheritance. Though in a sense that's what Parrot did before. However, in 6model this mechanism is 1 PMC lighter per object. | ||
[Coke] | PerlJam: trying to. | ||
jnthn | [Coke]: And likely performs better. | ||
PerlJam | [Coke]: cool | ||
[Coke] | jnthn: ah, sneaky. | 22:31 | |
Radvendii | what's a macro... (in terms of perl6) | 22:32 | |
22:34
benabik left
|
|||
PerlJam | Radvendii: a macro is a routine that is executed immediately and it should return either an AST or some actual perl code that doesn't something useful | 22:34 | |
Radvendii: the AST or code is "injected" into original program at the point that the macro was called. | 22:35 | ||
22:36
bkolera left
|
|||
[Coke] | PerlJam: "that doesn't" ? | 22:37 | |
PerlJam | sorry, weird braino | ||
...some actual perl code that *does* something useful | |||
Radvendii | okay | 22:40 | |
thanks | |||
so why is niecza considering the last part of this line a "macro": | 22:42 | ||
return [||] (%.h.keys.grep(/$c/).map: -> $p { self.legal($p, $l, :flag(False)) } ); | |||
ignore the first two characters... | |||
niecza: sub a {True}; <a b c>.grep: {a}; | 22:45 | ||
p6eval | niecza v13-357-g9374d97: ( no output ) | ||
Radvendii | niecza: sub a {True}; say <a b c>.grep: {a}; | ||
p6eval | niecza v13-357-g9374d97: OUTPUT«a b c» | ||
jnthn | Time for some rest...night o/ | ||
Radvendii | o/ | ||
PerlJam | g'night jnthn! | 22:47 | |
Radvendii | niecza hasn't implimented Proxy or eager yet? | ||
masak | 'night, #perl6 | 22:49 | |
22:49
preflex left
22:50
preflex_ joined,
estrabd left,
preflex_ is now known as preflex,
estrabd joined
|
|||
colomon | Radvendii: correct | 22:52 | |
23:07
bacek joined
23:11
bbkr2 joined,
bbkr1 left
|
|||
Radvendii | colomon: then i guess rakudo is the lesser of the two evils for what i am doing... | 23:12 | |
23:16
bbkr1 joined,
bbkr2 left
23:27
spine left
23:30
bluescreen10 left
23:39
whiteknight joined
|
|||
Radvendii | is there any ways to print out what you are going to print out, and what it evaluates to without typing it out twice? | 23:44 | |
oh... probably not. because it evaluates before being passed to 'say' | 23:45 | ||
23:46
bluescreen10 joined
|
|||
Radvendii | nom: say 'a' ~~ /b|c|a/ | 23:51 | |
p6eval | nom 052cc6: OUTPUT«=> <a>» | ||
Radvendii | nom: say 'aasdf' ~~ /b|c|a/ | ||
p6eval | nom 052cc6: OUTPUT«=> <a>» | ||
Radvendii | nom: say 'aasdf' ~~ /b|c|a/ | 23:54 | |
23:54
benabik joined
|
|||
p6eval | nom 052cc6: OUTPUT«=> <a>» | 23:54 | |
Radvendii | oops. sorry guys, wrong tab | 23:55 | |
23:59
tokuhirom joined
|