»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:01 cognominal joined 00:02 aBound joined 00:03 aBound left 00:07 lue joined 00:09 erkan joined, erkan left, erkan joined 00:11 cognominal left 00:13 thou left 00:21 cognominal joined 00:27 thou joined 00:30 bowtie left, MayDaniel left 01:07 cognominal left 01:15 rindolf left 01:16 marloshouse joined 01:48 dayangkun left 01:54 whiteknight left, ifim left 01:55 erkan left 02:01 dayangkun joined 02:12 fgomez left 02:19 thou left 02:37 popl joined 02:40 fgomez joined 02:50 PacoAir left 02:56 FROGGS_ joined 02:58 FROGGS left 03:02 hash_table joined 03:25 noggle joined 03:29 noggle_ left 03:30 hash_table left 03:32 cognominal joined 03:47 jaldhar joined 03:50 Chillance left 03:52 cognominal left 04:09 stevan_ left 04:11 stevan_ joined 05:32 xinming left 05:36 xinming joined 06:21 araujo joined 06:54 am0c joined 06:57 SamuraiJack joined 07:29 donghongbo joined 07:32 popl left 07:51 slayer101_ joined 07:52 slayer101_ left
timotimo the advent post turned out good. except "thats how Perl 6 spells Perl 5′s qr operator,<unnecessary linebreak>" and "Larry Wall also likes to joke that he back the “regular” back" has one back too much 08:01
08:03 GlitchMr joined 08:12 SamuraiJack left 08:16 kaare_ joined
diakopter hi 08:23
Thats needs apostrophe 08:41
08:47 donghongbo left 08:55 am0c left
GlitchMr std: /(?:\d\w)+/ 08:59
p6eval std a8bc48f: OUTPUT«===SORRY!===␤Unsupported use of (?: ... ) for grouping; in Perl 6 please use [ ... ] at /tmp/orxEAYSjF4 line 1:␤------> /(?:⏏\d\w)+/␤Parse failed␤FAILED 00:00 41m␤»
GlitchMr std: /(?!(?=what)(?!....the)that)+/ 09:00
p6eval std a8bc48f: OUTPUT«===SORRY!===␤Unsupported use of (?! ... ) for lookahead; in Perl 6 please use <!before ... > at /tmp/HkLsCRyBJm line 1:␤------> /(?!⏏(?=what)(?!....the)that)+/␤Parse failed␤FAILED 00:00 41m␤»
09:23 MayDaniel joined, pmurias joined 09:35 fgomez left
moritz travel& 09:36
09:41 Psyche^ joined 09:42 Patterner left, Psyche^ is now known as Patterner 10:01 donghongbo joined 10:10 donghongbo left 10:34 donghongbo joined
tadzik damn wordpress is horrible 10:41
but still, loliblogged! ttjjss.wordpress.com/2012/12/22/thr...do-perl-6/
10:43 Kharec joined 11:00 PacoAir joined, gaussblurinc_ joined
pmurias jnthn: ping 11:00
11:02 PacoAir left, Vlavv joined
pmurias tadzik: don't green threads which block on IO have very little usefullness? 11:02
* usefulness 11:03
11:03 PacoAir joined
tomgj Suppose I'm returning a Proxy object from a read write method. What's the best way to access the outer object's private data from within the Proxy object's methods? 11:03
tadzik pmurias: they do, yeah
it is a bit imperfect, but it's the best we've got
11:04 lichtkind joined
tomgj ie do something like this but with a private variable instead of $.bar: 11:05
class Foo { has $.bar is rw; method my_bar($foo:) is rw { return Proxy.new: FETCH => method () { $foo.bar }, STORE => method ($new) {$foo.bar = $new} } }
lichtkind masak: great work reads lot smoother, hoever is still a &mash; in it
tadzik tomgj: won't $!bar just work?> 11:06
tomgj tadzik: do you mean like this: 11:08
class Foo { has $!bar is rw; method my_bar($foo:) is rw { return Proxy.new: FETCH => method () { $!bar }, STORE => method ($new) {$!bar = $new} } }
tadzik yeah, doesn't that work?
oh, hold on
you don't need has $!bar is rw;
tomgj I get "Method 'bar' not found for invocant of class 'Foo'" from rakudo 2012-11 11:09
tadzik (I think)
can you nopaste the whole code somewhere?
11:13 am0c_ joined
tomgj tadzik: nopaste.info/e989c26d09.html 11:13
takzik: apologies, the error is actually "Cannot assign to a non-container ..." 11:14
with rakudo-star-2012.11 11:15
tadzik indeed, I see
tomgj: nopaste.info/c887b0f688.html 11:17
I feel that it may be more of a workaround than a solution, but seems to work :)
pmurias what should the method to convert to a nqp number be called?
and the ones to convert to a nqp integer and string?
tadzik p6unbox_n or something 11:18
if that's what you mean
rakudo has nqp::unbox_n, nqp::unbox_i and so 11:19
11:21 am0c_ left
tomgj tadzik: thanks, interesting. So what kind of thing would one say $ is in that? 11:22
11:25 Pleiades` joined 11:26 am0c_ joined
tomgj hmm, I see that S12-attributes/mutators.t has an example that's very similar, but is disabled for rakudo 11:29
tadzik tomgj: well, method is not much different from a sub, which first argument is the invocant 11:39
I write '$' as "here be the invocant, whatever it is"
hoelzro afternoon #perl6 11:40
pmurias tadzik: I need a method to implement the conversion in nqp-js 11:41
11:51 Pleiades` left
sorear fun little logic puzzle for y'all to solve (in perl 6 or otherwise): gist.github.com/4358598 11:54
spoilers can be found easily by searching on the description
tomgj okay, so the invocant of that proxy method is a Foo? 11:55
as well as being a Proxy? 11:56
btw this segfaults my rakudo: nopaste.info/232ed09242.html
11:56 Pleiades` joined
tadzik jnthn may be interesting in segfaults 11:56
tomgj: I must say I'm not sure what's the invocant in that case 11:57
synopses probably know
tomgj err, my last paste should have been more like nopaste.info/0a7d389e98.html - still segfaults it
masak hola, #perl6 12:13
12:14 jokar joined
masak diakopter: s/thats/that's/ fixed. 12:16
timotimo: thanks for proofing.
tadzik++ # ttjjss.wordpress.com/2012/12/22/thr...do-perl-6/ 12:17
12:17 att__ joined 12:18 gaussblurinc_ left
tadzik hola masak :) 12:19
sorear moin masak. 12:20
my last link was intended largely for you.
but now sleep&
jokar Excuse me, A beginner user can use perl 6? 12:21
masak jokar: yes, absolutely. 12:22
it's easy:
r: say "oh hai!"
p6eval rakudo c8de2e: OUTPUT«oh hai!␤»
masak a beginner user can do that :)
jokar if it is not know any programming language, 12:23
tadzik you have to start with some
12:23 rindolf joined
jokar You recommended Perl 5 or 6? 12:24
:-/ 12:25
tadzik both!
rindolf jokar: what for?
jokar for start
tadzik Perl 6 is very insightful, but it may not be suitable for real-world applications
for learning, Perl 6 is perfectly fine, probably saner than Perl 5 too 12:26
jokar OK, Thank you
masak jokar: if you start with Perl 5, you have to live with all the misfeatures that we've improved in Perl 6. 12:27
jokar: but you'll get a more complete platform to code on.
jokar: inversely with Perl 6: the language experience is nicer, but not all tools are there for you, and some assembly required.
jokar misfeatures?
masak jokar: yes, I can give you a few examples if you want.
jokar yes
masak sigil variance. 12:28
thought to be a really cool idea when it was introduced.
jokar masak: Can i send Pm?
masak eval: my @a = (1, 2, 3); $a[1]
buubot_backup masak: 2
masak jokar: yes, but there are some advantages to doing the discussion here on #perl6.
12:28 am0c_ left
masak more people are able to respond to you. 12:28
(and I'll have access to the evalbots) :) 12:29
jokar: see that $a[1]?
that's sigil variance. the @ changes to a $ because we access one scalar value from the array. 12:30
huf it's arguable if that's a misfeature in p5
still, i get why it was changed ni p6
masak huf: it's very arguable, yes.
huf: I've heard sigil variance being defended by staunch p5ers.
huf i *like* it in p5. it makes sense.
masak oh, I agree. 12:31
tomgj talking of evalbots, what's the output here from the bot if rakudo segfaults?
masak huf: do you agree that it's not geared towards, hm, pleasing beginners? :)
tomgj is it okay if i try?
huf but the very bottom of p6 is so vastly different from p5, it's no wonder it was changed
masak: i dont see the point in pleasing beginners
and every language/ecosystem has beginner-unfriendly warts
tomgj r: class Foo { has $.bar is rw; method my_bar($foo:) is rw { return Proxy.new: FETCH => method () { print self.WHAT; return $foo.bar; }, STORE => method ($new) { print self.WHAT; $foo.bar = $new; } } } my $foo = Foo.new; $foo.my_bar = 7; 12:32
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/jMFEQoEoDI:1␤------> print self.WHAT; $foo.bar = $new; } } } ⏏my $foo = Foo.new; $foo.my_bar = 7;␤ expecting any of:␤ postfix␤ infix or meta-infix␤ infix stopper␤ …
masak huf: you didn't answer my question.
we can talk about the point of pleasing beginners separately ;)
huf masak: well, i dont know. i see people struggling with it on #perl, but fwiw, i never got stuck at that point
masak I think it's one of those "easy if you know it" things. 12:33
huf they strugle _far_ more with explicit references, and i think those are brilliant too
same for the autoflatten behavior
masak it's definitely something that goes into a Perl course.
huf so yeah, it's different, but i dont think it's complicated or a misfeature :)
but i know the reasons why people dont like it
masak Perl 6 has autoflattening too, although a bit less of it in places. 12:35
and the autoflattening happens a bit more lazily.
Perl 6 gets rid of the explicit references, and goes all-out implicit references. 12:36
12:36 ServerSage left
huf what does the sigil do in p6? constrain the types a variable can hold? 12:36
masak aye.
huf and maybe affect how it interpolates in specific contexts?
a list of 1, @a flattens, a list of 1, $a doesnt (where both @a and $a are an array of things)
or am i misremembering?
masak what Perl 5 succeeds with brilliantly is to make the language core feel "small". (amazingly) you could define a core of Perl 5 consisting of scalars, arrays, and hashes, and that'd describe most of it. 12:37
huf: sounds about right.
huf: the $ sigil signals "I'm an item, don't autoflatten me".
huf cause yeah, in this world, the sigil-variance of p5 would make no sense :)
masak right.
huf masak: implicit refs as in everything is a ref everywhere? 12:38
and apart from =, and sub params declared is copy, no magic copying?
masak huf: yes, that kind of implicit refs. 12:40
huf: not 100% about the magic copying, but I think so.
huf hm. so if i'm mangling complicated self-referential datastructures, i just switch to := instead of =
and it just works? :)
iirc = tries hard to pretend you're still in perl5 12:41
... as far as copying goes
pmurias masak: re core language doesn't Perl 6 also have the small core property? 12:42
masak I think = will work as well as := for complicated self-referential datastructures.
since most things are references.
huf so how do you get copies? 12:43
masak pmurias: quite possibly, but I personally don't see it as clearly, as core aspects such as lists keep changing around.
pmurias: so, ask me again in 10 years or so ;)
huf: oh, I think I see what you mean.
r: my @a = 1, 2, 3; my @b = @a; say @a === @b
p6eval rakudo c8de2e: OUTPUT«False␤»
masak huf: yeah, that's a copy.
huf $x = 1; $y = $x; $y++; # i'd expect $x to still be 1 :)
masak right.
r: $x = 1; $y = $x; $y++; say $x 12:44
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Variable $x is not declared␤at /tmp/nOy2L4Nce2:1␤------> $x⏏ = 1; $y = $x; $y++; say $x␤ expecting any of:␤ postfix␤»
masak ehm :)
r: my $x = 1; my $y = $x; $y++; say $x
p6eval rakudo c8de2e: OUTPUT«1␤»
huf r: my $x = 1; my $y := $x; $y++; say $x
p6eval rakudo c8de2e: OUTPUT«2␤»
huf well. nice.
thanks for allowing me this braindrain :)
i have a very hazy understanding of p6 concepts and then every now and then i pester someone to explain 12:45
masak it's always fun to have discussions with well-versed p5ers. 12:47
and important, I would say.
we need advocates in both camps, to combat all the FUD. 12:48
12:48 FROGGS_ left
huf oh yes. 12:48
12:50 am0c_ joined
masak sorear: what a delightful little problem. gist.github.com/4358598 12:59
sorear: and the search space is small enough for a brute-force approach :) 13:00
I might attempt that.
the interesting part is still modeling the problem, even with a brute-force approach.
13:02 GlitchMr left
masak rn: say "how many pairs (X, Y) of integers exist such that X & Y > 1 and X + Y < 100?" 13:02
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«how many pairs (X, Y) of integers exist such that X & Y > 1 and X + Y < 100?␤»
masak rn: my $c = 0; for 2..100 -> $X { for 2..100 -> $Y { if $X + $Y < 100 { $c++ } } }; say $c 13:03
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«4656␤»
masak rn: say +(2..100 X 2..100).grep({ $^X + $^Y < 100 })
p6eval rakudo c8de2e: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in block at /tmp/S6jDrfgXYE:1␤␤»
..niecza v24-12-g8e50362: OUTPUT«Unhandled exception: No value for parameter '$Y' in 'ANON'␤ at /tmp/EWghYwbodg line 0 (ANON @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1058 (Block.ACCEPTS @ 4) ␤ at <unknown> line 0 (KERNEL grep @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting l…
masak aw, that still doesn't work? :( 13:04
rn: say +(2..100).map(-> $X { [(2..100).map(-> $Y {[$X, $Y]})] ) 13:05
p6eval niecza v24-12-g8e50362: OUTPUT«===SORRY!===␤␤Unable to parse block at /tmp/OX4XDxs9E9 line 1:␤------> say +(2..100).map(-> $X {⏏ [(2..100).map(-> $Y {[$X, $Y]})] )␤Couldn't find final '}'; gave up at /tmp/OX4XDxs9E9 line 1:␤------> > $X { [(2..1…
..rakudo c8de2e: OUTPUT«===SORRY!===␤Unable to parse expression in block; couldn't find final '}'␤at /tmp/km1uFdFuyU:1␤------> > $X { [(2..100).map(-> $Y {[$X, $Y]})] ⏏)␤ expecting any of:␤ postfix␤ infix or meta-infix␤ infix st…
felher sorear++ #posting a logic puzzle that was fun to solve :) 13:07
masak rn: say +(2..100).map(-> $X { (2..100).map(-> $Y { [$X, $Y] if $X + $Y < 100 }) })
p6eval niecza v24-12-g8e50362: OUTPUT«99␤» 13:08
..rakudo c8de2e: OUTPUT«4656␤»
masak felher: oh, you already solved it? :)
sorear: surely something wrong there.
(with niecza's output just now)
13:08 renormalist joined
felher masak: yes, I did :) 13:08
masak dang, I'm behind the curve :P 13:09
time to start coding it, then.
dalek kudo-js: b16d865 | (Paweł Murias)++ | TODO:
start of TODO
13:11
kudo-js: 780cb6c | (Paweł Murias)++ | TODO:
[nqp] add stuff to TODO
kudo-js: 4ea22c5 | (Paweł Murias)++ | / (3 files):
[nqp] keep lexicals in the ctx object so we can access from called subs,pass test 29, implement !make
felher has another problem to solve right now...
0 139 root@win6071d [ /home/felher ] #> mount
zsh: segmentation fault mount
masak felher: "I was sure that you could not find them" corresponds to the product X*Y not having unique factors, right? 13:12
felher Mount should not get me a segmentation fault...
masak oh, and I think moritz will like this puzzle as well.
he's been known to post "knowledge-based" math problems before.
heh, this kind of problem would be completely impossible to solve for someone without a Theory of Mind... :P 13:13
felher masak: Correct :) "i was sure..." means "the sum I know can not be expressed as the sum of two primes"
masak oh, right. S is saying that. 13:14
I'll post my solution here as a gist when I've solved the problem. 13:15
felher oO... mount - segmentation fault. dmesg - input/output error, cat /var/log/messages - input/output error. 13:19
tadzik oh noes
felher reboots and hopes he comes back on again...
masak rn: say +(2..100).map(-> $X { ($X..100).map(-> $Y { [$X, $Y] if $X + $Y < 100 }) }) 13:21
p6eval niecza v24-12-g8e50362: OUTPUT«99␤»
..rakudo c8de2e: OUTPUT«2352␤»
masak I briefly forgot about symmetry breaking ;) 13:22
13:22 Chillance joined
felher is eager to see masaks gist :) 13:28
masak rn: my @primes = (1..100).grep(*.is-prime); sub isn't_sum_of_2_primes($n) { return !@primes.first( { is-prime $n - $_ } ) }; say (2..100).grep(&isn't_sum_of_2_primes) 13:31
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«2 3 11 17 23 27 29 35 37 41 47 51 53 57 59 65 67 71 77 79 83 87 89 93 95 97␤»
masak well, this simplifies matters further :)
13:38 lichtkind left 13:41 isBEKaml joined
isBEKaml p6advent post looks good. We need an apostrophe in "Thats still kinda clunky" 13:43
"If we’re interested in the individual integers" -- one too many "the", maybe that's just me. :) 13:44
"inside of the bigger Perl 6 language" -- doesn't sound too good. How about "within" ? 13:46
</end>
13:50 bowtie joined 13:53 donghongbo left
masak isBEKaml: good points. fixing. 14:01
isBEKaml masak++ #blog post, proofing, rewording. 14:02
masak updated. 14:03
14:03 donghongbo joined
colomon rn: my @primes = (1..100).grep(*.is-prime); my $prime-sums = set @primes X+ @primes; say (2..100).grep(* !(elem) $prime-sums); 14:08
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«2 3 11 17 23 27 29 35 37 41 47 51 53 57 59 65 67 71 77 79 83 87 89 93 95 97␤»
colomon can you import MAIN from a module? 14:09
colomon is trying to figure out how to re-engineer the Collatz benchmarking framework to more precisely measure the time the actual calculations take -- right now overhead is swamping the timings of the faster routines. 14:11
14:12 dayangkun left, rindolf left
colomon is now dreaming about lazy infinite Sets... 14:14
masak how do you ensure that a membership query on a lazy infinite set terminates? 14:16
14:18 Kharec left
colomon masak: I was specifically thinking sets of numbers, and they'd have to be ordered to work. 14:19
well, I guess anything that was ordered could work.
donghongbo join coffeescript 14:21
masak donghongbo: :)
donghongbo sorry
isBEKaml donghongbo: phel :)
masak donghongbo: what brings you to #coffeescript? 14:22
masak still hasn't decided if CoffeeScript is a good idea or not
donghongbo i just think it's simple, and type less 14:23
masak right. 14:25
but suddenly you're working one step away from the actual substrate of programming.
error messages happen in code you didn't directly write.
your mental model has to accommodate for both JavaScript and CoffeeScript. 14:26
felher is afk for some hours. 14:47
masak: I would appreciate it, if you highlight me, when posting your gist. So I find it quickly when I return :) 14:48
14:49 GlitchMr joined 14:53 GlitchMr left, GlitchMr joined
timotimo colomon: maybe have a probabilistic membership query instead? 14:54
14:54 am0c_ left
masak felher: will do. :) 14:55
working on the solution now.
timotimo like is-prime, there may be a formula that approximates the probability of an error 14:56
dalek p: 3370a7d | (Paweł Murias)++ | t/nqp/21-contextual.t:
Test that contextuals are not implemented as globals.
14:57
15:06 rindolf joined 15:07 am0c joined
pmurias masak: of course coffescript is a bad idea, that's why I'm working on nqp-js ;) (and once that's done on rakudo-js) 15:07
timotimo so do you think nqp-js can be used semi-properly for website scripting? or would you feed it to node.js instead?
15:09 donghongbo left
pmurias timotimo: I don't really on anything really node specific ATM, it could be easily tweaked for website scripting 15:11
timotimo that amuses me :)
15:20 lolage joined 15:27 bot48 left 15:29 sw joined, bot48 joined, sw left 15:31 isBEKaml left
timotimo r: my &fullwidth := *.trans("a".."z" => chrs(0xFF41..0xFF5A), "A".."Z" => chrs(0xFF21..0xFF3A)); say fullwidth("Hello all you happy perl6 people") 15:32
p6eval rakudo c8de2e: OUTPUT«Hello all you happy perl6 people␤»
15:34 lorn joined
timotimo r: my &fullwidth := *.trans("a".."z" => chrs(0xFF41..0xFF5A), "A".."Z" => chrs(0xFF21..0xFF3A)); say fullwidth("azAZ") 15:34
p6eval rakudo c8de2e: OUTPUT«azAZ␤»
GlitchMr my &fullwidth := *.trans(chrs(0x20..0x7F) => chrs(0xFF41..0xFF5A)); say fullwidth("Hello all you happy perl6 people") 15:35
timotimo r: my &fullwidth := *.trans("a".."z" => "a".."z", "A".."Z" => "A".."Z"); say fullwidth("Hello all you beautiful and silly unicode characters")
GlitchMr r: my &fullwidth := *.trans(chrs(0x20..0x7F) => chrs(0xFF41..0xFF5A)); say fullwidth("Hello all you happy perl6 people")
p6eval rakudo c8de2e: OUTPUT«(timeout)»
rakudo c8de2e: OUTPUT«oryybanyyalbhauncclacreywacrbcyr␤»
GlitchMr oh, rite
rindolf kicks Dist-Zilla's documentation. 15:36
GlitchMr r: my &fullwidth := *.trans(chrs(0x20..0x7F) => chrs(0xFF20..0xFF7F)); say fullwidth("Hello all you happy perl6 people")
p6eval rakudo c8de2e: OUTPUT«h・ャャッ@。ャャ@ケッオ@ィ。ーーケ@ー・イャV@ー・ッーャ・␤»
rindolf It needs a FAQ fast!
timotimo what caused the timeout? :\
GlitchMr oh, right, it doesn't map to ASCII
timotimo r: +("a".."z")
r: say +("a".."z")
GlitchMr Or they do
p6eval rakudo c8de2e: OUTPUT«(timeout)» 15:37
timotimo this surprises me.
GlitchMr r: my &fullwidth := *.trans(chrs(0x20..0x7E) => chrs(0xFF00..0xFF5E)); say fullwidth("Hello all you happy perl6 people")
p6eval rakudo c8de2e: OUTPUT«Ifmmp!bmm!zpv!ibqqz!qfsm7!qfpqmf␤»
timotimo r: say "a".succ
GlitchMr Close enough
p6eval rakudo c8de2e: OUTPUT«a␤»
timotimo huh?
r: say chr("a".ord.succ)
p6eval rakudo c8de2e: OUTPUT«b␤»
timotimo is this a rakudobug?
r: say "a".succ 15:38
p6eval rakudo c8de2e: OUTPUT«b␤»
timotimo perhaps it only works for "a".."z"? as a special case?
GlitchMr r: my &fullwidth := *.trans(chrs(0x21..0x7E) => chrs(0xFF01..0xFF5E)); say fullwidth("Hello all you happy perl6 people")
p6eval rakudo c8de2e: OUTPUT«Hello all you happy perl6 people␤»
tadzik whoa
Text::Fatspeak
GlitchMr r: my &fullwidth := *.trans(chrs(0x21..0x7E) => chrs(0xFF01..0xFF5E)); say fullwidth("int main() { return 0; }")
p6eval rakudo c8de2e: ( no output )
GlitchMr right 15:39
r: my &fullwidth := *.trans(chrs(0x21..0x7E) => chrs(0xFF01..0xFF5E)); say fullwidth('int main() { return 0; }')
p6eval rakudo c8de2e: OUTPUT«int main() { return 0; }␤»
GlitchMr perl6: sub full-width { .trans: chrs(0x21..0x7E) => chrs(0xFF01..0xFF5E) } ; say full-width('int main() { return 0; }')
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'full-width' will never work with argument types (str) (lines 1, 1)␤ Expected: :()␤»
..niecza v24-12-g8e50362: OUTPUT«int main() { return 0; }␤»
tadzik I find it entertaining that the "" one didn't work 15:40
timotimo tadzik: if you want to, that'd be a nice exercise for me
tadzik timotimo: I want to what?
GlitchMr perl6: sub full-width (Cool $_) { .trans: chrs(0x21..0x7E) => chrs(0xFF01..0xFF5E) } ; say full-width('int main() { return 0; }')
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«int main() { return 0; }␤»
tadzik timotimo: you want to roll out a module?
timotimo er, if you want to have Text::Fatspeak
tadzik yeah, go for it :)
consider Acme:: for it :) 15:41
timotimo surely will
tadzik or maybe not :)
timotimo hey, maybe i'll keep that idea around until i'm back at home with my fat desktop and i'll turn it into an educational screencast
GlitchMr This would be serious module.
Some people like fullwidth letters.
tadzik that'd be awesome
GlitchMr Just make sure it supports every ASCII character. 15:42
timotimo in fact, i could use one of my parent's computers while i'm here. i even brought a cheap microphone :]
pmurias timotimo: amuses you?
timotimo the possibility of writing javascript things in nqp 15:43
GlitchMr Fullwidth letters are useful.
Especially when mixing them in CJK text.
upload.wikimedia.org/wikipedia/com...Prompt.png
15:44 hash_table joined
timotimo i could offer this as an online service on heroku for people who can't get to the required amount of pages in their thesis or something 15:44
there once was a post on how to host perl6 services on heroku, but it got lost somehow
oh, GlitchMr, it does map ascii to unicode 1:1? that's neat :) 15:48
GlitchMr Yes
Range 0x21 .. 0x7E is mapped to 0xFF01 .. 0xFF5E.
But it sadly doesn't have fullwidth space.
You could try putting two spaces instead or something.
And yes, 'a' .. 'z' is special case. Otherwise, code like this wouldn't work properly: 15:50
rn: ('a0' .. 'b9').perl.say;
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«"a0".."b9"␤»
GlitchMr ...
rn: @('a0' .. 'b9').perl.say;
p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«("a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9").list␤»
pmurias timotimo: what does the amount of pages have to do with compiling Perl 6 to JavaScript?
15:51 rurban1 joined
pmurias timotimo: making things extra complex on purpose? 15:53
timotimo pmurias: er, pardon?
15:53 am0c left
pmurias timotimo: sorry got confused 15:53
timotimo perl6 goes in, javascript comes out. never a miscommunication. 15:54
you can't explain that!
pmurias I wouldn't be so sure about the lack of miscommunication ;) 15:55
masak felher, sorear: here's my solution: gist.github.com/4359618 16:04
(it ended up being a port of the Python solution on the Wikipedia article. but the Python solution contained a lot of Pythonesque repetition that I removed, and I renamed all the variables.) 16:05
timotimo rename all the variables: prof won't find it on google: full score 16:13
masak nah, I just had better names ;) 16:16
timotimo allowing - in names is really something nice, methinks 16:28
moritz \o 16:30
seems I've missed a lot of backlog 16:31
timotimo i'm still missing a whole lot of frontlog :(
scrolling through the frontlog is crazy slow :[ 16:32
masak moritz! \o/ 16:35
timotimo: the frontlog is realtime, with no expected improvements.
timotimo i sometimes perceive certain jumps in the speed in which frontlogs populate. they seem to do multiple hours almost in an instant. happens approximately daily. do you know if that technology could be harnessed to unlock whole chapters of the frontlog in advance? 16:38
16:38 isBEKaml joined
masak surely there must be a much shorter solution than mine, by the way. 16:40
I'm populating hashes with cumbersome for loops and if statements. there's probably a few-liner that uses sets and closures in a straightforward way. 16:41
masak attempts to write one
moritz what's this puzzle you're talking about? 16:45
GlitchMr t1? 16:46
masak moritz: sorear posted it in the backlog.
gist.github.com/4358598 16:47
hm, using sets and bags works, but seems to be affecting readability a bit more than I'd like.
I bet a Haskell solution would look pretty, though.
moritz ... and a normal human programmer takes three days to understand a pretty Haskell solution :-) 16:49
masak the problem is nice, because it's all about pairs of numbers, predicates/sets of these pairs, and four distinct mental states about these sets. 16:50
moritz: half of me wants to agree with you, half of me wants to disagree :)
masak goes ahead and writes the Haskell solution
16:51 skids left 16:53 raiph joined
timotimo with perl6s lazyness and multi-dispatch with pattern matching, how close does one get to haskell? 16:54
moritz well, the typ-y stuff is still missing :-)
mst moritz: but that's ok, since we're not normal programmers 16:58
in any case, "takes 3 days to understand" is the sort of valueless comment people make about perl a lot
moritz I know, I know
mst I will admit, however, that a pretty haskell solution would probably take a while for -me- to understand 16:59
but presumably that just means I'm the wrong sort of not normal :D
moritz or the normal sort of not normal :-)
masak I remember being in #haskell and someone told me "no, you can write it like this", and their solution was this beautiful pretzel of logic that I could understand momentarily if I made my brain a pretzel, too. but each time I relaxed it looked incomprehensible. 17:03
could be it's just a matter of habit. there are many things I understand perfectly fine now that I didn't five years ago.
isBEKaml yeah, I sort of wondered what makes people say things like that can just be made clear with just a little more effort. 17:05
for example, if I come across something I don't understand, I just usally try to break it down. Of course, that means you know your way around debugging these things. I cannot say this about haskell, mainly because I'm relatively new at it. :) 17:06
isBEKaml feels too much justified. Wrong end of the road.. :/ 17:08
"just"ified.
moritz btw: new HPMoR chapter! 17:09
17:11 pigi joined
pigi ciao 17:11
!lista 17:12
masak ciao, pigi.
moritz: ooh!
I've been so busy this week that I've only had time to re-read Ch. 85. 17:13
so now I have two new chapters to read :D
pigi ciao 17:15
!lista
17:15 pigi left
moritz has read stuff up, and now has a pretty good idea how to attack t1 17:15
masak \o/
moritz actually I'm of two minds about this stuff 17:16
masak has no idea what went through the mind of pigi during those four minutes
moritz on the one hand I see that you don't want to drop too many hints
masak right.
17:17 PacoAir left
moritz on the other hand I find it kinda unfair to those not knowing a specific bit of theory to not even know what to read up, and thus having a sever disadvantage in the contest 17:17
masak well, the sharpest example of that happened in the 2010 edition of p6cc. 17:18
moritz you mean the nim sums?
masak with the two-player game that turned out to have a simple analyzable solution.
yes, the num sums.
moritz or whatever they were called
arnsholt Kayles! 17:19
moritz still hasn't finished more than the first two or three chapters of the book on mathematical games he promised himself to read
masak the theory is called the Sprague-Grundy theorem. en.wikipedia.org/wiki/Sprague%E2%8...dy_theorem
heh, yes, arnsholt was the *only* person who solved that problem using the theory.
...which delighted me, since it showed that knowing the theory helped, and that not everyone would make the connection. 17:20
moritz: in essence, I guess it is "kinda unfair". all I can say is if you're a programmer, there's not much standing in your way of spending a fraction of those five weeks trying to find relevant theory. 17:21
"ability to Google", as Tim Minchin beat-poems.
tadzik hehehe 17:22
arnsholt That's pretty much how I got there
masak I rest my case.
arnsholt The problem statement just felt like perfect play should be possible
I think I found it by way of the game whose name I can't remember, with the depressions with little tokens in them 17:23
masak indeed, there is a bootstrapping paradox in there somewhere. you can't know you don't know some thing when you don't know it, etc.
17:23 GlitchMr left
arnsholt Which I happened to know was perfectly playable 17:23
masak but part of the thing I want to score people on is the ability to find their bearings in unknown problem situations.
moritz on the first hand again, when you try to solve a real-world programming problem, the problem doesn't come with a theory name either 17:24
masak arnsholt: that game has many names. en.wikipedia.org/wiki/Mancala
moritz: one of my heroes, Eric Evans, has a knack for finding a kernel of theory to exploit in real-world problems. 17:25
hoelzro hi #perl6 folk 17:26
masak hoelzro! \o/
arnsholt masak: Yeah, that's the one
Reading about the theory of that game's perfect play led me to making and breaking and the fun theories 17:27
masak moritz: you've been co-organizing once, so you know my thought process when it comes to selecting the puzzles. they should look simple, but preferably have unexpected depth and subtlety.
arnsholt Octal notation for example =D
masak arnsholt: if you haven't read the "Winning Ways" books yet, you totally should.
moritz masak: for some time I thought that t1 had more depth than I wanted to tackle :-) 17:28
arnsholt Yeah, they turned up in my research, but no copies conveniently available at the time IIRC
hoelzro so I'm reading the specs on Unicode bracketing characters for Perl 6...am I correct in thinking that bracketing characters are any defined in the BidiMirroring document, or with Ps/Pe/Pi/Pf properties, with the latter definition taking precedence? 17:31
17:37 rummik left, rummik joined
arnsholt Hmm. t5 smells faintly of knapsacks 17:39
17:42 isBEKaml left
hoelzro ok, well, you guys think about it =) I'll be back later! 17:42
moritz arnsholt: faintly :-) 17:46
masak gets stuck because he doesn't manage to print a list of results in Haskell 17:51
:/
something about do notation and monads, I guess.
masak tries #haskell 17:52
moritz masak: did I read the p6cc announcement correctly, that there's no separate sign-up deadline this year?
masak moritz: "Registration is open for two weeks, starting *now*." from strangelyconsistent.org/blog/the-20...ng-contest 17:53
moritz ok, I didn't read correctly
moritz brings the p6cc news to perlmonks 17:54
tomgj So I've read markmail.org/message/rzvfkbsxlkp4ewex 18:00
masak excellent. :)
tomgj heh. My app has a doubly linked data structure where the nodes are of varying types.
18:01 isBEKaml joined 18:02 FROGGS_ joined
tomgj I've done a "class Foo {...};" declaration instead of a "use Foo;" in Bar.pm6 18:02
moritz and then rakudo complains that you haven't declared class Foo
masak #haskell could help me :> 18:03
tomgj For this application, it's fine, as Foo.pm6 gets loaded elsewhere.
18:04 GlitchMr joined
tomgj But in general I want Bar to be usable in applications where Foo isn't necessarily used from elsewhere. And now that I don't "use Foo" from Bar, that isn't the case. 18:04
18:06 not_gerd joined
not_gerd hello, #perl6 18:06
tomgj Ideally I'd want something which either does equivalent of "use Foo" or equivalent of "class Foo {...}" depending on whether Foo.pm6 is already being loaded, ie get behaviour close to Perl 5 ;)
not_gerd masak: %sums_with_ambiguous_products is a rather perculiar name for a hash containing the *un*ambiguous ones... 18:07
dalek : 69504a5 | duff++ | misc/perl6advent-2012/schedule:
[advent] claim Dec 24
tomgj is there a standard approach to this issue? I'd have thought mutually referential types were a pretty common requirement. 18:08
PerlJam I wrote something for Dec. 24 and would appreciate a review. Right now I've got some family stuff to do, but I'll check back for commentary later. See perl6advent.wordpress.com/?p=1841&a...eview=true 18:09
PerlJam bbl
masak PerlJam++
PerlJam: `constant @months` line is way too long as it stands now. 18:10
could use a linebreak or two.
isBEKaml masak: day24 has code? I thought it was special. :-) 18:11
arnsholt tomgj: Declare the two types in the same file
masak PerlJam: apart from that, looks like a nice post :)
not_gerd: yeah.. I realized that too late. :/ 18:12
not_gerd: serves me right for trying to come up with better names.
not_gerd: and the gist was made anonymously, so I can't change it.
tomgj arnsholt: okay, I guess I will in this case. Would be interested to hear about any solutions that would work for types in two different modules maintained by two different authors that need to refer to each other. 18:15
18:17 spider-mario joined
arnsholt In that case you'd probably want parametric types or some such 18:18
Hardcoded deps between types in wildly different codebases would be insane
The reason you have to do this is that "use Foo" doesn't necessarily mean that a type Foo will be defined (just most of the time)
And the Perl 6 syntax requires all types to be properly declared, so if you want mutually dependent types, you're gonna have to put them in the same compilation unit 18:19
(And temporarily stub one of them with "class Foo { ... }") 18:20
tomgj I'll read up on parametric types, but I am assuming that the types in mutual use have well specified and stable interfaces, so the comment about "wildly different codebases" doesn't apply -- they are both just using something else by contract
arnsholt Parametric types are sort of like generics in Java (to first order, anyways) 18:24
Which is what you want for a proper linked list type anyways
tomgj It's not a linked list. Just a data structure with two way references between the nodes. But each node is of a specific type, so no generics or similar required. That is all I meant by "doubly linked data structure". 18:27
I'm happy with making a stub class declaration in my current application, I just don't see how this scales to cases where Foo needs Bar, Bar needs Foo, and neither one knows whether something other than itself is going to load the thing it needs. 18:30
moritz the solution is to design your applications not to need that kind of dependencies 18:34
applications and libraries in all languages are designed to fit well with the language 18:37
people are used to the fact that perl fits most design approach, but it simply can't fit all possible approaches
nr: my @a = <a b c>; my %h; %h{.value} //= .key for @a.pairs 18:42
p6eval niecza v24-12-g8e50362: ( no output )
..rakudo c8de2e: OUTPUT«Method 'key' not found for invocant of class 'Any'␤current instr.: '' pc 177 ((file unknown):174270982) (/tmp/ZDd4dvFElF:1)␤called from Sub 'METAOP_TEST_ASSIGN:<//>' pc 128320 (src/gen/CORE.setting.pir:58643) (src/gen/CORE.setting:12563)␤called from Sub '' pc 238 (…
moritz rakudobug
afaict the first one uncovered by this year's p6cc :-)
r: $_ = 'abc'; my $x //= .uc; 18:43
p6eval rakudo c8de2e: ( no output )
moritz r: $_ = 'abc'; my $x //= .uc; say $x
p6eval rakudo c8de2e: OUTPUT«ABC␤»
masak moritz++
moritz r: my $x //= .uc for 'a'
p6eval rakudo c8de2e: OUTPUT«Method 'uc' not found for invocant of class 'Any'␤current instr.: '' pc 135 ((file unknown):87) (/tmp/MLZb5oFAnf:1)␤called from Sub 'METAOP_TEST_ASSIGN:<//>' pc 128320 (src/gen/CORE.setting.pir:58643) (src/gen/CORE.setting:12563)␤called from Sub '' pc 171 ((file un…
masak submits rakudobug
moritz that's the golfed variation
masak noted.
moritz propose methods Hash.pop and Hash.unshift 18:46
they do the reverse of .push
method pop($key) { self{$key} ~~ Positional ?? self{$key}.pop || self{$key}:delete } 18:47
masak sounds sane. 18:48
though I've never felt a need for it yet myself.
maybe because I don't much use the magic behavior of Hash.push
moritz I just have the need
I want to order thing in the same order in which they original appeared in a list 18:49
so the obvious approach is to put the original indexes in a hash
but one thing can appear twice in the original list
not_gerd bye, #perl6
18:49 not_gerd left
moritz so I need to use Hash.push, and then when sorting reconsider stuff 18:50
hoelzro I had an interesting thought while I was out 18:51
wouldn't it be cool if you could tell a Perl 6 grammar to print out a Pygments lexer version of itself?
it's probably wishful thinking, but it would be pretty neat.
18:54 cognominal joined 18:56 huf joined
masak hoelzro: sounds like a nice module. 18:57
hoelzro maybe I should write that instead of working on this Pygments lexer ;)
rindolf Hi all. 18:59
Hi masak , moritz , hoelzro
hoelzro rindolf: hello
rindolf So how's life past the end of the world?
isBEKaml world ended? I didn't know! 19:00
rindolf isBEKaml: it was supposed to do.
isBEKaml was it? I thought it was some kind of out of memory error on Mayan's part. :P 19:01
rindolf isBEKaml: heh.
isBEKaml yeah, failed malloc(), maybe.
masak "Rumors of the world's end have been greatly exaggerated." :)
pmurias hoelzro: what do you need a Pygments lexer of Perl6 for? 19:02
hoelzro pmurias: I want Perl6 code to be properly highlighted on Github.
isBEKaml hoelzro: If you've already spent some time with pygments, I guess you'd not want to redo all of that with a perl6 grammar. :-) Ofcourse, it'd make a nice exercise coming up with a module so we don't have to do it all over again for an update. 19:04
hoelzro isBEKaml: well, I've got the basics working. I was thinking that it would be cool to just Perl6::Grammar.pygmentize, though
19:04 xinming left
moritz that'll be note quite trivial :-) 19:05
hoelzro indeed
moritz s/note/not/
pmurias hoelzro: have you looked at Perl6::Grammar? 19:06
isBEKaml hoelzro: awesome. You could push whatever you've got so far (so you don't throw away your time you've put in this)
hoelzro pmurias: a little bit
isBEKaml: my lexer is on bitbucket
19:06 xinming joined
pmurias the hard part of that seems to all the bits of imperative code 19:06
so in order to turn that into a pygments lexer we would need a Perl6->python compiler 19:08
s/Perl6/NQP
which seems to be loads of work for little clear benefitsd
* benefits
mst with the possible exception of "fun" 19:09
19:09 am0c joined, PacoAir joined
pmurias mst: targeting python doesn't seem significantly more fun than targeting JavaScript 19:10
hoelzro I was hoping that most of the imperative stuff would be confined to Perl6::Actions, but I suppose that was a silly assumption to make
pmurias mst: which I'm already doing
mst I said "possible" advisedly.
cognominal reading the backlog. What is nqp-js?
mst presumably something that compiles NQP to javascript 19:11
pmurias yes
masak cognominal: it's pmurias implementation of nqp on JavaScript.
mst I mean, it could turn out to be a toaster
but that doesn't seem amazingly likely given the name
masak :P
cognominal: with the eventual goal of giving Rakudo a JavaScript backend.
cognominal masak: is that on github?
pmurias yes
masak github.com/pmurias/rakudo-js 19:12
cognominal thx
pmurias it actually evolved from a (very incomplete) Rakudo JavaScript backend 19:13
masak I've decided I like Haskell for this problem. 19:14
19:20 am0c left 19:22 huf left 19:23 thou_ joined
pmurias masak: this problem = the logical problem you are solving? 19:23
masak pmurias: aye. 19:27
almost done.
19:28 Vlavv left, Vlavv joined
masak ...and now I want Haskell's list comprehensions in Perl 6. :) 19:32
maybe there'll be a module (and a blog post) coming out of this exercise.
19:34 lorn left
moritz r: say <1 2>.sum 19:35
p6eval rakudo c8de2e: OUTPUT«No such method 'sum' for invocant of type 'Parcel'␤ in block at /tmp/gBAun135Z2:1␤␤»
moritz r: say ([1, 4], 3).sort: &sum 19:36
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Undeclared name:␤ &sum used at line 1␤␤»
moritz r: say ([1, 4], 3).sort: &prefix:<[+]>
p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Undeclared name:␤ &prefix:<[+]> used at line 1␤␤»
19:36 rummik left 19:38 FROGGS joined
FROGGS hi there 19:38
19:38 lorn joined
masak FROGGS! \o/ 19:38
FROGGS masak: hi, what a greeting ;o) 19:39
19:39 huf joined, rummik joined
masak FROGGS: well, it's great that you're here :D 19:41
GlitchMr github.com/rakudo/rakudo/commit/01...4ff7614133 19:43
huh?
Wouldn't that cause code like `my $variable = $variable;` break
(moving variable to higher scope) 19:44
moritz well, first of all that doesn't work as you'd expect it to
GlitchMr It worked in Perl 5.
masak that was wrong :)
moritz because in Perl 6, variables are visible immediately after declaration
masak not on the statement after. 19:45
(which is insane)
moritz and secondly, the commit makes it complain if the mention of the variable happens *before* the declaration
so this case isn't affected at all
hoelzro q'... 19:49
sorry, formulating a question.
q'...', qq'...', and Q'...' can all work with the various bracketing characters, yes? 19:50
moritz yes.
hoelzro ok, good to know
hoelz.ro/files/perl6-pygments3.png 19:54
(for anyone who's interested in my progress)
GlitchMr Better than my syntax highlighting :-) 19:56
Also, interesting prompt 19:57
hoelzro thanks
isBEKaml hoelzro: about the prompt - oh-my-zsh? :)
hoelzro isBEKaml: nah, I converted my bash profile a few weeks ago to try out zsh
so far, so good =) 19:58
isBEKaml hoelzro: nice work, keep going!
19:58 pmurias left
hoelzro thanks! 19:58
20:00 GlitchMr left
hoelzro it feels like every time I tick a TODO item off this lexer list, I add another =/ 20:03
masak that's how TODO lists always work for me. 20:09
hoelzro heh
dalek kudo-js: 89c7a01 | (Paweł Murias)++ | / (4 files):
[nqp] <?{...}> assertions, pass test 34, use .to_s,.to_i,.to_n for
20:24 popl joined 20:27 rodasac joined
moritz hoelzro: TODO is not a list, it's a queue :-) 20:27
20:28 pmurias joined 20:30 rodasac left 20:31 snearch joined
popl moritz: a list is an implementation of a queue, isn't it? 20:32
I mean, queue is abstract.
masak an array has all the operations needed for a queue, but it also has a bit too many. 20:33
moritz popl: I meant more in the sense of how you perceive the data structures
masak for a queue, you only need .push and .shift -- but if you also have .pop, you can violate the protocol invariants of the queue. 20:34
moritz a TODO list is something where you tick off items, and then you're done
popl My first thought was that you meant TODO has some sorting based on priority
masak: violating protocol invariants sounds like my idea of a good time 20:35
popl sorts some hashes
moritz when in fact a TODO is an ever-growing lump of items 20:36
popl moritz: indeed!
moritz like, a stack overflow :-)
isBEKaml 'night, #perl6 folks!
20:36 isBEKaml left
masak fare thyself well, isBEKaml. 20:37
felher masak: sweet, thnx :)
masak Rust seems an interesting beast to me, in that they evolve their implementation quite rapidly: github.com/mozilla/rust/wiki/Doc-d...ease-notes
popl masak: Are you wearing a cloak and drinking out of a horn?
masak reminds me of Perl 6 somehow, except that they seem to do more of an implement-is-spec thing. 20:38
popl Ok, quit it. You just rhymed.
/Rust seems an interesting beast to me/in that they evolve their implementation quite rapidly/
masak :D
popl waits for masak to bring out a lute and start dancing 20:39
20:39 xinming left
masak popl: it was not my intention to rhyme; but yes, it's *my* idea of a good time :P 20:39
popl www.encyclopediaofukraine.com/pic%5..._dance.jpg # masak's idea of a good time 20:40
masak oh, I've done my fair share of that.
not necessarily in full uniform, though. 20:41
20:41 xinming joined
popl masak: my friend did morris dancing at his wedding 20:41
masak felher: I wrote a Haskell version of it, too: gist.github.com/4360642
felher: it's pretty, but it has a bug somewhere, so it outputs too many solutions :/
20:42 sergot joined
sergot hi o/ ! 20:42
masak sergocie! \o/
sergot masaku !
How are You? :)
felher masak: oh, cooooooooooooooooooool! I'll take a look at it after one episode of simpsons and maybe implementing it in haskell, too, before I look at yours :) 20:43
sergot It's Christmas time! I should dive into perl6 again! :)
popl humbug
moritz masak: it's easy to get the wrong answer in O(beautiful code) :-) 20:44
20:45 cognominal left
popl moritz: doesn't matter if it's pretty 20:45
masak felher: I'd be happy to compare solutions, and be influenced by your solution. 20:51
moritz: I'm sure I missed something fairly trivial. the port was fairly straightforward, modulo five-or-so beginned questions on my part on #haskell.
moritz has reworked his t5 solution to be Moar Good[tm] 20:54
diakopter Moar Good is Good 20:56
masak whacks diakopter over the head with a feather :) 20:58
I'm glad to report we have a second prize for this yer's p6cc, too.
I'll be changing the blog post now to reflect that. 20:59
felher masak: seems like you have to wait another day. I'm quite tired and heading for bed now. And since I'm far away from knowing haskell by heart, doing it in Haskell would take a while. 21:07
night, #perl6 :)
diakopter o/
masak 'night, felher 21:08
(and I know what you mean. feeling stumped at printing things in a loop was a refreshing experience.) :) 21:09
21:10 Moukeddar joined
Moukeddar \o/ #perl6 21:11
masak Moukeddar! \o/ 21:12
second prize now published: strangelyconsistent.org/blog/the-20...ng-contest
sign up sign up sign up
less than one week left to sign up. do it before it's too late.
masak tweets
Moukeddar o/ masak
saw your blog o HNews the other day, strangelyConsistent is catchy 21:13
masak Perl 6 is strangely consistent ;)
21:13 snearch left
Moukeddar so, how's the best community doing ? 21:15
21:15 Pleiades` left
masak we're having a blast today. :) 21:15
Moukeddar: would you like to see a nifty math problem? :)
21:16 cognominal joined
Moukeddar let's see :) 21:16
21:16 am0c joined
masak Moukeddar: gist.github.com/4358598 21:16
(courtesy of sorear++)
21:17 nyuszika7h joined
Moukeddar somehow this problems bring some bad memories about arithmitics and its sadistic teacher 21:17
masak yeah, well, we have weird tastes here :) 21:19
I wrote a solution in Perl 6 earlier today (which worked).
and then one in Haskell (which didn't).
Moukeddar i fail to see the role of S and P here 21:21
could you elaborate?
21:21 Pleiades` joined
masak oh, sure. S and P are two people. S knows the sum X+Y, and P knows the product X*Y. but S doesn't know the product and P doesn't know the sum. 21:22
all they can do is analyze the other person's thinking process. 21:23
Moukeddar is there a specific math rules i should know in order to solve this, i did study some Arithmitics 21:24
masak nah, not really.
you need to know how to add and multiply.
factors come in a bit too. but nothing fancy.
Moukeddar so, if S says their sum, P gotta figure the numbers and their product, right ? 21:26
21:26 mj41 joined
masak yes, but the weird thing about this problem is that neither S nor P ever say any numbers. 21:27
Moukeddar find every two numbers which thei sum is equal to what S said, and calculate their product ?
masak they just talk about what they learn from the (very small) clues they are giving each other.
Moukeddar what, so, find every two numbers which their sum is under 100, calculate their product, no ?
sorear good * #perl6 21:32
pmurias hi
masak sorear! \o/
Moukeddar: yeah, that's a good start, but far from it.
21:32 thou_ left
masak Moukeddar: the objective is to find X and Y. 21:32
21:33 mj41 left
cognominal speaking of thinking about knowledge involving many people, I like this problem. discuss.joelonsoftware.com/default.....179310.37 21:33
Moukeddar given that X+Y <100 , and X,Y >1 , right ? 21:34
masak Moukeddar: right.
Moukeddar: also, you might as well assume X<Y to avoid duplicate solutions.
cognominal: ah, that one. 21:35
cognominal: there's something that deeply disturbs me about that class of problems.
cognominal: maybe the fact that it assumes that the participants are far more rational than normal people, in the sense that they reason arbitrarily deeply down the he-knows-she-knows stack. 21:36
cognominal it assumes many things, the the husbands are intellegent enough to figure out and that they play by the rules...
masak right.
popl "he-knows she-knows stack" # masak++ 21:39
Moukeddar is it finite?
popl We can hope.
cognominal the mathematician Jean Yves Girard is very critical of these kinds of problems and about people who enjoys unchecked conceptual recursions and meta levels and trashe authors that loosely play on that, like the author of gödel, escher, bach. Too bad I am not sharp enough to understand his own logic.
popl Moukeddar: sorry, conflation 21:40
popl--
sorear cognominal: is that the calc of constructions guy?
popl sorear: so-rear or s-orear? 21:41
or s-or-ear?
OH
popl does /whois
sorear: sorry
FROGGS_ or-ear, lol 21:42
popl masak: I think I am in that class of people. :(
cognominal that is the guy which created System F used to infer types thru unification. Language like haskell tries to push forward that logic.
masak popl: what class of people? 21:43
popl some subset of the complement of the set of ideal people in those problems 21:44
masak :)
it's somewhat a matter of habit, I guess. 21:45
that, and pattern matching.
popl it is horrible and depressing :P
cognominal Jean Yves Girard explains that the incompletude theorem is just an encoding that permits to apply the Cantor's diagonal. 21:46
That cuts most of the crap written by many authors.
masak the incompleteness theorem affects any system that's smart enough to start describing itself. 21:49
it's basically the possibility of autopuns infecting the system, bringing it down.
:)
21:51 cognominal left 21:54 cognominal joined 21:57 kaare_ left 22:07 leont joined 22:14 LlamaRider joined 22:19 rindolf left 22:24 rurban left 22:32 Moukeddar left
LlamaRider Hi. Any tips on what are the most detailed docs on P6 grammars out there? I just "experimentally" found out that you can't mix <names> with 'string literals' in grammar "rules" and am wondering if I could've read about it beforehand. 22:34
pmurias LlamaRider: you have seen the synopsis?
LlamaRider I've seen S05 and it seemed quite brief. 22:35
diakopter O_O 22:36
well, the section on grammars, comparatively, I suppose 22:37
LlamaRider then again I entered from perlcabal.org/syn/S05.html#Grammars, which seems quite close to the end of S05
didn't read the entirety of it
22:38 FROGGS_ left
timotimo moritz: perl-6.de is a bit out of date, no? "kinda perl6"? :) 22:38
diakopter LlamaRider: can you show an example of mixing <names> with 'string literals'? I'm curious what you mean
LlamaRider rule compare {<name> ' and ' <name> ' are of ' <type_claim> '.'} 22:40
what I managed to get working was:
rule compare {<name><and><name><are><type_claim><dot>}
where I just moved the literals into their own tokens
diakopter was there an error before? 22:41
LlamaRider just the matching was failing, it seemed permitted
diakopter oh
it's because a rule eats whitespace between terms
so the ' and...' won't match
LlamaRider even withing apostrophes? sigh. 22:42
within*
diakopter no, I mean
the rule processor chews through the whitespace in the string before it gets to the ' and ' portion
LlamaRider that's fine, I never needed that whitespace
I just need the whitespace within the apostrophes 22:43
token and {' and '}
diakopter did you try changing compare to a token instead of a rule?
LlamaRider O_O
it worked...
yes, that is the kind of difference I would've liked to read about :) 22:44
but wait... then why is the rule failing?
diakopter see perlcabal.org/syn/S05.html#Regex_Ro..._Anonymous 22:45
it shows the equivalents to regex/token/rule
see how rule inserts the <.ws> 22:46
timotimo is it possible (but please don't spoil the solution) to make a lazy list of all combinations of my enum Blah<A, B>? i was trying to make a lazy self-referencing list with the sequence operator that uses X, but that didn't work very well. 22:52
i'd like one or two non-spoily hints, please :) 22:53
diakopter has no hints, spoily or otherwise 22:54
22:55 leont left
LlamaRider I still find it baffling why the rule clashes with single-quoted whitespace. But I guess that's that, I'll just avoid using rules when I have whitespace chars. 23:00
diakopter if you require whitespace between the terms, use a rule, but don't put whitespace in the literals 23:01
timotimo r: sub mysub() { "hey" }; mysub\ () 23:02
p6eval rakudo c8de2e: OUTPUT«No such method 'postcircumfix:<( )>' for invocant of type 'Str'␤ in at src/gen/BOOTSTRAP.pm:852␤ in any at src/gen/BOOTSTRAP.pm:836␤ in block at /tmp/KrKe1OW5Iy:1␤␤»
timotimo is this a bug? shouldn't the unwhitespace reduce to this?
r: sub mysub() { "hey" }; mysub()
p6eval rakudo c8de2e: ( no output )
diakopter no; to invoke there has to be nothing before the ( 23:03
timotimo i thought unwhitespace turns whitespace into nothing?
diakopter places where comments and unwhitespace can appear, yes
so the comment tells the parser it's done parsing the term mysub 23:04
what does niecza do?
23:04 am0c left
diakopter n: sub mysub() { "hey" }; mysub\ () 23:05
p6eval niecza v24-12-g8e50362: ( no output )
diakopter n: sub mysub() { "hey" }; mysub\ .WHAT().say
p6eval niecza v24-12-g8e50362: OUTPUT«Str()␤»
diakopter n: sub mysub() { "hey" }; mysub\ ()()
p6eval niecza v24-12-g8e50362: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Str␤ at /tmp/5aOO25TQCh line 1 (mainline @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4219 (module-CORE @ 580…
diakopter n: sub mysub() { "hey" }; mysub\ ()\ ()
p6eval niecza v24-12-g8e50362: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Str␤ at /tmp/wIkKeFYV5N line 1 (mainline @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4219 (module-CORE @ 580…
diakopter looks like niecza doesn't do that 23:06
timotimo heh.
23:09 spider-mario left 23:11 cognominal left 23:12 cognominal joined 23:13 cognominal left 23:16 mj41 joined
timotimo gotta run, bye 23:16
23:21 mj41 left 23:28 popl left, popl joined, popl left, popl joined
masak 'night, #perl6 23:34
sorear night masak
23:46 bot48 left 23:56 Celelibi left 23:58 popl left