»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by sorear on 25 June 2013. |
|||
00:00
sivoais left
00:12
Mouq joined
00:19
kivutar left
00:22
BenGoldberg joined
00:23
rurban1 joined
00:28
pmurias left
00:32
unclefester2 left
00:35
sivoais joined
00:38
rurban1 left
00:41
colomon left
00:42
colomon joined
01:14
Rotwang left
01:26
colomon left
01:29
colomon joined
01:34
jnap joined
01:35
hoverboard joined
01:36
rurban1 joined
01:41
daniel-s_ left
01:42
daniel-s_ joined
|
|||
dalek | kudo-star-daily: af07b0e | coke++ | log/ (5 files): today (automated commit) |
01:45 | |
rl6-roast-data: 0f29ebf | coke++ | / (5 files): today (automated commit) |
|||
[Coke] | moar: 73.40% | 01:47 | |
01:49
raiph joined
01:52
colomon left
01:54
thou joined
|
|||
raiph | perlmonks.org/?node_id=1068630 # of interest to timotimo? | 01:55 | |
01:59
jnap left
02:03
colomon joined
|
|||
timotimo | meh :) | 02:05 | |
02:10
daniel-s_ left
|
|||
lue | looking at S05, I'm wondering about "5) Declaration with least number of 'uses' wins" | 02:16 | |
Does 'use' mean something specific (e.g. the use statement), or is just referring generally to the number of times a declaration is used in some fashion? | 02:17 | ||
timotimo | i seem to recall having learnt about this once | ||
diakopter | lue: it's got to be the latter | 02:18 | |
02:19
colomon left
|
|||
lue | so /<alpha> <alpha>/ would be using "alpha" twice, and (I'm guessing) /(<alpha>)+/ would be using it once. | 02:19 | |
diakopter | I think it means overlapping uses in that stem prefix | 02:20 | |
lue | .oO('Use' is too generic a verb for this methinks) |
02:21 | |
timotimo | agreed. | ||
even if it's in scare quotes | |||
lue | The fact that you'll never encounter the tie-breaker unless you do MONKEY_PATCHING type things doesn't help one's understanding :) | 02:22 | |
timotimo | right | ||
"you'll never see this! why are we even explaining it to you?!" | |||
diakopter | "stop reading this!" | 02:23 | |
lue | r: $/ = 5; say $/; | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«5» | ||
lue | That should've stopped me and made me wish for a no warnings :perl5 thing :) | 02:24 | |
timotimo | should it give a warning instead? | ||
lue | $/ = $x; # "Unsupported use of $/ variable as input record separator" | 02:25 | |
so says the spec | |||
diakopter | heh, oh | ||
timotimo | r: $/ = "hi"; say $/; | 02:26 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«hi» | ||
timotimo | i saw that warning once before somewhere | ||
lue | n: $/ = 5; say $/; | ||
camelia | niecza v24-109-g48a8de3: OUTPUT«(timeout)[auto-compiling setting]» | ||
lue agrees with rakudo's current behavior though :) | 02:29 | ||
02:33
raiph left
02:36
colomon joined
02:42
beastd left
|
|||
moritz | 02:52 | ||
timotimo | |||
moritz not alone sleepless in .de | 02:53 | ||
timotimo is watching a talk from the 30c3 | |||
(recht auf remix) | |||
02:57
rurban1 left,
dwarring left
03:00
rurban1 joined
03:04
rurban1 left
|
|||
lue | I just discovered the :c adverb, and I get the strangest feeling it would've come in handy a few times before :) | 03:05 | |
timotimo | closure interpolation? | 03:08 | |
lue | timotimo: I was thinking rx:c, not Q:c | 03:09 | |
timotimo | oh? | ||
i don't know what that does, to be honest | |||
oooooh, continue | |||
that's cute! | |||
lue | r: "foo123" ~~ m/<alpha>+/ && m:c/<digit>+/; | 03:10 | |
camelia | rakudo-jvm e5268b: OUTPUT«Cannot call 'match'; none of these signatures match::(Cool:D : $target, *%adverbs) in any at gen/jvm/BOOTSTRAP.nqp:1201» | ||
..rakudo-parrot e5268b: OUTPUT«Cannot call 'match'; none of these signatures match::(Cool:D : $target, *%adverbs) in any at gen/parrot/BOOTSTRAP.nqp:1218 in any at gen/parrot/BOOTSTRAP.nqp:1209 in method match at gen/parrot/CORE.setting:3487 in block at /tmp/TgDu…» | |||
03:10
Pleiades` left
|
|||
lue | r: "foo123" ~~ m/<alpha>+/; say m:c/<digit>+/; | 03:11 | |
camelia | rakudo-jvm e5268b: OUTPUT«Cannot call 'match'; none of these signatures match::(Cool:D : $target, *%adverbs) in any at gen/jvm/BOOTSTRAP.nqp:1201» | ||
..rakudo-parrot e5268b: OUTPUT«Cannot call 'match'; none of these signatures match::(Cool:D : $target, *%adverbs) in any at gen/parrot/BOOTSTRAP.nqp:1218 in any at gen/parrot/BOOTSTRAP.nqp:1209 in method match at gen/parrot/CORE.setting:3487 in block at /tmp/arMa…» | |||
03:11
colomon left
|
|||
lue | What the hell is @() supposed to mean? | 03:13 | |
timotimo | in what context? | ||
isn't it a shorthand for @($/)? | |||
lue | is it? | ||
r: say @().perl if "abracadabra" ~~ m:ov/a (.*) a/; | 03:14 | ||
camelia | ( no output ) | ||
lue | r: say @().perl if "abracadabra" ~~ m/a (.*) a/; | ||
camelia | rakudo-parrot e5268b: OUTPUT«(Match.new(orig => "abracadabra", from => 1, to => 10, ast => Any, list => ().list, hash => EnumMap.new()),).list» | ||
..rakudo-jvm e5268b: OUTPUT«(Match.new(to => 10, hash => EnumMap.new(), ast => Any, list => ().list, orig => "abracadabra", from => 1),).list» | |||
timotimo | it may be a shorthand to extract the .ast if it exists | 03:15 | |
03:16
Pleiades` joined,
rurban1 joined
|
|||
lue also isn't too clear on what exactly the difference between :ov and :ex are. | 03:16 | ||
timotimo | easy | ||
"the first match from every position is returned" vs "every match is returned | 03:17 | ||
let me demonstrate | |||
r: say "aaaaaa" ~~ m:ov/a+/ | |||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«False» | ||
timotimo | ... er ... | ||
r: say "aaaaaa" ~~ rx:ov/a+/ | |||
camelia | rakudo-jvm e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/pgEcbiYhM7Adverb ov not allowed on rxat /tmp/pgEcbiYhM7:1------> say "aaaaaa" ~~ rx:ov/a+/⏏<EOL>» | ||
..rakudo-parrot e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/ZZsWOdj0jWAdverb ov not allowed on rxat /tmp/ZZsWOdj0jW:1------> say "aaaaaa" ~~ rx:ov/a+/⏏<EOL>» | |||
timotimo | r: say "aaaaaa" ~~ m:overlap/ a+ / | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«False» | ||
timotimo | ... why?! | ||
lue | Oh, I'm currently reading S05, in case you can't tell :) . Trying to see how difficult that ol' libp6regex idea would be. | 03:18 | |
timotimo | yes, i'm on S05 as well | ||
but why does that give false? | |||
r: say "aaaaaa" ~~ m/ a+ / | |||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«「aaaaaa」» | ||
timotimo | r: say "aaaaaa" ~~ m:ex/ a+ / | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«False» | ||
timotimo | ... wat ... | ||
lue | r: say "abaccadddaaea" ~~ m:ov/ a <-[a]>* a / | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«False» | ||
timotimo | are those just b0rken? | 03:20 | |
if i could have demonstrated, you would have seen the following results: | |||
with overlapping: aaaaaa, aaaaa, aaaa, aaa, aa, a | 03:21 | ||
with exhaustive: aaaaaa, aaaaa, aaaa, aaa, aa, a, aaaaa, aaaa, aaa, aa, a, aaaa, aaa, aa, a, aaa, aa, a, aa, a | |||
03:21
atroxaper joined
|
|||
lue | timotimo: I wouldn't be surprised if they are broken. | 03:21 | |
timotimo | :( | ||
lue | Ah, so ov it's "one match per spot", and ex is "every match per spot". | 03:22 | |
timotimo | yup | ||
"first match per spot" even | |||
lue | (incidentally your specific example looks like a permutations/combinations demonstration :P) | 03:23 | |
timotimo | :D | ||
lue | or at least is reminiscent of one. | ||
03:28
colomon joined
03:32
rurban1 left
03:38
colomon left
|
|||
lue | r: say "a" ~~ / <alpha> & <alnum> / | 03:38 | |
camelia | rakudo-jvm e5268b: OUTPUT«「a」 alnum => 「a」 alpha => 「a」» | ||
..rakudo-parrot e5268b: OUTPUT«「a」 alpha => 「a」 alnum => 「a」» | |||
timotimo | yup, the & is really nifty | 03:40 | |
i also love that you can capture inside the right-hand-side of the % operator | |||
and with that, i go to bed | 03:41 | ||
lue | ♞ timotimo o/ | ||
TimToady | we have no decent way of printing Rats with consistent number of fractional digits; see rosettacode.org/wiki/Currency#Perl_6 | 03:46 | |
lue | What's $¢.pos nowadays? | ||
TimToady | maybe we need an optional argument to .base | ||
well, it's still $¢.pos in STD... | 03:47 | ||
$/.CURSOR.pos or some such, iirc | 03:48 | ||
lue | I almost want to bring back ¢, just so the artifacts in the spec stop popping up all the time :) | ||
TimToady | $¢ has nothing to do with the old ¢ sigil | 03:49 | |
lue | r: say "abc" ~~ / <alpha> {say $¢.pos} <alpha>+ / | 03:50 | |
camelia | rakudo-jvm e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/iACnz6bVBbUnsupported use of $¢ variableat /tmp/iACnz6bVBb:1------> say "abc" ~~ / <alpha> {say ⏏$¢.pos} <alpha>+ / expecting any of: argument list …» | ||
..rakudo-parrot e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/YKMsAzljIaUnsupported use of $¢ variableat /tmp/YKMsAzljIa:1------> say "abc" ~~ / <alpha> {say ⏏$¢.pos} <alpha>+ / expecting any of: argument list…» | |||
lue | TimToady: I know, I just keep thinking ¢ looks cool. I think my feelings on ¢ in P6 are similar to ß in German :P (In particular Swiß German, what with its removal of the letter) | 03:51 | |
03:52
rurban1 joined
|
|||
lue | TimToady: "f a floating-point number, in fixed decimal notation" Is that not what you could use for currency, or am I misreading that? | 03:56 | |
lue is not a printf expert | |||
TimToady | unfortunately that attempts to translate to floating-point first, and overflows | 04:00 | |
04:00
colomon joined
|
|||
TimToady | p: printf("%0.2f", 12345123451234512345) | 04:01 | |
camelia | rakudo-parrot e5268b: OUTPUT«12345123451234512896.00» | ||
TimToady | note the inaccuracy | ||
lue | Ah. Maybe we could introduce %r for Rat then, and %R for FatRat perhaps :) | ||
(though there's a problem of if that %r would print a fraction or decimal.) | 04:02 | ||
TimToady | I suspect the 'f' is supposed to mean 'fixed point' | 04:03 | |
so maybe we should just make that work | |||
lue | Yeah, I wouldn't be surprised if the "floating-point" bit in the original printf was an issue of C's capabilities, rather than the preferred way to get to fixed point. | 04:05 | |
(just for %f that is) | |||
Mouq | "This example is incorrect. It does not accomplish the given task. Please fix the code and remove this message. " rosettacode.org/wiki/Parametric_pol...ism#Perl_6 | 04:08 | |
TimToady | maybe the task changed? | 04:11 | |
Grondilu marked it incorrect | |||
colomon | TimToady: fixing that has been on my to-do list for a while now. no time, though…. | 04:12 | |
(the %f thing, not the rosettacode thing) | 04:13 | ||
TimToady hates to put workarounds into rosettacode... | |||
but whenever... | |||
04:14
kaare_ left
|
|||
Mouq | It's strange; this seems like the logical golf: | 04:14 | |
r: role A[::T] {method test(T $t) {say $t}}; class B does A[Int] {}; B.test(4) | |||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«4» | ||
Mouq | But it works? | ||
TimToady | sorry, family doings (The Third Noël, or so), so distracted... | 04:16 | |
not to mention having driven from Seattle to SoCal in the last two days... | 04:18 | ||
04:19
itz joined
04:20
kaare joined,
kaare is now known as Guest31073,
itz_ left
|
|||
Mouq | r: role A[::T] {has T $.n; method assign(T \t) {$.n = t;}}; my $golf = (class B does A[Int] {}).new; $golf.assign(4); say $golf.n | 04:20 | |
camelia | rakudo-parrot e5268b: OUTPUT«No such method 'item' for invocant of type 'T' in method assign at /tmp/ecZVQz7Sqv:1 in block at /tmp/ecZVQz7Sqv:1» | ||
..rakudo-jvm e5268b: OUTPUT«No such method 'item' for invocant of type 'T' in method assign at /tmp/C0iVA9deQD:1» | |||
04:28
rurban1 left
04:38
preflex_ joined,
ChanServ sets mode: +v preflex_
04:40
preflex left,
preflex_ is now known as preflex
|
|||
TimToady | lue: it means how deep in 'use Module' nesting the declaration is; a module that is used directly counts as closer than a module that is used by a module that you use | 04:54 | |
lue | Those scare quotes should say 'use's then :) | 04:55 | |
(I had a feeling it was something like that.) so does 'use MONKEY_TYPING' count, or is that simply what can cause tiebreaker #5 to be reached most easily? | 04:56 | ||
04:56
espadrine left
|
|||
TimToady | MONKEY_TYPING has nothing to do with #5, unless the declaration in question was pulled in somehow by 'use MONKEY_TYPING;', which I sincerely doubt | 04:57 | |
lue | so you're saying MONKEY_TYPING pulling in a module would require some serious... MONKEY_BUSINESS then? | 04:58 | |
05:09
newbie_Perl6 joined
05:13
atroxaper left
|
|||
TimToady | Mouq: yeah, definitely looks like a rakudobug of some sort | 05:15 | |
05:16
newbie_Perl6 left
|
|||
TimToady | gist.github.com/TimToady/8264706 <-- this works | 05:18 | |
changed 'has $!value;' to use . instead | 05:19 | ||
and changed the .?'s to use 'if defined' instead | |||
so maybe the T !=== Int is a red herring of some sort | |||
05:23
rurban1 joined
05:32
Lorn left
05:33
geekosaur left,
simcop2387 left,
sjohnson left
05:35
rjbs left,
rjbs joined
05:36
geekosaur joined
05:37
simcop2387 joined
05:39
newbie_Perl6 joined
|
|||
TimToady | p: say '言' ~~ /<alpha>/ | 05:44 | |
camelia | rakudo-parrot e5268b: OUTPUT«「言」 alpha => 「言」» | ||
TimToady | p: say 'º' ~~ /<alpha>/ | 05:48 | |
camelia | rakudo-parrot e5268b: OUTPUT«「º」 alpha => 「º」» | ||
TimToady | p: say '°' ~~ /<alpha>/ | 05:49 | |
camelia | rakudo-parrot e5268b: OUTPUT«Nil» | ||
TimToady keeps wondering why people use º for degrees when it's just as easy to get to ° | |||
05:49
newbie_Perl6 left
|
|||
lue | TimToady: me too | 05:50 | |
TimToady | easier, in fact, with a compose key, since it's just compose-o-o | ||
05:50
newbie_Perl6 joined,
atroxaper joined
|
|||
TimToady | of course, then there's why people use °F when there's a precomposed ℉ | 05:50 | |
05:51
newbie_Perl6 left
|
|||
lue | r: say ord("℉") | 05:51 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«8457» | ||
05:51
newbie_Perl6 joined
|
|||
TimToady | p: say ord('℉').base(16) | 05:52 | |
camelia | rakudo-parrot e5268b: OUTPUT«2109» | ||
TimToady also doesn't understand why people use decimals for unicode codepoints :) | |||
lue | I was just too lazy to type the .base(16) part :P | 05:54 | |
lue doesn't understand why ord doesn't produce a hex string, as that's what people tend to be going for anyway in Unicode-land :) | |||
TimToady | well, we could return an IntStr, I guess... | 05:56 | |
but it seems like a low-lux feature | |||
lue | use radix :16th could be another solution :) | ||
my $a = 2A; and such | 05:57 | ||
lue half-proposes that 0d123 change to 0i123, as that's the first letter in "decimal" that doesn't show up in hex. | 05:58 | ||
06:04
newbie_Perl6 left
|
|||
raydiak | is there any reason ":!$foo" couldn't be used to mean ":foo(!$foo)"? | 06:20 | |
06:23
araujo left
06:25
darutoko joined
06:38
kurahaupo_mobile left
|
|||
TimToady | .oO(This means the opposite of what you think it means...) |
06:43 | |
raydiak | it'd be useful when you have recursive routines that tend to toggle flags before passing them to the next level, which seems to emerge in my designs from time to time; is it just me? | 06:49 | |
TimToady | I really don't see a reason to encourage people to flip the polarity of "foo" like that; it's a design smell most of the time, and not worth huffmanizing the rest of the time, methinks | 06:50 | |
and in the cases where you'd want it, toggle => !$toggle would be much clearer | |||
raydiak | all true...keep the more frightening things more difficult to type, I suppose | 06:52 | |
lue | I have to say, I've always felt a bit weird that :adv/:!adv was some sort of weird trinary thing by default, except that you need to check two things for that trinariness. | ||
TimToady | also, :!$ is just a bit too much punctuation in a row for most sane people :) | 06:53 | |
bad enough we can have :$^foo and such | 06:54 | ||
or even :$:foo :) | |||
raydiak | does :$!foo work? | 06:55 | |
TimToady | should | ||
lue | raydiak: sure, that's :foo($!foo) | ||
.oO( :!$@!attr ) |
|||
TimToady | "What is that, swearing?" --Heidi | 06:56 | |
Appearances to the contrary notwithstanding, we are not optimizing Perl 6 for golf. :) | 06:57 | ||
07:00
rurban1 left
|
|||
raydiak | haha. I really should avoid using line noise syntax, whther it's valid or not...obsessive compulsions die hard I suppose | 07:00 | |
07:02
berekuk joined
07:13
berekuk left
07:33
BenGoldberg left
07:35
sjohnson joined,
rurban1 joined
07:39
hoverboard is now known as totesobamacare
07:40
rurban1 left
07:56
totesobamacare is now known as hoverboard
07:57
nnunley left
08:24
bonsaikitten left
08:31
bonsaikitten joined
08:37
Rotwang joined
|
|||
masak | "It was dishonest to call it Python." -- news.ycombinator.com/item?id=7013438 | 08:52 | |
(just as some people want Perl 6 to have been called something else.) | |||
'morning, #perl6 | |||
08:53
Pleiades` left
|
|||
raydiak | \o good morning masak | 08:55 | |
08:58
Pleiades` joined
|
|||
tadzik | wow, imagine Perl 5 users saying "booo, 5.10 is not Perl anymore, dishonest!" | 09:02 | |
but maybe that's the point here; it's not different enough to justify the migration hassle | 09:04 | ||
xfix | Is there max() function that returns lvalue? | 09:11 | |
It would be nice for codegolf.stackexchange.com/questio...m-in-array | |||
09:26
sqirrel joined
|
|||
raydiak | japhb: since you were trying to use it, thought you'd want to know that deintersection not only runs without errors, but also now actually functions :) | 09:30 | |
09:32
xinming left
09:34
xinming joined
09:36
thou left
09:37
rurban1 joined
09:42
rurban1 left
09:44
sqirrel left
09:47
sue_ joined
09:50
atroxaper left
09:55
sue_ is now known as virtualsue
10:09
araujo joined
10:18
atroxaper joined
10:29
kivutar joined
10:37
hoverboard is now known as IronedElf
10:45
IronedElf is now known as hoverboard
10:51
hoverboard left
10:55
[Keith] left,
[Keith] joined
|
|||
moritz | \o | 10:55 | |
virtualsue | greets | 10:58 | |
moritz | hello virtualsue | ||
11:15
dmol joined
11:40
spider-mario joined
11:44
virtualsue left
11:46
berekuk joined
11:51
rindolf joined
12:08
spider-mario left,
kivutar left
12:21
darutoko- joined
12:25
darutoko left
12:32
denisboyun joined
12:37
denisboyun left
12:42
dmol left
|
|||
masak | tadzik: the Perl community tried a Big Upgrade. it took several years, and people got tired of waiting and started advocating forgetting Perl 6 and sticking with Perl 5. | 12:43 | |
tadzik: the Python community tried a Small, Limited Upgrade. it took several years, and people got tired of waiting and started advocating forgetting Python 3.x and sticking with Python 2.7. | |||
12:46
mohij joined
12:50
kivutar joined
12:56
berekuk left
|
|||
masak | maybe the lesson simply is "however you do it, some people will lose patience and/or advocate sticking with $?OLD_VERSION" | 12:59 | |
13:01
kivutar left
|
|||
nwc10 | there is at least one difference. Python 3 has declared itself "production ready" for about 5 years (while Perl 6 hasn't), but the end user Python upgrade plan always assumed a flag day change. (effectively) | 13:02 | |
we've not yet seen what will pan out once Larry (and @Larry) says "Perl 6 is ready" | |||
13:09
berekuk joined
13:11
espadrine joined
|
|||
masak | troo. | 13:11 | |
in practice, I doubt there will be much migration of Perl 5 projects to Perl 6, whatever time scale you choose to look on. | 13:12 | ||
nwc10 | my assumption also. Not much working Perl 5 code is going to get re-written as Perl 6. | 13:21 | |
The trick is to make it easier to run a hetrogeneous Perl 5/Perl 6 environment than a hetrogeneous Perl 5/$other | |||
masak | aye. | 13:22 | |
nwc10 | although, another significant difference betwen 2 and 3 vs 5 and 6 is that 3 doesn't really have many exciting features over and above 2. Particularly, it still has a GIL. Whereas 6 offers at least one obvious relevant feature - less insane concurrency | 13:23 | |
Python 2 is already too damn good | |||
masak | yeah, that's what I meant by "Big Upgrade" vs "Small, Limited Upgrade". | 13:24 | |
13:31
yogan left,
yogan joined
13:36
rindolf left
13:52
Guest31073 left
14:03
jferrero left
14:04
colomon left
14:07
darutoko joined
14:11
darutoko- left,
gcole joined
14:12
hoelzro left
14:13
hoelzro joined,
atta left
14:14
atta joined
14:19
colomon joined
14:20
rindolf joined
14:25
virtualsue joined
14:34
cognominal left
14:35
benabik left
14:37
PacoAir_ joined,
PacoAir left,
PacoAir_ is now known as PacoAir
|
|||
timotimo | o/ | 14:44 | |
masak | \o | 14:46 | |
FROGGS | o/ | 14:49 | |
14:56
ggoebel118 joined,
ajr joined
14:57
ajr is now known as Guest59725,
Guest59725 is now known as ajr_
14:58
kivutar joined
15:05
ggoebel118 left
|
|||
timotimo | how can perl6's concurrency be anything other than insane if it doesn't have a GIL? :) | 15:10 | |
15:37
nnunley joined
15:42
zakharyas joined
|
|||
arnsholt | Well, it's going to be concurrent. Which probably guarantees a certain amount of insanity^Whilarity =) | 15:49 | |
15:53
beastd joined
15:58
Psyche^ joined
16:01
kivutar left
16:03
Psyche^_ left
16:13
thou joined
16:19
kivutar joined
|
|||
masak | well, if anything is to ensue, it might as well be hilarity. | 16:20 | |
16:23
berekuk left
16:26
thundergnat joined
|
|||
thundergnat | r: say (max map {.chars => $_},<juicypacakes sweetchickeneggs tastycheezezzz yourmomzez countchoclatez>).value~'izwhatzforzbrekfatz'; | 16:27 | |
preflex | thundergnat: you have 1 new message. '/msg preflex messages' to read it. | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«sweetchickeneggsizwhatzforzbrekfatz» | ||
thundergnat | xfix: ^^ not exactly what you were looking for... but close. | 16:28 | |
16:30
atroxaper left
16:32
berekuk joined
16:33
kivutar left
16:42
kivutar joined
|
|||
timotimo | max-rw and min-rw does sound really convenient | 16:48 | |
(no matter if it's to replace max or be a separate operator) | 16:49 | ||
dalek | kudo-star-daily: 65ed5eb | coke++ | log/ (5 files): today (automated commit) |
16:58 | |
16:59
raiph joined
17:00
colomon left
|
|||
FROGGS | p: my role Hurz; 1 does Hurz; # masak, a bug for you :o) | 17:03 | |
camelia | rakudo-parrot e5268b: OUTPUT«(signal KILL)» | ||
17:04
pmurias joined
|
|||
timotimo | [...]None of the parametric role variants for 'Hurz' matched the arguments supplied. | 17:07 | |
maximum recursion depth exceeded | |||
o_O | |||
there aren't even parameters for that role >_< | |||
FROGGS | adding the role's body helps :o) | ||
timotimo | oh! | 17:08 | |
of course | |||
it's a semicolon definition of the role | |||
like class Foobar; | |||
17:08
[Keith] left
17:13
johnmilton joined
|
|||
arnsholt | r: my class Foo; my Foo $foo .= new; | 17:13 | |
camelia | ( no output ) | ||
17:23
colomon joined
|
|||
timotimo | r: class Test { say "oh my" }; | 17:26 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«oh my» | ||
timotimo | what time does that run? | ||
17:28
slavik left
|
|||
colomon | r: class Test { say "oh my" }; BEGIN { say "begin"; }; say "end?"; | 17:32 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«beginoh myend?» | ||
colomon | r: say "sackbut"; class Test { say "oh my" }; BEGIN { say "begin"; }; say "end?"; | 17:33 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«beginsackbutoh myend?» | ||
17:33
djanatyn left
17:34
djanatyn joined
|
|||
timotimo | so ... compose time? | 17:36 | |
oh, just run time i guess | |||
17:36
Tene left
17:37
Tene joined
|
|||
colomon | class creation time, I think, which is regular run time, right? | 17:37 | |
timotimo | may be | 17:38 | |
17:38
xinming left
17:42
djanatyn left,
djanatyn joined
17:45
xinming joined
17:46
berekuk left
17:51
virtualsue left
17:53
cognominal joined
17:57
spider-mario joined
18:06
kivutar left
18:13
berekuk joined
18:26
[Sno] joined
|
|||
timotimo | can we please spec something that makes the "highwater" stuff available in arbitrary grammars? :\ | 18:27 | |
getting a partial parse tree, for exmaple | |||
18:32
virtualsue joined
18:38
darutoko left
18:39
BenGoldberg joined
|
|||
FROGGS | +1, since that question comes often from various ppl | 18:41 | |
clsn__ | How would I refer to a method as code, as opposed to calling it? That is, sub foo {...} can later be referred to as &foo, but what about class A { method bar {...} } ? | 18:46 | |
arnsholt | There's a call find_method in the MOP, IIRC | 18:47 | |
clsn__ | I can do A.^methods[0] I think, or other tricks like that, but that seems sort of roundabout. | 18:48 | |
arnsholt | r: class A { method foo { say "foo" } }; my A $a .= new; my $m = $a.^find_method("foo"); $m($a); # clsn__ | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«foo» | ||
clsn__ | Thanks. | ||
Can't find private methods that way I think. Hm. | 18:53 | ||
moritz | sure; they are private :-) | ||
if you could find them, you could call them | |||
clsn__ | I mean, you can't even find them from inside the class that way. | 18:54 | |
moritz | r:my $n = 1e2; my @methods := $n.^can('sqrt'); say @methods[0]($n) | ||
p: my $n = 1e2; my @methods := $n.^can('sqrt'); say @methods[0]($n) | |||
camelia | rakudo-parrot e5268b: OUTPUT«10» | ||
moritz | clsn__: there's a find_private_method | 18:55 | |
clsn__ | orly? I didn't know. | ||
moritz | I just found by looking into src/Perl6/Metamodel/PrivateMethodContainer.nqp | ||
18:55
ajr_ left
|
|||
clsn__ | not sure it's working... lessee... | 18:56 | |
18:56
ajr joined
|
|||
clsn__ | Aha, no, it works. | 18:56 | |
18:56
ajr is now known as Guest20321
|
|||
moritz | p: class A { method !foo { say 42 } }; A.^find_private_method('foo')(A) | 18:56 | |
camelia | rakudo-parrot e5268b: OUTPUT«42» | ||
18:56
Guest20321 is now known as ajr_
|
|||
clsn__ | Mm, that shouldn't work from outside the class though. Makes the private public. | 18:58 | |
moritz | there are no access restrictions when going meta | ||
just like you can inspect private attributes and all that | 18:59 | ||
because in the end, everything builds on the MOP | |||
in the end, it's still "we're all adults around here" | |||
Perl 6 goes a step further to make access to foreign private stuff more inconvenient | 19:00 | ||
clsn__ | I guess. | ||
moritz | but it doesn't really treat it as hard barrier | ||
just like C++ for example (where you can still grab a pointer to private methods if you do enough black magic) | |||
[Coke] | r: say 22311 - 20883 ; # moar improvement | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«1428» | ||
19:01
ajr_ left
|
|||
[Coke] | (based on today's waiting-for-the-jvm-to-finish daily run) | 19:01 | |
FROGGS | very nice! | 19:03 | |
19:03
rindolf left
|
|||
timotimo | clsn__ o/ | 19:06 | |
clsn__ | o/ | ||
19:09
Guest31073 joined
|
|||
clsn__ | Rix: class D { has Int $.x; has &!setter=method ($self: $v) { $!x=$v; }; method val is rw { Proxy.new(FETCH=>method {$.x*10}, STORE=>method ($s: $f) {&!setter($f-10)}) } }; my $a=D.new; $a.val | 19:11 | |
Argh. | |||
r: class D { has Int $.x; has &!setter=method ($self: $v) { $!x=$v; }; method val is rw { Proxy.new(FETCH=>method {$.x*10}, STORE=>method ($s: $f) {&!setter($f-10)}) } }; my $a=D.new; $a.val | 19:12 | ||
camelia | rakudo-jvm e5268b: OUTPUT«Unhandled exception: java.lang.StackOverflowError in <anon> (/tmp/G1HSkE_rWe) in (gen/jvm/BOOTSTRAP.nqp:300) in <anon> (/tmp/G1HSkE_rWe) in (gen/jvm/BOOTSTRAP.nqp:300) in <anon> (/tmp/G1HSkE_rWe) in (gen/jvm/BOOTSTRAP.nqp:300) …» | ||
..rakudo-parrot e5268b: OUTPUT«(signal SEGV)» | |||
clsn__ | (auto nick completion) | ||
woo, segv. | |||
Mouq | clsn__: what are you trying to do? method != sub | 19:20 | |
or... wait :P | 19:22 | ||
clsn__ | well,simpler cases cause the problem; I think there mighgt be some infinite regress using $.x in FETCH. | 19:23 | |
But look, all this is various attempts to do something that ought to be simple. | |||
Let's say I have a class temperature. It stores its value internally as kelvins. There's a method .celcius that gives me the celcius equivalent. I'd like to make .celcius rw, so I could set it to a celcius temp, and it would do the conversion internally. | 19:24 | ||
Mouq | you can do that | ||
clsn__ | This is really tough with a proxy object, since the proxy obj doesn't have access to the private attributes. | ||
So I was thinking about passing in a setter closure to the proxy obj etc... | 19:25 | ||
Mouq | we don't have methods that are... first class(???) like that, I'm pretty sure. You can do that, I think, but methods only exist in the first level of the class/role/grammar's body AFAIK | 19:27 | |
19:27
Piers joined
|
|||
clsn__ | Yeah, that's why I started trying stuff like "has &!setter" instead of "method setter". How would you do it? | 19:27 | |
19:29
sergot_ joined,
moritz_ joined,
sftp_ joined
19:30
mathw_ joined,
pdcawley left,
daxim_ joined,
zakalwe_ joined,
zakalwe_ left,
zakalwe_ joined
|
|||
Mouq | I'm not actually sure what Proxy does. :P I'm just saying that using method anywhere other than at the statement level of class Whatev { ... } is gonna cause trouble :PP | 19:30 | |
19:30
rhr joined,
nebuchad` joined
19:31
moritz left,
sergot left,
daxim left,
zakalwe left,
mtj_ left,
mathw left
|
|||
clsn__ | heh. ok. | 19:31 | |
19:31
mtj_- joined
|
|||
Mouq | You might be able to get away with making closures out of 'sub's and/or '->'s that capture self somehow, though I wouldn't be surprised if you run into bugs | 19:31 | |
19:31
rindolf joined
|
|||
Mouq | r: class D { has Int $.x; has &!setter=sub ($v) { $!x=$v; }; method val is rw { Proxy.new(FETCH=>sub {$.x*10}, STORE=>sub ($f) {&!setter($f-10)}) } }; my $a=D.new; $a.val | 19:32 | |
camelia | rakudo-jvm e5268b: OUTPUT«Unhandled exception: Too many positional parameters passed; got 1 but expected 0 in (/tmp/GkK7EmC85X) in (gen/jvm/BOOTSTRAP.nqp:300) in MAIN (gen/jvm/main.nqp:46) in (gen/jvm/main.nqp:41) in (gen/jvm/main.nqp)» | ||
..rakudo-parrot e5268b: OUTPUT«Too many positional parameters passed; got 1 but expected 0current instr.: '' pc 355 ((file unknown):206) (/tmp/qzxm0nxOH7:1)called from Sub '' pc 14044 (src/gen/perl6-bootstrap.pir:3858) (gen/parrot/BOOTSTRAP.nqp:315)called from Sub 'MAIN' pc 3…» | |||
19:32
cxreg2 joined
|
|||
Mouq | r: class D { has Int $.x; method export-setter { sub ($v) { $!x=$v; } }; }; my $a=D.new; my $b = $a.export-setter; $b(5); say $a.x | 19:33 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«5» | ||
Mouq | \o/ | ||
That's pretty awesome | |||
clsn__ | Now to shoehorn that into a Proxy somehow... | 19:34 | |
19:35
genehack_ joined,
thundergnat left
|
|||
Mouq | r: class D { has Int $.x; method val is rw { Proxy.new(FETCH=> ->{$.x*10}, STORE=> ->$f{$!x=$f-10}) } }; my $a=D.new; $a.val | 19:35 | |
camelia | rakudo-jvm e5268b: OUTPUT«Unhandled exception: Too many positional parameters passed; got 1 but expected 0 in (/tmp/FUQEXDc21K) in (gen/jvm/BOOTSTRAP.nqp:300) in MAIN (gen/jvm/main.nqp:46) in (gen/jvm/main.nqp:41) in (gen/jvm/main.nqp)» | ||
..rakudo-parrot e5268b: OUTPUT«Too many positional parameters passed; got 1 but expected 0current instr.: '' pc 277 ((file unknown):159) (/tmp/a11f63PJK_:1)called from Sub '' pc 14044 (src/gen/perl6-bootstrap.pir:3858) (gen/parrot/BOOTSTRAP.nqp:315)called from Sub 'MAIN' pc 3…» | |||
Mouq | hmm | ||
BenGoldberg | I wish Proxy were better documented :( | ||
Mouq | I wish Proxy were better documented and threw better errors :/ | 19:36 | |
clsn__ | Yeah. I'm not sure it's powerful enough to do all that we ask of it. | 19:37 | |
Mouq | r: class D { has Int $.x; method val is rw { Proxy.new(FETCH=> ->{$x*10}, STORE=> ->$f{$!x=$f-10}) } }; my $a=D.new; $a.val | ||
camelia | rakudo-parrot e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/agHOmwzH6eVariable '$x' is not declaredat /tmp/agHOmwzH6e:1------> thod val is rw { Proxy.new(FETCH=> ->{$x⏏*10}, STORE=> ->$f{$!x=$f-10}) } }; my $ expecting a…» | ||
..rakudo-jvm e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/6b4tSNqvHnVariable '$x' is not declaredat /tmp/6b4tSNqvHn:1------> thod val is rw { Proxy.new(FETCH=> ->{$x⏏*10}, STORE=> ->$f{$!x=$f-10}) } }; my $ expecting any …» | |||
Mouq | oops | ||
r: class D { has Int $.x; method val is rw { Proxy.new(FETCH=> ->{$!x*10}, STORE=> ->$f{$!x=$f-10}) } }; my $a=D.new; $a.val | |||
camelia | rakudo-jvm e5268b: OUTPUT«Unhandled exception: Too many positional parameters passed; got 1 but expected 0 in (/tmp/3pwDe3BOgl) in (gen/jvm/BOOTSTRAP.nqp:300) in MAIN (gen/jvm/main.nqp:46) in (gen/jvm/main.nqp:41) in (gen/jvm/main.nqp)» | ||
..rakudo-parrot e5268b: OUTPUT«Too many positional parameters passed; got 1 but expected 0current instr.: '' pc 277 ((file unknown):195980479) (/tmp/jRxRDXVYfF:1)called from Sub '' pc 14044 (src/gen/perl6-bootstrap.pir:3858) (gen/parrot/BOOTSTRAP.nqp:315)called from Sub 'MAIN…» | |||
clsn__ | Adding some slurpy *@_ params here and there would at least suppress that error message. | 19:40 | |
19:40
nebuchadnezzar left,
sftp left,
rhr_ left,
cxreg left,
genehack left
|
|||
Mouq | r: class D { has Int $.x = 0; method val is rw { my $n := $.x; Proxy.new(FETCH=> sub {@_;$n*10}, STORE=> sub {$n=@_[0]-10}) } }; my $a=D.new; $a.val | 19:41 | |
camelia | ( no output ) | ||
Mouq | It should really be easier than that, but that's the simplest I got it | 19:43 | |
clsn__ | class E { has Int $.x; method !export-setter { sub ($v) { $!x=$v; } }; method val($self:) is rw { Proxy.new(FETCH=>sub (*@_) {$self.x*10;},STORE=>sub ($s,$v) { ($self!export-setter)($v-10) }) } }; my $a=E.new(x=>10); $a.val | ||
r: class E { has Int $.x; method !export-setter { sub ($v) { $!x=$v; } }; method val($self:) is rw { Proxy.new(FETCH=>sub (*@_) {$self.x*10;},STORE=>sub ($s,$v) { ($self!export-setter)($v-10) }) } }; my $a=E.new(x=>10); $a.val | |||
camelia | ( no output ) | ||
clsn__ | huh, that worked for me... | 19:44 | |
r: class E { has Int $.x; method !export-setter { sub ($v) { $!x=$v; } }; method val($self:) is rw { Proxy.new(FETCH=>sub (*@_) {$self.x*10;},STORE=>sub ($s,$v) { ($self!export-setter)($v-10) }) } }; my $a=E.new(x=>10); $a.val=8 | |||
camelia | ( no output ) | ||
clsn__ | r: class E { has Int $.x; method !export-setter { sub ($v) { $!x=$v; } }; method val($self:) is rw { Proxy.new(FETCH=>sub (*@_) {$self.x*10;},STORE=>sub ($s,$v) { ($self!export-setter)($v-10) }) } }; my $a=E.new(x=>10); say $a.val | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«100» | ||
clsn__ | r: class E { has Int $.x; method !export-setter { sub ($v) { $!x=$v; } }; method val($self:) is rw { Proxy.new(FETCH=>sub (*@_) {$self.x*10;},STORE=>sub ($s,$v) { ($self!export-setter)($v-10) }) } }; my $a=E.new(x=>10); say $a.val=8 | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«-20» | ||
clsn__ | There, that works. | ||
Sprinkled *@_ around just to shut up error messages. | 19:45 | ||
19:45
genehack joined
19:46
rhr_ joined,
daxim__ joined,
Ben_Goldberg joined
19:48
xinming_ joined
19:51
Rotwang1 joined
19:52
BenGoldberg left,
spider-mario left,
kaare joined
19:53
kaare is now known as Guest65081,
genehack_ left,
rhr left,
daxim_ left,
xinming left,
hoelzro left,
yogan left,
Celelibi left,
pnu left,
japhb_ left,
rurban left,
tokuhirom left,
atrodo left,
dylanwh left
19:54
ribasushi_ joined
19:56
spider-mario joined,
genehack left
19:57
Rotwang left,
felipe left,
ribasushi left,
Guest31073 left,
ribasushi_ is now known as ribasushi
19:58
genehack joined
20:01
berekuk_ joined
20:02
colomon is now known as 17WAAPHZY,
colomon joined,
raydiak_ joined,
tadzik1 joined,
[Coke]_ joined
20:03
shlomif joined
20:04
tadzik left,
tadzik1 is now known as tadzik,
[Sno]_ joined
20:05
ashleyde1 joined
20:07
broquain1 joined,
Rotwang1 left
20:08
raydiak left,
broquaint left,
zakalwe_ left,
berekuk left,
[Coke] left,
ribasushi left,
17WAAPHZY left,
rindolf left,
ashleydev left,
nebuchad` left,
ribasushi joined
20:09
Rotwang joined
20:13
[Sno] left,
simcop2387 left,
[Sno]_ is now known as [Sno],
broquaint joined
20:14
simcop2387 joined
20:17
zakharyas left
|
|||
colomon | r: say 2.log | 20:18 | |
camelia | rakudo-jvm e5268b: OUTPUT«0.6931471805599453» | ||
..rakudo-parrot e5268b: OUTPUT«0.693147180559945» | |||
20:18
zakalwe joined,
zakalwe left,
zakalwe joined,
broquain1 left
20:21
nnunley_ joined,
Piers is now known as 21WAB3U7B,
Piers joined
20:22
baest_ joined
20:23
mattp_ joined,
raydiak__ joined
20:24
sergot joined,
brother| joined
20:25
Juerd_ joined,
Mouq left,
mattp__ left
20:36
sorear left,
ivan`` left,
stevan___ left,
Vlavv__ left,
ingy left,
wsri left,
avuserow left,
lizmat left,
mcglk left,
Woodi left,
wtw left,
corecatcher left,
pochi left,
integral left,
autumn left,
Gothmog_ left,
grep0r left,
tomaw left,
raydiak__ left,
Piers left,
colomon left,
berekuk_ left,
spider-mario left,
Ben_Goldberg left,
rhr_ left,
sftp_ left,
moritz_ left,
cognominal left,
gcole left,
silug left,
aindilis left,
PZt left,
markov left,
yeltzooo left,
perigrin left,
diakopter left,
jtpalmer left,
sunnavy left,
obra left,
Grrrr left,
mls left,
eiro left,
cosimo left,
d^_^b left,
baest_ left,
Rotwang left,
ribasushi left,
samebchase left,
SHODAN left,
Timbus left,
arnsholt left,
Psyche^ left,
espadrine left,
mohij left,
kst left,
mtk left,
apejens left,
smash left,
FROGGS left,
awwaiid_ left,
cotto left,
BinGOs left,
Juerd_ left,
brother| left,
tadzik left,
xinming_ left,
daxim__ left,
cxreg2 left,
djanatyn left,
Tene left,
avar left,
_sri left,
rafl left,
flussence left,
Maddingue left,
segomos_ left,
TimToady left,
ashleyde1 left,
raydiak_ left,
genehack left,
sergot_ left,
21WAB3U7B left,
virtualsue left,
johnmilton left,
nnunley left,
atta left,
araujo left,
Pleiades` left,
torbjorn left,
brother left,
ivanshmakov left,
baest left,
lue left,
cooper left,
Juerd left,
synopsebot left,
pmurias left,
beastd left,
xenoterracide left,
abnorman left,
sjn left,
dagurval left,
logie left,
woolfy left,
BooK left,
prammer left,
revdiablo left,
ggoebel left,
jnthn left,
ponbiki left,
clsn__ left,
nwc10 left,
odoacre left,
robinsmidsrod left,
Rix left,
LordVorp left,
huf left,
geekosaur left,
preflex left,
telex left,
clkao_ left,
PerlJam left,
Grimnir_ left,
Bucciarati left,
sitaktif left,
Biohazard left,
c1sung left,
risou_awy left,
JimmyZ left,
jlaire left,
japhb left,
sergot left,
mattp_ left,
nnunley_ left,
thou left,
PacoAir left,
itz left,
Alina-malina left,
dalek left,
_ilbot left,
Khisanth left,
krunen left,
zamolxes left,
mtj_- left,
hugme left,
zakalwe left,
broquaint left,
[Sno] left,
shlomif left,
[Coke]_ left,
Guest65081 left,
mathw_ left,
sjohnson left,
rjbs left,
pmichaud left,
Util left,
masak left,
eternaleye left,
breinbaas left,
[particle] left,
lestrrat left,
simcop2387 left,
kshannon_ left,
dbrock left,
go|dfish left,
labster left,
xfix left,
pjcj left,
bakedb left,
bibifuc left,
Exodist left,
Ulti left,
rom1504 left
20:38
mtj_ joined,
ivan``_ joined,
sorear_ joined,
araujo joined,
atta joined,
Pleiades` joined,
synopsebot joined,
brandon__ joined,
lue joined,
cooper joined,
genehack_ joined,
Juerd joined,
brother| joined,
sergot joined,
raydiak__ joined,
mattp_ joined,
baest_ joined,
Piers joined,
nnunley_ joined,
zakalwe joined,
simcop2387 joined,
broquaint joined,
Rotwang joined,
ribasushi joined,
[Sno] joined,
shlomif joined,
[Coke]_ joined,
tadzik joined,
colomon joined,
spider-mario joined,
Guest65081 joined,
xinming_ joined,
Ben_Goldberg joined,
daxim__ joined,
rhr_ joined,
cxreg2 joined,
mathw_ joined,
sftp_ joined,
moritz_ joined,
cognominal joined,
djanatyn joined,
Tene joined,
pmurias joined,
thou joined,
Psyche^ joined,
beastd joined,
PacoAir joined,
gcole joined,
espadrine joined,
mohij joined,
sjohnson joined,
geekosaur joined,
rjbs joined,
preflex joined,
itz joined,
telex joined,
kst joined,
xenoterracide joined,
abnorman joined,
Alina-malina joined,
mtk joined,
dalek joined,
grep0r joined,
Gothmog_ joined,
autumn joined,
integral joined,
pochi joined,
corecatcher joined,
wtw joined,
Woodi joined,
_ilbot joined,
Khisanth joined,
krunen joined,
zamolxes joined,
clkao_ joined,
PerlJam joined,
Grimnir_ joined,
Bucciarati joined,
sitaktif joined,
jlaire joined,
Biohazard joined,
c1sung joined,
risou_awy joined,
JimmyZ joined,
japhb joined,
sjn joined,
dagurval joined,
logie joined,
woolfy joined,
BooK joined,
prammer joined,
revdiablo joined,
ggoebel joined,
jnthn joined,
dickson.freenode.net sets mode: +vv preflex dalek,
ponbiki joined,
clsn__ joined,
nwc10 joined,
odoacre joined,
robinsmidsrod joined,
Rix joined,
LordVorp joined,
huf joined,
lestrrat joined,
[particle] joined,
breinbaas joined,
eternaleye joined,
masak joined,
Util joined,
pmichaud joined,
kshannon_ joined,
dbrock joined,
stevan___ joined,
Vlavv__ joined,
bibifuc joined,
ingy joined,
wsri joined,
avuserow joined,
go|dfish joined,
lizmat joined,
labster joined,
xfix joined,
camelia joined,
jercos joined,
ruoso_ joined,
pjcj joined,
bakedb joined,
Exodist joined,
Ulti joined,
rom1504 joined,
avar joined,
_sri joined,
rafl joined,
flussence joined,
Maddingue joined,
segomos_ joined,
TimToady joined,
apejens joined,
smash joined,
FROGGS joined,
awwaiid_ joined,
cotto joined,
dickson.freenode.net sets mode: +v camelia,
BinGOs joined,
SHODAN joined,
Timbus joined,
arnsholt joined,
mcglk joined,
samebchase joined,
silug joined,
aindilis joined,
PZt joined,
markov joined,
yeltzooo joined,
perigrin joined,
diakopter joined,
jtpalmer joined,
sunnavy joined,
obra joined,
Grrrr joined,
mls joined,
eiro joined,
d^_^b joined,
cosimo joined,
tomaw joined
20:39
ivanshmakov joined,
berekuk joined
20:42
hugme joined,
ChanServ sets mode: +v hugme
|
|||
pmurias | r: class E { has Int $.x; method val($self:) is rw { Proxy.new(FETCH=>sub (*@_) {$!x*10;},STORE=>sub ($s,$v) { $!x = $v-10 }) } }; my $a=E.new(x=>10); $a.val=8; say $a.val; | 20:48 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«-20» | ||
pmurias | clsn__: ^^ you don't need to define helper setter methods | ||
FROGGS | r: class E { has Int $.x; method val($self:) { Proxy.new(FETCH=>sub (*@_) {$!x*10;},STORE=>sub ($s,$v) { $!x = $v-10 }) } }; my $a=E.new(x=>10); $a.val=8; say $a.val; | 20:50 | |
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«-20» | ||
FROGGS | and no 'is rw' | ||
21:00
krunen left
21:01
krunen joined
|
|||
clsn__ | I thought the is rw was key. OK. | 21:02 | |
21:03
Mouq joined
21:10
shlomif left
|
|||
clsn__ | Not clear what goes on in that *@_ slurpy param. When I try to print it out before returning the value, it never returns. When I return @_, I get an empty array. | 21:15 | |
lue | clsn__: have you tried using something other than @_ for slurpy, see if that somehow is the issue? /me doesn't recall what, if any, weird stuff @_ does. | 21:23 | |
21:30
berekuk left
21:34
berekuk joined
21:39
nebuchadnezzar joined,
moritz_ is now known as moritz
|
|||
clsn__ | Name doesn't matter; it looks like it contains the Proxy object, but printing that out causes things to thrash. I can print out +@_ or @_[0].WHAT. | 21:41 | |
pmurias | FROGGS: re no 'is rw' isn't that a rakudo bug? | ||
masak | pmurias: no, $!x is always writable. | 21:43 | |
(because it's the underlying storage) | |||
clsn__ | But shouldn't the method have to be marked is rw? | ||
FROGGS | pmurias: I'm not sure... I tend to think that the proxy is always writeable if you make its STORE method that way... | ||
pmurias | r: my $foo; $foo = 1; sub foo { $foo };foo = 123;say $foo | 21:44 | |
camelia | rakudo-jvm e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/jyTiriQKsZPreceding context expects a term, but found infix = insteadat /tmp/jyTiriQKsZ:1------> y $foo; $foo = 1; sub foo { $foo };foo =⏏ 123;say $foo» | ||
..rakudo-parrot e5268b: OUTPUT«===SORRY!=== Error while compiling /tmp/4OPj_aUdI6Preceding context expects a term, but found infix = insteadat /tmp/4OPj_aUdI6:1------> y $foo; $foo = 1; sub foo { $foo };foo =⏏ 123;say $foo» | |||
pmurias | r: my $foo; $foo = 1; sub foo { $foo };foo() = 123;say $foo | ||
camelia | rakudo-jvm e5268b: OUTPUT«Cannot assign to a readonly variable or a value» | ||
..rakudo-parrot e5268b: OUTPUT«Cannot assign to a readonly variable or a value in block at /tmp/JfWT0Csz0K:1» | |||
pmurias | r: my $foo; $foo = 1; sub foo is rw { $foo };foo() = 123;say $foo | ||
camelia | rakudo-parrot e5268b, rakudo-jvm e5268b: OUTPUT«123» | ||
pmurias | masak, FROGGS: is rw seems to be required | 21:45 | |
FROGGS | you don't have a proxy there | 21:46 | |
21:46
raydiak__ is now known as raydiak
|
|||
clsn__ | r: class A { has Int $.x; method val($self:) {Proxy.new(FETCH=>sub ($d) { $!x*10}, STORE=>sub ($a,$v) { $!x=$v-10})}}; my $a=A.new(:x(10)); say $a.val | 21:46 | |
camelia | rakudo-parrot e5268b: OUTPUT«(signal SEGV)» | ||
..rakudo-jvm e5268b: OUTPUT«100» | |||
clsn__ | Interesting! I only have rakudo-p, I kept getting segvs. | ||
FROGGS | the proxy is in charge to handle fetch and store, so why don't you let it handle it? | 21:47 | |
pmurias | S06:535 | ||
synopsebot | Link: perlcabal.org/syn/S06.html#line_535 | ||
clsn__ | It's okay if the $d is *@d, but not $d. | ||
pmurias | r: class A { has Int $.x; method val($self:) is rw {Proxy.new(FETCH=>sub ($d) { $!x*10}, STORE=>sub ($a,$v) { $!x=$v-10})}}; my $a=A.new(:x(10)); say $a.val | ||
camelia | rakudo-parrot e5268b: OUTPUT«(signal SEGV)» | ||
..rakudo-jvm e5268b: OUTPUT«100» | |||
clsn__ | It's the signature of the FETCH that it doesn't like somehow. | 21:48 | |
pmurias | actually according to the spec Proxy takes methods | ||
FROGGS | r: class A { has Int $.x; method val($self:) is rw {Proxy.new(FETCH=>sub ($d) { $self.x*10}, STORE=>sub ($a,$v) { $!x=$v-10})}}; my $a=A.new(:x(10)); say $a.val | ||
camelia | rakudo-parrot e5268b: OUTPUT«(signal SEGV)» | ||
..rakudo-jvm e5268b: OUTPUT«100» | |||
FROGGS | r: class A { has Int $.x; method val($self:) is rw {Proxy.new(FETCH=>sub ($d) { $self.x*10}, STORE=>sub ($a,$v) { $self.x=$v-10})}}; my $a=A.new(:x(10)); say $a.val | 21:49 | |
clsn__ | Yeah, I'd been trying with methods on the proxy before but at least the subs worked. | ||
camelia | rakudo-parrot e5268b: OUTPUT«(signal SEGV)» | ||
..rakudo-jvm e5268b: OUTPUT«100» | |||
masak | personally, I like "100" a lot better. | 21:57 | |
FROGGS | depends... is "signal SEGV" a type object? | 21:59 | |
22:00
Ben_Goldberg is now known as BenGoldberg
|
|||
FROGGS | p: Int.HOW.set_name(Int, "signal SEGV"); say my Int $x # /o\ | 22:01 | |
camelia | rakudo-parrot e5268b: OUTPUT«(signal SEGV)» | ||
lue | FROGGS: no(t yet, perhaps) | ||
( notice how your example has  after the () ) | |||
FROGGS | :P | ||
we should invent a game: abuse the MOP | 22:02 | ||
lue | I forget if SIGSEGV is one of those uncatchable signals (I'm guessing no, but...) | ||
geekosaur | it's catchable, just dubious | 22:10 | |
since it's entirely likely that something is now too screwed up for you to be able to do anything | |||
22:11
benabik joined
22:14
hoverboard joined
22:22
spider-mario left
22:23
Mouq left
22:25
brandon__ left
22:29
beastd left
22:32
raiph left
|
|||
masak | 'night, #perl6 | 22:32 | |
22:47
raiph joined
23:03
berekuk left
23:07
Mouq joined
23:25
berekuk joined
23:26
raiph left,
[Coke]_ is now known as Coke,
Coke is now known as [Coke]
23:44
berekuk left
23:46
colomon left
23:49
colomon joined
23:51
raiph joined
|
|||
jnthn is home from the Christmas/New Year travels :) | 23:54 | ||
preflex | jnthn: you have 1 new message. '/msg preflex messages' to read it. | ||
timotimo | oh hey jnthn :) | 23:55 | |
can you quickly sketch out what method bind_sig is supposed to do when it gets a BIND_RESULT_JUNCTION back from the binder? | 23:56 | ||
it seems like all i have to do is call Junction.AUTOTHREAD($caller, $sig) | |||
but if that was all, it wouldn't have been stubbed with a nqp::die that's about as many characters of code as the corresponding implementation | 23:57 | ||
ah, no, that's not quite right | 23:59 | ||
i think i have to keep the signature, but prepend the code to be called to it and invoke the method with that resulting signature perhaps? |