»ö« 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:16 bluescreen10 left 00:17 uvtc joined 00:48 uvtc left 00:54 kcwu left, jevin left 00:58 jevin joined 01:01 noganex joined 01:04 noganex_ left 01:07 kcwu joined 01:24 jaldhar joined 01:38 cooper joined 01:46 whiteknight left, envi joined 02:40 Chillance left 02:52 am0c left 03:02 satyavvd joined 03:04 am0c joined, satyavvd left 03:23 Su-Shee_ joined 03:26 Su-Shee left 03:32 dayangkun joined
TimToady rosettacode.org/wiki/Pattern_matching#Perl_6 <-- Red/Black trees (sig patterns, not regex patterns) 04:05
sorear TimToady: How much are Perl 6 metaoperators related to J metaoperators? 04:12
TimToady not very
I did decide to make dwimmy hyper cyclic after seeing some APL though 04:13
04:14 uvtc joined
TimToady I also decided to (continue to) make metaops visually distinctive in Perl 6 after seeing how APL didn't :) 04:15
04:16 am0c left
TimToady so far I think that has been quite successful 04:16
uvtc TimToady: I was just thinking about back when svn replaced cvs. 04:18
I remember it being marketed heavily as the cvs replacement.
Maybe the same thing happend with Java and C++... 04:19
It's interesting, Perl 6 seems to be taking the opposite approach.
For example, the perl6.org site saying that Per 6 is Perl 5's spunky little sister. 04:20
04:20 Mowah joined
uvtc It made me think of a part of the "who killed the electric car" movie. At one point, 04:21
the narrator was listing the reasons why GM killed the EV-1. One of the reasons was
that to properly advertise the electric car meant also implicitly listing why the fossil-fuel vehicles were ... worse. 04:22
And GM wouldn't do that to their bottom line. 04:23
Gah. Sorry for blathering. Just saw some parallels there.
TimToady when the time is right, Perl 6 will advertise itself 04:24
uvtc I understand.
Thanks for the reply. TimToady++ :) 04:25
04:26 uvtc left 04:41 cooper left 04:45 dayangkun left, kaare_ joined 04:46 cooper joined, cooper left, cbk joined
sorear perl 6 has slept for many years in dark obscurity, but when the stars are right, it will rise, and no agency of man will be able to stop it... 04:47
05:01 buubot_backup joined, s1n left 05:04 s1n joined, s1n left 05:44 ciphertext left 06:08 jevin left
moritz good morning fellow lambdazebras 06:12
06:12 jevin joined
mberends good morning moritz. I hope your Norwegian family are all safe after yesterday's terrible events. 06:21
moritz mberends: safe but shocked 06:22
mberends everyone here in .nl is also shocked 06:23
sorear o/ moritz 06:30
o/ mberends too 06:31
moritz perl6: say ~'123'.match(:g, :p(0), /\d/) 06:40
p6eval niecza v7-44-g54b5188: OUTPUT«Unhandled exception: Unable to resolve method match in class Str␤ at /tmp/SruhkI59qc line 1 (MAIN mainline @ 1) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1933 (CORE C906_ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 1934 (CORE module-CORE… 06:41
..rakudo 922500: OUTPUT«1 2 3␤»
..pugs: OUTPUT«*** No such method in class Str: "&match"␤ at /tmp/35NaTNVfTb line 1, column 5 - line 2, column 1␤»
moritz rakudo: say ~'1x3'.match(:g, :p(0), /\d/)
p6eval rakudo 922500: OUTPUT«1 3␤»
06:44 CBro2007 joined 06:53 Mowah left
mberends o/ sorear. it's fun to see all the "little animal farm" programs evolve, even as a lurker. don't worry at all about the arbitrary 100 line goal, you'll get more satisfaction by simply ignoring it. 06:56
moritz the goal of the 100 line limit is not to encourage golfing, but to encourage soluations that are not bloated 07:01
niecza: $_ = "aba"; s:g[a] = do { say $/.from; 'FOO' }; .say 07:09
p6eval niecza v7-44-g54b5188: OUTPUT«0␤2␤FOObFOO␤»
moritz so the second match has seen the original string 07:10
07:20 masak joined
masak morning, #perl6. 07:20
masak feels sadness for the shootings 07:21
:/
moritz too 07:22
masak mberends: indeed, the 100-LoC goal was mainly to get out of the OO thinking that led to bloat already by the first test, with the promise of much more to come.
moritz I raelly hope they won't lead to the kind of security paranoia/theatre that we see in the US (and parts of Europe too) 07:23
masak moritz: I thought we already had that.
moritz: though I do see more guards in France and Poland than I do in Sweden. it never really occurred to me that you can screen the bags in the entrance to a library or a science park. 07:24
sorear hmm. how heterogenous is Europe on security theatre? is any of it worse than the US? 07:27
masak doubts that 07:28
only leaving Russia was I ever asked to take off my shoes so they could have my socks screened.
moritz on the one hand they forbid liquids on flights, but nobody would stop you from driving on a big ferry with a truck full of explosives 07:34
masak nobody ever said security theatre would make much sense. 07:35
07:43 pernatiy joined
mathw I don't think we're as bad as the US for security theatre 07:47
Although we may be worse in the UK
I remember flying back from Germany once, they seemed to have a special extra security line for us :/
I suppose that might have been something connected with us not being part of Schengen 07:48
tadzik mathw: where are you from?
mathw England
tadzik oh
mathw So kind of European but kind of not European, thanks stupid governments 07:49
Oh and stupid tabloid newspapers who keep writing ridiculous, easily-disprovable stories about things the EU apparently make us do 07:50
Khisanth there is an easy solution for that :) 07:53
masak mathw: there are so many unions and trade associations and whatnot, either of which you could be or not be a member of: www.boingboing.net/2011/03/12/venn-...lustr.html
moritz mathw: it's the British that want the additional security, not the Germans (at the airports at least) 07:54
mathw moritz: thought it might be 07:56
masak: yes it's complicated isn't it 07:57
masak how feasible is it for subtypes to have methods? 08:10
ruz hi, would lovely to be able to extend subsets with methods and attributes: gist.github.com/1101175
masak ruz++
(we were just privmsging about it) 08:11
moritz I'm not sure if that's how subsets are meant to be in Perl 6 08:15
tadzik I look at it as a way of easy inheritance
so, class Direction is Str { but bla bla } 08:16
masak ...which is probably wrong :)
moritz subsets inherently break Liskov, which inheritance is meant to preserve
tadzik oh, that... right
just saw that one coming
moritz note that if you add methods ore attributes, you need to change storage
masak in particular, subset membership is defined (dynamicaaly!) by the object's properties.
tadzik right 08:17
ruz ok
it should be syntax I presented
moritz so you can't make subset Positive of Int where * > 0; 1 ~~ Positive work (at least not without major hacks)
ruz is there clear way to jump from subsets to classes?
masak begins a slow migration to the airport 08:18
08:18 masak left
ruz moritz: Liskov? 08:19
tadzik moves out too
dalek kudo/nom: 98fed2e | moritz++ | src/core/Str.pm:
implement :overlap in Str.match
moritz ruz: en.wikipedia.org/wiki/Liskov_substi..._principle
kudo/nom: 1123ec5 | moritz++ | / (3 files):
&truncate
08:22 CBro2007 left 08:27 Jackneill joined 08:43 SHODAN joined
moritz nom: m:g/a/ 08:45
p6eval nom: OUTPUT«Null PMC access in clone()␤current instr.: 'nqp;QRegex;P6Regex;Grammar;nibbler' pc 34669 (src/stage2/QRegex.pir:11430) (src/stage2/QRegex.nqp:771)␤»
08:57 sivoais joined 09:00 ab5tract joined, sivoais left 09:01 sivoais joined 09:16 M_o_C joined 09:33 CBro2007 joined 09:36 nebuchadnezzar joined
felher TimToady++ (Rosetta Code). You've written that perl6 does not _(yet)_ have algebraic datatypes. Are they planned to come in near future? 09:37
09:42 araujo left
sorear Perl 6 is designed for unplanned extension 09:52
felher sorear: guess that means they are not plannend but may very well come. thnx. :) 09:56
TiMBuS i know this is a perl 6 channel, but: Can't locate object method "getline" via package "IO::Handle" <- honestly stumped here 09:57
since the IO::Handle doc says right there, method $io->getline
09:58 Su-Shee_ is now known as Su-Shee
sorear TiMBuS: have you use'd the appropriate module? 09:58
TiMBuS WHAT KIND OF SECOND RATE PROGRAMMER DO YOU THINyeah thats probably it 09:59
:p
sorear truism of the day: only second-rate programmers can see second-rate bugs easily 10:09
10:09 CBro2007 left
felher :D 10:10
10:20 whiteknight joined 10:28 smash left 10:35 pernatiy left 10:36 MayDaniel joined 10:40 pernatiy joined 11:01 araujo joined 11:07 im2ee joined 11:16 mj41 joined 11:17 CBro2007 joined 11:27 MayDaniel left 11:36 jaldhar left 11:37 jaldhar joined 12:01 Jackneill left 12:30 SHODAN left 12:31 MayDaniel joined 12:32 mj41 left 12:41 [Coke] left 12:43 [Coke] joined 12:47 MayDaniel left 12:51 s1n joined 12:53 JimmyZ joined 13:03 [Coke] left 13:05 [Coke] joined 13:24 tadzik is now known as straz_nocna 13:25 straz_nocna is now known as tadzik 13:29 [Coke] left 13:31 [Coke] joined 13:34 jack-ji joined 13:35 donri joined, jack-ji left 13:44 M_o_C left 13:45 [Coke] left 13:47 [Coke] joined 13:49 Jackneill joined 13:50 MayDaniel joined, drbean left 13:58 CBro2007 left 13:59 [Coke] left 14:02 [Coke] joined, Mowah joined 14:06 MayDaniel left 14:31 envi left 14:39 tokuhirom left 14:44 im2ee left 15:02 mattp_ left 15:22 pmurias joined 15:27 MayDaniel joined 15:33 CBro2007 joined 15:39 jevin left 15:40 jevin joined 15:41 MayDaniel left 15:53 MayDaniel joined 16:01 MayDaniel left 16:14 ab5tract left 16:20 perlhack joined 16:21 am0c joined, perlhack left 16:26 molaf joined 16:43 JimmyZ left 16:53 am0c left 17:22 perlhack joined 17:24 ashleydev left 17:27 perlhack left 17:40 masak joined
masak good evening, #perl6 17:40
mberends hi masak, just departing to London for a few days o/ 17:57
masak ...preserving the eternal balance of Stroopwafel fans on the channel :) 18:01
18:08 Jackneill left 18:11 Mowah left
moritz the stroopwafel concentration is deplorably low in Erlangen, Germany 18:43
18:46 SHODAN joined
yath .nl is too far... 18:46
masak we have wafels here in Sweden, but it's not the same. 18:47
they just don't stroop like those in .nl do 18:48
masak tries a root beer and concludes that it must be one of those "acquired taste" things 18:49
moritz makes waffles too, but it's just not the same 18:53
18:54 Jackneill joined 19:04 dorlamm joined 19:29 wooden joined 19:31 cosimo left 19:37 cosimo joined 19:41 Hexta joined 19:42 Hexta left 19:44 Chillance joined 19:55 donri left 19:56 donri joined
sorear good * #perl6 20:06
20:06 MayDaniel joined 20:12 simcop2387 left 20:13 [particle]1 joined
pmurias sorear: hi 20:14
20:15 [particle] left 20:16 SHODAN left 20:18 kaare_ left, simcop2387 joined
masak good *, sorear 20:19
20:22 dorlamm left
masak I like it when changes due to a new test turn old tests red because they don't follow the rules of the new test. :) 20:45
in that vein, my farm game now has the monozooism restriction, too. 20:47
20:48 CBro2007 left
sorear monozooism? 20:49
masak the one we discussed yesterday. 20:50
only one animal either bought or sold.
in my code, the corresponding boolean test turned out to be spelled '1 == [+] %trade{'selling'|'buying'}.values' 20:51
20:55 Jackneill left 21:01 dual joined 21:22 whiteknight left 21:32 MayDaniel left 21:38 y3llow_ joined, pothos_ joined 21:40 y3llow left, y3llow_ is now known as y3llow, pothos left, pothos_ is now known as pothos 21:43 colomon left, Psyche^ joined 21:44 colomon joined
masak perl6: my @e = 1, 2, 3; .say for @e[0 ..^ *] 21:46
p6eval rakudo 922500, niecza v7-44-g54b5188: OUTPUT«(timeout)»
..pugs: OUTPUT«pugs: out of memory (requested 1048576 bytes)␤»
21:47 Patterner left, Psyche^ is now known as Patterner
masak for something I think should work, the implementations seem unusually united against me. 21:47
masak goes to read S09
std: my @seasons[4:map(*%4)]; 21:51
p6eval std 516268a: OUTPUT«ok 00:01 122m␤»
masak \o/
moritz nom: my @e = 1, 2, 3; .say for @e[0 ..^ *] 21:52
p6eval nom: OUTPUT«1␤2␤3␤» 21:53
masak hugs nom
huh!? S09 talks about substr on an array of uint8 without batting an eye... I'm not sure I like that idea. 21:55
correction. I am sure I don't like that idea. 21:56
moritz array of unit8... a Buf? 21:57
moritz -> sleep 21:58
sorear masak: S09 is a living fossil
masak isomorphically, yes. but it's declared as 'my uint8 @buffer;'.
sorear: I am aware that much of S09 is blue-skying. but this seems different; it seems more like dangerous certitude. 21:59
sorear masak: I mean that large parts of S09 date from the time before we had Buf and Str straight 22:00
masak hm, I hope that's the reason in this case.
but we've had Bug and Str straight for a few years now. longer than S09 has gone without edits. 22:01
and I don't believe anyone has ever seriously proposed substr working on arrays (except by stringifying them first).
am I understanding correctly that 'my @a = [42]; say @a[0;0]' will lead to an error? 22:04
flussence "Bug and Str"? :)
(it's technically correct...)
rakudo: my @a = [42]; say @a[0;0] 22:05
p6eval rakudo 922500: OUTPUT«42␤»
flussence not what I'd expect... 22:06
masak flussence: oops. s/Bug/Buf/. guess I'm used to writing the former more often... :)
flussence: Rakudo doesn't implement the semantics of ; inside of .[] yet, so you only get the last 0 from that indexing. 22:07
rakudo: my @a = [42]; say @a[65535;0]
p6eval rakudo 922500: OUTPUT«42␤»
flussence rakudo: my $a = 42; say $a[0] 22:09
p6eval rakudo 922500: OUTPUT«42␤»
flussence I'm not sure whether that's right or wrong, actually...
rakudo: my $a = 42; say $a[0][0]
p6eval rakudo 922500: OUTPUT«42␤»
flussence it's 42 all the way down 22:10
masak that's correct. 22:11
.[0] is a no-op for scalar values.
Tene That kind of duck typing still seems wrong to me. :(
masak I have no strong opinion either way. to me it feels neither more nor less wrong than list flattening in various situations. 22:13
it's... just something that happens in Perl :)
Tene :)
masak ok, S09 supports my belief that @e[0 ..^ *] shouldn't loop infinitely. 22:15
masak submits rakudobug
flussence I think the 0;0 case could at least warn when it hits a scalar before the end, since it's being given enough information to know the user's expecting something else.
masak flussence: again, Rakudo doesn't implement any of the multidim indexing stuff. 22:16
flussence yeah, but when it does.
masak flussence: S09 seems to indicate that doing .[0;0] on a normally declared array is erroneous, yes. 22:17
22:19 mattp_ joined
masak 'night, #perl6 22:19
TimToady o/
22:19 masak left 22:21 ashleydev joined
sorear I don't understand how @a[0;0] is supposed to work at all 22:25
22:26 mattp_ left 22:27 mattp_ joined 22:36 donri left
flussence AIUI (as a lowly user), @a[$x;$y;$z] is similar to doing @a[$x]».[$y]».[$z] 22:37
(except that the postcircumfix is given full knowledge of what it's returning, so it's free to optimise into something less stupid than I'd write :) 22:40
22:52 REPLeffect left, whiteknight joined
TimToady nom: say ((0),(0)).lol.perl 23:09
p6eval nom: OUTPUT«LoL.new(0, 0)␤»
TimToady nom: say ((0,),(0,)).lol.perl
p6eval nom: OUTPUT«LoL.new((0,), (0,))␤»
TimToady that's really uninformative 23:10
nom: say ((1..10),<a b c>)[1].perl 23:11
p6eval nom: OUTPUT«2␤»
TimToady nom: say ((1..10),<a b c>).lol[1].perl
p6eval nom: OUTPUT«("a", "b", "c")␤»
TimToady basically subscripts bind with lol semantics to **@x, so @x[0] is the first lazy list, @x[1] is the second, etc 23:12
23:13 Transformer joined
TimToady with [0;0] it's just that either list has only one element 23:13
but [1..10;<a b c>] would be two lists
when everything is done with nested references, it doesn't buy you much, but we have shaped arrays that can calculate multi-dim offsets, it's starts getting all fortrany 23:15
well, apart from column-major vs row-major...
23:15 Transformer left
TimToady and yes, it does have the auto-hyper between subscripts as flussence++ points out, so that multi-dim slices work the way mathematicians think they oughta 23:16
we probably also need a way to express ideas like @a[0;0], @a[1;1], @a[2;2]... 23:19
flussence @a.rotate(45°)[0][*] # :) 23:20
TimToady this is much the same problem as making the right side of X depend on the current value of the left side
sorear @a[i;0] 23:27
TimToady well, I was thinking of 𝘪
.u 𝘪 23:28
phenny U+1D62A MATHEMATICAL SANS-SERIF ITALIC SMALL I (𝘪)
TimToady I meant 𝑖
.u 𝑖
phenny U+1D456 MATHEMATICAL ITALIC SMALL I (𝑖)
TimToady we could either have an an explicit 𝑖<- or >-𝑖, or we could implicitly label them 𝑖, 𝑗, 𝑘 23:29
23:29 jaldhar left, orafu left 23:30 jaldhar joined, orafu joined
TimToady so the diagonal would be expressed as [*; �] 23:30
but still thinking about that 23:31
that's another bit that ties in with bindings to non-sigiled readonly syms that I was mentioning the other day 23:32
anyway, if we come up with a notation for [;], it should also work for X 23:33
and enable multi-dimensional list comprehensions
well, easier ones
23:33 benabik_ joined
TimToady not thinking this is for 6.0.0, just future directions 23:34
23:35 benabik left, benabik_ is now known as benabik
TimToady I meant [*; 𝑖], wasn't suggesting using REPLACEMENT CHARACTER :) 23:42
23:44 pmurias left
TimToady well, more likely we'll just grab bare ->$i without a block, or some such, and pass it through to the implicit loop of ; or X 23:44
so you can write for 1..10 -> $i X $i..10 -> $j {...} and such 23:46
flussence (for a diagonal slice, wouldn't something like ||(1..* xx @a.elems) work?)
oh wait, that's wrong
TimToady only if you have a form that takes (0,0), (1,1), (2,2) as subscripts
oh, the double ||, hmm 23:47
it still seems wrongish 23:48
first, it'd have to be @a.dimensions 23:50
and second, it'd make [1..*; 1..*] which isn't gonna work
well, 0..*
APL/J probably has some magical way of turning a list of tuples into multidim subscripts 23:51
flussence
.oO( I'm not quite in my right mind at the minute, I've been reading about PHP again... )
TimToady is that cause or effect? :)
flussence it doesn't help that I'm trying to fit multidimensional arrays into my head at the same time :) 23:52
TimToady multiple dimensions are supposed to help with that sort of thing... 23:54
23:55 molaf_ joined 23:58 molaf left 23:59 Trashlord left, whiteknight left