»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
TimToady added some explanation for the beauty of the Perl 6 entry on rosettacode.org/wiki/Brace_expansion lest anyone's eyes glaze over 00:01
psch: yes, but there may be some bootstrapping issues; rakudo has to use a big circularity saw at that spot, and might have difficulty making it look unsawn there 00:03
because Bool has to be defined very early in the setting 00:04
psch okay, i guess i have to look much closer at this to get there 00:07
the HOW for Bool gets Cool via add_parent, but there's nothing later on to put it below Int, which seems to be what's missing for the ticket
00:09 btyler_ joined 00:12 btyler left 00:13 raiph left
jnthn Well, just 'cus there's a ticket after it doesn't automatically mean the spec agrees... 00:16
dalek ecs: 27b8a23 | larry++ | S99-glossary.pod:
define "circularity saw" and "biab"
psch jnthn: right, is there anything specced wrt Bool smartmatching against type objects? 00:17
jnthn
.oO( I need to fetch my circularity saw, biab... )
00:18
psch: I can't think of a bit of the spec that says Bool ~~ Int should be true, off hand...
psch niecza thinks it should work at least
n: say True ~~ Int
camelia niecza v24-109-g48a8de3: OUTPUT«True␤»
00:18 stevan_ left 00:19 btyler_ left
psch the ticket implies Bool is specced as an Enum 00:19
similary does doc.perl6.org/type/Bool by calling it 'enum Bool' 00:20
although i guess none of those are set in stone
TimToady the intent is for Bool to behave like enum Bool <False True> to the extent we can hide the circularity saw 00:21
m: enum Boul <Fals Tru>; say False ~~ Int 00:22
camelia rakudo-moar 04c4fb: OUTPUT«False␤»
TimToady m: enum Boul <Fals Tru>; say Fals ~~ Int
camelia rakudo-moar 04c4fb: OUTPUT«True␤»
TimToady hopefully that can be fixed at some point, but I'm sure there's a thing or two that is higher on jnthn++'s list :) 00:23
psch right, i probably should get into the habit of asking for reasonably-important-but-not-overly-difficult things i could look at instead of jumping at random tickets :) 00:26
jnthn At the moment, trying to hack something up for my FOSDEM talk is fairly high... :) 00:27
TimToady Bool is defined as an enum at perlcabal.org/syn/S12.html#Built-in_Enumerations 00:28
00:29 pdcawley left
TimToady course, it's tainted by being in proximity to the Taint enum... 00:29
and the Intness of a (non-string) enum is specced at perlcabal.org/syn/S12.html#Value_Generation 00:34
00:37 berekuk left
psch so there should be the role Boolean somewhere? rakudo doesnt do that at the moment, but lets built-in types declare .Bool themselves 00:41
unless that's just an example to illustrate how it behaves 00:42
TimToady that bit of the spec is perhaps more handwavey; if no use case arises for a Boolean role, there's little need to introduce one 00:43
psch i see 00:46
thanks for the explanations
00:54 jnap left
psch anyway, sleep o/ 00:58
00:58 psch left 01:03 kivutar left 01:05 araujo joined 01:13 smls left
TimToady rosettacode.org/wiki/Memory_layout_...ure#Perl_6 in order to stay 4 solutions ahead of J :) 01:16
01:17 thou left 01:21 araujo left 01:25 jnap joined
jnthn sleep time...'night o/ 01:26
TimToady o/ 01:27
colomon \o
01:27 skids joined
skids o/ 01:28
TimToady o/⋯⋯⋯\o <-- incipient kendou battle 01:29
01:29 jnap left
TimToady o_/⋯⋯⋯\_o <-- well, more like this 01:30
01:45 stevan_ joined
clsn MONKEY_TYPING doesn't really type the monkeys. Or generally adding a method (with ^add_method or something) to a class doesn't propagate it to the child classes, because classes build a method cache at compose time or something. Hmm. 01:53
diakopter I always envision MONKEY_TYPING meaning "enable genetic algorithm on my code to evolve improvement by random mutation" 01:59
million monkeys and all 02:00
colomon diakopter: what it should really do is toss the problem to #perl6 02:01
a million monkeys are probably less effective than 20 #perl6ers. ;)
diakopter well no that's MONKEY_FLOOD
use MONKEY_TYPOS; 02:02
TimToady clsn: that augmenting does not invalidate the cache is a known problem, I believe 02:16
and I think it would be BARREL_OF_MONKEYS here
or MONKEY_SPEC_MONKEY_DO
clsn Probably. I suppose it isn't particularly hard to expect, given that we use a cache.
TimToady it's said that there are only two difficult problems in CS; off-by-one errors, and cache coherence 02:17
but those are really the same error
caches are inherently off-by-one
clsn Thing is, how do you go invalidating the cache? Parent classes/roles don't know their derivatives, do they? So they can't tell them. And checking at method-call time defeats the purpose of a cache (though checking is faster than rebuilding a cache). 02:18
TimToady well, you can do like P5 does and invalidate *all* the caches 02:19
that's pretty easy with a generation counter
clsn I suppose there are worse plans. Or if you're already going to search through everything, go through ALL the classes and find the descendants, maybe. 02:20
TimToady well, you can notice your generation changed, then do a quick check to see if you need to do more work than just up your own generation counter 02:21
clsn Yeah.
02:22 Sqirrel left, colomon left 02:23 colomon joined
TimToady leg-o'lamb & 02:24
[Coke] (generation counter) tcl uses that to track if builtins have been overridden. 02:25
02:25 jnap joined 02:30 jnap left 02:33 konnjuta joined
konnjuta how to turn off strict and warnings in rakudo? 02:33
02:37 dayangkun_ left
colomon konnjuta: as far as I know we don't support that yet. 02:42
colomon has frequently been wrong, mind you.
konnjuta thanks 02:44
02:49 stevan_ left, stevan_ joined 02:50 dayangkun_ joined
jercos Ahahah, when I originally saw the nude method for Rats, I sorta assumed it meant that you were seeing the rational seperated from its clothing, i.e., "in the nude", rather than the NUmerator and DEnominator :D 03:03
I guess technically either one fits, but I now strongly suspect the latter is the original intent. 03:04
clsn jercos: That's what I assumed too. 03:07
colomon things like that from TimToady, you should probably assume both meanings were there from the start. ;) 03:09
TimToady almost certainly :) 03:14
you can't be a good language designer if you don't know how to make things serve multiple purposes simultaneously 03:16
03:19 btyler joined
BenGoldberg n: say <6/9>.nude 03:20
camelia niecza v24-109-g48a8de3: OUTPUT«2 3␤»
03:22 bjz joined
clsn thinks (elem) (and ∈, and I guess (cont) and ∋) should be defined so that if it's a range, it works like ~~. That is, 6.1 ∈ 6..8 (which is currently not the case). So there. 03:24
03:26 jnap joined
colomon clsn: it's an interesting question. I've pondered a bit what it would take to support more procedural sets. 03:28
TimToady what if you wanted a set of ranges? 03:29
clsn Ranges behave like mathematical intervals (when they're not behaving like lists), so it just seemed natural.
I guess something like that could be asked about a lot of "smart" operators.
TimToady Mäsak's Law: For every DWIM, there's a corresponding WAT. 03:30
colomon masak++ 03:31
03:31 jnap left
clsn Besides, if it's a set of ranges, the range will be on the left, not the right. 03:32
Mäsak's point is a good one. 03:33
TimToady but see also rosettacode.org/wiki/Set_of_real_numbers#Perl_6 03:35
otoh, it's not clear when someone writes 0..^10 whether they mean a set of integers or a set of reals, it's kind of ambiguous in P6 03:38
hence a type that is explicitly real intervals
03:38 cognominal joined
clsn 0...^10 is explicitly integers. 0..^10 behaves like an interval wrt smart-matching anyway. 03:38
TimToady yes, it's intentionally ambiguous, but if you overload it too much, your DWIM turns to WAT 03:39
forcing people to write all their slices with ... rather than .. is construed to be a pain in the nether regious 03:40
so if you want, you can use the IvSet and define ∈, and then there's no ambiguity 03:41
colomon module?
TimToady but this is opening a can of worms, for all the sets that's are defined by rule rather than enumeration
those sets are defined via 'subset' currently
and we don't attempt to do set theory with 'em, much 03:42
we're not really trying to turn P6 into a symbolic math engine 03:44
clsn <TimToady> forcing people to write all their slices with ... rather than .. is construed to be a pain in the nether regious -- I guess for historical reasons? After all, a slice really is an index that's a list, why shouldn't it be ... ? 03:45
TimToady it can be ... as well as ..
colomon TimToady: I think we need to keep subset clearly distinct, for sure.
TimToady but there's a lot of integer history for .. in Perlland
.. is one of those semi-allomorphic beasties you get in Perl that tries to be a little dwimmy, at the expense of not generalizing completely in any one direciton 03:46
... is much more specificly generalizable :) 03:47
so yeah, .. is just an interval, until you use it in a list, and then it biases toward something discrete 03:48
clsn That's the thing; .. is ambiguous. ... we know is integers, but .. we're treating a little like this and a little like that. I guess I see it leaning a little farther toward that. 6.1 ∉ 5..7 seems strange.
TimToady well, surely you should write things like [5..7) instead :P 03:49
clsn I figure if it's not being a list, it's being an interval. The question is which is it when it's on the right of ∈. The operator makes sense either way, with different results.
Well, we know P6 has its own notation, using ^.. instead of (], etc.
TimToady yeah, I'm not arguing strongly here 03:50
but if we did that, we'd certainly have to make it a different type so that the dispatch happens correctly 03:51
clsn You mean, make a new type of Interval distinct from Range?
TimToady or that the dwim doesn't have to be mediated by Set each time
no, a new type of Set, like IvSet, which the dwimmer for not having a set on the right of ∈ would target 03:52
or RealSet, or whatever we'd call it
but the demand for the feature as a built-in is not high 03:53
as colomon says, probably a module
or at minimum something that demand loads the defs
clsn Considering Ranges are always Numeric (probably should be Real; what does (3+2i)..(9-6i) mean?), we can be pretty detailed regarding the params of the multi dispatch to catch the cases in question (I'm here still assuming using Range).
TimToady r: say "a".."z" 03:54
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«"a".."z"␤»
clsn Oops, forgot, good point.
TimToady r: print "a".."z"
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«abcdefghijklmnopqrstuvwxyz»
clsn I suppose I should say that interval-type ranges (the ones that match as intervals with ~~) are always numeric.
TimToady course in P5 .. was overloaded with flipflop semantics
clsn multi sub:<∈> (Numeric $n, Range $range) { ... } would home in on just the cases in question pretty well. Something for the module/defs. 03:56
TimToady as long as nobody else added a conflicting multi
clsn That's always true. 03:57
TimToady but it should beat out the Any,Any dwims that Set provides
clsn Right. And properly lose to other kinds of ∈-matching.
TimToady anyway, as you can see from the RC entry (which I wrote), it has certainly been thunk about 03:58
03:58 jeffreykegler joined
TimToady by and large, P6 has moved in the direction of less dwimmy ops, with certain key exceptions 03:59
notably ~~
03:59 thou joined
TimToady and .. is differently dwimmy from P5 03:59
clsn As you said, .. was overloaded in various ways in P5.
TimToady and even if we define ∈, I suspect most folks find it easier to type ~~ 04:00
clsn True, though ∈ looks better. Just seemed weird when I found it wasn't true that 6.1∈5..7. Most people will use ~~ for a lot of things, which is sort of the point. 04:01
TimToady modules will happen, and somedoay some of them will become standard
*day
konnjuta r: say "A" .. "z" 04:08
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«"A".."z"␤»
konnjuta r: say "A".."z"
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«"A".."z"␤»
konnjuta r: say "a".."Z"
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«"a".."Z"␤»
clsn r: sub circumfix:<[ )> ([$a, $b]) { $a ..^ $b }; say [3,6) 04:10
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«3..^6␤»
clsn Heh. :)
TimToady congratulations, you just destroyed the array composer :) 04:12
good thing you didn't destroy parenthesized expressions...
konnjuta r: print ":".."~" 04:13
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~»
clsn Yeah, that would come next. I'm pleased the unbalanced brackets didn't break things. I mean, more than usual.
TimToady r: sub circumfix:<[ )> ([$a, $b]) { $a ..^ $b }; say [1,2,3,4,5] 04:14
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse expression in circumfix:sym<[ )>; couldn't find final $stopper ␤at /tmp/tmpfile:1␤------> ([$a, $b]) { $a ..^ $b }; say [1…»
TimToady ooh, interpolation failure :)
konnjuta r: print "\x3A"..\x7E"
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> print "\x3A"..\x7E⏏"␤ expecting any of:␤ argument list␤ …»
lue Yeah, I've occasionally wondered about 4..6 being an implicitly integer thing myself. But it's not too hard to deal with (there's ... for less discrete things after all)
konnjuta r: print "\x3A".."\x7E"
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~»
clsn lue: on the contrary, ... is for discrete things. 04:15
konnjuta r: print "x3A".."x7E"
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«x3Ax3Bx3Cx3Dx3Ex3Fx3Gx3Hx3Ix3Jx3Kx3Lx3Mx3Nx3Ox3Px3Qx3Rx3Sx3Tx3Ux3Vx3Wx3Xx3Yx3Zx4Ax4Bx4Cx4Dx4Ex4Fx4Gx4Hx4Ix4Jx4Kx4Lx4Mx4Nx4Ox4Px4Qx4Rx4Sx4Tx4Ux4Vx4Wx4Xx4Yx4Zx5Ax5Bx5Cx5Dx5Ex5Fx5Gx5Hx5Ix5Jx5Kx5Lx5Mx5Nx5Ox5Px5Qx5Rx5Sx5…»
lue clsn: perhaps s/less discrete/higher resolution/
konnjuta r: print "x0".."x7F"
lue (decimals have greater resolution/precision/* than integers. .. for integers only, ... does decimals too) 04:16
konnjuta r: print "\x0".."\x7F"
TimToady but it doesn't do all of them
lue r: sub circumfix:<[ [> ([$a, $b]) { $a ..^ $b }; say [3,6[ # for the non-US out there :)
camelia rakudo-moar 04c4fb: OUTPUT«(timeout)x0x1x2x3x4x5x6x7x8x9y0y1y2y3y4y5y6y7y8y9z0z1z2z3z4z5z6z7z8z9aa0aa1aa2aa3aa4aa5aa6aa7aa8aa9ab0ab1ab2ab3ab4ab5ab6ab7ab8ab9ac0ac1ac2ac3ac4ac5ac6ac7ac8ac9ad0ad1ad2ad3ad4ad5ad6ad7ad8ad9ae0ae1ae2ae3ae4ae5ae6ae7ae8ae9af0af1af2af3af4af5af6af7af8af9ag0ag1a…»
..rakudo-jvm 04c4fb: OUTPUT«(timeout)x0x1x2x3x4x5x6x7x8x9y0y1y2y3y4y5y6y7y8y9z0z1z2z3z4z5z6z7z8z9aa0aa1aa2aa3aa4aa5aa6aa7aa8aa9ab0ab1ab2ab3ab4ab5ab6ab7ab8ab9ac0ac1ac2ac3ac4ac5ac6ac7ac8ac9ad0ad1ad2ad3ad4ad5ad6ad7ad8ad9ae0ae1ae2ae3ae4ae5ae6ae7ae8ae9af0af1af2af3af4af5af6af7af8af9ag0ag1ag…»
..rakudo-parrot 04c4fb: OUTPUT«(timeout)x0x1x2x3x4x5x6x7x8x9y0y1y2y3y4y5y6y7y8y9z0z1z2z3z4z5z6z7z8z9aa0aa1aa2aa3aa4aa5aa6aa7aa8aa9ab0ab1ab2ab3ab4ab5ab6ab7ab8ab9ac0ac1ac2ac3ac4ac5ac6ac7ac8ac9ad0ad1ad2ad3ad4ad5ad6ad7ad8ad9ae0ae1ae2ae3ae4ae5ae6ae7ae8ae9af0af1af2af3af4af5af6af7af8af9ag0ag…»
rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«␀ ␤
rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse expression in subscript; couldn't find final ']' ␤at /tmp/tmpfile:1␤------> say [3,6[ # for the non-US out there :)…»
clsn lue: Ah, I see what you mean. But it's still just a list, not a "range" 04:17
lue clsn: I think I was too attached in my image of various sets of numbers as being on continuum of relative discreteness :P 04:18
clsn Ah. So they're discretely continuous. Or something.
TimToady sprinkles some cantor dust
TimToady tries to make a pun on floaters... 04:20
lue
.oO(dear math(s): there's a reason almost no programming language does the []/[)/(]/() thing (doubly so for []/[[/]]/][). Please update your notation to preserve and/or restore peoples' sanity.)
lue ponders a Math::HyperReal module... 04:22
TimToady
.oO(dear ASCII: please include a lot more brackets, includes ones only for the mathematicians)
lue r: sub circumfix:<⟦ ⟦> ([$a, $b]) { $a ..^ $b }; say ⟦3,6⟦ 04:23
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«3..^6␤»
clsn Who needs ASCII? Perl6 supports Unicode; we can do ⦃⦄, ⸨⸩...
Yes, exactly. 04:24
I've been playing around with using ⦃⦄ mostly.
lue I'm pretty sure ⟦ has an existing meaning though...
TimToady alas, and it's one of the few labeled "MATHEMATICAL"
clsn I don't think I have keystrokes for ⟦ (I do for ⦃)
lue "In formal semantics, double brackets, ⟦ ⟧, also called Strachey brackets, are used to indicate the semantic evaluation function."
clsn: same for me, I've got the compose keys for ⦃⦄, but not ⟦⟧ IIRC. 04:25
clsn Yeah, I have an enormous XCompose file that I keep adding to...
lue I'd love to know what ⊏ means, by the way. It came in an XCompose file I downloaded a while ago, and I still have no clue what it is. 04:26
It's called "SQUARE IMAGE OF", and is one of a set of symbols similar to ⊂ and friends.
skids Designating certain sets of unicode brackets as never being considered balanced delimiters for bra-ket notation and such might be nice.
clsn Oh, the mathematical operators sections of Unicode have lots of lovely symbols. 04:27
04:27 jnap joined
lue skids: I think Perl 6 shouldn't be the one to break Unicode rules though :) 04:27
clsn I just like the look of ⟅⟆... 04:28
lue I still say ⟅⟆ is the obvious choice for Bag literal :)
skids lue: coincidentally I was wondering about "image of" and "original of" myself, but about ⊷
lue .u ⊷
yoleaux U+22B7 IMAGE OF [Sm] (⊷)
TimToady perl6: say ⟅<a b b c d d>⟆ 04:29
camelia niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/tmpfile line 1:␤------> say⏏ ⟅<a b b c d d>⟆␤␤Confused at /tmp…»
..rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> say ⏏⟅<a b b c d d>⟆␤ expecting any of:␤ argument list␤ …»
clsn ⟅⟆⟨⟩⟪⟫⟬⟭⟮⟯⦑⦒⦓⦔⦕⦖⦗⦘⧼⧽⧘⧙⧚⧛⸢⸣⸤⸥⸨⸩「」『』
<lue> I still say ⟅⟆ is the obvious choice for Bag literal :) -- have to agree with you there.
TimToady coulda sworn I saw ⟅⟆ defined somewhere in P6land
lue TimToady: if anywhere, probably one of several other times I've brought it up here :P
TimToady alas, math overloads {} for sets 04:30
lue rn: say Q"Literal string\" eq 「Literal String\」
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> say Q"Literal string\" eq ⏏「Literal String\」␤ expecting any of:␤ …»
..niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Bogus term at /tmp/tmpfile line 1:␤------> say Q"Literal string\" eq ⏏「Literal String\」␤␤Parse failed␤␤»
raydiak .u ⟅ 04:31
yoleaux U+27C5 LEFT S-SHAPED BAG DELIMITER [Ps] (⟅)
TimToady it really is for bags
raydiak really is the obvious choice...
04:31 jnap left
konnjuta what characters are valid for postfix and prefix custom operators? 04:33
clsn Most of them.
lue konnjuta: all the ones that aren't blank, IIRC
skids shapecatcher.com/ # just to make clsn more dangerous :-) 04:34
konnjuta how about alphabets?
sub postfix:<p>($N) { [*] 2..$N };
say p6;
returns error
lue r: sub prefix:<I>($a) { say $a }; my $b = 12; say I$b; 04:35
clsn You said postfix and used it as prefix.
skids: ;)
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«12␤True␤»
clsn sub postfix:<p>($N) { [*] 2..$N }; say 7p
r: sub postfix:<p>($N) { [*] 2..$N }; say 7p
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«5040␤» 04:36
lue
.oO( die unless ⧜ < $a < ∞; )
TimToady konnjuta: note that p6 will still parse as an identifier under longest token matching, so you'd have to say p 6 04:38
konnjuta r: sub prefix:<p>($N) { [*] 2..$N }; say p 7; 04:39
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«5040␤»
TimToady might still not work
well, I guess it does
thought it might parse as a listop
std: : sub prefix:<p>($N) { [*] 2..$N }; say p 7; 04:40
camelia std 09dda5b: OUTPUT«===SORRY!===␤Preceding context expects a term, but found infix : instead at /tmp/zeUB1kCweC line 1:␤------> <BOL>⏏: sub prefix:<p>($N) { [*] 2..$N }; say ␤Parse failed␤FAILED 00:01 122m␤»
konnjuta r: my $num = 7; sub postfix:<p>($N) { [*] 2..$N }; say $num p;
TimToady std: sub prefix:<p>($N) { [*] 2..$N }; say p 7;
clsn Of course, we have single-character … and ‥ in Unicode. And we can use ∀(...) for all(...). I am surprised that ≥ and ≤ aren't already defined.
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> postfix:<p>($N) { [*] 2..$N }; say $num ⏏p;␤ expecting any of:␤ …»
std 09dda5b: OUTPUT«ok 00:01 132m␤»
lue The only real symbol I can find for infinitesimal is ε, but I'm not a fan of that somehow. Come to think of it, ⧜ could possibly be a better choice.
clsn: ∀ does not mean "all()", it means "for all", a.k.a for $thing { } :)
TimToady well, there're lots of epsilons
lue say $_ ∀ 2..10 04:41
TimToady in fact, there are 38 epsilons in Unicode
04:41 bjz_ joined 04:42 SamuraiJack joined
clsn lue: yeah, I can see that too. 04:42
lue This discussion is one of those times I wish search engines stepped out of the ASCII age :/
TimToady ∄ that feature
04:43 bjz left
clsn experiments with being evil and defining circumfix:<RLO PDF> ... 04:47
r: sub prefix:<‮> ($a) {$a.flip}; say ‮"hello" 04:49
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«olleh␤»
clsn That's using prefix; didn't quite work out with circumfix first time I tried... 04:50
lue clsn: what is PDF? And did you try LRO in its place? 04:51
clsn r: sub circumfix:<‮ ‬> ($a) { $a.flip }; say ‮"hello"‬;
camelia rakudo-jvm 04c4fb: OUTPUT«(timeout)» 04:52
..rakudo-parrot 04c4fb, rakudo-moar 04c4fb: OUTPUT«olleh␤»
clsn That's actually cooler than it looks, since the string was actually "hello"...
PDF is Pop Directional Formatting or something like that.
Wait, I think PDF is supposed to be used after RLE, not RLO.
konnjuta r: sub postfix:<$_>($N) { 8 } ; say 5$_ 04:53
camelia rakudo-jvm 04c4fb: OUTPUT«(timeout)»
..rakudo-parrot 04c4fb, rakudo-moar 04c4fb: OUTPUT«8␤»
clsn I guess not, though, since things behaved right when I used it.
konnjuta r: sub postfix:<$_>($N) { 8 } ; say $_$_ for 1..5 04:54
camelia rakudo-jvm 04c4fb: OUTPUT«(timeout)»
..rakudo-parrot 04c4fb, rakudo-moar 04c4fb: OUTPUT«8␤8␤8␤8␤8␤»
konnjuta wow!
clsn And you can do assorted evil things, apparently, like making BOM an operator, and various other invisibles. But not any of the spaces at least. 04:56
I played with this some in my "pretty-mode.el", which replaces various things in programming languages with Unicode characters on-screen. mostly just for laughs. So == becomes ≟, logical AND/OR symbols, ␣ for ' ', and so on... 04:58
github.com/clsn/pretty-mode.el 05:00
clsn & 05:02
05:24 [Sno] left 05:28 jnap joined 05:32 jnap left 05:42 xenoterracide left 05:46 raiph joined
raiph .tell TimToady "a direct translation to Haskell": www.reddit.com/r/readablecode/comme...es/cf229at 05:49
yoleaux raiph: I'll pass your message to TimToady.
05:53 jeffreykegler left 05:57 thou left
TimToady of course, I've changed it since then... 06:01
yoleaux 05:49Z <raiph> TimToady: "a direct translation to Haskell": www.reddit.com/r/readablecode/comme...es/cf229at
06:02 BenGoldberg left
TimToady and the Haskell version should be added to RC 06:03
06:05 zby_home_ joined
raiph oh! you got rid of the alt/alts code duplication. very nice. 06:05
06:09 Sqirrel joined 06:14 kanishka joined
TimToady "This is better because we used a monad, so wah, wa-waa, wawawa wa wawa wa waaah." <-- what most mere mortals hear 06:15
on top of that, there's too many keywords :) 06:17
kanishka perl6 say 3 06:22
perl6: say3
camelia rakudo-jvm 04c4fb: OUTPUT«(timeout)»
..rakudo-parrot 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared routine:␤ say3 used at line 1. Did you mean '&say'?␤␤»
..niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'say3' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_…»
06:23 kaleem joined 06:27 [Sno] joined
konnjuta r: say .chars for "zt".."zz" 06:29
camelia rakudo-jvm 04c4fb: OUTPUT«(timeout)»
..rakudo-parrot 04c4fb, rakudo-moar 04c4fb: OUTPUT«2␤2␤2␤2␤2␤2␤2␤»
konnjuta r: say .unpack("H*",$_) for "zt".."zz"
camelia rakudo-jvm 04c4fb: OUTPUT«(timeout)»
..rakudo-parrot 04c4fb, rakudo-moar 04c4fb: OUTPUT«No such method 'unpack' for invocant of type 'Str'␤ in block at /tmp/tmpfile:1␤␤»
konnjuta pack and unpack not yet implemented on rakudo? 06:30
TimToady you just fed $_ to it two different ways
but I don't think they are very implemented 06:31
p: say unpack("H*", "a")
camelia rakudo-parrot 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/UDROnc4FvL␤Undeclared routine:␤ unpack used at line 1. Did you mean '&pack'?␤␤»
TimToady heh
p: say .comb».ord.base(16) for 'zt' .. 'zz' 06:32
camelia rakudo-parrot 04c4fb: OUTPUT«No such method 'base' for invocant of type 'Parcel'␤ in block at /tmp/NrpT2myO6k:1␤␤»
TimToady p: say .comb».ord».base(16) for 'zt' .. 'zz' 06:33
camelia rakudo-parrot 04c4fb: OUTPUT«7A 74␤7A 75␤7A 76␤7A 77␤7A 78␤7A 79␤7A 7A␤»
kanishka p: say 10
camelia rakudo-parrot 04c4fb: OUTPUT«10␤»
TimToady p: say .ords».base(16) for 'zt' .. 'zz' 06:34
camelia rakudo-parrot 04c4fb: OUTPUT«7A 74␤7A 75␤7A 76␤7A 77␤7A 78␤7A 79␤7A 7A␤»
TimToady p: say .ords.fmt('%02x',',') for 'zt' .. 'zz' 06:35
camelia rakudo-parrot 04c4fb: OUTPUT«7a,74␤7a,75␤7a,76␤7a,77␤7a,78␤7a,79␤7a,7a␤»
06:36 xenoterracide joined
konnjuta thanks for that 06:36
moritz \o 06:37
TimToady o/
diakopter how many of those comb ord feeds can each of moar and parrot due wo timing out camelia
um. do. 06:38
I'm curious about the 》overhead 06:39
or however you type it
>>
■□●○■□●○■□●○■□●○■□●○■□●○■□●○■□●○ 06:40
°•○●o.O°○●•
06:41 quester joined, quester is now known as Guest53720 06:42 Guest53720 left, Guest53720 joined, Guest53720 is now known as quester 06:45 xenoterracide left 06:53 xenoterracide joined 06:58 darutoko joined, xenoterracide left 07:07 FROGGS joined
FROGGS o/ 07:08
07:20 btyler left 07:24 sqirrel_ joined 07:29 jnap joined 07:34 jnap left
konnjuta r: say ++<<(1,2,3) 07:42
camelia rakudo-jvm 04c4fb: OUTPUT«Cannot modify an immutable value␤ in sub prefix:<++> at gen/jvm/CORE.setting:4342␤ in sub prefix:<++> at gen/jvm/CORE.setting:1756␤ in sub hyper at gen/jvm/CORE.setting:16639␤ in sub hyper at gen/jvm/CORE.setting:16598␤ in sub METAOP_HYPER_PR…»
..rakudo-moar 04c4fb: OUTPUT«No such method 'STORE' for invocant of type 'Int'␤ in sub prefix:<++> at src/gen/m-CORE.setting:4342␤ in sub prefix:<++> at src/gen/m-CORE.setting:1756␤ in sub hyper at src/gen/m-CORE.setting:16636␤ in sub hyper at src/gen/m-CORE.setting:16595…»
..rakudo-parrot 04c4fb: OUTPUT«Cannot modify an immutable value␤ in sub prefix:<++> at gen/parrot/CORE.setting:4346␤ in sub prefix:<++> at gen/parrot/CORE.setting:1760␤ in sub hyper at gen/parrot/CORE.setting:16910␤ in sub hyper at gen/parrot/CORE.setting:16865␤ in sub …»
konnjuta r: my @a=(1,2,3); say ++<<@a
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«2 3 4␤»
konnjuta hyper operators not working on anonymous lists? 07:43
FROGGS konnjuta: that is not the problem, the problem is that you are doing this:
p: ++1
camelia rakudo-parrot 04c4fb: OUTPUT«Cannot modify an immutable value␤ in sub prefix:<++> at gen/parrot/CORE.setting:4346␤ in sub prefix:<++> at gen/parrot/CORE.setting:1760␤ in block at /tmp/zjh63C1o3r:1␤␤»
FROGGS you are trying to increment the elements of that list, which are immutable 07:44
r: my @a=(1,2,3); ++<<@a; say @a
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«2 3 4␤»
FROGGS it is not happening on a copy of the elements
07:53 immortal joined
konnjuta r: say 1 <<+<< (1,2,3) 07:54
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«2 3 4␤»
07:54 Rotwang joined, erkan left
konnjuta thanks 07:55
FROGGS :o)
07:58 zakharyas joined 07:59 kanishka left, kanishka joined 08:05 berekuk joined 08:07 berekuk left 08:09 tgt joined 08:11 berekuk joined 08:12 FOSScookie joined
FOSScookie So, with perl6 I could do something similar with it as with javac and compile the source code to bytecode and then share the bytecode with .class files and all which can be run like 'java -jar yyyy'? 08:14
08:14 tgt left
moritz FOSScookie: currently there's no way to combine all the dependencies into a single .jar file 08:16
(like the Perl 6 runtime and compiler, which you need for EVAL and the likes) 08:17
FOSScookie moritz: Is there a plan for that functionality?
moritz FOSScookie: I don't know; I'm not much of a JVM hacker, and don't have any such plans 08:18
others might have them
arnsholt I've been thinking a bit about bundling NQP and all of its deps as a single runnable JAR, but that's a bit tricky 08:22
Looks like we have to write our own classloader to load the bundled JARs
08:23 pecastro left 08:26 atta left 08:28 FOSScookie left
tadzik and call the bundles .jarjar 08:31
moritz and distribute it through the bing servers :-) 08:33
raydiak is it possible to build r-j in such a way that it could be bundled with your app and used portably instead of forcing prospective users to compile rakudo themselves? not necessarily as a single runnable JAR 08:34
08:34 Rotwang left
raydiak I mean, I'm assuming for one reason or another, that I can't just copy my perl6-j install to another machine and expect it to work 08:35
08:35 pdcawley joined
FROGGS I would probably prefer a staticperl6: a single file that contains your app including the resource files plus perl6-m plus modules 08:38
tadzik a six pack
FROGGS there is such a thing for Perl 5, called staticperl
it is awesome fast still, because it does not zip itself 08:39
(good for games)
though, this was linux only I believe
08:40 raiph left
FROGGS and you had to build it on a very old machine, to make it run everywhere (I used a debian 3 or so) 08:40
tadzik :o 08:41
raydiak that sounds much more ideal, but I meant maybe something that is possible right this moment or with a minimal amount of tweaking to makefiles or some such 08:42
08:42 quester left 08:44 FOSScookie joined 08:45 berekuk left
raydiak are there bits in there which are specific to your computer's configuration, or is it as portable as any other java app? 08:46
FROGGS well, it records you osname for example 08:47
and other build information, which is then used by nativecall
raydiak ah, so not portable then 08:48
hoelzro morning #perl6
raydiak good morning hoelzro
FROGGS raydiak: well, we could add a cache somewhere that gets invalidated when somebody moves it to another machine 08:50
though, probing for make toolchains is not that easy
well, it is easy, easy to do the wrong thing 08:51
hi hoelzro
raydiak I'm basically wondering about a way around the build requirements entirely other than distributing your app as a QEMU image 08:53
moritz docker! 08:54
timotimo much backlog 08:56
so discuss
08:57 PZt left
raydiak ah, I see...hadn't heard of it; took a minute to find the buried slide that explains what it is 08:58
moritz basically a tool to deploy images into linux containers 09:03
raydiak this looks fun: bit.ly/14RYL6x 09:04
now I understand...I didn't realize that "linux container" meant something specific 09:08
09:09 dmol joined
moritz it's like solaris zones or *bsd jails 09:12
so some form of isolation without a hypervisor
raydiak any reason moar couldn't be compiled as a redistributable binary in the future? 09:14
FROGGS that should work out I think
that should work already when I think about it
masak morning, #perl6 09:20
raydiak "./moar: cannot execute binary file" 09:21
that might be coming from 64-bit to 32-bit though, now that I think about it 09:22
yep; I don't have a 32-bit machine with moar built or another 64-bit linux machine to test on; will have to pursue this later unless someone else tries it out in the meantime 09:24
FROGGS raydiak: moar does not work on 32bits at all yes 09:28
yet*
masak: morning
raydiak FROGGS: thank you for saving me hours of wondering what I'm doing wrong when the build fails :) 09:29
hoelzro tadzik: ping
FROGGS raydiak: ohh, I did not want to stop you from fixing it :o) 09:30
09:31 jnap joined
tadzik hoelzro: pong 09:31
raydiak FROGGS: it's a thought, though I hope it gets fixed in less time than it takes me to learn C well enough to fix it 09:34
FROGGS I am not sure that somebody intends to work on it :/
time to step in masak!
:P
09:35 jnap left
raydiak ah, I forget...my hardware is antequated; perhaps it's not relevant to the modern world? 09:36
32-bit support, I mean
FROGGS no, the goal is to support 32bit too 09:37
Run all the languages! /o/
err, wait
Run on all the platforms! /o/ 09:38
09:42 PZt joined
masak <TimToady> Mäsak's Law: For every DWIM, there's a corresponding WAT. 09:46
TimToady: an *equal and opposite* WAT, to be exact ;)
(mirroring Newton's third law of motion)
raydiak I'm fading fast...g'night #perl6 09:47
masak there are so many examples of this.
DWIM: "ooh, let's make parentheses on sub and method calls optional"
(several years pass)
WAT: "turns out we can't provide the DWIM without surprising *someone* about TTIAR with methods calls" 09:48
(e.g. '$obj.meth $arg' doesn't work, and needs to be either '$obj.meth($arg)' or '$obj.meth: $arg')
hoelzro tadzik: Jollas are on sale over the weekend due to FOSDEM 09:49
40 EUR off, but it's something =)
09:51 sqirrel_ left 09:52 pecastro joined
FROGGS gnight raydiak 09:53
09:53 dakkar joined 10:11 kivutar joined, atroxaper joined
jnthn o/ 10:13
masak \o
FROGGS morning jnthn 10:14
10:19 kivutar left 10:21 ribasushi left, ribasushi joined, ribasushi left 10:22 ribasushi joined, zby_home_ left, ggoebel1113 left 10:23 ggoebel1113 joined
tadzik hoelzro: oh, oh, hmmmmm 10:31
10:31 jnap joined
tadzik not on shop.jolla.com tho 10:33
hoelzro tadzik: there's a code
tadzik ah
hoelzro tadzik: lists.sailfishos.org/pipermail/dev...03211.html 10:36
10:36 jnap left
masak oh, the DWIM/WAT example I mentioned before is better stated like this: 10:40
DWIM: "ooh, let's make parens optional!"
10:41 kanishka2 joined, kanishka2 left
masak WAT: "hey, why can't I put whitespace between $obj and .meth :(" 10:41
tadzik hoelzro: tempting tempting :)
hoelzro tadzik: just thought I would throw that out there =)
I think it's on sale for a week 10:42
tadzik yeah, until 9 Feb
hoelzro (if I understand the e-mail correctly)
tadzik no need to hurry with making up my mind :)
hoelzro indeed!
tadzik if I'll own 2 half-working phones, that's like 1 fully working phone :P 10:43
moritz you can speak into one and hear from the other one?
tadzik so that's what "The Other Half" is about...
moritz so that you have to do a three-way conference on each call
10:44 FOSScookie left, kanishka left
ribasushi what is WAT short for? :) 10:46
jnthn WAT is short for what.
masak which is short for "whaaaaaaaaat!"
:P
ribasushi ah, WTF in russian
ok ;)
moritz bacek's WTF :-) 10:47
masak ribasushi: www.destroyallsoftware.com/talks/wat
10:56 Alula joined 10:58 rindolf joined 11:11 zakharyas left 11:19 tgt joined 11:21 woolfy1 joined 11:22 lizmat left 11:23 woolfy left 11:24 lizmat joined 11:25 tgt left 11:29 tgt joined 11:31 zakharyas joined 11:34 tgt left 11:44 kurahaupo_mobile joined 12:04 amkrankruleuen left 12:05 amkrankruleuen joined, amkrankruleuen left, amkrankruleuen joined 12:13 rindolf left
masak reads www.modernperlbooks.com/mt/2014/01/...-bomb.html with fascination 12:17
there's an essence to all of this that affects both Perl 5 and Perl 6, and many other languages out there. 12:18
how to upgrade not just a language, but also its dependent code.
how to upgrade not just a module but also the modules that depend on it.
tadzik hm, Mark&LazySweep looks interesting
masak moritz++ once said that this upgrading problem feels like the big unsolved problem of our time, or something like that. 12:19
moritz that must have been a clever moritz at that time :-)
12:20 zby_home_ joined
masak moritz++ # clever :) 12:24
12:33 jnap joined 12:38 jnap left 12:40 regreg joined 12:41 tgt joined 12:45 regreg left, tgt left 12:48 sqirrel_ joined
nwc10 no warnings; is pretty "cool" too, as it disables all deprecation warnigs 12:55
ie you should be disabling only the warning(s) you know isn't relevant 12:56
nwc10 didn't work this one out with foresight
masak it's tricky. 13:04
nwc10 agree. But there are ways to shoot yourself in the foot, and these are best identified and avoided 13:06
nwc10 misses bacek
masak to me, that's what the CPAN is: a big repository, with tooling and community around it, to minimize the risk of foot-shooting. 13:11
the back-and-forth is often at least as interesting as the tasks the modules are meant to perform :) 13:12
nwc10 but chromatic has it spot on - they are called warnings for a reason, and if others do stuff that makes it impossible to add new warnings, then those others are not being helpful (to put it politely) 13:19
"wrong", to be blunt.
moritz RONG, to be blunt 13:20
nwc10 "you get to keep both pieces"
13:20 regreg joined 13:25 regreg2 joined 13:28 regreg2 left 13:29 regreg left 13:30 pdcawley left 13:32 SamuraiJack left 13:34 jnap joined 13:37 skids left
ribasushi moritz: blogs.perl.org/users/peter_rabbitso...l#comments 13:37
(his comments are completely borken)
13:38 regreg joined, jnap left
regreg perl6? say 3? 13:39
perl6: say 3;
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«3␤»
13:41 rindolf joined 13:42 dalek left, dalek joined, ChanServ sets mode: +v dalek, SamuraiJack joined
masak ribasushi: hehe, "fire and replace yourself" :P 13:50
ribasushi masak: it was an obfuscation contender ;) 13:51
masak I can imagine ;)
ribasushi masak: it is linked in my 2nd comment 13:52
13:53 atroxaper left
masak aye. 13:55
13:56 smls joined 14:01 pecastro left 14:02 pecastro joined 14:05 ajr joined, ajr is now known as Guest22613, Guest22613 is now known as ajr_ 14:07 kaleem left 14:11 V_ joined, kbaker joined
[Coke] .u ☑ 14:16
yoleaux U+2611 BALLOT BOX WITH CHECK [So] (☑)
[Coke] .u ☐ 14:18
yoleaux U+2610 BALLOT BOX [So] (☐)
14:18 varna joined 14:20 varna left
masak [Coke]: if you want us to vote, just say so. :P 14:20
[Coke] someone internally posted that they used these ASCII characters to do something in excel. 14:21
masak "these ASCII characters"?
masak is a little confused
[Coke] so was the guy that posted. 14:22
14:22 bonsaikitten left, Grimnir_ left, Bucciarati left, bonsaikitten joined, Alula left, avar left, bloonix left 14:23 mathw left, jnthn left, Gothmog_ left
moritz ctrl + ASCII-characters do stuff in excel :-) 14:23
=SUM(A1-A5); # also ASCII characters
14:23 jnthn joined, mathw joined, Bucciarati joined 14:24 Alula joined, Gothmog_ joined, bloonix joined, avar joined, avar left, avar joined 14:26 V_ left 14:27 Grimnir_ joined 14:35 jnap joined 14:39 jnap left 14:40 pdcawley joined 14:42 jnap joined 14:43 pdcawley left, pdcawley joined
masak by the way, this one is doing the rounds on Twitter right now: twitter.com/JeffSpeckAICP/status/4...2925038593 -- qualifies as an autopun, with a negative determinant. 14:54
14:55 thou joined
masak it's a little bit interesting, because the "use" part is mostly non-verbal. 14:55
moritz amused 14:57
tadzik heh, I guess it would be Poland-specific if I said "it's funny because you don't have even one job after the college" 14:59
diakopter pretty cute, since there's obviously room for the whole sign to fit if it's just shifted right some
masak diakopter: yeah. that's the "Planning" bit, I guess :P 15:00
timotimo tadzik: you had *zero* jobs!
tadzik :>
15:02 atroxaper joined
PerlJam Is that pic photoshopped? 15:10
15:10 btyler joined 15:13 tgt joined 15:14 kaare_ left 15:16 ggoebel1113 left, ggoebel1113 joined 15:17 tgt left, xenoterracide joined
timotimo o/ from a train station 15:21
FROGGS o/ 15:24
15:25 smls left 15:26 raiph joined
diakopter i like trains 15:29
timotimo :)
hoelzro listens to I Like Trains now 15:30
15:32 btyler_ joined
diakopter btw enabling parallel build of libtommath made the entire thing build from scratch in like 2 seconds 15:32
cl.exe /MP that is
I'll try it for the moar .c later 15:33
15:35 btyler left
[Coke] wonders if it's worth pinging bioperl folks and making sure they'd be happy with six. 15:39
FROGGS [Coke]: do they tend to need nativecall? 15:41
[Coke] I have no idea. joining their channel and attempting to blend in now. 15:43
PerlJam [Coke]++
FROGGS [Coke]++ 15:45
15:53 Sqirrel left 15:57 aindilis left, aindilis joined 15:59 Psyche^_ joined, tgt joined 16:02 Psyche^ left 16:04 tgt left, ajr_ left, ajr joined, ajr is now known as Guest13914 16:05 Guest13914 is now known as ajr_ 16:07 btyler_ left 16:09 smls joined
masak wow, I just had this awesome idea for a hackathon. 16:12
timotimo a hackathon? 16:13
that sounds great!
masak called "Let's Make a Language", it would start with a simple language in NQP.
and then a dedicated team would spend a weekend simply discussing and implementing features on that language, and having them play well together. 16:14
timotimo oh, kind of like the RaNIW, but with a focus on making your own idea come true
rather than implementing a rubyish/phpish
PerlJam ... and would end with Javascript ;)
FROGGS cool! then we could run rakudo-js on top of nqp!
masak PerlJam: my idea was basically "and end with what JavaScript would have been if we'd had all of today's knowledge about early design mistakes".
PerlJam masak: Wait... who chooses the language? I think Coke would appreciate it if people hacked on partcl for a week :) 16:15
masak hehe.
this is just the seed of an idea right now.
I'm not proposing we do this, just toying around with the thought.
FROGGS I'd propose a hackathon about RT tickets :o) 16:16
masak in fact, there would need to be some more meat to the idea before *I* committed to it.
FROGGS++ # I like that.
dalek ecs: d528d11 | pmichaud++ | S99-glossary.pod:
circularity saw: s/breakage/resulting splice/

  ...since the use of the saw is actually a patched thing, not a broken thing
masak FROGGS: with a score board "how many RT tickets did we close this weekend?"
FROGGS and the goal would be to get rid of 100 tickets
yeah
masak I'll shelve my language hackathon idea for now.
I like FROGGS++' idea better :) 16:17
FROGGS *g*
masak I'll go out on a limb and say we don't have the tooling/machinery to make a language hackathon (in the way I envision it) effective/agile/fun. 16:19
but maybe getting that tooling is a goal worth striving for. 16:20
16:22 bluescreen10 joined
masak ...or maybe the extreme simplicity and agility that I'm picturing would simply cause Alan Perlis to appear and hand me a lollipop. 16:23
TimToady today is last call for OSCON talks... 16:24
16:25 [Sno] left
jnthn is doing a bunch of European workshops, which probably gives him a full enough schedule. 16:27
TimToady but then us Americans will just get stupider 16:30
16:31 btyler joined, atroxaper left 16:39 FROGGS left 16:44 skids joined 16:46 jeffreykegler joined
rjbs There is talk of implementing ($x < $y < $z) in p5. 16:46
I am wondering whether you futurists who have done this already have any interesting pointers or caveats to share.
TimToady is a shame you can't combine the precedence of == with it in P5 16:50
smls rjbs: FYI, here's the spec: perlcabal.org/syn/S03.html#Chained_comparisons 16:51
16:51 treehug88 joined
TimToady it's a little trickier in our case because we have to be able to generate the appropriate function for it when we curry 16:51
16:51 zakharyas left
rjbs smls: thanks 16:51
TimToady but I don't see P5 having that problem soon 16:52
rjbs TimToady: Oh, I didn't know about that == bit.
Heh.
timotimo recently implemented the code to do the proper currying of chained operators :3
TimToady so basically we have to think in terms of a function call like chaining($x, &[<], $y, &[<], $z) or so 16:53
that has to be smart enough to evaluate $y only once 16:54
well, I guess if you pass it as an argument to a function, one evaluation comes for free 16:55
rjbs heh
and the chain can be arbitrarily long, it seems, yes? 16:56
TimToady yup
rjbs Yves O. is on holiday and looking at doing this for fun. We'll see what comes back. Based on his previous talk about it, I expect to see something supporting exactly two comparisons. 16:57
Thanks!
TimToady yer welcome 16:58
rjbs (I'm slightly suspicious that such an implementation would be met by a counterimplementation by one of another small handful of people extending it to arbitrary length...)
smls TimToady: but if you pass them all as args to a function, wouldn't that break the short-circuiting? 16:59
rjbs pass as lazily-evaluated arguments :) 17:00
TimToady smls: yeah, that's an issue 17:05
r: say 1 < 0 < die "oops" 17:06
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤»
TimToady so the third, fifth, etc args need to be thunks 17:07
dalek kudo-star-daily: b8a8922 | coke++ | log/ (5 files):
today (automated commit)
17:08
[Coke] modules/perl6-lwp-simple failed today. 17:13
DBIsh still failing.
timotimo isn't it high time for the star release?
tadzik, weren't you the star releaser this month?
[Coke] timotimo: ^^
modules are failing, we need to fix those.
timotimo ah 17:14
fair enough
timotimo looks at DBIish
17:17 kaleem joined 17:18 kaleem left, kaleem joined
timotimo i can't open that file in vim 17:18
[Coke] :? 17:20
17:20 kbaker left, benabik joined 17:21 kbaker joined
timotimo it completely eats up one cpu core 17:21
probably syntax highlighting gone haywire
i don't see where reset_errstr and set_errstr are supposed to come frmo
ah, there it is 17:22
17:22 bjz joined 17:23 pecastro left, FROGGS joined
timotimo apparently my jvm has disappeared 17:24
i've got a commit that probably fixes DBIish, but i'll test it before i push
and for that i have to build a rakudo first 17:25
17:26 bjz_ left
timotimo do we know if the lwp-simple failure is legit? 17:26
17:35 ajr_ left
vendethiel I, I'm trying out perl and I tried to do in perl6 a snippet I've read a lot in perl5 : while (<>) { chomp; s/blah/bla/; say $_; } 17:39
However, it seems that 1) the way to write that in perl6 is (usually ...) for lines() { say $_; }, but then $_ is readonly. 2) chomp's arity is now always 1 17:40
So, I'm wondering if the best way now is to *always* name your for variables 17:41
[Coke] m: say slurp.lines.chomp.subst(/men/, 'boys')
camelia rakudo-moar 04c4fb: OUTPUT«There were three boys came out of the West Their fortunes for to try And these three men made a solemn vow John Barleycorn must die They've ploughed, they've sewn, they've harrowed him in Threw clouds upon his head And these three men made a solemn vow Jo…»
jnthn lines gives you ready-chomp'd stuff
[Coke] m: say slurp.lines.chomp.subst(/men/, 'boys')
camelia rakudo-moar 04c4fb: OUTPUT«There were three boys came out of the West Their fortunes for to try And these three men made a solemn vow John Barleycorn must die They've ploughed, they've sewn, they've harrowed him in Threw clouds upon his head And these three men made a solemn vow Jo…»
[Coke] gah. 17:42
TimToady you need a :g
[Coke] listen to jnthn++ :)
jnthn [Coke]: You're turning it into one bick string with chomp there :)
uh, big
TimToady vendethiel: Perl 6 is in many ways a different language
[Coke] m: say slurp.lines.subst(/men/, 'boys', :g)
camelia rakudo-moar 04c4fb: OUTPUT«There were three boys came out of the West Their fortunes for to try And these three boys made a solemn vow John Barleycorn must die They've ploughed, they've sewn, they've harrowed him in Threw clouds upon his head And these three boys made a solemn vow …»
vendethiel TimToady, I realize that, that's why I'm intrigued
TimToady especially in the parts that are most irregular in Perl 5
PerlJam vendethiel: and "naming your variables" is orhtogonal to the other things you mention 17:43
orthogonal even
TimToady r: for lines() { s:g/men/boys/; .say }
camelia ( no output )
..rakudo-moar 04c4fb: OUTPUT«(signal SEGV)»
..rakudo-parrot 04c4fb: OUTPUT«Cannot assign to a readonly variable or a value␤ in sub infix:<=> at gen/parrot/CORE.setting:16362␤ in block at /tmp/tmpfile:1␤␤»
vendethiel exactly that error. 17:44
TimToady right, you need an 'is copy'
r: for lines() -> $_ is copy { s:g/men/boys/; .say }
camelia ( no output )
..rakudo-parrot 04c4fb: OUTPUT«There were three boys came out of the West␤Their fortunes for to try␤And these three boys made a solemn vow␤John Barleycorn must die␤␤They've ploughed, they've sewn, they've harrowed him in␤Threw clouds upon his head␤And these three boys ma…»
..rakudo-moar 04c4fb: OUTPUT«(signal SEGV)»
PerlJam wow
jnthn wtf...
TimToady the default is to assume 'is rw', but that requires the input to be mutable 17:45
and lines returns immutables
benabik r-m: lines() # golfed?
camelia rakudo-moar 04c4fb: OUTPUT«(signal SEGV)»
vendethiel can't I do something like ::lines() ? I read the synopsis 1, 3 and 12 so I've seen some syntax but not sure where it's applicable
timotimo do we need something like <-> as an alternative to -> that gives you an is copy $_ instead? :P 17:46
TimToady what do you think the :: means?
jnthn benabik: Ugh. That's a regression...
PerlJam timotimo: we already have <-> :)
vendethiel TimToady: I've seen a =:: $b (or ::=, ha !) as (object) copy
TimToady but <-> implies rw, not copy
timotimo PerlJam: yeah, but <-> is for ... yes
benabik jnthn: Just a small one. ;-)
jnthn benabik: Odd, it works out fine for me.
timotimo IO gets re-worked completely in the near future anyway :P 17:47
17:47 kaleem left
benabik jnthn: `perl6-m -e 'lines()'` gives me "Unhandled exception: Failed to close filehandle: bad file descriptor", but I think that's a completely separate issue. 17:47
jnthn benabik: I don't... 17:48
vendethiel TimToady: `for lines() <-> $_ { s/a//: }` seems to give me the same error, though
TimToady yes, I just said it would 17:49
<-> $_ is the default in any case, but you need 'is copy' semantics there
vendethiel oh, I thought "read write" would allow me to write :P
PerlJam vendethiel: $_ is still aliased to whatever you're iterating over, so if you iterate immutables, you have the same problem.
TimToady it allows you to write back to the original variable
but there is no variable here 17:50
jnthn It needs the incoming thing to be writable...
17:51 thou left
vendethiel jnthn, TimToady: I see, thanks :)! So the shortest way is `for lines() -> $_ is copy ...` ? I'll go with that 17:52
TimToady vendethiel: otoh, we don't feel the need for 'is copy' all that often. why do you want to to modify $_ in place? we have other ways of doing things now
for instance:
r: for lines() { .subst(/men/,'boys',:g).say }
camelia ( no output )
..rakudo-parrot 04c4fb: OUTPUT«There were three boys came out of the West␤Their fortunes for to try␤And these three boys made a solemn vow␤John Barleycorn must die␤␤They've ploughed, they've sewn, they've harrowed him in␤Threw clouds upon his head␤And these three boys ma…»
..rakudo-moar 04c4fb: OUTPUT«(signal SEGV)»
vendethiel TimToady: just to call s//; etc in-place, nothing fancy
yeah, I'm probably better off using that syntax 17:53
timotimo how about this:
r: lines()>>.subst(/men/, 'boys', :g)>>.say
camelia ( no output )
..rakudo-moar 04c4fb: OUTPUT«(signal SEGV)»
..rakudo-parrot 04c4fb: OUTPUT«Without a little Barleycorn␤Nor so loudly to blow his horn␤␤And little Sir John and the nut-brown bowl␤And little Sir John and the nut-brown bowl␤For he's ground him between two stones␤To cut him skin from bone␤␤And there they made a sole…»
timotimo oh, haha 17:54
silly me :)
vendethiel this is like groovy's .* ?
jnthn timotimo: Not if you want them in order :P
timotimo r: lines()>>.subst(/men/, 'boys', :g).map: .say
camelia rakudo-moar 04c4fb: OUTPUT«(signal SEGV)»
..rakudo-parrot 04c4fb: OUTPUT«Nil␤Method 'count' not found for invocant of class 'Bool'␤current instr.: '' pc 331388 (src/gen/p-CORE.setting.pir:139424) (gen/parrot/CORE.setting:7326)␤called from Sub 'reify' pc 331234 (src/gen/p-CORE.setting.pir:139345) (gen/parrot/CORE.setting…»
..rakudo-jvm 04c4fb: OUTPUT«Nil␤Unhandled exception: Method 'count' not found for invocant of class 'Bool'␤ in (gen/jvm/CORE.setting:7322)␤ in reify (gen/jvm/CORE.setting:7321)␤ in (gen/jvm/CORE.setting:7235)␤ in reify (gen/jvm/CORE.setting:7207)␤ in gimme (gen/jvm/…»
TimToady *.say
jnthn p: .subst(/men/, 'boys', :g).say for lines(); # how I'd do it if this really is all that's needed 17:55
camelia rakudo-parrot 04c4fb: OUTPUT«There were three boys came out of the West␤Their fortunes for to try␤And these three boys made a solemn vow␤John Barleycorn must die␤␤They've ploughed, they've sewn, they've harrowed him in␤Threw clouds upon his head␤And these three boys ma…»
timotimo on, no, that's not right
[A[A^H^H^H^H^H*.say
bleeeh, very laggy ssh connection :(
tunnels are the bane of my ircsistence 17:56
TimToady vendethiel: if you'd like to compare Perl 6 with other languages, you probably want to look at rosettacode.org/wiki/Category:Perl_6 17:59
vendethiel timotimo: yeah, just tried `[1, 2].succ` 18:00
timotimo: yeah, just tried `[1, 2]>>succ`
18:00 raiph left
vendethiel jnthn: indeed, that works too :) 18:01
TimToady r: say [1,2]».succ
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«2 3␤»
vendethiel not a bit ASCII fan :p
TimToady you need both the hyper and the dot
Ayiko hi, * 18:02
TimToady o/ 18:03
vendethiel yes indeed, I actually have it in my code haha. (TimToady, timotimo, jnthn )>>++ then ;)
(with the dot, damn)
TimToady dot is optional with ++
vendethiel oh, okay. Well, 'twould fail because I can't modify that in-place anyway, but the idea is here: p 18:04
TimToady ++ works there because [] is an array of varaibles
18:04 thou joined 18:05 dakkar left
smls p: say <2 4 6 8>.sort :descending; 18:05
camelia rakudo-parrot 04c4fb: OUTPUT«2 4 6 8␤»
smls ^^ Why no error/warning about unknown attribute?
TimToady r: my $array := [1,2]; $array»++; say $array
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«2 3␤»
jnthn smls: See S12 section titled Interface Consistency
18:06 [Sno] joined
Ayiko what's the canonical way to test if 2 arrays are equal? "[and] @a Z== @b" ? 18:06
TimToady just use eqv
moritz Ayiko: define "equal"?
TimToady @a eqv @b
vendethiel TimToady: not even sure what's the difference in practice about (1, 2) vs [1, 2], need to read about lists vs arrays
Ayiko equal value at same location for each array
moritz the problem with [and] @a Z== @b is that will false-positive array with different lengths
TimToady so use eqv 18:07
moritz [1] eqv ['1'] returns False
Ayiko hrm, can't be that simple :s
moritz that might or might not be that simple
smls jnthn: thanks
moritz erm
desired
r: say [1] eqv $_ for '1', 1 18:08
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤False␤»
TimToady yes, eqv will assume you aren't doing silly things with types
moritz r: say [1] eqv [$_] for '1', 1
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤True␤»
TimToady r: say [1] ~~ ['1']
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤»
18:08 spider-mario joined
TimToady r: say ['1'] ~~ [1] 18:08
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤»
TimToady I thought that was recursively defined back to ~~ 18:09
moritz though note that array ~~ also magifies *
might or might not be desired
TimToady nope, goes to === 18:10
jnthn Yeah, just found it does ===
moritz r: say [1, 2, 3, 4] ~~ [1, *, 4]
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«True␤»
18:10 kurahaupo_mobile left
Ayiko r: say <0 1 2> eqv ^3; say ^3 eqv (0,1,2) 18:10
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤False␤»
moritz ^3 is a Range
r: say (^3).list eqv (0, 1, 2).list 18:11
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«True␤»
Ayiko r: say (^3).list eqv <0 1 2>.list
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False␤»
TimToady n: say <0 1 2> === (^3).list 18:12
camelia niecza v24-109-g48a8de3: OUTPUT«False␤»
TimToady perl6: say +«<0 1 2> === (^3).list
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«False␤»
benabik r: say <0 1 2>.list.perl
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«("0", "1", "2").list␤»
TimToady perl6: say +«<0 1 2> eqv (^3).list
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«False␤»
TimToady perl6: say <0 1 2>».Int eqv (^3).list 18:13
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«False␤»
TimToady say waht?
moritz list vs. Parcel?
TimToady perl6: say <0 1 2>».Int.list eqv (^3).list 18:14
camelia niecza v24-109-g48a8de3: OUTPUT«False␤»
..rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«True␤»
moritz p6: say <0 1 2>».Int.^name
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«Parcel␤»
..niecza v24-109-g48a8de3: OUTPUT«Array␤»
moritz
.oO( eqv surprises even TimToady )
TimToady well, eqv and === are designed to be picky
my flu-enhanced brane is no match
vendethiel TimToady: may I ask, is there a "full list of operators with examples", or are synopsis the best read for that ? 18:16
TimToady perl6: say [<0 1 2>».Int] eqv [^3]
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«True␤»
TimToady the synopses won't give a lot of examples; RC is better for examples, but of course, is not indexed by operator used 18:17
PerlJam p6: say @(<0 1 2>».Int) eqv @((^3))
TimToady maybe someone should remedy that...
camelia niecza v24-109-g48a8de3: OUTPUT«False␤»
..rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«True␤»
PerlJam oops, too many parens
TimToady @ only guarantees positional, it doesn't guarantee a particular type as [] does
p6: say @(<0 1 2>).WHAT 18:19
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«(List)␤»
TimToady p6: say @(^3).WHAT 18:20
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb, niecza v24-109-g48a8de3: OUTPUT«(List)␤»
PerlJam n: say @(<0 1 2>».Int).perl; say @(^3).perl;
camelia niecza v24-109-g48a8de3: OUTPUT«[val("0"), val("1"), val("2")].list␤(0, 1, 2).list␤»
Ayiko r: say (1 <<Z==>> (1,1,1,1,1)) # bug? it works with « » 18:21
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Missing << or >>␤at /tmp/tmpfile:1␤------> say (1 <<Z==>>⏏ (1,1,1,1,1)) # bug? it works with « »␤ expecting any of:…»
TimToady the problem there is that ==> is an operator, and wins under LTM
jnthn TimToady: Does that go away with our changing it to a sequencer, ooc? 18:22
TimToady r: say (1 <<[==]>> (1,1,1,1,1))
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«True True True True True␤»
jnthn TimToady: um, or statement sep, or whatever it become...
*became
TimToady that might fix that particular case 18:23
but => will still be an operator
not a problem here 18:24
18:24 sqirrel_ left
TimToady anyway that's why we have the [op] disambiguating syntax 18:24
perl6: my @a = <a b c>; @a Z~= <x y z> 18:25
camelia ( no output )
TimToady perl6: my @a = <a b c>; @a Z~= <x y z>; say @a 18:26
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c␤»
..niecza v24-109-g48a8de3: OUTPUT«ax by cz␤»
TimToady perl6: my @a = <a b c>; @a [Z~]= <x y z>; say @a
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Preceding context expects a term, but found infix = instead␤at /tmp/tmpfile:1␤------> my @a = <a b c>; @a [Z~]=⏏ <x y z>; say …»
..niecza v24-109-g48a8de3: OUTPUT«ax by cz␤»
TimToady perl6: my @a = <a b c>; @a Z[~=] <x y z>; say @a
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c␤»
..niecza v24-109-g48a8de3: OUTPUT«ax by cz␤»
TimToady rakudo is not coming off very well here, compared to niecza++ 18:27
Ayiko r: sub infix:<[Z==]>($a, $b) { $a != $b }; say (1 <<[Z==]>> (1,1,1,1,1))
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False False False False False␤»
TimToady r: sub infix:<Z==>($a, $b) { $a != $b }; say (1 <<[Z==]>> (1,1,1,1,1)) 18:29
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«False False False False False␤»
TimToady you get those brackets on the right for free
r: sub infix:<Z==>($a, $b) { $a != $b }; say (1 <<[[[[Z[==]]]]]>> (1,1,1,1,1))
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«True True True True True␤»
TimToady but overriding the built-in meanings of meta-operators is generally considered a bad idea 18:30
(except perhaps to optimize)
Ayiko I was optimizing for confusion :) 18:31
TimToady we already good at that 18:32
Ayiko I was optimizing for confusion :) 18:37
eh
timotimo i fixed the warnings in DBIish and the tests still pass
Ayiko yay for 2 keyboards
colomon \o/
dalek Iish: bf5de44 | (Timo Paulssen)++ | lib/DBDish/Pg.pm6:
use the now public errstr in one more place.
moritz timotimo++
timotimo that was easy :P
Ayiko well, another question then: is (^1000).combinations supposed to be lazy, NYI or temporarily out of order? 18:38
timotimo combinations uses gather/take
as does permutations
18:39 telex left
Ayiko p: say (^50).combinations.first( { True } ).perl; say 'done' 18:39
camelia rakudo-parrot 04c4fb: OUTPUT«(timeout)»
timotimo :(
oh my 18:40
Missing or wrong version of dependency 'lib/MIME/Base64/PIR.pm6'
build stage failed for LWP::Simple: Failed building lib/LWP/Simple.pm
is there a known workaround for that?
18:40 telex joined
colomon there's a pure p6 Base64, I believe. 18:41
timotimo yeah, but a bit further up it said it successfully installed that.
colomon it's clearly trying to call the non-pure-p6 version.
timotimo yeah, but it's on parrot
colomon I guess that's not so much a "known workaround" as a "you might be able to do this with lots of work." 18:42
timotimo :o
18:42 ajr joined 18:43 ajr is now known as Guest62902, Guest62902 is now known as ajr_
TimToady combinations and permutations are supposed to be lazy, yes. 18:43
you very often want to use the in search-ish algorithms that want to short-circuit when they've found something 18:44
*them
r: say <a b c d e f g>.combinations(4)[^20] 18:45
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c d a b c e a b c f a b c g a b d e a b d f a b d g a b e f a b e g a b f g a c d e a c d f a c d g a c e f a c e g a c f g a d e f a d e g a d f g a e f g␤»
TimToady r: say <a b c d e f g h i j k>.combinations(4)[^20]
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c d a b c e a b c f a b c g a b c h a b c i a b c j a b c k a b d e a b d f a b d g a b d h a b d i a b d j a b d k a b e f a b e g a b e h a b e i a b e j␤»
TimToady r: say <a b c d e f g h i j k>.combinations(1..4)[^20]
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c d e f g h i j k a b a c a d a e a f a g a h a i a j␤»
TimToady seems lazy here 18:46
r: say <a b c d e f g h i j k l m o p q r s t u v w x y z>.combinations(1..4)[^20]
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c d e f g h i j k l m o p q r s t u␤»
TimToady r: say <a b c d e f g h i j k l m o p q r s t u v w x y z>.combinations(1..*)[^20]
18:46 kbaker left
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«a b c d e f g h i j k l m o p q r s t u␤» 18:46
TimToady r: say <a b c d e f g h i j k l m o p q r s t u v w x y z>.combinations()[^20]
yeah, bug
18:47 SamuraiJack left
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«(timeout)» 18:47
TimToady r: say <a b c d e f g h i j k l m o p q r s t u v w x y z>.combinations(0..*)[^20]
18:47 kbaker joined
TimToady doesn't seem to want to start at 0 18:47
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«(timeout)»
TimToady is probably confusing the combinations sub into looping
vendethiel TimToady: just saw your answer, thanks. I read "RFC" first, but what's RC? rosetta code? 18:49
TimToady yes 18:52
except when it's "release candidate" 18:53
p: say <a b c>.combinations(0)
camelia rakudo-parrot 04c4fb: OUTPUT«␤»
vendethiel yes, definitely :). I'll try to go through some of these, even if I need to ctrl-f each time :P 18:54
TimToady p: say <a b c>.combinations(0..*)
camelia rakudo-parrot 04c4fb: OUTPUT«a b c a b a c b c a b c␤»
vendethiel TimToady: <a b> is ['a', 'b'] or ('a', 'b') ? 18:55
TimToady ()
Ayiko m: (^20).combinations(1..5)[^50].map: *.say
camelia rakudo-moar 04c4fb: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤12␤13␤14␤15␤16␤17␤18␤19␤0 1␤0 2␤0 3␤0 4␤0 5␤0 6␤0 7␤0 8␤0 9␤0 10␤0 11␤0 12␤0 13␤0 14␤0 15␤0 16␤0 17␤0 18␤0 19␤1 2␤1 3␤1 4␤1 5␤1 6␤1 7␤1 8␤…»
Ayiko m: (^20).combinations(1..5)[50].map: *.say
camelia rakudo-moar 04c4fb: OUTPUT«(timeout)»
Ayiko asking for 1 element is not lazy any more? :( 18:56
timotimo yeah, something must be wrong here
vendethiel Ayiko: was this syntax introduced recently ? (^20).combinations doesn't seem to work here 18:57
TimToady yes, it's recentish
18:57 japhb_ joined
timotimo ^20 is very old, but .combinations is new-ish 18:57
TimToady and combinations with a default of 0..* is even more recent
Ayiko last msi installer of star doesn't have it 18:58
timotimo right.
sounds about right, yeah :(
TimToady that's one of the reasons we're playing with it here...
18:59 jnap left
vendethiel Ayiko: my question exactly :P 18:59
ty
Ayiko so I'm running my perl6 in a fresh compile on a linux vm now (doesn't help performance when trying an encoder/decoder prog for all 1000! permutations)
19:00 jnap joined
TimToady 1000! is a big number 19:01
r: sub postfix:<!>($n) { [*] 2..$n }; say 1000! 19:02
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«40238726007709377354370243392300398571937486421071463254379991042993851239862902059204420848696940480047998861019719605863166687299480855890132382966994459099742450408707375991882362772718873251977950595099527612087…»
TimToady r: sub postfix:<!>($n) { [*] 2..$n }; say 1000!.chars
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«2568␤»
Ayiko I should wait for a few performance improvements then? :( 19:03
TimToady so about 25 googles
*googols
er, no, more than that
grondilu 25.68?
TimToady yeah :)
19:03 darutoko left
Ayiko and the encoder will fail way before reaching combinations of 950 elements I guess 19:04
TimToady this does not sound like a scalable solution to me
Ayiko the question at codegolf.stackexchange.com/question...t-back-out didn't set scalability as a requirement :) 19:05
moritz m: sub fac-len($x) { ceil ($x * $x.log - $x) / 10log }; say fac-len(1000)
camelia rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/VLqQFHTTav␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/VLqQFHTTav:1␤------> c-len($x) { ceil ($x * $x.log - $x) / 10⏏log }; say fac-len(1000)␤ …»
moritz m: sub fac-len($x) { ceil ($x * $x.log - $x) / 10.log }; say fac-len(1000)
TimToady not without some way to short circuit entire sets of subpermutations
camelia rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/b2FD2S0bma␤Undeclared routine:␤ ceil used at line 1␤␤»
moritz m: sub fac-len($x) { ceiling ($x * $x.log - $x) / 10.log }; say fac-len(1000)
camelia rakudo-moar 04c4fb: OUTPUT«2566␤»
moritz m: say (2568 - 2566) / 2578 19:06
camelia rakudo-moar 04c4fb: OUTPUT«0.000776␤»
moritz m: say (2568 - 2566) / 2568
camelia rakudo-moar 04c4fb: OUTPUT«0.000779␤»
TimToady it's bad enough trying to solve rosettacode.org/wiki/ABC_Problem with permutations
moritz pretty good approximation for a physicst :-)
grondilu you forgot 1/2*log(2*pi*$x) 19:07
TimToady that's because he's a physicist :P
moritz grondilu: that's only O(log($x)) 19:08
grondilu well yeah, I guess that does not matter indeed.
m: sub fac-len($x) { ceiling ($x * $x.log - $x + .5*log(2*pi*$x)) / 10.log }; my $y = fac-len(1000); say ($y - 2568) / 2568; # just to check, though 19:10
camelia rakudo-moar 04c4fb: OUTPUT«0␤»
TimToady physicists only really believe in 0, 1, 2, i, and occasionaly pi 19:11
e can be derived from those...
timotimo .o( supermutations? ) 19:12
TimToady hence it was a great shock to them when quarks showed up with fractional charges
19:13 Sqirrel joined
moritz well, it was 1 / (1 + 2) after all :-) 19:15
TimToady indeed 19:20
oh, they also believe in c, but they always set it to 1, so it doesn't matter 19:21
colomon is finding it very hard to focus on $work after spending the first five hours of the day reading aloud to his son. 19:28
PerlJam colomon: just read your work aloud to your son next time :) 19:29
timotimo wow, five hours of reading?
colomon PerlJam: I suspect he would definitely prefer another Patricia Wrede book.
timotimo: 255 page book, we started it sometime after he got home from preschool yesterday afternoon and finished it just in time to leave for preschool today. 19:30
moritz colomon: time for you son to learn reading himself :-) 19:31
PerlJam My 8 yr old son yesterday read a 100+ page book in a few hours. It's amazing what can happen when you take away the XBox and Nintendo DS ;) 19:32
colomon moritz: I wouldn't object to it. :) 19:33
timotimo hah
19:37 bluescreen10 left
smls What facilities does P6 provide for validating/postprocessing things assigned to lvalue methods? 19:37
IMO lack of such facilities was the reason why lvalue routines never really caught on in Perl 5 outside of the built-in ones like substr. 19:38
But P6 uses them for 'has $.foo is rw', with the official reasoning (afaik) that the attribute is still private and the accessor only an autogenerated method that the author of the class may replace with a custom one in the future without breaking backwards compatibility. 19:39
timotimo smls: you can have Proxy, as well as a "where" type constraint on the variable
PerlJam isn't sure where "postprocessing" fits in with lvalue assignment. 19:40
smls ah ok, there's something about Proxy's in S06 19:41
timotimo "Proxies"
's is for genitive, not for plurals :)
smls :)
timotimo er ... no, that's german
smls PerlJam: what if the underlying representation of the class changes?
19:42 jnap left
smls e.g. you used to implement all your attributes using the normal syntax, but later decide to combine multiple ones into a single array attribute without changing their accessor APIs 19:43
19:44 regreg left 19:45 berekuk joined
PerlJam oh, I guess it's just a point-of-view difference. I'd call that "preprocessing" (what you do to the assigned value in order so that it fits in the appropriately shaped slots) 19:47
smls fair enough 19:48
19:48 jnap joined
smls r: my @a = 1, 2, 3; sub a0 is rw { @a[0] }; a0() = 5; say @a; 19:51
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«5 2 3␤»
smls ^^ ok so apparently in the example I gave, a proxy wouldn't even be necessary... :)
colomon r: my @a = 1, 2, 3; sub a0 is rw { @a[0] }; a0(= 5; say @a; 19:52
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Preceding context expects a term, but found infix = instead␤at /tmp/tmpfile:1␤------> = 1, 2, 3; sub a0 is rw { @a[0] }; a0(=⏏[31…»
colomon r: my @a = 1, 2, 3; sub a0 is rw { @a[0] }; a0 = 5; say @a; 19:53
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Preceding context expects a term, but found infix = instead␤at /tmp/tmpfile:1␤------> = 1, 2, 3; sub a0 is rw { @a[0] }; a0 =⏏[31…»
colomon () needed. hmm.
smls probably not when it's a method though
colomon r: class A { has @.a; method a is rw { @.a[0]; }; }; my $a = A.new; $a.a = 10; say $a.a 19:54
camelia rakudo-moar 04c4fb: OUTPUT«(timeout)»
..rakudo-jvm 04c4fb: OUTPUT«java.lang.StackOverflowError␤␤»
..rakudo-parrot 04c4fb: OUTPUT«maximum recursion depth exceeded␤current instr.: 'print_exception' pc 138749 (src/gen/p-CORE.setting.pir:59212) (gen/parrot/CORE.setting:10940)␤called from Sub 'a' pc 186 ((file unknown):113) (/tmp/tmpfile:1)␤called from Sub 'a' pc 208 ((file unkno…»
colomon r: class A { has @.b; method a is rw { @.b[0]; }; }; my $a = A.new; $a.a = 10; say $a.a
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«10␤»
colomon nice 19:55
smls yep
PerlJam r: class A { has @.a; method a is rw { @!a[0]; }; }; my $a = A.new; $a.a = 10; say $a.a
camelia rakudo-parrot 04c4fb, rakudo-jvm 04c4fb, rakudo-moar 04c4fb: OUTPUT«10␤»
PerlJam FYI
colomon PerlJam++
vendethiel Uuh, what's <<[Z==]>> ? "Just" a combinations of "<<", (a combination of "Z" and "==") and ">>" ? 19:59
PerlJam vendethiel: It's a hypered Z== 20:00
colomon Z== is the zip numeric equality tester
[Z==] is the same
vendethiel that I know, the other part I don't :p
Ayiko m: say ((1,10) <<+>> (3,4,5))
camelia rakudo-moar 04c4fb: OUTPUT«4 14 6␤»
colomon and << >> around it hypers it, as PerlJam says
presumably it would compare arrays of lists. 20:01
vendethiel okay, so if list A is longed than list B, when B is done it'll just call the operator with A[n] and B[*-1] 20:02
20:03 xenoterracide left
Ayiko B[0] again, repeats the shorter list 20:04
m: say ((1,10) <<+>> (3,4,5,6,7))
camelia rakudo-moar 04c4fb: OUTPUT«4 14 6 16 8␤»
vendethiel OH. Okay ! Thanks Ayiko 20:05
Ayiko m: say ((1,10) >>+>> (3,4,5,6,7))
camelia rakudo-moar 04c4fb: OUTPUT«4 14␤»
vendethiel compared to X that will, on the other hand, generate every possible value
Ayiko m: say ((1,10) <<+<< (3,4,5,6,7))
camelia rakudo-moar 04c4fb: OUTPUT«4 14 6 16 8␤»
vendethiel yeah I'm on the wiki, I saw that =)
nice nice, thanks. wrapping my head around it 20:06
itz woot! nearly FOSDEM 20:08
20:16 xenoterracide joined 20:17 ashleyde1 is now known as ashleydev 20:21 jnap left 20:23 Rotwang joined 20:28 jeffreykegler left, Alina-malina left, eternaleye left 20:29 pdcawley left 20:32 eternaleye joined 20:33 kaare_ joined 20:35 prammer left, kaare__ joined 20:37 kaare_ left 20:38 benabik left 20:39 kivutar joined 20:40 kaare__ left, kaare_ joined 20:41 sqirrel_ joined 20:44 prammer joined 20:45 kaare_ left 20:46 kaare_ joined 20:51 wdnch joined
wdnch hey guys 20:51
i have a quick question. who can help me?
colomon o/
what do you want to ask?
20:51 kaare_ left, rindolf left
colomon may not be able to help, but probably someone will 20:51
wdnch i wrote a python code which using basic regex 20:52
20:52 jnap joined
wdnch i tried to change datetime format like dd-mm-yy to mm-dd-20yy 20:52
but my code convert 01/30/1401 to 30-01-201401 20:53
FROGGS wdnch: do you want to fiddle with a string or do you want to work with a datetime object? 20:54
20:54 kaare_ joined 20:55 [Coke] left 20:56 rurban1 joined, jnap left 20:57 [Coke] joined
FROGGS but 01/30/1401 is not dd-mm-yy 20:58
that looks more like mm/dd/yyww
no, strip the ww
p: say "01/30/1401" ~~ / [\d\d]+ % '/' /
what's up with camelia?
camelia rakudo-parrot 04c4fb: OUTPUT«「01/30/14」␤␤»
[Coke] 's screen apparently just freaked out on feather.
FROGGS wdnch: the above should work (for a certain definition of "work")
p: say "01/30/1401" ~~ / [\d\d?]+ % '/' / # maybe better
camelia rakudo-parrot 04c4fb: OUTPUT«「01/30/14」␤␤»
FROGGS p: say "01/30/1401" ~~ / (\d\d?)+ % '/' / # with captures 20:59
camelia rakudo-parrot 04c4fb: OUTPUT«「01/30/14」␤ 0 => 「01」␤ 0 => 「30」␤ 0 => 「14」␤␤»
wdnch actually it is better to dont change if 2digit/2digit/2digit format
some strings is like "0101/30/14" or "30/30/14a" 21:01
FROGGS p: my regex dd { \d\d }; say "01/30/1401" ~~ / <m=.dd> '/' <d=.dd> '/' <y=.dd> / # with named captures
camelia rakudo-parrot 04c4fb: OUTPUT«「01/30/14」␤ m => 「01」␤ d => 「30」␤ y => 「14」␤␤»
21:02 dayangkun_ left
FROGGS [Coke]: kill it with fire :P 21:03
p: my regex dd { \d\d }; say "0101/30/14" ~~ / <m=.dd> '/' <d=.dd> '/' <y=.dd> /
p: my regex dd { \d\d }; say "30/30/14a" ~~ / <m=.dd> '/' <d=.dd> '/' <y=.dd> / # 30 months might be a bit much though
camelia rakudo-parrot 04c4fb: OUTPUT«「01/30/14」␤ m => 「01」␤ d => 「30」␤ y => 「14」␤␤»
rakudo-parrot 04c4fb: OUTPUT«「30/30/14」␤ m => 「30」␤ d => 「30」␤ y => 「14」␤␤»
smls wdnch: Python uses a different regex syntax than Perl 6 though, so if you're trying to implement this in Python you'll probably get better help on a channel dedicated to that lnaguage.
21:03 treehug8_ joined, benabik joined
wdnch is it true usage froggs? (r'\.dd/\.dd/\.dd', string) 21:04
21:05 treehug88 left, rurban1 left
FROGGS true 21:07
wdnch: I have no idea about Python, sorry
wdnch ok thanks a lot anyway 21:08
21:12 raiph joined 21:13 wdnch left 21:17 dayangkun_ joined
dalek rl6-roast-data: 23bd17b | coke++ | / (3 files):
today (automated commit)
21:17
21:19 rurban1 joined 21:28 zby_home_ left 21:29 rurban1 left 21:30 rurban1 joined 21:33 beastd joined 21:36 bjz left, bjz joined 21:37 ajr_ left 21:43 panchiniak joined 21:44 virtualsue joined 21:45 benabik left 21:46 immortal left, smls left, erkan joined, erkan left, erkan joined, smls joined 21:48 FOSScookie joined 21:49 FOSScookie left 21:53 jnap joined 21:57 jnap left 22:03 ajr joined, ajr is now known as Guest78233, Guest78233 is now known as ajr_ 22:04 berekuk left 22:06 skids left 22:10 berekuk joined 22:11 raiph left, spider-mario left 22:12 tgt joined
masak 'night, #perl6 22:15
diakopter o/
22:17 berekuk left
tadzik timotimo: I am 22:19
timotimo: (the star releaser) 22:20
the release date is tomorrow :)
I sort of hoped that module failures will go away
22:20 berekuk joined
diakopter just don't include failing ones :) 22:22
tadzik or checkout older revisions :) 22:23
tomorrow is opensource day
22:24 spider-mario joined 22:26 spider-mario left 22:30 virtualsue left, panchiniak left 22:32 sqirrel_ left 22:34 kbaker left
[Coke] do the star instructions indicate that you should try to pull the latest version of the odules? 22:39
tadzik not sure 22:40
I never did Star before :o
22:45 BenGoldberg joined 22:50 arnsholt left, arnsholt joined 22:53 jnap joined
lue wonders if Perl6::MIME::Base64 still needs special treatment. 22:56
tadzik it does for panda :/ 22:57
lue tadzik: so the ATTENTION I put in the release guide probably still applies then. 22:58
tadzik okayo
22:59 Sqirrel left
woolfy1 It's a lot of Perl and a lot of other open source, it is very big: Fosdem. wendyga.wordpress.com/2014/01/26/fo...12feb2014/ 23:00
And we will have diakopter doing two 20 minute talks about MoarVM, and jnthn doing a 60 minute closing talk about all that' 23:01
s possible in Perl 6.
dalek kudo/nom: d6a93b0 | larry++ | src/core/List.pm:
fix for .combinations timeout
23:03
23:05 arnsholt left, arnsholt joined 23:06 konnjuta left 23:07 konnjuta joined, beastd left
jnthn woolfy1: Yeah! I even am quite a long way into preparing for that :) 23:08
woolfy1 jnthn++ ftw \o/ 23:09
I am looking forward to see that, but I think it will be busy at the booth (cleaning up for the evening), so I am afraid I am going to miss it, and I have to depend on the video that I hope will be made (Theo is the man)... 23:10
23:15 Rotwang left 23:17 tgt left 23:28 daniel-s joined 23:29 ajr_ left
perigrin jnthn: remember if the talk goes well you'll still have time to submit it to YAPC::NA! 23:30
perigrin hides.
colomon jnthn++ diakopter++ 23:34
perigrin++
jnthn But...the heat...the humidity...
...and the other stuff I've said I'll do in June. :) 23:35
colomon must admit his preferred time to visit Orlando is early November. 23:39
woolfy1 jnthn: you told me you would definitely go to Orlando! 23:40
jnthn: Oh wait, you said you would probably be too bust with other stuff. :-) 23:41
s/bust/busy/
23:41 xinming joined
jnthn Well, and I did YAPC::NA last year. I try to go to different ones over the years. 23:43
colomon we'd certainly love to get you back over to the States. 23:44
jnthn colomon: Get places with sensible temperatures to bid! ;)
23:44 xinming_ left
woolfy1 jnthn: if you won't go, Liz and I will be very lonely there... :-) 23:44
jnthn woolfy1: What, with all the other Perl people who'll be there? :) 23:45
konnjuta [nam@namcntperl pl6]$ perl -e 'print pack("H*","41E282AC42") . "\n" . pack("H*","41E282AC42") . "\n"' > /tmp/utffile [nam@namcntperl pl6]$ perl6 -e 'lines.ords.fmt("U+%04x").uc.say' < /tmp/utffile U+0041 U+20AC U+0042 U+0020 U+0041 U+20AC U+0042 [nam@namcntperl pl6]$ perl6 -e 'lines>>.ords.fmt("U+%04x").uc.say' < /tmp/utffile U+0041 U+20AC U+0042 U+0041 U+20AC U+0042
[nam@namcntperl pl6]$ perl -e 'print pack("H*","41E282AC42") . "\n" . pack("H*","41E282AC42") . "\n"' > /tmp/utffile
[nam@namcntperl pl6]$ perl6 -e 'lines.ords.fmt("U+%04x").uc.say' < /tmp/utffile
woolfy1 jnthn: nah, only you are important. You can drive a bike and pet a cat and drink good beer, so you are THE ONE.
konnjuta U+0041 U+20AC U+0042 U+0020 U+0041 U+20AC U+0042
[nam@namcntperl pl6]$ perl6 -e 'lines>>.ords.fmt("U+%04x").uc.say' < /tmp/utffile 23:46
U+0041 U+20AC U+0042 U+0041 U+20AC U+0042
jnthn
.oO( I can't actually remember how I steered the bike, with the hands taken up with the cat and the beer... )
konnjuta carriage returns seems to be missing left out when using lines. 23:47
can some explain this behaviour?
woolfy1 :-)
jnthn konnjuta: lines auto-chomps
konnjuta is there a function that doesn't? 23:48
jnthn No, it's actually associated with the file handle, iirc... 23:50
23:50 skids joined
jnthn open('-', :!chomp).lines 23:50
23:51 treehug8_ left
konnjuta ok thanks 23:51
23:52 daniel-s left 23:53 daniel-s joined 23:56 dmol left