»ö« 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:05 Koven is now known as Kovensky
donri ) 00:06
00:16 molaf_ joined 00:19 molaf left 00:23 awoodland left 00:35 solarion_ left, solarion_ joined, jtbraun1 joined, solarion_ is now known as Solarion 00:36 cdarroch left, icwiener left 00:38 arlinius joined 00:43 envi joined 01:02 MayDaniel left 01:04 jtbraun1 left 01:11 lopaway is now known as lopnor 01:13 hudnix left, arlinius left 01:14 hudnix joined 01:23 zykes- left, zykes- joined 01:30 mtk left 01:31 zykes- left 01:35 lopnor is now known as lopaway 01:36 _twitch joined 01:38 mtk joined 01:39 Rotwang left 01:41 zykes- joined 01:43 lopaway is now known as lopnor 01:47 drbean left 01:49 drbean joined 01:50 lopnor is now known as lopaway 01:54 lopaway is now known as lopnor 02:00 noganex_ joined 02:01 donri left 02:03 noganex left 02:04 envi left 02:14 jtbraun1 joined 02:38 whiteknight left 02:49 takadonet joined 02:53 lopnor is now known as lopaway
takadonet phenny: tell donri I would admin the /r/perl6 subreddit if you need more people 02:55
phenny takadonet: I'll pass that on when donri is around.
02:56 Chillance left, silent_h_ joined 03:11 jtbraun1 left 03:22 VXZ joined, donri joined
donri Is there [plans for] anything in Perl 6 or Parrot that would make persistence of objects work well without hacks? 03:23
phenny donri: 02:55Z <takadonet> tell donri I would admin the /r/perl6 subreddit if you need more people
donri takadonet: yes please!
added 03:25
jdhore donri, I will as well if you'd like
donri, my Reddit username is jdhore1
Tene donri: feel free to add me if you like; there's a small chance I may do something.
donri jdhore: added 03:26
Tene donri: good serialization of objects is part of the plans for the nom refactor
donri Tene: username?
Tene
jdhore :D
donri ;)
jdhore thanks
donri So, for object persistence to work well you need serialization and mutation tracking 03:27
Tene donri: I don't know of anyone planning to work on persistence specifically. 03:28
03:28 newguyhere joined
donri Tene: Nah, but I'm curious if perhaps Parrot or Perl 6 already has [plans for] the features that would make that work well 03:28
Like, tracking changes to arbitrary objects
03:31 newguyhere left 03:33 silent_h_ left
takadonet donri: user name is takadonet 03:34
donri re r/perl6: do whatever you feel is right to it, and please don't think of it as "donri's"
takadonet: already added :)
takadonet i just saw thanks 03:35
donri i checked if there was such a user and saw perl6 posts
03:35 PZt left
takadonet ya... i have lots 03:35
donri and made the reckless gamble that it might be you
03:36 PZt joined
takadonet good night everyone 03:40
03:40 takadonet left 03:55 lopaway is now known as lopnor 04:13 cls_bsd left 04:14 cls_bsd joined 04:23 Su-Shee_ joined 04:24 cosimo left, cosimo joined 04:25 donri left
Tene jnthn: I get a failure in nqp tests for t/hll/02-modules.t btw 04:26
04:26 satyavvd joined 04:27 Su-Shee left 04:30 woosley joined
diakopter niecza: rule a($b) { { say($b) } } 04:30
p6eval niecza v2-99-g1e36fcc: OUTPUT«Unhandled exception: trying to dereference null␤ at /home/p6eval/niecza/boot/lib/SAFE.setting line 377 (SAFE die @ 2)␤ at /home/p6eval/niecza/src/Metamodel.pm6 line 648 (Metamodel Unit.deref @ 2)␤ at /home/p6eval/niecza/src/NieczaPassBegin.pm6 line 276
..(NieczaPassBegin C113_ANON…
diakopter rakudo: rule a($b) { { say($b) } }
p6eval rakudo 050ce7: OUTPUT«Useless declaration of has-scoped rule in a module; add our or my to install it in the lexpad or namespace␤» 04:31
diakopter rakudo: my rule a($b) { { say($b) } }
p6eval rakudo 050ce7: ( no output )
04:41 arlinius joined 04:44 mfollett joined, mfollett left 04:51 gbacon left
dalek kudo: 5959cd6 | perlpilot++ | src/Perl6/Grammar.pm:
Panic on shape declarations.
05:02
kudo: 10d86d7 | perlpilot++ | src/cheats/relops.pir:
Make =:= return Bool (Fix RT #84594)
diakopter ponders parametric grammar rules (other than protos) 05:19
05:26 kanishka joined
sorear diakopter: you mean like src/STD.pm6 lines 6068-6073 in niecza? 05:28
I complained about not being able to write parametric rules once, TimToady responded that he'd already come up with a syntax and semantics, and amazingly it was <<1 day implementable 05:30
05:32 HarryS left 05:36 masonkramer left, masonkramer joined
diakopter sorear: cool 05:38
05:41 HarryS joined
diakopter perl6: grammar GG { say(55) } 05:48
p6eval pugs, rakudo 050ce7, niecza v2-99-g1e36fcc: OUTPUT«55␤»
sorear diakopter: S10:88 - the specs don't get much clearer than this. 05:50
diakopter true enough 05:51
05:52 baest left
diakopter perlesque: class GG { say 55; say 10 } 05:52
p6eval perlesque: OUTPUT«55␤10␤»
dalek rixel: 53ff55a | diakopter++ | / (9 files):
grammar declarations are "live"; lots of regex progress
05:55
rixel: 8168ef4 | diakopter++ | sprixel/src/compiler/Env.cs:
forgot to press save
05:56
diakopter perlesque: grammar GG { say(55) } 05:58
p6eval perlesque: OUTPUT«55␤»
06:09 sftp left, clkao left 06:22 obra joined 06:41 lue left 06:48 kaare_ joined 06:56 gfldex left, gfldex joined 06:57 cjk101010 joined 06:59 JohnGalt2600 joined 07:05 gfldex left, gfldex joined, JimmyZ joined 07:14 cosimo left, hanekomu joined 07:23 clkao joined 07:25 JimmyZ left
moritz_ good morning 07:26
moritz_ bemoans the lack of new MoR chapters
07:29 fhelmberger joined 07:36 baest joined, baest left 07:37 baest joined
dalek p: a007136 | moritz++ | src/HLL/Compiler.pm:
rewrite parse_name in nqp
07:46
07:53 fhelmberger left 08:02 kjeldahl joined 08:04 Axius joined, Axius left, Su-Shee_ is now known as Su-Shee 08:05 Axius joined 08:06 Axius left, Axius joined 08:09 wtw joined 08:14 Mowah joined 08:21 lopnor is now known as lopaway, Solarion left 08:22 Solarion joined 08:30 yves left 08:39 noganex_ is now known as noganex 08:44 justatheory left, justatheory joined 08:49 justatheory left 09:04 am0c joined 09:07 Axius left, satyavvd left 09:17 mtk left 09:19 daxim joined 09:25 cosimo joined 09:26 mtk joined 09:30 agentzh joined 09:32 dakkar joined 09:33 envi joined, coldhead left 09:38 woosley left 09:40 perplexa joined 09:42 woosley1 joined
tadzik hello zebras 09:42
jnthn o/, tadzik 09:43
perplexa hello weasel 09:44
i think i've accidentally joined #zoo
09:44 tzhs joined
tadzik (: 09:44
jdhore They have zebras in zoos? 09:45
perplexa is perl6 supposed to be perl5's successor or to be treated as a rather new, totally incompatible language?
tadzik I think so
perplexa: yes and yes
perplexa good point jd
jdhore (I should qualify that by saying that i have not visited a zoo in ~12 years)
perplexa i think there aren't any in zoos
moritz_ jdhore: depends on the zoo, of course
tadzik I've been hacking cardinal all night long instead of sleeping, and I wasn't tired at all, not before I spent to hours on Java lectures :| 09:46
perplexa protection of species and all that stuff :)
09:46 am0c left
perplexa should have a look at perl6 :) 09:46
still doing my stuff with p5
moritz_ perplexa: to some degree, Perl 6 is meant as a successor to most dynamic programming languages, not just Perl 5. Though of course people disagree :-)
but it's not a successor in the sense that we'll silently roll out an upgrade so that people who had perl 5 installed suddenly have Perl 6 on their machines 09:47
perplexa yeah that's of course logical :) 09:48
i was just curious if it aims to replace perl 5 at some point
or if people are meant to keep perl5 :)
what i was trying to say was basically if it's backwards compatible
moritz_ it's not
perplexa fine, gonna have lots of fun porting my shit :) 09:49
perplexa shudders
moritz_ but neither is python3 backwards compatible to python2, and still the developers expect people to upgrade
perplexa yeah, well
moritz_ perplexa: there's no compelling reason to port large amounts of code
perplexa there are scripts that do the porting for you
moritz_ there'll be some cross-calling solutions (a limited solution actually exists) 09:50
perplexa nah well, i consider it to learn new stuff easily
moritz_ that's a much better approach :-)
perplexa just had a loot at some rather old perl i wrote and realised that i'm a bad guy :/ 09:52
look*
on the other side, my perl has always been a mess
foreach ( @{ ${ ${ $self->{modules} }{$name} }->get_facilities() } ) { @{ $self->{$_} } = map { $_ eq $name ? () : $_ } @{ $self->{$_} }; }
:/
moritz_ that map could be replaced by grep 09:53
perplexa yeah?
moritz_ but even then it's ugly
yes, it's just grep { $_ eq $name } @{ $self->{$_} }
perplexa yeah well that's from a module interface when modules remove all their registered entities :)
ah cool 09:54
didn't know perl had a grep command :)
for me, perl alwas WAS grep
moritz_ the grep built-in works on lists, not files
perplexa makes sense :) 09:55
09:55 woosley1 left
flussence nothing a tie()'d array can't fix :) 09:56
perplexa are there any good books yet? 09:57
moritz_ we're writing one 09:58
perplexa :D
so i guess that's a no
moritz_ you can find snapshots on github.com/perl6/book/downloads
you'll be the judge if you find it good
perplexa thx :) 09:59
moritz_ if you find something that's not good, tell us on github.com/perl6/book/issues
09:59 am0c joined
perplexa i will 09:59
i guess any feedback is welcome
moritz_ yes 10:00
even praise :-)
10:16 nymacro joined 10:17 agentzh left 10:29 awoodland joined
JohnGalt2600 nice... hmm.. but only 1k downloads.. 10:31
TiMBuS clearly you need to link more people to it 10:33
moritz_ JohnGalt2600: if you sum up the download numbers for the previous snapshots too, you'll get quite a number 10:34
especially considering that we haven't released it as "finished" yet
10:36 Patterner left
snarkyboojum is there a rough date for the "finished" book? Or is that a taboo subject :D 10:37
10:38 Psyche^ joined, Psyche^ is now known as Patterner
moritz_ we had a date, and we missed it 10:39
JohnGalt2600 is there any need for a finished book? updates to an online book is better than a finalized book...
moritz_ and now it seems we've lost steam 10:40
JohnGalt2600: think s/finished/printed/
snarkyboojum moritz_: right, I thought chromatic was talking about a date a while back
moritz_ people like paper
JohnGalt2600 I cant ctrl-f paper
moritz_ but you can smash mosquitos with paper :-) 10:41
snarkyboojum I'd even love an edition of a book that is a work in progress :)
I suspect most publishers wouldn't
JohnGalt2600 true heh
snarkyboojum moritz_: there are lots of uses for paper :O
moritz_ JohnGalt2600: the idea is also to sell the paper version... the profit won't be huge, but it'll be enough to pay an editor, which in turns improves the quality 10:42
snarkyboojum I've noticed masak-san committing to the book lately
moritz_ indeed
snarkyboojum masak++ then :D 10:43
10:43 cosimo left
snarkyboojum it is discussed as a roadmap item in the phasers meetings? 10:43
10:43 tornadovj joined
moritz_ we've discussed it 10:44
but we should do it again
btw to have even more distractions, I've applied for a Hague grant today
snarkyboojum moritz_: w00t - link?
colomon \o/
moritz_ snarkyboojum: it's not yet online, but I've nopasted it here during YAPC::EU time last year 10:45
about exceptions and error messages
snarkyboojum ah - right - sweeet
jnthn moritz_: yay :) 10:46
Tene jnthn: I've been experimenting with implementing a ruby object model on nqp, but mostly all I get are crashes :( 10:52
jnthn: gist.github.com/838498
10:53 barika left
Tene afk bed 10:56
jnthn Tene: Can't look right now, but will do a bit later one. :) Sleep well.
Tene jnthn: no hurries 10:57
jnthn: I expect I'm getting a lot wrong there, and missing the point in at least one place.
10:59 barika joined
TiMBuS who is responsible for IO::Socket::INET ? i think it is starting to bitrot 11:02
moritz_ all rakudo developers are responsible for it, in some sense
TiMBuS well its just, id patch it up but im not entire sure how it's supposed to work.. 11:03
moritz_ "just like in perl 5", more or less 11:04
if it has a bit more convenience here and there, that wouldn't hurt
TiMBuS: and you can talk to tewk; he's working on non-blocking sockets in parrot, and hopefully then rakudo
maybe he has some unification plans
TiMBuS that would be fantastic
the only issue i have with io::socket::inet is (aside from the fact its not working), that most of the functions create a new socket? like regardless of there being an existing one or not.. 11:07
it should at lease close the old one =/
least*
moritz_ which methods are you talking about? 11:08
TiMBuS bind, open, socket? 11:10
moritz_ yep, seems like new, socket and bind all share that code
TiMBuS actually socket seems to return a parrot socket
thats not a good idea
moritz_ it does not
it calls .new
and passes a new socket to it
anyway, it would be much nicer to have a private method that create a parrot level socket 11:11
and call that when needed
and don't duplicate all that PIR code all over the file
TiMBuS ah i see, didnt see the new up there. 11:12
but yeah it seems parrot requires you to call Socket.socket now and open is not doing that 11:13
resulting in my irc bot being for offline use only :<
11:14 literal left 11:16 literal joined 11:18 donri joined
tadzik eh, the slowness of neutro makes it barely possible to test and debug 11:23
11:43 hanekomu left, pmurias joined 11:59 shi joined 12:12 hanekomu joined 12:16 bluescreen joined 12:21 jaldhar left, jaldhar joined
jnthn tadzik: Do you know what bit is the slow part? 12:23
Or just everything? 12:24
tadzik jnthn: JSON, sadly 12:25
adds like 30 seconds to the runtime
jnthn Oh, wow.
How much of JSON?
(e.g. file size)
tadzik jnthn: feather.perl6.nl:3000/projects.json
jnthn 17 KB. Nie je velmi velke... 12:26
:/
jnthn wonders if NQP parses it as slowly 12:27
I guess the grammar probably works as an nqp or nqp-rx one as well as a Rakudo one, mostly.
12:28 MayDaniel joined, MayDaniel left, MayDaniel joined
moritz_ and if not, it could at least be easily be made to work 12:31
jnthn Right 12:32
donri parse json with some NativeCall?
jnthn I'm curious if there's a bit difference between NQP and Rakudo there. And if so, why.
moritz_ we have a layer of etra wrappers are Regex::Match objects
tadzik I'm afraid using some C lib through NativeCall will just move the slowness to the amount of method calls needed 12:33
donri oh 12:34
the slowness of parsing json is just because of lack of optimization as of yet right? 12:35
or are grammars going to be noticably slow for larger data?
moritz_ there's no reason why they need to be slow in principle 12:36
jnthn Aye 12:37
moritz_: Would anything in them make it likely they'd be way slower?
I'm pretty sure Rakudo doesn't take 30 seconds to compile 17 KB of Perl 6 code. :) 12:38
moritz_ jnthn: you mean in the Match wrappers?
jnthn moritz_: yes
moritz_ I'm not aware of anything expensive in the initialization ...
except maybe that we use Perl 6 arrays instead of RPAs 12:39
donri I mean some parsing techniques are slow "by design"
moritz_ (which is overkill, because we don't need no stinkin' laziness)
donri: only backtracking in grammars is slow, but most grammars work nearly without backtracking
donri and you can often speed it up with memoization right= 12:40
moritz_ "depends" 12:41
conceptually the fastest way is to compile it to an equivalent automaton that doesn't backtrack 12:42
but that only works for regular languages
and fails for things like backreferences and code assertions
in which case you're pretty much lost
if you do something like primality testing with regexes, you're in O(2**n) land, and no amount of caching will save you 12:43
it's just that real parsers don't need such cracy stuff
for example for parsing XML, you do need backreferences to test if a pair of tags match 12:44
but if it doesn't match, you don't backtrack
but you throw an error
so it's more like '<' $<open> = (\w+) '> ... '</' $<close> = (\w+) { $/.CUROSR.panic('unmatched tags') if $<open> ne $<close> } '>' 12:46
12:56 takadonet joined
takadonet morning all 12:57
tadzik morning
13:02 pmurias left 13:13 hanekomu left 13:19 JimmyZ joined
flussence wonders if the HTML5 parsing spec is doable with just grammars... 13:21
takadonet that would be sweet
moritz_ if not, it's utterly broken 13:22
after all you can parse nearly everything with just grammars :-)
arnsholt Indeed. And if there are any really, really tricky parts, you can insert a method to do the custom munging you need =) 13:23
[Coke] yawns. 13:24
flussence the hard part is that HTML5's parsing has to be backward compatible with... well, the likes of geocities and worse
takadonet geocities is dead my friend :(
geocities.yahoo.com/index.php
JimmyZ o 13:25
flussence (they actually have </sarcasm> specced)
13:28 kanishka left 13:29 sftp joined 13:32 [Coke] left 13:35 MayDaniel left 13:36 TiMBuS left 13:39 [Coke] joined, plobsing left 13:40 plobsing joined 13:41 TiMBuS joined 13:54 fhelmberger joined 14:09 cjk101010 left, bluescreen left, cjk101010 joined 14:14 arlinius left 14:17 Axius joined 14:24 isBEKaml joined 14:30 jaldhar left 14:39 Chillance joined 14:49 PacoLinux left 15:04 shi left 15:09 kaare_ left 15:12 am0c left, risou joined 15:13 ggoebel left 15:18 wtw left 15:22 ggoebel joined 15:24 ggoebel left, orafu joined 15:29 am0c joined
moritz_ niecza: my $x = 5; say ~m/\d/ 15:31
p6eval niecza v2-99-g1e36fcc: OUTPUT«Bool::False␤»
moritz_ perl6: my $x = 5; say ~m/\d/
p6eval rakudo 10d86d: OUTPUT«Method 'match' not found for invocant of class ''␤ in main program body at line 22:/tmp/x2mm8F9oWV␤»
..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
..niecza v2-99-g1e36fcc: OUTPUT«Bool::False␤»
moritz_ perl6: $_ = 5; say ~m/\d/ 15:32
p6eval niecza v2-99-g1e36fcc: OUTPUT«Bool::True␤»
..rakudo 10d86d: OUTPUT«5␤»
..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.16/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** '<HANDLE>' trapped by operat…
moritz_ sorear: why does prefix ~ boolifies?
15:33 spq joined
sorear moritz_: the boolification happens in m// 15:33
15:34 Axius left
moritz_ why? 15:34
sorear moritz_: I wanted if m// {} and if $str ~~ m// {} to both work, so m// had to return an object $x such that $x.ACCEPTS(anything) = $x
Bool was the obvious choice
s/// returns Bool for the same reason 15:35
moritz_ sorear: the specced choice is Match, and instead Match.ACCEPTS is a bit... weird
isBEKaml niecza: $_ = 5; say m/\d/; # prefix ~ is superfluous? 15:36
p6eval niecza v2-99-g1e36fcc: OUTPUT«Bool::True␤»
15:36 Axius joined
moritz_ isBEKaml: yes, it is 15:36
isBEKaml: but since niecza's Match objects behaved unexpected in list context in the past, I'm careful
isBEKaml rakudo: $_ = 5; say m/\d/; 15:37
p6eval rakudo 10d86d: OUTPUT«5␤»
isBEKaml moritz_: unexpected behaviour in list context with niecza. I'm curious, how so? 15:38
sorear Match objects return a their positional captures in list context
moritz_ isBEKaml: Match.list would return a list of all captures, so in the case above it would return the empty list. So say() would print nothing
sorear in order to stop suprising moritz, I added a special case for Match objects with no positional captures 15:39
moritz_ suddenly feels important :-)
isBEKaml (sorear,moritz_)++
:-)
well, I was wondering you two were speaking different scenarios. sorear++ nicely backed it up with a special case. :) 15:40
15:41 gbacon joined
colomon speaking of what one might do with grammars -- I was just thinking the other day that we ought to get a C++ parsing grammar module up and running. That might constitute a pretty good killer app for p6... 15:42
15:42 clkao_ joined, clkao_ left
JimmyZ E:\rakudo>perl6 ..\roast\S02-builtin_data_types\hash.t 15:43
===SORRY!===
Unicode rindex not implemented
:(
isBEKaml colomon: of all the languages in the world, why C++? (just kiddin') :-)
moritz_ ouch
colomon isBEKaml: because parsing C++ is notoriously hard. :)
PerlJam isBEKaml: that's exactly what I was thinking ;)
mux s/hard/messy/ maybe? :-) 15:44
PerlJam parameterized types require an indeterminant amount of look-ahead IIRC
moritz_ knew immediately what colomon++ meant
15:45 bluescreen joined
PerlJam "Only Perl can parse C++" ?? 15:45
:)
sorear isBEKaml: there are about 3 C++ parsers in existance today. 2 of them are expensive proprietary libraries and 1 of them was deliberately designed to be difficult to reuse.
moritz_ sorear: are you talking about g++? :-) 15:46
isBEKaml sorear: are you talking about g++?
sorear although clang++ is trying to change this
isBEKaml ah, moritz_ ! :o)
I have heard good things about clang, but never got around to trying it out. 15:47
PerlJam: I'd say only Perl6 can run C++! /more awesomeness/ !
( parse != run ) but heck, why not? :) 15:48
PerlJam There's a joke in there somewhere about C++ being slow ... I can just feel it!
;)
colomon afk # cross-country skiing! 15:50
isBEKaml I'm not very strong willed to actually program in C++. I remember forgetting to insert destructors in classes and quickly ran into memory issues. (that was when turbo c++ was all the rage) 15:51
PerlJam wow.
PerlJam hasn't heard mention of turbo c++ in over 15 years, easy
15:51 cjk101010 left
isBEKaml I can now safely say I don't know C++. :) 15:53
slavik1 isBEKaml: nobody 'knows' C++ 15:54
moritz_ just like with perl :-)
slavik1 moritz_: yes, but some of us can claim to come close
isBEKaml slavik1: I think I know what you're referring to. Even the author himself confessed as much in his programming book. :)
slavik1 I am sure TimToady can claim to come close to knowing something about Perl ... 15:55
moritz_ did you know that in perl 5, a - followed by an identifier is a valid string literal, even under 'use strict;'?
PerlJam "knowing perl" is really having a good base of meta-knowledge (i.e. know where to look to find out something)
15:55 justatheory joined
slavik1 as in my $a = -blah; ? 15:55
moritz_ slavik1: correct
huf yeah why is that anyway?
slavik1 PerlJam: but that is basic "having a brain" knowledge
moritz_ huf: there's somebody in this channel you could ask... 15:56
isBEKaml speaking of meta knowledge, anybody tried out magpie? the author says that's his USP in magpie( as of now)
15:56 jtbraun1 joined
huf moritz_: i'm sure i'd get a vague pun as an answer ;) 15:56
moritz_ oh, and -"foo" returns 0 (plus warning), but -"-foo" returns "+foo"
anybody wants to say "huh"? :-)
isBEKaml magpie.stuffwithstuff.com 15:57
15:57 am0c left
PerlJam huf: I think the answer is so that my %hash = ( -foo => 1 ); would work properly. 15:57
But don't really remember why
huf PerlJam: but that already works properly due to =?
=>
PerlJam like I said. I don't really remember why 15:58
but! I'm sure the answer is buried in the perl documentation somewhere ;0) 15:59
er, ;-)
15:59 kjeldahl left
huf :D 15:59
moritz_ perlop (not perlsyn, mind you) explain what it does, but not why 16:00
I collect weird Perl 5 things on my perlmonks homenode 16:02
for example I was also quite surprised that you can have whitespace afters sigils in p5
16:02 snearch joined
moritz_ my $ x = 3; 16:02
PerlJam I still think -blah was so that hash keys could be specified like ( -foo => 1 ) => stringifies its LHS, but unary minus would have already mangled it if it didn't work the way it does. 16:04
moritz_: do you like "foo" =~ s xooxaax; # too ? :) 16:06
16:06 jtbraun1 left
moritz_ PerlJam: I find that hilarious too, but not sufficiently weird for my collection 16:07
isBEKaml hilarious!
PerlJam moritz_: what about this? echo "foo" | perl -nE '} continue { say "hi"' 16:09
16:09 am0c joined
isBEKaml I don't regularly follow perlmonks. But on occasional visits to the site, I've found it to be down or just plain unresponsive (probably down to maintenance windows or mostly due to my timezones) 16:10
PerlJam Or any variation where there are apparently unmatched curly braces on the command line
dalek ast: f47e392 | jimmy++ | S02-builtin_data_types/hash.t:
added test for RT #61412
moritz_ PerlJam: nice too, but I've known this one for a long time, so it wasn't really surprising 16:11
JimmyZ couldn't make spectest on windows :(
moritz_ JimmyZ: what stopped you?
PerlJam moritz_: There's lots of things that I know about Perl that are no longer surprising, but would certainly cause surprise in others :)
JimmyZ moritz_: I guess 'Unicode rindex not implemented'
PerlJam Perl is full of surprises if you'd just keep looking for them. 16:12
moritz_ JimmyZ: does that happen for all test files?
16:12 obra left
JimmyZ moritz_: t\spec\S02-names\identifier.t ...................... Dubious, test returned 1 (wstat 256, 0x100) 16:13
moritz_: all the same
moritz_ JimmyZ: that's... ouch. Do you have icu installed?
JimmyZ moritz_: nope. 16:14
icu blocked all test running?
moritz_ it shouldn't
I'm just looking for possible explanations 16:15
isBEKaml moritz_: shouldn't it be that all unicode tests run only when icu is installed? ( I vaguely remember having a switch like that)
moritz_ isBEKaml: it should, yes
isBEKaml so I find it confusing that JimmyZ says that it runs on his non-icu machine. :(
16:16 Patterner left
isBEKaml or are they just part of a separate test file? 16:16
JimmyZ I guess the new parrot string refactor breaked it. 16:17
16:17 bluescreen left
moritz_ isBEKaml: he says it doesn't run on his non-icu machine 16:17
JimmyZ 'Unicode rindex not implemented' is from there.
moritz_: RT #61412 is closable now? 16:18
16:18 Psyche^ joined, Psyche^ is now known as Patterner
isBEKaml moritz_: I'm just asking if that should be shown at all. If that's specific to unicode, that test would have been skipped. 16:18
moritz_ JimmyZ: yes 16:19
16:20 hanekomu joined
JimmyZ moritz_: you have the power. :) 16:20
moritz_ closed. 16:22
JimmyZ++
JimmyZ rakudo: my %h=<a b c> Z 1,2,3; for %h { .say }
p6eval rakudo 10d86d: OUTPUT«a 1␤b 2␤c 3␤»
16:23 Mowah left, MayDaniel joined
baest away DND - afk 16:24
whoops
isBEKaml rakudo: my $a=-blah; say $a; # :o)
p6eval rakudo 10d86d: OUTPUT«Could not find sub &blah␤ in main program body at line 22:/tmp/iMq80XjFbG␤»
16:25 risou left
isBEKaml baest: that's okay. I occasionally do :wq anyway. ;) 16:25
like
:wq
hugme hugs isBEKaml, good vi(m) user!
diakopter :wq! 16:27
hugme hugs diakopter, good vi(m) user!
16:29 hanekomu left
[Coke] :s/hugme//g 16:29
diakopter heh 16:30
isBEKaml diakopter: you must be pretty used to savepoints very much. ;) 16:31
I just can't stop myself from hitting ctrl+S everytime when on windows.
[Coke] ^S works fine in gvim! 16:34
16:35 nymacro left, Axius left 16:36 ggoebel joined
isBEKaml "It's a trap!" :D 16:37
16:38 tzhs left 16:42 JimmyZ left 16:46 JimmyZ joined, bluescreen joined 16:48 ab5tract joined
donri evim 16:50
16:51 JimmyZ left
tadzik is disappointed for the movement on perl6-users@ not being about Perl6::Critic :) 16:53
donri :q! 16:55
hugme hugs donri, good vi(m) user!
donri I'd say that's a bad vim user.
16:55 alester joined
sbp ZZ 16:59
17:05 mtk left 17:06 PacoLinux joined 17:08 plobsing left, plobsing joined 17:15 mtk joined 17:16 shi joined, ggoebel left 17:18 isBEKaml left 17:20 bluescreen left
allbery_b "perl6 critic" still means nitpicking the spec :) 17:25
17:32 jtbraun1 joined 17:35 bluescreen joined 17:36 dwhipp joined, masonkramer left, masonkramer joined 17:49 envi left 17:50 cdarroch joined, cdarroch left, cdarroch joined 17:59 mberends joined 18:01 awoodland left 18:09 mkramer1 joined
donri What does := really do/mean? 18:11
Seems necessary for recursively defined lists 18:12
arnsholt Bind, instead of assign
diakopter it connects all the Midi-chlorians everywhere 18:13
arnsholt (By-reference instead of by-value is an ok first approximation I think)
But I don't quite grok the finer points of the distinction yet. Not enough Lisp experience =)
18:16 dakkar left
donri paste.pocoo.org/show/342907 why syntax error? 18:22
"missing block" 18:23
seems to be the newline before given 18:24
18:31 ColloquyUser_ joined
dalek rixel: 4de54aa | diakopter++ | / (9 files):
grammars have rules that work as their methods
18:32
18:34 masak joined
masak evening, zebras. of all kinds and stripings. 18:34
donri rakudo: say (1 .. ceiling sqrt $_ ==> grep $_ %% * ==> map { $^a, $_ div $^a }).perl given 13195; 18:36
p6eval rakudo 10d86d: OUTPUT«((1, 13195), (5, 2639), (7, 1885), (13, 1015), (29, 455), (35, 377), (65, 203), (91, 145))␤»
donri rakudo: my @factors = 1 .. ceiling sqrt $_ ==> grep $_ %% * ==> map { $^a, $_ div $^a } given 13195; say @factors.perl 18:37
p6eval rakudo 10d86d: OUTPUT«[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
..72, 73…
donri what's up with this?
is it because of the @list-context somehow
18:39 daxim left
jnthn god kvell, masak o/ 18:42
18:43 mkramer1 left 18:44 mkramer joined
masak what is that? Danish? :P 18:50
phenny: "god kvell, masak o/"? 18:51
phenny masak: "good evening, Masaka o /" (no to en, translate.google.com)
masak apparently, Google Translate is not well-versed in the International Waving Sign Language. 18:52
colomon #phasers in 8?
masak ooh!
jnthn masak: Generic Scandinavian. :P 18:53
masak ;)
18:57 orafu left, ColloquyUser_ left 19:01 bluescreen left, kaare_ joined
dwhipp I was wondering if anyone had time to look at my patch from last week (rt #84362), which added higher-arity limit functions to sequences 19:05
19:05 ColloquyUser joined 19:07 getgrnam left 19:08 silent_h_ joined 19:12 jevin left 19:13 jevin joined 19:15 MayDaniel left 19:16 alester left
masak dwhipp: I saw it flash by, and found it a good idea. haven't reviewed it, though. 19:17
19:17 kanishka joined
dwhipp OK, thanks 19:18
19:19 alester joined
dalek rixel: 1b6ea71 | diakopter++ | sprixel/src/ (4 files):
<.rulename> works
19:19
pmichaud good afternoon, #perl6 19:21
jnthn pmichaud! \o/
19:22 ymasory left
jnthn brb 19:23
19:26 molaf_ left 19:28 impious joined 19:30 impious left 19:35 silent_h_ left 19:38 Axius joined 19:41 ColloquyUser_ joined, ColloquyUser left, ColloquyUser_ is now known as ColloquyUser 19:44 ColloquyUser left 19:45 ColloquyUser joined 19:47 stepnem left, _sri left 19:48 _sri joined 19:49 stepnem joined 19:55 Vlavv left 19:56 pnu left, pnu joined
masak liked blogs.perl.org/users/jeffrey_kegler...dence.html 19:57
I wonder where the previous six "Perl and Parsing" posts are at, though... 19:58
19:58 _sri left, newbieUno joined
newbieUno rakudo: say "monty"; 20:00
p6eval rakudo 10d86d: OUTPUT«monty␤»
20:00 _sri joined
newbieUno how can i make my perl6 tests not visible to others here? I wish to try it a little before i install. 20:01
masak newbieUno: /msg p6eval rakudo: say "monty";
20:02 cognominal joined
masak newbieUno: there's also try.rakudo.org 20:02
newbieUno try.rakudo.org sounds nice i will test
20:02 noganex left 20:03 noganex joined, barika left
newbieUno masak: how can i know what build i am testing in try.rakudo? 20:04
20:04 barika joined
masak probably the same as here; bleeding edge. 20:04
or as near as not to matter.
donri why doesn't take default to taking $_ 20:05
masak donri: because in Perl 6, no function defaults to taking $_. 20:06
pmichaud I wonder if .&take works, though :-)
donri then I want an Any.take ;)
masak pmichaud: it does
donri: me too :)
Perl 6 tries to minimize the amount of things you have to learn by rote. such as which functions default to $_ and which don't. 20:07
20:07 Vlavv joined
donri and $x.&foo == foo($x) ? 20:08
masak yes. 20:09
we sort of... discovered that half a year or so ago :P
donri cool. still, simply .take would be nice :)
masak yes :)
donri $_ is neat but ugly in itself :D 20:10
which also makes me abuse the shit out of Whatever
using when instead of if, for example
pmichaud as long as you're aware that 'when' and 'if' are different :-)
donri that's the point of using when
20:11 newbieUno left
arnsholt when $x is roughly the same as if $_ ~~ $x, IIRC 20:12
(Modulo given and such)
pmichaud except for the implied break out of the enclosing block. :-)
donri why does "do for" work similar to gather/take?
20:13 stkowski joined 20:16 spq left
masak pmichaud: ...and the implied break is in effect for the block-style 'when' but not for the statement-modifier 'when'... ;) 20:17
implied 'succeed', I should say. 20:18
20:19 donaldh joined 20:21 mberends left 20:24 fhelmberger left 20:26 tylercurtis joined 20:28 ab5tract left 20:29 Tedd1 left
dalek rixel: b8f0c11 | diakopter++ | / (5 files):
debug/cleanup
20:33
20:37 dual left
masak I have a kvetch about S09. 20:38
one has to read all the way to "Multidimensional arrays" to be certain that something like 'my @a[-5 .. 15];' is a valid declaration. 20:39
but I don't think it's a stretch at all to assume that it is.
given that, (it is my contention that) it's wrong of S09 to say that * means 'length of array'. 20:40
S09:660
if it is, then it won't be possible to index easily from the end of non-0-based arrays.
20:41 alester left, jevin left, mkramer left, TiMBuS left, zykes- left, szabgab left, ponbiki left, nadim left, pjcj left, Lorn left, betterworld left, charsbr__ left, cookys_ left, pochi left, dsp_ left, pmichaud left, tty234 left, dukeleto left, szbalint left, Grimnir_ left, Juerd left, Util left, bbkr left, rblackwe left, breinbaas left 20:43 JohnGalt2600 left 20:44 snearch left
donri take * taking $_ would also look better, but duno if that's bad for some reason 20:44
20:45 JohnGalt2600 joined 20:46 dual joined 20:49 cognominal left 20:51 Vlavv left
arnsholt Indeed. It should probably mean "last index of array", or perhaps "last index of array+1" to keep [*-1] meaning the same 20:52
masak donri: term:<*> generally either means "the option I want" or "make a closure around me".
donri: though the former might fit, it seems to me to be an unnecessary kind of mangic, just to get rid of $_ 20:53
arnsholt: yes, I would suggest the latter.
20:54 flussence left
donri masak: doesn't 'when' do that exactly though? 20:55
20:55 flussence joined
donri "when * > 5" same as "when $_ > 5" 20:55
masak technically, it means 'when { $_ > 5 }'
donri or is it actually "when $_ ~~ -> $x { $x > 5 }"
masak that's the "create closure here" part.
donri yea
masak it's more like 'if $_ ~~ -> $x { $x > 5 }', but yes. 20:56
20:56 tty234 joined
masak plus the implicit 'succeed' semantics pmichaud was talking about ;) 20:57
tylercurtis It does have the same effect as "when $_ > 5", though. (Unless Bool.ACCEPTS's weirdness has changed since last I've heard).
Tene donri: for is the same as map, except for is a statement and map is just a function (or method)
masak tylercurtis: right.
tylercurtis: but the point here was whether $_ was synonymous to *. it isn't. 20:58
donri Tene: but isn't 'do' do-once?
Tene donri: yes, and the thing you're doing once is the for loop
donri and why does it "take" the return of each iteration
moritz_ because it's more useful that way
Tene 13:57 < Tene> donri: for is the same as map 20:59
donri oh i get it, thanks
Tene donri: the return value of for is a list of the return values of each iteration
20:59 Vlavv joined, bluescreen joined
Tene donri: incidentally, the other answer is that map is implemented with gather/take 20:59
21:00 alester joined, jevin joined, mkramer joined, zykes- joined, szabgab joined, ponbiki joined, nadim joined, pjcj joined, Lorn joined, betterworld joined, charsbr__ joined, cookys_ joined, pochi joined, dsp_ joined, pmichaud joined, dukeleto joined, szbalint joined, Grimnir_ joined, Util joined, Juerd joined, bbkr joined, rblackwe joined, breinbaas joined, mkramer1 joined, Rotwang joined, Axius left
masak though 'for' in void context doesn't need to capture its results. 21:00
21:00 Axius__ joined, Rotwang left, Rotwang joined, donri left, donri joined
masak or is indistinguishable from something that is ;) 21:01
masak puts down the hair-splitter
21:01 _twitch left, mkramer left 21:04 estrabd left 21:05 phenny left, meraxes left, takesako left, yahooooo left, Intensity left, nrr left, mux left, aloha left, kolibrie left, cibs left, stkowski left, sftp left, starcoder left, y3llow left, _dev0_ left, Trashlord left, amkrankruleuen left, donri left, bluescreen left, gbacon left, Su-Shee left, drbean left, cschimm1 left, s1n left, pothos left, maja left, saaki left, Vlavv left, noganex left, jtbraun1 left, aesop left, jtbraun left, REPLeffect left, _ilbot left, kst left, robinsmidsrod left, bhwu left, JohnGalt2600 left, barika left, ruoso left, rbuels left, chitragupt left, simcop2387 left, tewk left, nothingmuch_ left, jql left, hatseflats left, diakopter left, allbery_b left, apejens left, knewt2 left, silug left, Helios- left, moritz_ left, cxreg left, rokoteko left, lestrrat left, broquaint left, woldrich left, hcchien left, mux joined, takesako joined, phenny joined 21:06 nrr joined, donri joined, bluescreen joined, Vlavv joined, stkowski joined, noganex joined, jtbraun1 joined, gbacon joined, sftp joined, Su-Shee joined, drbean joined, aesop joined, jtbraun joined, cschimm1 joined, s1n joined, starcoder joined, pothos joined, y3llow joined, _dev0_ joined, Trashlord joined, REPLeffect joined, _ilbot joined, amkrankruleuen joined, maja joined, kst joined, robinsmidsrod joined, saaki joined, bhwu joined, cibs joined, bluescreen left, kolibrie joined, aloha joined, meraxes joined, knewt2 joined, silug joined, Helios- joined, woldrich joined, cxreg joined, moritz_ joined, lestrrat joined, rokoteko joined, broquaint joined, hcchien joined 21:07 yahooooo joined, estrabd joined, JohnGalt2600 joined, barika joined, tewk joined, ruoso joined, rbuels joined, chitragupt joined, simcop2387 joined, nothingmuch_ joined, jql joined, hatseflats joined, diakopter joined, allbery_b joined, apejens joined 21:09 kaare_ left 21:10 kaare_ joined 21:12 coldhead joined 21:22 ggoebel joined 21:23 ggoebel left
colomon I'm getting "Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace," which is certainly true, though it wasn't that long ago this code worked. 21:30
But it seems like nothing else is happening in the code, which is very confusing to me.
Is that error actually a "Shut down and do nothing else" error?
masak has-methods in modules last worked in alpha. 21:31
moritz_ rakudo: module A { method foo() { } }; say "alive"
p6eval rakudo 10d86d: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤alive␤»
masak a module simply doesn't have the MOP to handle has-methods.
and we stopped cheating in the alpha->ng switch.
colomon I'm fairly certain this code does not go back to alpha. 21:32
masak extraordinary claims require extraordinary evidence... ;) 21:33
colomon errr... though I may be wrong. geez, I've been working on this for THAT long?!
masak the real question is... why do you have methods in your module?
colomon it's not a module, it's a class. 21:34
errr... at least, that's what I've been assuming is causing the error.
Hmmm... though the class name does not match the filename in case. 21:35
it's a class in a module, I mean.
masak are the methods in the class? 21:38
whether the class matches the file name shouldn't matter, really.
Tene rakudo: module A { class B { method foo() { } }; say "dood";
colomon They are, and making them "our" has not fixed the error at all.
p6eval rakudo 10d86d: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
21:38 Lorn left
Tene rakudo: module A { class B { method foo() { } } }; say "dood"; 21:38
p6eval rakudo 10d86d: OUTPUT«dood␤»
21:39 Lorn joined
Tene colomon: you've got something else going on; are you *sure* they're in the class? 21:39
colomon masak: this is sort of dodging my larger question: Why does a "useless declaration" apparently shut down my script's execution? Or is something completely different going on here?
ooo, that may be it. 21:40
masak colomon: could you try to golf the error and then post it here?
colomon one moment, I think I've got it.
rakudo: method foo($a) { say $a; }; 21:41
p6eval rakudo 10d86d: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤»
colomon there, golfed to a tee.
Tene std: method foo($a) { say $a; };
colomon So it's a real error, with a LTA error message.
p6eval std 4608239: OUTPUT«ok 00:01 122m␤»
Tene std: method foo() { };
p6eval std 4608239: OUTPUT«ok 00:01 119m␤»
Tene rakudo: method foo() { };
p6eval rakudo 10d86d: OUTPUT«Useless declaration of has-scoped Method in a module; add our or my to install it in the lexpad or namespace␤»
Tene erm, what's wrong with that error message? 21:42
colomon First, it says "module" where you would normally say "script" or "program".
21:42 _twitch joined
Tene No I wouldn't? 21:42
Maybe it should say "outside of a class or role", though? 21:43
colomon Second, it doesn't mention the name of the method in question or provide a line number, either of which would have instantly pinpointed the actual problem.
Tene That would be nice, yes. :)
21:49 mkramer1 left, Chillance left, Solarion left, VXZ left, dju__ left, jjore left, coldhead left, Rotwang left, alester left, jevin left, zykes- left, szabgab left, ponbiki left, nadim left, pjcj left, betterworld left, charsbr__ left, cookys_ left, pochi left, dsp_ left, pmichaud left, dukeleto left, szbalint left, Grimnir_ left, Juerd left, Util left, bbkr left, rblackwe left, breinbaas left, wolverian left, kfo left, frettled_ left, frettled joined 21:50 coldhead joined, Rotwang joined, mkramer1 joined, breinbaas joined, rblackwe joined, bbkr joined, Juerd joined, Util joined, Grimnir_ joined, szbalint joined, dukeleto joined, pmichaud joined, dsp_ joined, pochi joined, cookys_ joined, charsbr__ joined, betterworld joined, pjcj joined, nadim joined, ponbiki joined, szabgab joined, zykes- joined, jevin joined, alester joined, Chillance joined, Solarion joined, VXZ joined, dju__ joined, jjore joined, kfo joined, mathw left, mathw joined, wolv joined 21:53 Axius__ left 21:56 ColloquyUser left
donri So my Perl 6 Euler #3 solution is damn slow, not sure if my code is to blame or not. :D 21:56
Tene donri: Just run it under Devel::NYTProf... ;) 21:57
donri: (perl 5 profiling library; perl 6 doesn't have good profiling tools)
donri And that thing runs Perl 6 code??
Anyway my code runs "fast enough for Perl 6" for lower numbers, and uses RAM steadily 21:58
if my code is to blame it's because it maybe does computations that aren't necessary 21:59
Pondering trying it in Haskell
colomon show us the code! ;) 22:01
22:03 MayDaniel joined
Tene donri: No, it doesn't run Perl 6 code. It was a bad suggestion intended as a joke, and then I remembered that you're not that familiar with Perl 5. 22:05
donri Ah you meant port to v5
22:06 ColloquyUser joined
Tene donri: You seem to be under the impression that I was being helpful. I was trolling, and making a side comment on the pool tools infrastructure in Perl 6 right now. 22:06
donri :) 22:07
Tene Man, you'd think you'd know me better by now. ;P
donri Trollne
colomon: paste.pocoo.org/show/343029/ 22:08
masak today's mini-challenge: write a version of rosettacode.org/wiki/Hamming_numbers#Perl_6 that does not use lazy lists. 22:11
donri _ should be disallowed in terms :D
22:12 jtbraun1 left 22:14 kjeldahl joined
masak donri: you mean in identifiers? 22:14
donri yea
colomon masak: but.... that would require work!
masak colomon: yes, I bet any such solution would be far less elegant, too. 22:15
donri so come on, rate my code, does it suck?
colomon masak: work == less elegant. ;)
masak colomon: thing is, I have an idea for how to do it. I just haven't tried it yet.
arnsholt As I was going to say: But why on Earth would want to -not- use lazy lists =)
donri it's admittedly greatly plagiarized from rosettacode examples
colomon donri: I don't think it's terrible.
masak arnsholt: here's one possible reason: because you're running Perl 5 :) 22:16
arnsholt: I'm sure there are others...
donri i make a point though of understanding both syntax and semantics, and not just copy-paste
colomon donri: you can look at Math::Prime for an example of how to create @primes that we actually tried to optimize a bit.
donri: I don't see anything obvious that should make it slow, you're probably just running into general Rakudo slowness. 22:17
donri I thought so
it's actually still not finished after maybe 40+ minutes 22:18
masak donri: with @factors, what is it that the ...^ enumerates?
colomon masak: actually, I think that ma...
masak donri: I'm not convinced you'll get multiplicity that way...
tadzik any neat idea to transform a string into a regex in nqp?
colomon donri: wait, that's got to be something wrong!
donri yea might be completely wrong 22:19
22:19 cosimo joined
colomon masak: as I was saying, actually, I think the doing a better lazy version of Hamming might be more interesting than doing a non-lazy version. 22:19
masak donri: recall that ... is a list operator. so putting @primes before it like that is probably Wrong.
donri I was aiming for "all primes lower than square root of the number we're decomposing"
colomon @primes ... * > blah is perfectly correctly.
masak colomon: oh, you think the lazy version can be improved? interesting. 22:20
colomon the sequence operator can take a (possibly lazy) list on either side.
colomon 's grammar is not perfectly correctly, however.
masak colomon: oh, and it won't iterate over the whole list?
@primes, in this case.
colomon masak: nope.
masak nice. 22:21
colomon it's actually a very handy usage of the sequence operator.
masak I should have known that.
donri rakudo: say (^* ...^ * > 10).perl
p6eval rakudo 10d86d: OUTPUT«Can't take numeric value for object of type Whatever␤ in 'Any::Numeric' at line 1462:CORE.setting␤ in 'prefix:<^>' at line 7467:CORE.setting␤ in main program body at line 22:/tmp/Y5E4veDVi5␤»
donri rakudo: say (^Inf ...^ * > 10).perl
p6eval rakudo 10d86d: OUTPUT«(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)␤»
colomon nice example
masak donri++ colomon++ 22:22
yeah, that's a cool usage.
'night, #perl6
22:22 masak left
colomon night 22:22
donri rakudo: say ((0, 2 .. *) ... * > 10).perl
p6eval rakudo 10d86d: OUTPUT«(0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)␤»
colomon rakudo: say ((0, 2 ... *) ... * > 10).perl 22:23
p6eval rakudo 10d86d: OUTPUT«(0, 2, 4, 6, 8, 10, 12)␤»
donri oh, right
haha nice "cheating" in math::prime 22:24
colomon :)
the algorithm works, but it's nice to have it primed with a bunch of easy answers. ;) 22:25
donri what's up with is export(:DEFAULT), isn't :DEFAULT the, uh, default? :)
colomon donri: actually, I'd be very worried about your use of $_ %% *
donri: (re :DEFAULT) me paranoid.
donri $_ is set by the "given" 22:26
colomon and $_ is set by grep
maybe not in this case, I admit.
I don't know exactly what gets bound when.
donri :D 22:27
it works, i've tested it on smaller numbers
colomon was just going to ask that.
donri maybe you're thinking grep { closure without explicit args or $^ordered args }
==> seems to have weird precedence or something 22:28
rakudo: my @nums = ^10 ==> grep * %% 2; say @nums.perl 22:29
p6eval rakudo 10d86d: OUTPUT«[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]␤»
colomon donri: I might be wrong, because of some twisty binding thing I don't understand. But at the very least, it's worrisome-looking code, even if it's right.
donri rakudo: my @nums = (^10 ==> grep * %% 2); say @nums.perl
p6eval rakudo 10d86d: OUTPUT«[0, 2, 4, 6, 8]␤»
donri whyever wouldn't assignment take like the lowest precedence?
or is this a rakudo bug?
colomon grep very definitely binds $_, but if you're getting $_ from before that binding you're okay. 22:30
22:31 _twitch left
donri does it really set $_ itself though or isn't it more that it takes a code object and those can grab arguments via $_? 22:32
colomon oooo, your primes calculation is very slow.
donri I sorta wish (or have missed that there is) a Haskell-like 'where' clause
diakopter perlesque: my $frontierSet = SortedSet[BigInteger].new; say $frontierSet
p6eval perlesque: OUTPUT«System.Collections.Generic.SortedSet`1[System.Numerics.BigInteger]␤» 22:33
diakopter o_O
colomon donri: I don't know. but let me suggest that if you've got to parse obscure areas of what's going on like that, your code might be less than ideal. :)
diakopter masak: I see a hamming heading your way
donri that is, I'd like statement-local after-thought scope 22:34
22:34 gbacon left
donri do-stuff-to $n with { my $n = 'temp' } 22:35
diakopter perlesque: say BigInteger.One # o_O
p6eval perlesque: OUTPUT«1␤»
donri is there anything like that?
moritz_ donri: it's spelled 'given' and sets $_
rakudo: .say given 7 + 4 22:36
p6eval rakudo 10d86d: OUTPUT«11␤»
donri that's what I'm (possibly ab-) using already and it only sets one variable
colomon moritz_: he knows that, and is looking for something which can have a different name.
moritz_ ah, it's called 'my' :-=)
colomon moritz_: because I'm objecting to his use of "grep $_ %% *" 22:37
moritz_ my $x = 4 + 7;
22:37 kanishka left
donri Yes but then I need to do it imperatively which feels less elegant ;) and I might also need to use {} if I'm gonna be truely OCD about the namespace 22:37
22:38 shi left
moritz_ so doing things in order is "imperatively"? 22:38
donri yea ;)
nah but ; as in statements = imperatively
more elegant to do "single units" in a single expression 22:39
I should of course write subs instead, but shoot me
22:40 molaf joined
colomon donri: In fact, I instinctively rewrote your code into a sub almost the second it hit my editor. :) 22:41
donri I just like the sub-free style for these euler problems 22:46
treating the whole file as a sub in a way
hm blocks in a way do this thing i was talking about before 22:47
{ do-stuff-to $^a }('temp') 22:48
colomon: are my @primes slow because of the code or because of only two hardcoded primes? 22:49
colomon donri: investigating.
but your code takes 10m18s (on my MacBook Pro) to calculate the primes up to 10000.
oh, duh. 22:52
you say "$a is copy"
never mind, that's not it. 22:53
22:53 kaare_ left
colomon I'm not sure where the slow is, but Math::Primes calculates the primes to 10000 in 1m34s 22:53
so it's pretty drastically faster.
the hardcoded primes only go up to 541, so that's only a tiny portion of the difference. 22:54
donri but the following primes rely on the previous primes
hm but i'd expect it somewhat quickly goes up to 541 anyway
colomon using "@primes ...^ * > sqrt $a" in your inner loop is probably killing you. 22:55
getting up to 541 is the easy part.
Math::Prime's next-prime function is designed to work fast, not look pretty. :) 22:56
donri but you're doing the same with last if $_ > $sqrt; 22:59
dukeleto colomon: there are many prime-checking optimizations in Math::Primality on CPAN 23:02
colomon: all well-documented as well
colomon donri: same math, but very different p6 code. 23:03
using the sequence operator is drastically slower than a hand-coded loop. 23:04
23:08 alester left
donri ah 23:09
because it needs to or because its implementation is less optimized?
23:15 kjeldahl left 23:20 whiteknight joined, skangas_ joined 23:22 Rotwang left
donri colomon: why is sequence op slower, is it because using smartmatching? 23:23
i think the code that's still running on my machine was earlier code that used @primes.map { last when * > sqrt $^a; ... } 23:24
23:24 skangas left, skangas_ is now known as skangas
donri which similarly uses smartmatching 23:25
23:27 jferrero joined
diakopter perlesque: gist.github.com/839655 23:28
p6eval perlesque: OUTPUT«First 20 Hamming numbers: ␤1␤2␤3␤4␤5␤6␤8␤9␤10␤12␤15␤16␤18␤20␤24␤25␤27␤30␤32␤36␤1691st Hamming number: 2125764000␤One millionth Hamming number: 519312780448388736089589843750000000000000000000000000000000000000000000000000000000␤»
23:28 dju_ joined
diakopter phenny: ask masak take a look at the clog from here - hamming perlesque 23:29
phenny diakopter: I'll pass that on when masak is around.
diakopter phenny: tell masak (blatantly ported from the Java solution) 23:30
phenny diakopter: I'll pass that on when masak is around.
23:31 dju__ left 23:33 JodaZ left 23:39 ColloquyUser left 23:40 ColloquyUser joined 23:41 ColloquyUser left 23:47 donaldh left 23:49 wolv is now known as wolverian