Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-12-09

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 brrt yeah, unbreaked it
00:00 timotimo good
00:00 brrt :-)
00:01 MasterDuke m: my @a = ^9; my $b = 3; say @a[*-$b..*]
00:01 camelia rakudo-moar 345f6a: OUTPUT«(6 7 8)␤»
00:01 TimToady samcv: I believe it's just a hardwired list in nqp/src/HLL/Grammar.nqp currently
00:01 samcv okay thanks
00:02 MasterDuke vcv_: my examples looks like *-n..* works
00:02 samcv yeah. i made a script that goes through all codepoints, and tries the codepoints above/below 5 codepoints. and then uses a mix to record the ones that share the most words
00:02 samcv and then print out the matching ones
00:02 samcv will look at that code, thanks :)
00:02 tbrowder ref docs: modules and terminology. questions:
00:03 tbrowder 1. given this statement "use Foo :ALL", what is the proper name for the ":ALL" portion?
00:03 * brrt goes to sleep
00:04 timotimo brrt: why do we start arguments at $1? because $0 has the op's ame in it? :P
00:05 timotimo With the ‘&’ syntax, any C macro can be referenced, and with that any runtime expression evaluated.  -  wants to read "compiletime expression"?
00:05 samcv also my script also runs test, and uses eval to test all the things and see which ones we are not using. and there were like 5 of the 82 pairs that it wasn't able to pair up to another codepoint. will have to see either they coorasponding one is more than +/- 5 codepoints away or maybe doesn't have any matching ones
00:05 timotimo brrt:  ^
00:05 pierre__ joined #perl6
00:05 tbrowder 2. given this fragment of a sub definition: "sub foo() is export {", what is the proper name for the "is export" portion?
00:06 MasterDuke tbrowder: 2. "trait" i believe
00:06 tbrowder 3. given this fragment of a sub definition" "sub bar() is export(:other) {", what is the proper name for the ":other" portion?
00:07 timotimo for 1., we call that an "export tag" or maybe an "import tag"
00:08 tbrowder The reason I ask is that the docs are a little hazy and use names like "tags" a bit loosely i think.
00:09 timotimo mhm
00:10 cognominal joined #perl6
00:11 tbrowder So "tag" then really fits both situations 1 and 3 and we add the "import" or "export" according to context.  That sounds good.  And "trait" for situation 2 also sounds good.  Thanks.
00:13 babydrop samcv: it's this giant string: https://github.com/perl6/nqp/blob/master/src/HLL/Grammar.nqp#L4
00:13 samcv yeah looking at it now :)
00:13 samcv is it okay if I make it span multiple lines or no?
00:14 samcv kind of horrible as one line. unless there's a good reason not to
00:15 babydrop samcv: no idea, but I found it a pain to be a single line last time I added stuff to it
00:15 samcv yeah
00:17 vcv_ MasterDuke: yep, that does. thanks!
00:18 Technaton Dear p6 world, I still don't understand what is the difference between a HashSet and a simple hash. I've read p6 advent calendar for day 7, but why HashSet instead of Hash? Or: Since HashSet exists, when is a single Hash apropriate?
00:19 babydrop Technaton: wtf is a HashSet?
00:19 babydrop m: HashSet
00:19 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    HashSet used at line 1␤␤»
00:19 timotimo a long as you make sure it doesn't end up with newline characters in the middle, it should be fine to make it multi-line
00:20 tbrowder I was off base: the module pod looks pretty good after my questions were answered.
00:20 tbrowder Thanks.
00:20 Technaton SetHash, sorry.
00:21 babydrop Technaton: Sets are single-level and hashes can be nested
00:21 babydrop With corresponding optimizations that can be done of them.
00:21 babydrop I mean, they don't even inherit from a Hash or Map is how different they are
00:21 sortiz joined #perl6
00:25 Technaton Sorry if I am being overly persistent: The day 7 article starts with a 'traditional' code snipped for plain old hashes. Then, the article introduces Bags, Sets, etc. The syntactic sugar is really nice, but why SetHash vs. Hash? When is it appropriate to choose one against the other? Is there a performance gain, or is it simply the syntactic sugar? I am very sorry if this is just another newbie question;
00:25 Technaton it is simply not clear to me when to choose one over the other. :-/
00:27 babydrop The code in the article counts the thing by itself while in the "traditional" snippet you have to do it yourself.
00:28 geekosaur a SetHash is a mutable Set. (I'm not fond of that name) a Set is, well, you could think of it as just the keys from a Hash, no values
00:28 Technaton I.e., those classes are syntactic sugar on top of a hash? Again: Sorry, I might sound like an advocatus diaboli, but this isn't my intention.
00:29 geekosaur ...what?
00:29 geekosaur you could make a Set on top of a Hash but I would only do so in the absence of an actual set type
00:30 cpage_ joined #perl6
00:30 babydrop Technaton: a SetHash contains unique objects. A Hash contains nest structures of object that (by default) are references by string labels.
00:30 babydrop *nested
00:30 babydrop *objects bah
00:30 babydrop *referenced
00:30 * babydrop gives up :)
00:30 Technaton Again, I am just new to Perl 6, and I haven't read any of the underlying proposals. I am just reading the documentation, so there might be silly questions coming from my side. I simple do not understand why there is the SetHash type. I can understand the necessity for an immutable Set (or Bag), but - well, immutability might as well apply to any object in a language.
00:32 Technaton What's bad about nested structures? Or even: What is the difference? Considering a hash-of-hashes, the keys in one layer are still unique - aren't they?
00:32 Technaton I am profoundly confused, I fear. :-(
00:32 geekosaur it sounds like you are missing basic data structures as well
00:32 aborazmeh joined #perl6
00:32 aborazmeh joined #perl6
00:32 geekosaur a set is made of unique keys
00:32 geekosaur the only value associated with the key is the key itself.
00:33 Technaton Hum.
00:34 Juerd To me, the whole set/bag/sethash/baghash/mix/mixhash/hash thing feels like a hard-to-learn permutation resulting in way too many types that do very similar things.
00:34 geekosaur so a Hash gives you keys and associated values; the default key type is immutable strings. a SetHash is just the keys, but the keys are mutable (this has effects on how it is implemented and in turn on how fast operations on it are, which is why it's distinct from Set); this is most useful when the keys themselves are mutable objects instead of just Strings
00:34 Technaton Going back to the day 7 perl 6 advent calendar, I am having a hard time spotting the difference between the first and the second code example - except for the syntactic sugar that allows for smalller code.
00:35 Technaton Okay.
00:35 pyrimidine joined #perl6
00:36 geekosaur basically you need to know data structures to pick the right one (regardless of language; this is not something specific to Perl 6, but it is something Perl 5 didn't have because it didn't really do data types), and to pick the right data type you need some basic algorithms.
00:36 profan is there anything like koans for perl 6?
00:37 babydrop profan: nope
00:37 geekosaur in perl 5 you regularly abuse various things like hashes because there's no actual support for anything else. in perl 6 we support using real types, but to do that you have to know about data types in general
00:37 babydrop profan: well volunteered? :)
00:37 geekosaur or just fall back to being perl5-ish and use Hash
00:37 Juerd geekosaur: That is entirely true, but given the complexity of types that Perl 6 provides here, I think that for most programmers reinventing the wheel with regular hashes will be faster than learning and discovering which type to use.
00:37 geekosaur but I think teaching an algorithms and data structures course might be a bit beyond the scope of perl 6
00:38 Juerd geekosaur: No, since these types are part of the language, it is very much within the scope of Perl 6.
00:38 profan babydrop: haha, i'm just looking for a nice way into looking at some perl 6 constructs and learning bit by bit, haven't done that much perl 6 yet
00:38 babydrop Technaton: err.. but what about all the set and baggy operators?
00:38 Juerd (And that's the problem, in my opinion. It could have been the scope of some module.)
00:38 profan i'll think about it later once i've used it for more things :)
00:38 geekosaur ...what?
00:38 Technaton I am sorry, I still don't get it. I mean, I've optimzed C++ code for ANNs and for power flow analysis (which requires fast matrix code), so I guess I know my Knuth. But I still don't see the difference between a plain old hash and the new Bag/Set types in perl 6. Is there a general rule for, e.g., optimization?
00:39 Technaton babydrop: So, again, syntactic sugar?
00:39 geekosaur if you've done fast matrix code, you have only explored a corner of the algorithms and data structures space
00:39 Technaton I mean, I can live with that: 'Here are your set operations, they're fast and optimized, but you have to use this class.'
00:40 geekosaur but I guess someone has to build a full college course now in order to teach perl 6, because it made the mistake of including such things in core. never mind how many other languages include them in core and don't bundle the college course.
00:40 Technaton geekosaur: Yep. For sure.
00:41 babydrop Technaton: it's an entirely different semantic meaning and that comes with more than a dozen of specialized operators. If you think that's just "syntactic sugar" then well... no one's stopping you from using hashes for everything. I mean, you can view a string as just an array of characters, right? And all the string methods are "syntactic sugar"
00:41 Juerd Technaton: It must be syntactic sugar, because these classes are implemented using a hash (%!elems, as declared in src/core/Setty.pm line 2)
00:41 Technaton geekosaur: My question still stands: What is the difference between the Bag/Set/etc datatypes and plain old hash/array? Is there a (simple?) rule to choose one over the other?
00:41 geekosaur ...
00:42 geekosaur I doube there is a simple one
00:42 geekosaur *doubt
00:42 Juerd Technaton: I think it's syntactic sugar and self-documenting code, but not much more than that.
00:43 skids joined #perl6
00:43 Technaton Or is it simply: "If you want set operations, and you want them fast, use the Set datatype, because it is optimized for that, way faster than anything you could implement ontop of a p6 hash"? If it is so, I would be happy to know that an anwer like this exactly is the difference.
00:43 babydrop I disagree with that entirely.
00:43 Juerd babydrop: Which "that"? IRC is prone to race conditions :)
00:43 Technaton "Simply". Forgive me, please. :)
00:43 babydrop Juerd: your statement that Sets, Bags, and Mixes are just sugar for Hashes
00:44 Juerd babydrop: I'm reading the implementation. They are.
00:44 babydrop To my mind they have an entirely different semantic meaning.
00:44 geekosaur likewise
00:44 geekosaur but that seems to be an unacceptable answer
00:45 Juerd It having a different semantic meaning isn't mutually exclusive with it being syntactic sugar, is it?
00:46 Technaton Juerd, babydrop, geekosaur: Please, I do not want to start a flame war. I am just a p6 novice, albeit one who has written optimized code in quite some languages. I am happy if someone tells me 'believe me, if you want a set operation, the Set type is exactly optmized for this.' I have simply failed to spot an answer like this in the documentation, that's why I ask.
00:46 MasterDuke there's some truth that all data structures are just sugar for hashes, because every other data structure can be implemented with hashes
00:46 MasterDuke but sugar is nice
00:47 vcv_ is it possible to create a subset type of bool with the Str method overridden?
00:47 geekosaur it's just a less than ideal way to do it. and I suspect if it's being done with a hash underneath, it's a target for future optimization, not a statement that it's "syntactic sugar"
00:47 babydrop A hash contains objects you look up with a label. It's about being able to access an object simply.  Sets, Bags, and Mixes are all about objects themselves.
00:47 Technaton MasterDuke: Yeah, I guess that anything can be fast with malloc()ing a chunk of memory and an endless amount of bit fiddling. But that is not why I am asking the question.
00:47 Juerd Technaton: You may want to use the specific types for their semantics, for syntactic sugar, or just to have the right types for type constraints (think multi methods), but I think optimization is not (yet?) a good reason.
00:48 babydrop m: put True but "False";
00:48 camelia rakudo-moar 345f6a: OUTPUT«False␤»
00:48 babydrop vcv_: ^ that's one way
00:48 babydrop m: put True but role { method Str { "meows" } };
00:48 camelia rakudo-moar 345f6a: OUTPUT«meows␤»
00:48 babydrop A bit clearer example
00:49 babydrop m: class MeowBool is Bool { method Str { "meows" } }; my $m = MeowBool.new; put $m
00:49 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bool does not support inheritance, so MeowBool cannot inherit from it␤at <tmp>:1␤»
00:49 babydrop riight
00:49 babydrop vcv_: more information would give a better answer
00:50 babydrop Technaton: my suggestion would be simply to ignore those types for now.
00:51 Technaton 'For now' means 'until you've gained more knowledge in p6'? (I am completeley content with such a suggestion.)
00:52 babydrop Technaton: yeah
00:53 babydrop Technaton: these types aren't a must-know feature.
00:53 Technaton That's all well and good. So, behind «%counts{$_}++ for 'AGTCAGTCAGTCTTTCCCAAAAT'.comb;» vs. «'AGTCAGTCAGTCTTTCCCAAAAT'.comb.Bag<A T G C>» is a deeper reason beyond syntactic sugar on top of plain old hashes?
00:53 Juerd babydrop: I think the question is: can you have a user-defined data type that's like a boolean, but stringifies differently (e.g. "on"/"off" or "enabled"/"disabled")?
00:54 Technaton (If you answer with 'yes', I will be content, and strive to learn until the day comes when I grasp the difference.)
00:54 samcv u: SINGLE HIGH-REVERSED-9 QUOTATION MARK
00:54 unicodable6 samcv, U+0049 LATIN CAPITAL LETTER I [Lu] (I)
00:54 unicodable6 samcv, U+0053 LATIN CAPITAL LETTER S [Lu] (S)
00:54 unicodable6 samcv, U+004E LATIN CAPITAL LETTER N [Lu] (N)
00:54 unicodable6 samcv, https://gist.github.com/6ebe74943a567e3ba7fe89eb83f40630
00:54 babydrop Technaton: for me, yes. The first method just abuses the hash. The second one has actual semantic meaning behind it that represent the operation I'm performing. I have stuff and I care about its identity.
00:54 babydrop Technaton: but there's no point in beating your head against that if it's not making any sense right now :)
00:54 Juerd babydrop: I think it uses the hash, doesn't abuse it.
00:55 Technaton If 'right now, it is semantic, and in the future there will be an explicit performance gain in using it so' is the answer, I'll stick to it. :)
00:56 Technaton And thanks for your patience. :-)
00:57 babydrop Juerd: it just uses a label to reference an object it's manually manipulating to record relevant information. When Bag is an option, that's abuse.
00:57 canopus joined #perl6
00:58 Juerd babydrop: The problem that I have with that word is that it comes across as very unfriendly towards people who use only the more primitive aspects of the language.
00:58 vcv_ babydrop: creating an array of bools, say my @foo = True xx 5; I want '#####' if i do say @foo.join; or say [~] @foo;
00:59 Juerd If you're going to insist that this is not a must-know feature, don't accuse people for not yet knowing it.
01:00 babydrop m: y @foo = (True but 'X') xx 5; say @foo.join
01:00 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of y///; in Perl 6 please use tr///␤at <tmp>:1␤------> 3y7⏏5 @foo = (True but 'X') xx 5; say @foo.jo␤»
01:00 babydrop m: my @foo = (True but 'X') xx 5; say @foo.join
01:00 camelia rakudo-moar 345f6a: OUTPUT«XXXXX␤»
01:00 babydrop m: my @foo = (True but '#') xx 5; say @foo.join
01:00 camelia rakudo-moar 345f6a: OUTPUT«#####␤»
01:00 babydrop vcv_: like that?
01:01 Juerd babydrop: Could this be done in a type, such that after ?expr or !expr, it still stringifies to "#" if the value is true?
01:01 vcv_ good enough. thanks!
01:02 babydrop m: my \SBool = Bool but "#"; my $b = SBool.new: 1; say so $b
01:02 camelia rakudo-moar 345f6a: OUTPUT«True␤»
01:02 babydrop m: my \SBool = Bool but "#"; my $b = SBool.new: 0; say so $b
01:02 camelia rakudo-moar 345f6a: OUTPUT«False␤»
01:02 babydrop m: my \SBool = Bool but "#"; my $b = SBool.new: 0; print $b
01:02 camelia rakudo-moar 345f6a: OUTPUT«0»
01:02 babydrop hm
01:03 Juerd A use case that comes to mind is something I have to do all the time: provide user-friendly descriptions of boolean configuration options. Usually "enabled" and "disabled".
01:04 Juerd Of course, this could easily be solved with a simple helper function. But vcv_'s question made me wonder if it could be done with types.
01:05 babydrop No idea.
01:05 Juerd It'd be easy if you could inherit from Bool, but that's not possible.
01:06 Juerd Oh, of course. Enums. Bool's just an enum...
01:08 Juerd Hm, no, because your own enum doesn't accept Bool :|
01:11 Juerd Is it even possible to create an enum from, say, an Int? :)
01:13 Juerd Ah, by calling the enum as a function
01:14 pierre__ joined #perl6
01:14 Juerd m: enum Switch <off on>; my Switch $foo = Switch(True.value); put $foo
01:14 camelia rakudo-moar 345f6a: OUTPUT«on␤»
01:14 Juerd Seems overly repetative :)
01:19 cibs joined #perl6
01:20 timotimo m: enum Switch <off on>; my Switch $foo = Switch(True); put $foo
01:20 camelia rakudo-moar 345f6a: OUTPUT«Use of uninitialized value $foo of type Switch in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.␤  in block <unit> at <tmp> line 1␤␤»
01:21 timotimo ah, yes, of course
01:22 pierre__ joined #perl6
01:30 b7j0c joined #perl6
01:38 pyrimidine joined #perl6
01:45 Juerd timotimo: Is that a bug? I'd think that unsupported values shouldn't be silently discarded
01:46 timotimo dunno
01:56 mohae joined #perl6
02:03 Celelibi joined #perl6
02:04 BenGoldberg joined #perl6
02:09 kalkin-_ joined #perl6
02:25 TimToady There are lots of good reasons to have Sets/Bags as separate types from Hashes:
02:25 TimToady 1) they respond correctly to set and bag operators, while hashes will wrongly listify to a list of pairs and operate on those
02:25 TimToady 2) they allow the corresponding SetHash and BagHash types to autodelete when the associated value goes to False or 0
02:25 TimToady 3) they default to using objects for keys, rather than strings
02:25 TimToady 4) because they constrain the return values of lookups to True or Int, they can have other implementations
02:25 TimToady 5) yes, you can declare my Int %hash{Any} to get something with (some of) the contract of a Bag, but "Bag" is a lot easier to type
02:25 TimToady 6) in their natural state, Sets and Bags are immutable, which Hash doesn't get you (the SetHash and BagHash types can be thought of as containers for various sets and bags)
02:25 TimToady 7) mathematicians already know what sets and bags are, but have little clue about the peculiarities of hashes
02:25 TimToady 8) they are just very, very convenient, both syntactically and semantically, for histograms and such
02:26 pyrimidine joined #perl6
02:26 TimToady 9) set theory is very basic, and should not be upsetting reductionist curmudgeons :P
02:34 cpage_ joined #perl6
02:48 ilbot3 joined #perl6
02:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
03:01 tbrowder .tell [Coke] i'm going to sleep. please leave any suggestions for the blog in a gist or email or some other place i can find them. thanks.
03:01 yoleaux tbrowder: I'll pass your message to [Coke].
03:01 tbrowder left #perl6
03:05 xtreak joined #perl6
03:10 seatek joined #perl6
03:16 noganex_ joined #perl6
03:19 [Coke] .tell tbrowder I will do the review over coffee in the morning!
03:19 yoleaux 03:01Z <tbrowder> [Coke]: i'm going to sleep. please leave any suggestions for the blog in a gist or email or some other place i can find them. thanks.
03:19 yoleaux [Coke]: I'll pass your message to tbrowder.
03:20 bjz joined #perl6
03:21 dalek doc: cabe811 | coke++ | doc/Type/List.pod6:
03:21 synopsebot6 Link: http://doc.perl6.org/type/List
03:21 dalek doc: fix typo
03:21 dalek doc: review: https://github.com/perl6/doc/commit/cabe811f20
03:36 pierre__ joined #perl6
03:41 sydney_falk joined #perl6
03:59 pyrimidine joined #perl6
04:00 bjz joined #perl6
04:03 pierre__ joined #perl6
04:07 Ben_Goldberg joined #perl6
04:15 xtreak joined #perl6
04:17 pierre__ joined #perl6
04:19 samcv ok so the spec for perl 6 is basically starting + ending  OR initial + final quote right? as far as unicode properties
04:19 samcv I see an issue right now
04:19 samcv m: say '﴿'.uniname ~ '﴿'.uniprop
04:19 camelia rakudo-moar 345f6a: OUTPUT«ORNATE RIGHT PARENTHESISPs␤»
04:20 samcv #not ok 22 - Ps U+FD3F Pe U+FD3E ﴿ ﴾ ORNATE RIGHT PARENTHESIS | ORNATE LEFT PARENTHESIS
04:20 samcv so unicode says that the ornate right parenthesis is the starting one and the left parenthesis is the closing one
04:20 samcv m: say q ﴾test﴿
04:20 camelia rakudo-moar 345f6a: OUTPUT«test␤»
04:21 samcv so idk if that should work or not, or that is going to be an exception?
04:29 samcv it is meant for right to left languages since it's in the Arabic block.  ﴿ ﴾
04:31 skids heh.  Maybe it should .flip... in a module :-)
04:33 cdg joined #perl6
04:34 samcv hmm
04:39 cdg joined #perl6
04:42 samcv m: ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾sayq
04:42 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus statement␤at <tmp>:1␤------> 3<BOL>7⏏5﴿ليمان، إتفاقية بين ما, يذكر الحدود أي ب␤    expecting any of:␤        prefix␤        term␤»
04:42 samcv dammit
04:45 samcv m: say q﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾
04:45 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of a closing delimiter for an opener is reserved␤at <tmp>:1␤------> 3say q7⏏5﴿ليمان، إتفاقية بين ما, يذكر الحدود أي ب␤»
04:45 samcv bad bad perl 6
04:46 samcv i think i typed that properly
04:46 samcv ah. when i typed my text it looked incorrect like the () were reversed, but in the error message
04:46 samcv you can see that it is the correct direction
04:46 samcv at the end
04:55 samcv m: say q ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾
04:55 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of a closing delimiter for an opener is reserved␤at <tmp>:1␤------> 3say q7⏏5 ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي ␤»
04:56 samcv ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾say q
04:56 samcv m: ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾say q
04:56 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus statement␤at <tmp>:1␤------> 3<BOL>7⏏5﴿ليمان، إتفاقية بين ما, يذكر الحدود أي ب␤    expecting any of:␤        prefix␤        term␤»
05:04 mawkish joined #perl6
05:04 pierre__ joined #perl6
05:07 jespoting joined #perl6
05:08 raiph joined #perl6
05:11 samcv here is the string https://cry.nu/arabic.txt
05:13 samcv if you copy and paste it into anywhere in chromium at least it will show properly, apparently unicode says that many characters flip depending on RTL or LTR, but 'hard' characters like these arabic quotes do not reverse
05:15 samcv i'm make a PR for nqp tonight with a RFC about this
05:16 samcv once I get my test script passing for 100% of the brackety things
05:32 xinming joined #perl6
05:35 skrshn joined #perl6
05:36 skrshn For multi-dispatch, when there are multiple methods that satisfy arguments, which one gets called ? https://gist.github.com/skrisna/50ec2b89a8c166f081640f212e5975f2
05:37 skrshn For instance, if I call it with 31337 both SmallPrime and BigPrime are satisfied
05:42 TimToady if the are both constrained, it calls them in order
05:43 TimToady if they're nominally equivalent, it's an ambiguous dispatch, and illegal
05:44 Sgeo joined #perl6
05:46 raiph joined #perl6
05:54 Cabanossi joined #perl6
05:54 cdg_ joined #perl6
05:56 brillenfux joined #perl6
06:00 rurban joined #perl6
06:05 samcv what's the easiest way to combine an array of mixes into one mix?
06:06 samcv into the same mix with the weights added together etc
06:08 samcv or even just having one mix and then adding thinks afterward to it, i can't figure out how to do that
06:09 samcv i know i can add them individually with (+)
06:09 cibs joined #perl6
06:09 samcv and that's working fine but combining it for every item i add is slow
06:23 darutoko joined #perl6
06:23 pierre__ joined #perl6
06:26 pierre__ joined #perl6
06:40 FROGGS joined #perl6
06:42 brrt timotimo: good catch, fixed it
06:44 skrshn TimToady: thanks
06:46 skrshn samcv: can you give an example? finding it hard to follow
06:47 samcv ok so you have a MixHash, and you want to add things to it
06:47 domidumont joined #perl6
06:48 skrshn I plan to teach my 5.5 year old programming and start with perl 6 (and learn it myself along the way)
06:48 skrshn :-)
06:48 skrshn and good general programming references for kids ?
06:48 samcv m: my $mix =  MixHash.new-from-pairs: 'one' => 1, 'two' => 2; my $mix2 =  MixHash.new-from-pairs: 'one' => 1, 'three' => 3; my $mix3 = $mix ∩ $mix2; say $mix3
06:48 camelia rakudo-moar 345f6a: OUTPUT«mix(one)␤»
06:49 samcv m: my $mix =  MixHash.new-from-pairs: 'one' => 1, 'two' => 2; my $mix2 =  MixHash.new-from-pairs: 'one' => 1, 'three' => 3; my $mix3 = $mix ∩ $mix2; say $mix3.perl
06:49 camelia rakudo-moar 345f6a: OUTPUT«("one"=>1).Mix␤»
06:49 samcv uh don't know why that didn't combine them. oh oops
06:49 samcv used the intersection one by accident
06:49 samcv m: my $mix =  MixHash.new-from-pairs: 'one' => 1, 'two' => 2; my $mix2 =  MixHash.new-from-pairs: 'one' => 1, 'three' => 3; my $mix3 = $mix (+) $mix2; say $mix3.perl
06:49 camelia rakudo-moar 345f6a: OUTPUT«("two"=>2,"three"=>3,"one"=>2).Mix␤»
06:49 samcv but MixHash's are mutable so. would like to be able to add to it
06:50 skrshn samcv: ah.. i see
06:51 samcv m: MixHash.^methods.gist.say
06:51 camelia rakudo-moar 345f6a: OUTPUT«(Mix MixHash Bag BagHash elems pick list fmt categorize-list Set of classify-list Int Num Real Bool hash grabpairs pickpairs Numeric default grab kxxv roll SetHash new-from-pairs total WHICH Method+{<anon|41302672>}.new perl gist Method+{<anon|41302672>}.n…»
06:51 brrt sksrhn: well, there are books in development, i'm not sure what we have that is kid-friendly
06:51 samcv there should be some way right? i mean. they are mutable so what good is being mutable if i don't know how to add them?
06:52 RabidGravy joined #perl6
06:52 samcv not sure about that skrshn i mean there's some good adult tutorials but for a 5.5 year old idk
06:52 skrshn brrt: I am not looking for perl6 specific books. Just some suggestions for teaching programming to young kids. I can tailor them for perl6
06:52 skrshn I am looking for motivating examples and such
06:53 TEttinger well, on the plus side, they will learn the names of all the punctuation on and off the keyboard before the rest of their kindergarten class knows which is 'q' and which is 'p'
06:53 domidumont joined #perl6
06:53 skrshn TEttinger: :-)
06:54 TEttinger "teacher what's the texas for that multiplication sign?"
06:54 TEttinger (something I wish they could answer in some college classes...)
06:55 TEttinger double-struck R is all real numbers, but how would you write that in, say, an email without necessarily requiring the reader to have a font that supports that?
06:56 samcv using unicode?
06:57 brrt hmmmm
06:57 wamba joined #perl6
06:57 samcv u: ℝ
06:57 unicodable6 samcv, U+211D DOUBLE-STRUCK CAPITAL R [Lu] (ℝ)
06:57 brrt dunno, wouldn't logo do?
06:57 samcv just say {DOUBLE-STRUCK CAPITAL R}
06:57 brrt perl6 would seem to me to be a very hard first language (sorry camelia)
06:57 samcv lol.
06:58 samcv hard why?
06:58 brrt very many concepts, funky punctuation and sigils...
06:59 brrt on the other hand, that *can* help with disambiguations
06:59 samcv yeah
06:59 rurban joined #perl6
06:59 brrt but i'm recently leaning to 'BASIC was actually quite good for beginners' :-)
07:00 brrt basic, of course, does have some sigils
07:01 xtreak joined #perl6
07:03 skrshn brrt: but we don't have to teach everything at once
07:04 brrt that ist true as well
07:05 skrshn BASIC with the goto statements -- no thanks
07:05 skrshn python may be a good start too
07:06 skrshn still trying to make up my mind
07:06 skrshn but most importantly, trying to get some interesting things to do with programming -- don't want to start with -- "now, we learn about for loops"
07:09 skrshn what I am worried with perl 6 is that I probably need to know perl6 well to teach it in a simple way using verbs/nouns/ english like sentences
07:09 TimToady we shouldn't start kids with English either :P
07:10 skrshn :-)
07:11 samcv m: sub postfix:< ½ >($left) { $left + ½ }; say 10½
07:11 camelia rakudo-moar 345f6a: OUTPUT«10.5␤»
07:11 samcv has anybody thought about letting that work?
07:11 samcv i mean shouldn't have issues with using it as a number by itself
07:11 samcv would be neat
07:12 TimToady yes, it's been thought of, and not thought much of :)
07:12 samcv haha
07:12 samcv the most pressing problem facing perl 6 today!
07:12 samcv ha
07:16 TEttinger TimToady: there's about 1.5 million Nahuatl speakers today, though it's changed quite a bit from when the Aztecs used it
07:16 TEttinger apparently Quechua is a beautifully regular natural language, almost a formal language in how few ambiguities are in its conjugations and such
07:17 skrshn I heard similar things bout Sanskrit
07:17 TimToady I'm sure it pays for that elsewhere :)
07:17 TEttinger except sanskrit is hard as all hell to write in the actual devanagari script on a computer
07:18 TEttinger they may be getting to "moderately acceptable" now
07:18 TEttinger it needs serious font support
07:19 TEttinger I mean the script is absolutely beautiful, especially when hand-written
07:19 samcv wow Kate actually has sane ability to to right to left text. Like in Libreoffice, pressing right on the arrow key would move left
07:19 TEttinger nice.
07:19 firstdayonthejob joined #perl6
07:20 samcv yeah and it didn't realize the arabic parenthesis were RTL text. but at least chrome and kate know that and put it the proper way
07:20 TEttinger hebrew, arabic, not too many other scripts use RTL
07:20 samcv yeah
07:20 samcv m: say q﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾
07:20 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Use of a closing delimiter for an opener is reserved␤at <tmp>:1␤------> 3say q7⏏5﴿ليمان، إتفاقية بين ما, يذكر الحدود أي ب␤»
07:20 samcv and this should actually work when I make a PR for nqp with the changes
07:21 TEttinger u: ﴾
07:21 unicodable6 TEttinger, U+FD3E ORNATE LEFT PARENTHESIS [Pe] (﴾)
07:22 TEttinger Pe is ending
07:23 skrshn My reasons for going with Perl6 as the first programming language is that it lets the kids think at a higher plain most of the time
07:24 samcv it's a left parenthesis but left != opening as i figured out today
07:25 TEttinger m: say q﴾ل#﴿يمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو
07:25 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say q﴾ل#﴿7⏏5يمان، إتفاقية بين ما, يذكر الحدود أي بعد␤    expecting any of:␤        infix␤        infix stopper␤  …»
07:25 samcv only figured it out because i decided to go through every unicode Ps/Pe and Pi/Pf and test if they worked in rakudo.
07:25 TEttinger it doesn't work in WPF in this IRC client
07:25 TEttinger I can't delete the last char without messing up everything
07:26 samcv TEttinger, what i did is get the string, then slurp it and then add the text i wanted hah
07:26 samcv or uh
07:26 samcv TEttinger, cry.nu/arabic.txt
07:26 samcv type: say q<then paste the string>
07:26 samcv that will do it
07:27 samcv but yeah i slurped the string i knew was correct, then I added 'say q' in there, and then EVAL'd it just to make 100% sure
07:27 samcv it's annoying when text editors don't display things properly
07:28 TEttinger uh hang on, "knew was correct"
07:28 TEttinger is that the shahaddah?
07:28 samcv i'm not sure what it says
07:28 samcv maybe nothing
07:28 TEttinger ok
07:29 samcv oh no it does say something
07:29 TEttinger that's a really friggin bad idea to post that in a logged channel
07:29 samcv )laman, An agreement between what, little border after, the treatment of Poland, all Al Aao(
07:29 samcv also interestingly typing right to left, a ) will print a (
07:30 samcv because it reverses ones that are not RTL specified ones
07:30 samcv ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾
07:30 samcv does that show up correct?
07:31 TEttinger the shahada is a statement that, by some interpretations of Islam, means you are converting to Islam by saying it. reasonable interpretations require you to actually mean it. there are always non-reasonable interpretations of religions.
07:32 TEttinger it does seem to show up right
07:32 TEttinger but you have left on right
07:32 samcv yeah. if you only type RTL characters it correctly uses those parenthesis as RTL
07:32 samcv but if you add any other text they often get confused on something
07:33 samcv putting them on opposite sites of where they actually are
07:33 moritz RabidGravy: re 12th advent spot, I don't really want it. But if it's a burden to you, I can try to write up something
07:34 samcv well they seem to work fine if you type RTL and then after it type LTR text
07:34 samcv but if you type LTR text then type LTR text then it messed up
07:34 samcv ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾ say q
07:34 samcv in some alternate reality this maybe would work idk hahaha
07:35 samcv but the say q actually comes after the LTR text
07:35 samcv (if that shows up correctly, it does for me)
07:35 samcv m: ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾ say q
07:35 camelia rakudo-moar 345f6a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus statement␤at <tmp>:1␤------> 3<BOL>7⏏5﴿ليمان، إتفاقية بين ما, يذكر الحدود أي ب␤    expecting any of:␤        prefix␤        term␤»
07:36 samcv this is what it looks like if i add any LTR chars before it
07:36 TEttinger m: say q﴾ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴿
07:36 camelia rakudo-moar 345f6a: OUTPUT«ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو␤»
07:37 TEttinger you have the parens wrong I think
07:37 TEttinger left doesn't mean opening here, it means left, so in RTL that's the end
07:37 samcv hmm maybe i do?
07:37 TEttinger left is Pe, right is Ps
07:37 samcv yea i understand that
07:38 TEttinger u: ﴾﴿
07:38 unicodable6 TEttinger, U+FD3E ORNATE LEFT PARENTHESIS [Pe] (﴾)
07:38 unicodable6 TEttinger, U+FD3F ORNATE RIGHT PARENTHESIS [Ps] (﴿)
07:39 TEttinger the weird bit is that once you hit that block of LTR text, it goes q, then visually to the end of the line at the ornate right parenthesis, then goes right to left
07:39 samcv well TEttinger you just typed the closing one before the ending one
07:39 TEttinger right to left?
07:39 TEttinger I may have entered it wrong
07:39 samcv i mean it showed up fine
07:39 TEttinger here it displayed with the right paren on the right
07:40 samcv but you typed the closing one before the ending one
07:40 TEttinger and the left at left
07:40 samcv but maybe that's what we want?
07:40 samcv ugh you made me more confused
07:40 TEttinger closing is left
07:40 samcv yes i know
07:40 samcv you typed the closing one before the opening one
07:40 samcv regardless of what they look like.
07:40 TEttinger in this line?
07:40 TEttinger m: say q﴾ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴿
07:41 camelia rakudo-moar 345f6a: OUTPUT«ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو␤»
07:41 samcv yes
07:41 TEttinger well, no
07:41 TEttinger it's in a RTL block
07:41 samcv well. the closing comes before the ending. so
07:41 samcv maybe that is what we want
07:41 TEttinger wat
07:41 samcv otherwise it wouldn't work
07:41 moritz brrt++ # advent post
07:42 TEttinger ok I am going to attempt to write some perl 6 here, despite not knowing a lick of it
07:42 Actualeyes joined #perl6
07:42 samcv m: say Q/﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو﴾/.comb
07:42 camelia rakudo-moar 345f6a: OUTPUT«(﴿ ل ي م ا ن ،   إ ت ف ا ق ي ة   ب ي ن   م ا ,   ي ذ ك ر   ا ل ح د و د   أ ي   ب ع د ,   م ع ا م ل ة   ب و ل ن د ا ،   ا ل إ ط ل ا ق   ع ل   إ ي و ﴾)␤»
07:43 samcv ok so with that, it looks like ) on the left and ( on the right. but reading the bytes down the file, the closing one comes first
07:43 samcv that's what i'm trying to get at
07:43 samcv so what i was saying is maybe that is what we want, for RTL text that would be fine.
07:44 samcv i should add a comment to the source file maybe. since every other bracket conforms to the unicode open first close last
07:44 TEttinger m: say q﴾لو﴿.comb
07:44 camelia rakudo-moar 345f6a: OUTPUT«(ل و)␤»
07:45 TEttinger samcv: can you find some usage examples of ornate parentheses in arabic text? I think we may be looking at this wrong
07:45 samcv yeah
07:45 samcv i mean... it works fine if it's only RTL text
07:46 samcv but as soon as you add ascii text then it reverses the paren locations so
07:47 TEttinger yeah you had them backwards
07:47 TEttinger http://software.sil.org/scheherazade/wp-content/uploads/sites/29/2016/03/ScheherazadeGen11.png
07:47 TEttinger first line
07:48 samcv https://books.google.com/books?id=wn5sXG8bEAcC&amp;pg=PA290&amp;lpg=PA290&amp;dq=ornate+arabic+parens&amp;source=bl&amp;ots=J1eym2YfXA&amp;sig=FVvLokjeM3hMJ0Gh1IQtz5Hh3-k&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwjZ9MKVz-bQAhVBtI8KHQxTAUsQ6AEITjAM#v=onepage&amp;q=ornate%20arabic%20parens&amp;f=false
07:48 samcv maybe this will be helpful
07:49 TEttinger you saw the image link right?
07:49 TEttinger is that how the error-causing lines rendered on your end?
07:49 TEttinger the lines that evaluated without error that I sent looked like that image
07:50 TEttinger (on my side, using unifont which is pretty bad at this to be fair)
07:51 moritz brrt: I've fixed some small issues (capitalization of programming language names, a small typo) in your post; hope you're OK with the changes
07:54 brrt sure, np, thanks :-)
07:55 samcv TEttinger, well also confusing is that normal ( ) reverse in RTL text but the ornate ones are not supposed to
07:55 samcv so i am not sure if they are reversing when they shouldn't or not
07:55 samcv or if it's placing them on the wrong side
07:55 samcv when you combine LTR + RTR
07:55 TEttinger oh ok
07:55 samcv yeah
07:56 brrt sksrhn: BASIC with goto statement, yes, because that drives home the point that computers are procedural really, really well
07:56 TEttinger well for me they're somehow ... I'm not sure of the parens are fully considered RTL
07:56 brrt any attempt to ignore that fact is likely to confuse
07:56 samcv they are supposed to not flip
07:57 TEttinger m: say q﴾abc﴿.comb
07:57 camelia rakudo-moar 345f6a: OUTPUT«(a b c)␤»
07:57 brrt and as for python... the weakness of python from a learners perspective is that their is a *lot* of magic under the hood
07:57 samcv m: say say q{﴿}.uniname
07:57 camelia rakudo-moar 345f6a: OUTPUT«ORNATE RIGHT PARENTHESIS␤True␤»
07:57 brrt magic isn't good for learning; learning to program is all about how computers are *not* magical, imho
07:57 TEttinger m: say q﴾لو﴿.comb
07:57 camelia rakudo-moar 345f6a: OUTPUT«(ل و)␤»
07:58 TEttinger ah, weird, that doesn't print the insides in RTL order
07:58 brrt and as for fun... I'm not sure if you can entertain kids with logo anymore, these days
07:58 brrt I certainly enjoyed it, but I didn't have a smartphone, so there is that
07:59 samcv TEttinger, https://www.branah.com/arabic
07:59 samcv paste the string at https://cry.nu/arabic.txt in there
08:02 samcv https://cry.nu/arabic2.txt
08:02 samcv ok both these text files the parenthesis are reversed inside the string
08:03 TEttinger hm, well it's doing some weird mapping to my ornate parentheses and turning them into ascii parens
08:03 TEttinger also, try clicking shift on their soft keyboad
08:03 samcv well they often render the same
08:03 TEttinger shift 9 is ), shift 0 is ) , which is opposite of a QWERTY US keyboard
08:03 mawkish joined #perl6
08:03 TEttinger err
08:03 TEttinger shift 0 is (
08:04 samcv well those are just normal parenthesis
08:04 samcv they're just reversed because they are in RTL text
08:04 TEttinger uh
08:04 samcv yeah
08:04 TEttinger it wouldn't do that no
08:05 TEttinger on the keys themselves
08:05 samcv yes it would
08:05 samcv ﴿ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إ(((((((((
08:05 samcv all those parens are left parens^ left normal ones
08:05 TEttinger which are one char, ( would be rendered at position 0, it wouldn't change the ASCII value of ( to the value of )
08:05 samcv i just typed now
08:05 samcv uhm. the ascii value is a left paren but shows as right paren
08:06 samcv because RTL text
08:06 andrzejku joined #perl6
08:06 TEttinger where does that happen? is it specified in unicode?
08:06 samcv yeah
08:07 TEttinger I'm guessing it's swapping a Ps for a Pe, except there's no way to do that universally since there are more of one than the other IIRC
08:07 samcv no it doesn't swap
08:07 samcv it just flips it
08:07 pierre__ joined #perl6
08:07 domidumont joined #perl6
08:08 TEttinger ...this sounds sketchy
08:08 samcv well
08:08 samcv paste in https://cry.nu/arabic3.txt into anything and type left ( or right )
08:08 samcv it will display differently
08:08 TEttinger no no
08:09 TEttinger can you find documentation on how unicode specifies this, as opposed to their site's keyboard's specification?
08:09 TEttinger (which could be wrong in any number of ways)
08:09 samcv m: say Q/ليما)))، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو/.comb
08:09 camelia rakudo-moar 345f6a: OUTPUT«(ل ي م ا ) ) ) ،   إ ت ف ا ق ي ة   ب ي ن   م ا ,   ي ذ ك ر   ا ل ح د و د   أ ي   ب ع د ,   م ع ا م ل ة   ب و ل ن د ا ،   ا ل إ ط ل ا ق   ع ل   إ ي و)␤»
08:09 samcv hmm or maybe i'm wrong hm
08:10 samcv this is very confusing
08:10 TEttinger it is.
08:10 TEttinger I think the main thing to remember is left is always left
08:10 TEttinger and right is always right
08:10 TEttinger but you don't always start at one or the other
08:11 samcv well
08:11 samcv ornate ﴾ right parenthesis goes on the left side of the page
08:11 TEttinger that's the left paren
08:11 samcv u: ﴾
08:11 unicodable6 samcv, U+FD3E ORNATE LEFT PARENTHESIS [Pe] (﴾)
08:12 samcv err.
08:12 samcv ok you're right
08:12 TEttinger :)
08:12 TEttinger I'm... left
08:12 samcv it goes at the end
08:12 samcv of the text. not of the file... so confusing
08:12 TEttinger yep
08:13 samcv well at least we figured it out
08:13 TEttinger I18N is a brainslayer
08:13 samcv i'll make sure to comment on that one in the file that stores all the parens that these two are the only non matching ones
08:13 samcv i mean. as far as things are concerned
08:14 samcv so yeah, ( ) normal parens go at the start and end of the text
08:15 samcv but are reversed graphically. so that Pe Ps are both retained
08:15 samcv well.
08:15 samcv not really
08:15 samcv i mean they're reversed. uh
08:15 samcv visually they appear to be the same as their coorasponding Pe/Ps symbol
08:15 TEttinger I think that depends on how the RTL part starts and ends
08:15 TEttinger and that I am very unclear on
08:16 TEttinger if you're in an RTL area of code, which may or may not end as soon as you type a LTR char (not sure at all), then you have your Ps starters at the right and Pe enders at the left
08:16 TEttinger but if the RTL stuff is limited to arabic or hebrew or other RTL script!
08:17 TEttinger then '(' is LTR, the RTL goes inside that (after), and I think the ')' goes back to LTR and goes after the display of the RTL text I think
08:18 TEttinger which also explains why .comb is showing things in LTR order
08:18 TEttinger it has spaces interposed
08:18 TEttinger each RTL char only is drawn for one char, so the ordering is irrelevant inside that one char, before it goes back to LTR
08:19 TEttinger (where space is LTR)
08:20 pierre__ joined #perl6
08:22 samcv http://cry.nu/arabic.p6 if you want to play around with it
08:22 samcv i constructed this file using perl 6, well reading that string from the file, then adding perl 6 code around it
08:22 samcv so i know it is correct :P since I don't trust how things present things to me anymore
08:25 samcv but printing out a normal left paren + that string + right paren
08:25 samcv shows correct
08:26 samcv well. i mean it shows a left paren on the left right paren on the right
08:26 samcv u: )
08:26 unicodable6 samcv, U+0029 RIGHT PARENTHESIS [Pe] ())
08:29 samcv and to confuse matters more: https://cry.nu/test.txt TEttinger
08:29 samcv those are inserted exactly the same
08:30 TEttinger oh jeez
08:30 TEttinger the fonts I use in the browser render those really badly
08:30 ufobat joined #perl6
08:30 TEttinger notably, they use different parens, but none are ornate
08:31 TEttinger (?????? ??????? ??? ??, ???? ?????? ?? ???, ?????? ??????? ??????? ?? ???)
08:31 TEttinger oops sorry
08:31 bjz joined #perl6
08:33 samcv err actually my text there is incorrect
08:33 samcv normal left normal right, and ornate left ornate right
08:34 samcv though they look the same direction the end/start in unicode is different and both are displayed like that. the biggest question is... what should they correctly be. lol
08:34 samcv In the next phase, neutral and isolate formatting (i.e. NI) characters are resolved one isolating run sequence at a time. Its results are that all NIs become either R or L. Generally, NIs take on the direction of the surrounding text. In case of a conflict, they take on the embedding direction. At isolating run sequence boundaries where the type of the character on the other side of the boundary is required, the type assigned to sos or eos is used.
08:35 TEttinger head asplode
08:36 samcv yeah basically
08:37 samcv m: say "(ليمان، إتفاقية بين ما, يذكر الحدود أي بعد, معاملة بولندا، الإطلاق عل إيو)".ord
08:37 camelia rakudo-moar 345f6a: OUTPUT«40␤»
08:37 samcv u: '('.ord.say
08:37 unicodable6 samcv, U+0027 APOSTROPHE [Po] (')
08:37 unicodable6 samcv, U+0028 LEFT PARENTHESIS [Ps] (()
08:37 unicodable6 samcv, U+0027 APOSTROPHE [Po] (')
08:37 unicodable6 samcv, https://gist.github.com/2fa2cc1ea4b9ce54c208f2b9aa7281d4
08:37 samcv errr oops
08:37 samcv m: '('.ord.say
08:37 camelia rakudo-moar 345f6a: OUTPUT«40␤»
08:43 rurban left #perl6
08:46 zakharyas joined #perl6
08:50 dalek ecosystem: 5a7e479 | (Sam Gillespie)++ | META.list:
08:50 dalek ecosystem: Adding Algorithm::Genetic to ecosystem
08:50 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/5a7e479416
08:52 cibs joined #perl6
08:57 powerjuce joined #perl6
08:58 powerjuce Hi all, quick question about this code: my @lines = 'huge-csv'.IO.lines;
08:58 powerjuce It is in the section: Line by line
08:59 powerjuce If I use that code and then later run a for loop like this: for @lines -> $line { $line.say } will that still lazy load the file line by line?
08:59 powerjuce (i.e. create a generator)
08:59 powerjuce Or will it slurp the whole file in
09:04 seatek i'd think it would read the whole thing into @lines eventually, if you kept reading line by line. i don't believe it discards what is already read into @lines
09:04 rindolf joined #perl6
09:07 powerjuce seatek: I guess I mean more, does it slurp the full line in when I do @lines = 'huge-csv'.IO.lines?
09:07 powerjuce full file**
09:09 pierre__ joined #perl6
09:15 seatek powerjuce: i honestly don't know if it would if you used an array. you could try it out. but if you're worried you can just keep it as a scalar
09:15 powerjuce cool will do
09:15 powerjuce thanks!
09:23 wamba joined #perl6
09:23 xinming_ joined #perl6
09:29 seatek an HOUR lost because of an overlooked semicolon in a long arg list. i don't deserve to live.
09:30 seatek ah but such relief now. second-guessing that.
09:32 seatek oo! candy canes. never mind. :)
09:33 xtreak joined #perl6
09:37 babydrop m: my @lines = 1…∞; say @lines[^10]
09:37 camelia rakudo-moar 345f6a: OUTPUT«(1 2 3 4 5 6 7 8 9 10)␤»
09:38 aaa_ joined #perl6
09:40 seatek he left! but i didn't even think of it being just like that ;)
09:41 babydrop TimToady++ # set explanations
09:41 jnthn say "README.md".IO.lines.is-lazy
09:41 jnthn False
09:41 babydrop At least now I'm not losing my marbles
09:42 jnthn So, it's not marked as lazy, meaning that an assignment into an array will proceed eagerly
09:42 babydrop jnthn: so it'll put all of it into the array?
09:42 jnthn Correct
09:42 babydrop Ah, cool
09:42 babydrop Totally forgot about is-lazy
09:42 jnthn my @a = lazy 'foo'.IO.lines; # one way to force laziness
09:42 jnthn If you put it in a Scalar you're storing the Seq
09:42 jnthn Which means you can then build a pipeline off it.
09:42 jnthn That will only do work when needed, and pull them one at a time
09:43 jnthn But a Scalar will be a pain in that for $a { } doesn't iterate over $a
09:43 jnthn So normally when doing pipeline construction of lazy things, sigilless vars are the way to go
09:44 moritz if you do  my @a := foo.IO.lines.list  that should preserve laziness too, right?
09:44 moritz at the cost of keeping old elements
09:44 xinming joined #perl6
09:45 seatek i knew it couldn't be that cut and dried. ;)
09:45 jnthn moritz: This is true, but most people doing file I/O, when saying "I want laziness", normally mean they don't want to keep the stuff around in memory. :-)
09:46 jnthn my @a = lazy ... ; is thus vulnerable to the same thing
09:46 seatek keeps filling
09:47 xtreak joined #perl6
09:49 jnthn Yup. The lines are read in one at a time, but hang around
09:49 jnthn Which is sometimes what you want
09:49 xinming joined #perl6
09:49 babydrop Man, I thought DBIish #77 was a pretty obvious quick-fix. Apparently we need reams of discussion and blaming the user for destroying their system by doing such a stupid action as installing a Perl 6 module.
09:50 * babydrop clicks "Unsubscribe" button while eyerolling
09:54 seatek yeah i would rather it was an option to run tests against other stuff on your network.
09:58 seatek personally, i use a NET_TESTS environment variable and no tests that rely on network will run without seeing it.
10:00 seatek (includes sockets)
10:00 * babydrop uses Test::When
10:00 babydrop well... I would if I were writing any Perl 6 code....
10:02 seatek that makes me crazy to think about
10:04 bjz joined #perl6
10:04 babydrop which part? :)
10:05 seatek you not writing perl 6 code
10:05 Ulti m: getc
10:05 camelia rakudo-moar 345f6a: OUTPUT«read string requires an object with REPR MVMOSHandle␤  in block <unit> at <tmp> line 1␤␤»
10:05 babydrop I got nothing to make. Not writing other code either.
10:05 Ulti ^ bit of a weird error
10:06 babydrop Well, other than rakudo. But I mean code that makes stuff, not code to make code.
10:06 babydrop s: &getc
10:06 SourceBaby babydrop, Sauce is at https://github.com/rakudo/rakudo/blob/345f6a7/src/core/io_operators.pm#L130
10:06 seatek but how do you know what you need unless you use it?
10:07 seatek you could be making all kinds of things that are just insance
10:07 seatek insane
10:07 babydrop seatek: I don't need to. Plenty of bugs to fix: http://perl6.fail
10:07 babydrop s: $*ARGFILES, 'getc', \()
10:07 SourceBaby babydrop, Sauce is at https://github.com/rakudo/rakudo/blob/345f6a7/src/core/IO/Handle.pm#L150
10:08 seatek wow ok. so constrained by the structure that already exists at least ;)
10:08 jnthn For quite a few years most of the Perl 6 code I wrote was implementing Rakudo built-ins and Rakudo itself. :-)
10:09 csquared joined #perl6
10:09 babydrop Ulti: seems that needs to be added as a method in https://github.com/rakudo/rakudo/blob/nom/src/core/IO/ArgFiles.pm
10:09 jnthn During the last month or so, that's actually in the minority, which has been nice.
10:10 seatek it's so weird to think about. becuase in a way you've already written every program i'm writing
10:10 sena_kun joined #perl6
10:11 babydrop Ulti: 'cause it ends up going into IO::Handle's method that just reads from $!PIO but I see other methods in Argfiles have magicks to get proper handle: https://github.com/rakudo/rakudo/blob/nom/src/core/IO/ArgFiles.pm#L62-L63
10:20 pierre__ joined #perl6
10:35 captain-adequate joined #perl6
10:38 * jnthn just discovered Test::Mock wouldn't let you make mocks of classes that happened to have required attributes, and fixed it :)
10:38 babydrop \o/
10:39 jnthn (By trying to write a test for such a class and discovering it didn't work... :))
10:39 jnthn Yay, now my tests...fail, in the right way :)
10:52 cyphase_eviltwin joined #perl6
10:54 babydrop brrt++ good article :)
10:54 xtreak joined #perl6
10:55 japhb joined #perl6
10:59 bjz joined #perl6
11:00 gregf_ joined #perl6
11:01 kurahaupo__ joined #perl6
11:12 kurahaupo__ joined #perl6
11:15 pmurias joined #perl6
11:16 pmurias update on rakudo.js: http://blogs.perl.org/users/pawel_murias/2016/12/rakudojs-update-1.html
11:18 brillenfux_ joined #perl6
11:19 brillenfux__ joined #perl6
11:21 japhb joined #perl6
11:23 brillenfux_ joined #perl6
11:31 ufobat joined #perl6
11:32 moritz pmurias++
11:34 pmurias joined #perl6
11:37 rurban joined #perl6
11:41 rurban left #perl6
11:41 perlawhirl joined #perl6
11:41 babydrop "rakudo.js finally compiled the full setting"
11:41 babydrop pmurias++
11:48 AlexDaniel joined #perl6
11:52 tbrowder joined #perl6
11:52 kurahaupo__ joined #perl6
11:53 babydrop AlexDaniel: I'm regretting ever awesomifying X::Syntax::Number::InvalidCharacter
11:53 AlexDaniel what happened now? :)
11:53 AlexDaniel m: grammar G { proto token foo($bar?) { * } }; grammar G2 is G { token TOP { <foo(42)> }; token foo:sym<bleh>($bar?) { {say ‘BAR: ’, $bar} <?> } }; say G2.parse(‘z’)
11:53 camelia rakudo-moar 8e3cbc: OUTPUT«BAR: (Any)␤Nil␤»
11:53 AlexDaniel why is it Any?
11:53 AlexDaniel m: grammar G { proto token foo($bar) { * } }; grammar G2 is G { token TOP { <foo(42)> }; token foo:sym<bleh>($bar) { {say ‘BAR: ’, $bar} <?> } }; say G2.parse(‘z’)
11:53 camelia rakudo-moar 8e3cbc: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in regex foo:sym<bleh> at <tmp> line 1␤  in regex foo at <tmp> line 1␤  in regex TOP at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
11:54 AlexDaniel or in other words, why the argument is not passed?
11:54 babydrop AlexDaniel: Most of the code in .parse-base is error handling, and the bug about "1___x" reporting is still there. The error stuff already had at least 3 tickets.
11:54 babydrop It's just not worth it.
11:54 babydrop When "Could not parse that number" is sufficient in most cases.
11:54 moritz we should go the python route and simply say "syntax error"
11:55 jnthn AlexDaniel: protoregexes simply don't do that
11:56 babydrop m: :10<1.x>
11:56 camelia rakudo-moar 8e3cbc: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid base-10 character 'x': 1.7⏏5x. Please use one of 0..9␤at <tmp>:1␤------> 3:10<1.x>7⏏5<EOL>␤»
11:56 jnthn AlexDaniel: It may be possible to make it happen; feel free to file a feature request
11:56 AlexDaniel jnthn: hmmm, so are you saying that there is no way to pass an argument in this case?
11:56 jnthn AlexDaniel: But the easy solution is to store it in a dynamic in the signature of the proto and access it that way
11:56 AlexDaniel yea… I guess
11:58 AlexDaniel jnthn: wait, how would that look like?
11:58 AlexDaniel proto regex cannot have a body, right?
11:58 babydrop committable6: 2016.04 :10<1.x>
11:58 committable6 babydrop, ¦«2016.04»: ===SORRY!=== Error while compiling /tmp/ErYfwSI6HC␤Couldn't process entire number: 1/1 int chars, -1/1 fractional chars␤at /tmp/ErYfwSI6HC:1␤------> :10<1.x><HERE><EOL> «exit code = 1»
11:58 babydrop oh, right. Now I remember why we added a better error there :}
11:58 AlexDaniel babydrop: I think that ↑ was worse than what we have now
12:02 AlexDaniel m: grammar G { has $.hack; proto token foo($!hack) { * } }; grammar G2 is G { token TOP { <foo(42)> }; token foo:sym<bleh> { {say ‘BAR: ’, $.hack} <?> } }; say G2.parse(‘z’)
12:02 camelia rakudo-moar 8e3cbc: OUTPUT«BAR: 42␤Nil␤»
12:02 AlexDaniel alright… that works, I guess?
12:03 AlexDaniel babydrop: don't worry, we will remove all error handling after robot uprising
12:03 babydrop m: grammar G { proto token foo($*not-hack) { * } }; grammar G2 is G { token TOP { <foo(42)> }; token foo:sym<bleh> { {say ‘BAR: ’, $*not-hack} <?> } }; say G2.parse(‘z’)
12:03 camelia rakudo-moar 8e3cbc: OUTPUT«BAR: 42␤Nil␤»
12:03 babydrop AlexDaniel: can't wait!
12:04 AlexDaniel ohhh… alright
12:04 AlexDaniel kinda LTA but good enough, thanks!
12:11 * jnthn ended up giving Test::Mock a way to do more interesting things (like throwing exceptions) when stubbing methods also. :)
12:12 lichtkind joined #perl6
12:12 jnthn lunch &
12:13 FROGGS pmurias++
12:18 arnsholt Ooooh, fresh 6guts-post
12:20 timotimo samcv: did anybody tell you to use [(+)] for your array of Mixes?
12:21 pmurias babydrop: complex offset calculations don't work without proper tests ;)
12:22 pmurias babydrop: I'll get round to fixing X::Syntax::Number::InvalidCharacter soon
12:31 bjz_ joined #perl6
12:31 babydrop pmurias, ohhhh
12:32 babydrop pmurias, it didn't hit me yesterday what InvalidCharacter you meant
12:32 pmurias babydrop: are you fixing it up too?
12:33 babydrop pmurias, well, yeah, I fixed it this morning. Only the 1____x ticket remains, which I'll do after work
12:35 babydrop I figured I'd fix my own mess...
12:35 pmurias babydrop: ok, I'm working on the test
12:36 lucasb joined #perl6
12:37 babydrop it's tested as part of S32-str/parse-base.t
12:38 babydrop which I plan to improve too, after work: half it and use a loop to test the method/sub forms
12:41 babydrop jesus.... you know you're half asleep when you realize your belt is unbuckled and zipped on the pants isn't closed..... and you're on your second bus stop, halfway to work :o
12:42 lucasb christ... get yourself together
12:42 babydrop :)
12:45 babydrop pmurias, but if you have bright ideas on fixing the 1__x bug feel free. I can't think of solutions I like
12:45 babydrop m: 1____x
12:45 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 17⏏5____x␤    expecting any of:␤        whitespace␤»
12:45 babydrop m: 1____
12:45 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 17⏏5____␤    expecting any of:␤        whitespace␤»
12:45 babydrop cause trailing _ aren't meant to be valid
12:46 timotimo x__X
12:46 babydrop and you need to check for that case along with adjusting ofsets if they're not trailing.
12:46 babydrop a PITA
12:46 babydrop which is why I said I regret that exception
12:48 pyrimidine joined #perl6
12:49 babydrop maybe dialing it down a bit to "could not parse base-blah number. Only blah blah chars are valid" is a more valid solution to this
12:52 AlexDaniel babydrop: but that's LTA :PP
12:54 babydrop pmurias, ^ what are your thoughts. I'm feeling good about doing that when I get home, but you said you want to write tests.....
12:55 japhb joined #perl6
12:57 eliasr joined #perl6
12:59 canopus joined #perl6
13:01 isacloud joined #perl6
13:01 babydrop AlexDaniel, not really. It's not hard to spot an offcolour digit when told which ones are valid. When the code for the tiny extra hint makes a 5-line method 75-lines long you're no longer "torturing the developer on behalf of the user" you're making your codebase dense and a bug-prone to stratch some abstract itch hiding behind a vague acronym
13:04 babydrop "12345XFA".parse-base: 16;  -> "Invalid character in base-16 number. Only 0..9, A..F, optionally preceeded by a sign and separated by underscores are valid"
13:06 babydrop m: 'f.f.f.f'.parse-base: 16
13:06 camelia rakudo-moar c4a601: OUTPUT«Invalid base-16 character '.': 3f.f7⏏5.f.f. Please use one of 0..9, A..F␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
13:06 babydrop Boom. Another bug in that error reporting ^
13:07 babydrop Yeah, it's trying to do too much.
13:07 * babydrop will gut it
13:16 lucasb I didn't fully backlog; What was said about doing something with rakudo.org website?
13:16 parisba joined #perl6
13:18 lucasb I was wondering, what's the point about maintaing both rakudo.org and perl6.org? (they are on the same webserver, right?) Maybe back in the past, rakudo was just another attempt, but now it is THE implementation. you even need a TPF CLA to commit to it. So, why not merge the contents/objectives of both sites into just one?
13:18 tbrowder .tell  gfldex yr module Typesafe::XHTML::Writer is failing tests with latest rakudo nom branch, i haven't figured out how to fix it
13:18 yoleaux 03:19Z <[Coke]> tbrowder: I will do the review over coffee in the morning!
13:18 lucasb maybe drop the wordpress thing from rakudo.org and go with static pages? keep a simple front page pointing to perl6.org
13:19 babydrop lucasb: no, they're on different servers. It's not THE implementation, it's just the most complete implementation. Perl6.org is the website for the language, while rakudo.org is the website for a compiler
13:19 lizmat babydrop: agree
13:19 yoleaux 7 Dec 2016 23:44Z <babydrop> lizmat: would you be able to test whether 2**10000000000 throws on OSX on HEAD rakudo? pmurias++ fixed RT#125938 we just need someone with OSX to verify the fix works.
13:19 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=125938
13:19 yoleaux 8 Dec 2016 15:29Z <babydrop> lizmat: disregard RE 125938. someone else helpfully tested that.
13:19 timotimo yes, rakudo.org lives on pmichaud's private server
13:19 timotimo while perl6.org lives on the p6c server
13:19 babydrop I don't see anything said about rakudo.org in recent backlog
13:19 lucasb ok, then, I accept
13:20 babydrop lizmat: about the .parse-base error?
13:20 lizmat babydrop: no, about the difference between perl6.org and rakudo.org  :-)
13:20 babydrop oh heh :)
13:22 japhb joined #perl6
13:22 lucasb oh, sorry, has been a while since I visited those sites. they have been updated :)
13:22 tbrowder fwiw, i think doing our own thing with advent blog would be a good thing (static is okay). without babydrop's code, using wordpress for a blog would be too much pain for me.  with our own process we could use p6 pod, too!
13:22 lucasb and, as was said, yeah, Rakudo Star is monthly. so it is the recommended way for a newcommer to use, right?
13:23 babydrop lucasb: right
13:24 babydrop tbrowder: well volunteered?
13:25 babydrop I think dealing with the domain name and transfering old posts is the hard part in that endeavour. Unless we just have two advent places? vOv
13:26 moritz if we run in www.p6c.org, we could use a perl6.org subdomain
13:26 moritz advent.perl6.org
13:26 lucasb no need to port the post. keep it there, as a historical archive. next year, we do like the Perl 5 folks, have a static site
13:26 timotimo tbrowder: i wouldn't want to give up the stats that wordpress gives us
13:26 tbrowder mebbe, could just ref old stuff on new site?
13:27 * babydrop is reminded of https://xkcd.com/1319/
13:27 moritz timotimo: google analytics would work on a static site too
13:27 timotimo good point
13:28 moritz the real problem is finding somebody who creates the site in the first place, and maintains it for a few years
13:28 timotimo yes.
13:28 pyrimidine joined #perl6
13:29 * babydrop is happy with his script method
13:29 mrsolo joined #perl6
13:30 babydrop Could use improvement so you wouldn't have to deal with GitHub Gists but that's minor for something done 24 times a year
13:30 timotimo that's twice per month!
13:32 babydrop Or 1/15th time each day! :o
13:32 timotimo %)
13:32 * moritz writes only 1..3 advent posts per year
13:35 AlexDaniel joined #perl6
13:37 dogbert17 o/
13:39 lucasb perl6.github.io/blog or advent  <-- use github pages as a place to host markdown pages? :)
13:39 dogbert17 does this error msg look familiar to anyone: Unhandled exception in code scheduled on thread 6
13:39 dogbert17 No such method 'consume-all-chars' for invocant of type 'Any'
13:39 dogbert17 in method throw at ./CORE.setting.moarvm line 1
13:39 dogbert17 in any  at ./CORE.setting.moarvm line 1
13:40 dogbert17 happened when I ran perl6-valgrind-m on t/spec/S17-procasync/no-runaway-file-limit.t
13:40 lizmat dogbert17: feels like the type of error you get with HARNESS_TYPE=6
13:40 lizmat and running "make spectest"
13:42 dogbert17 hmm, output of make spectest is: /usr/bin/perl t/harness5 --fudge --moar --keep-exit-code --tests-from-file=t/spectest.data
13:42 dogbert17 s/is/was/
13:44 lucasb ok, next idea is about the faqs. last edit in the faq repo was in Oct 17, 2015. what's your opinion of merging them with the doc repo, inside a subdirectory?
13:44 lucasb perl5 separates the core docs from the faqs. I think they thought the faqs was going to be edited much more frequently than the docs. but with P6, it's the other way around, the docs are updated, and the faqs never touched.
13:44 pmurias babydrop: gutting it seems sane
13:44 babydrop OK. Will do it after work.
13:45 babydrop lucasb: IIRC FAQ was already merged into doc
13:45 jnap_ joined #perl6
13:45 babydrop lucasb: I think it's now this page https://github.com/perl6/doc/blob/master/doc/Language/faq.pod6
13:45 babydrop And the old repo is just historical remains
13:47 lucasb lol, you are right, sorry, I just saw the repo name and remembered about it, didn't check its content this time.
13:47 mp joined #perl6
13:47 babydrop no problem
13:47 dogbert17 m: say 1 + (3, 5...1001).map(-> $i { ($i*$i, {$_-($i-1)}...*)[^4]}).flat.sum # port attempt of lucasb's nifty solution to Project Euler problem 28
13:47 camelia rakudo-moar c4a601: OUTPUT«669171001␤»
13:47 lucasb (I was browsing the list of repos at github.com/perl6)
13:49 dogbert17 lizmat: does running './perl6 /spec/S17-procasync/no-runaway-file-limit.t' imply HARNESS_TYPE=6 ?
13:49 lucasb wow, nice dogbert17++
13:49 lizmat dogbert17: no
13:49 perlawhirl joined #perl6
13:49 babydrop dogbert17: no
13:50 dogbert17 lizmat babydrop, running it like that gives the strange error on my 32 bit system
13:50 dogbert17 the one I posted above
13:51 lizmat I get that
13:51 lizmat it's just the type of message: complaining about a method not existing on code that clearly managed to find the object's methods before
13:52 lizmat but: fwiw, it looks like HARNESS_TYPE=6 is now clean
13:52 lizmat at least on my 64bit MacOS
13:52 dogbert17 cool, how do you like the new machine?
13:52 babydrop dogbert17: that error reminds me of this commit from yesterday: https://github.com/rakudo/rakudo/commit/58cdfd80b30444ba4755bb3fa0992f0f449f8a9e
13:53 lizmat dogbert17: it's nice, :-)   ????
13:53 lizmat the ???? I touched on the touchbar  :-)
13:53 babydrop dogbert17: and here's what the comment on that `with` used to say: https://github.com/rakudo/rakudo/commit/75322970e807c49e5e8522a7737179c3317eae2c
13:53 babydrop dogbert17: so maybe the bug that required that `with` isn't fully fixed or you're not running on latest moarvm?
13:54 dogbert17 babydrop: This is Rakudo version 2016.11-167-gdb9ae22b0 built on MoarVM version 2016.11-41-gd2139b52
13:55 dogbert17 lizmat: so you have warmed up to the touchbar then :-)
13:55 lizmat yup...
13:56 lizmat biggest thing I had to get used to is that I can no longer have a finger "resting" on the ESC key
13:56 dogbert17 are you an emacs person?
13:56 lizmat nope, vim
13:56 lizmat all the way back to using Wordstar on an  Osborne-1  :-)
13:57 babydrop dogbert17: that should have the fix in it, so perhaps that bug isn't fully fixed then
13:57 dogbert17 babydrop: I'll try without that fix
13:57 babydrop Sounds like a plan
13:57 dogbert17 babydrop: do you happen to be close to you 32 bit dev machine by any chance?
13:58 girafe joined #perl6
13:59 dogbert17 oh, Wordstar, Osborne-1, sounds a bit like early/mid eighties
13:59 babydrop dogbert17: yeah, why?
13:59 pmurias m: ".123".parse-base(10)
13:59 camelia rakudo-moar c4a601: OUTPUT«Invalid base-10 character '.': 7⏏5.123. Please use one of 0..9␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
13:59 babydrop pmurias: and that case I was planning on just making work
13:59 dogbert17 babydrop: just to check if you have the same problem
14:00 lizmat argh, no
14:00 lizmat ===Unhandled exception in code scheduled on thread 9
14:00 lizmat No such method 'made' for invocant of type 'TAP::Runner::State'
14:00 lizmat in method close-data at /Users/liz/Github/rakudo.moar/lib/TAP.pm6
14:00 dogbert17 uh oh
14:00 lizmat so we still have some instability there, but it was only after the 5th run
14:00 lizmat before, only 1 in 10 would succeeed
14:01 babydrop dogbert17: how do I check?
14:01 dogbert17 babydrop: ./perl6 /spec/S17-procasync/no-runaway-file-limit.t
14:02 babydrop That test file flops on my 24-core box
14:02 dogbert17 ok, I'll try without the commit then
14:02 prammer joined #perl6
14:02 babydrop But yeah, it uses Proc::Async and that commit made the change in that code path
14:04 dalek doc: 9f2d7fe | samcv++ | doc/Language/quoting.pod6:
14:04 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:04 dalek doc: Document that identifiers like `'` and `-` can't be used after Q…
14:04 dalek doc:
14:04 dalek doc: q, or qq
14:04 dalek doc: review: https://github.com/perl6/doc/commit/9f2d7fe704
14:04 dalek doc: fa6a04a | samcv++ | doc/Language/quoting.pod6:
14:04 dalek doc: Correct typo from last commit
14:04 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:04 dalek doc: review: https://github.com/perl6/doc/commit/fa6a04a957
14:04 dalek doc: 6c2b8b8 | samcv++ | doc/Language/quoting.pod6:
14:04 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:04 dalek doc: Mention that Q(…) won't work either.
14:04 dalek doc: review: https://github.com/perl6/doc/commit/6c2b8b857c
14:04 dalek doc: de06d83 | samcv++ | doc/Language/quoting.pod6:
14:04 dalek doc: Change Q'…' example so it doesn'nt have a `'` in the text
14:04 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:04 dalek doc: review: https://github.com/perl6/doc/commit/de06d83385
14:04 dalek doc: 65833a3 | samcv++ | doc/Language/quoting.pod6:
14:04 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:04 dalek doc: Make it more clear
14:04 dalek doc: review: https://github.com/perl6/doc/commit/65833a3a57
14:04 dalek doc: 269c47b | (Zoffix Znet)++ | doc/Language/quoting.pod6:
14:04 dalek doc: Merge pull request #1038 from samcv/signal
14:04 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:04 dalek doc:
14:04 dalek doc: Document that identifiers like `'` and `-` can't be used after Q q, or qq quoting constructs
14:04 dalek doc: review: https://github.com/perl6/doc/commit/269c47b969
14:05 dogbert17 babydrop: will start with 0089a5514be39c
14:06 cdg joined #perl6
14:11 pyrimidine joined #perl6
14:13 dalek doc: f977dd5 | (Zoffix Znet)++ | doc/Language/quoting.pod6:
14:13 synopsebot6 Link: http://doc.perl6.org/language/quoting
14:13 dalek doc: Add more to Q-delim-as-identifier quirk
14:13 dalek doc: review: https://github.com/perl6/doc/commit/f977dd5402
14:13 TimToady joined #perl6
14:16 sena_kun Hmm... There are no obvious way to "patch" some part of a regex on the fly based on previous input and I need a hand-written parser?
14:16 babydrop .tell samcv I sent you an invite to perl6 org. So you should be able to commit to docs and some other repos directly.
14:16 yoleaux babydrop: I'll pass your message to samcv.
14:17 rindolf joined #perl6
14:17 babydrop sena_kun: patch in what way?
14:17 mspo sena_kun: you mean lik a conditional part of the regex?
14:19 sena_kun mspo, something like this. My goal is to parse "Q $char any-but-not-$char $char". I doubt it is possible with usual regexes, but it's p6 after all.
14:19 babydrop m: say "foo bar" ~~ /$<bar-type>=\S+ \s+ <.before "bar"> [ <?{$<bar-type> eq "booze"}> {die "eww"} || "bar" ]/
14:19 camelia rakudo-moar c4a601: OUTPUT«「foo bar」␤ bar-type => 「foo」␤»
14:20 babydrop m: say "booze bar" ~~ /$<bar-type>=\S+ \s+ <.before "bar"> [ <?{$<bar-type> eq "booze"}> {die "eww"} || "bar" ]/
14:20 camelia rakudo-moar c4a601: OUTPUT«eww␤  in block <unit> at <tmp> line 1␤␤»
14:20 babydrop sena_kun: that  doesn't sound overly complex :)P
14:22 sena_kun babydrop, thanks for the example, I'll try to imitate it in my code. (:
14:22 babydrop nah that example is not for your thing...
14:22 babydrop It's just what I thought you meant originally :)
14:22 sena_kun Aaah.
14:22 babydrop m: say "Q |meow|" ~~ /Q \s+ $<char>=. $<stuff>=[[<!before $<char>> .]+ .] $<char>/
14:22 camelia rakudo-moar c4a601: OUTPUT«「Q |meow|」␤ char => 「|」␤ stuff => 「meow」␤»
14:23 babydrop Something like that. There's probably a much simpler way to write that
14:23 PotatoGim joined #perl6
14:23 cygx joined #perl6
14:23 cygx first draft: https://perl6advent.wordpress.com/?p=5746&amp;preview=true
14:26 babydrop hm, actually that version fails when stuff is one or no chars
14:27 sena_kun m: say "Q_meow_" ~~ /'Q' $<char>=. $<stuff>=[<!before $<char>> .]+ $<char>/;
14:27 camelia rakudo-moar c4a601: OUTPUT«「Q_meow_」␤ char => 「_」␤ stuff => 「meow」␤»
14:27 sena_kun m: say "Q_meow_" ~~ /'Q' $<char>=. $<stuff>=[<!before $<char>> .]* $<char>/;
14:27 camelia rakudo-moar c4a601: OUTPUT«「Q_meow_」␤ char => 「_」␤ stuff => 「meow」␤»
14:27 sena_kun m: say "Q__" ~~ /'Q' $<char>=. $<stuff>=[<!before $<char>> .]* $<char>/;
14:27 camelia rakudo-moar c4a601: OUTPUT«「Q__」␤ char => 「_」␤ stuff => 「」␤»
14:28 Juerd Does the difference in dashes (Day $n -) bother anyone else or is it just me? :)
14:28 babydrop m: say "Q |x|" ~~ /Q \s+ $<stuff>=[ $<char>=. ~ $<char> .+? ]/
14:28 camelia rakudo-moar c4a601: OUTPUT«「Q |x|」␤ char => 「|」␤ stuff => 「|x|」␤»
14:28 perlpilot Juerd: I didn't even notice it.
14:29 babydrop I noticed because one of them fails to be handled by reddit's autotitler but it doesn't bother me
14:29 babydrop m: say "Q |x|" ~~ /Q \s+ [ $<char>=. ~ $<char> $<stuff>=.+? ]/
14:29 camelia rakudo-moar c4a601: OUTPUT«「Q |x|」␤ char => 「|」␤ stuff => 「x」␤»
14:29 Juerd Okay, I'll assume it doesn't matter then :)
14:29 babydrop sena_kun: weee?
14:30 babydrop m: say "Q ♥meows♥" ~~ /Q \s+ [ $<char>=. ~ $<char> $<stuff>=.+? ]/
14:30 camelia rakudo-moar c4a601: OUTPUT«「Q ♥meows♥」␤ char => 「♥」␤ stuff => 「meows」␤»
14:30 prammer joined #perl6
14:31 babydrop m: say "Q ♥meows♥" ~~ /Q \s+ $<char>=. ~ $<char> $<stuff>=.+?/
14:31 camelia rakudo-moar c4a601: OUTPUT«「Q ♥meows♥」␤ char => 「♥」␤ stuff => 「meows」␤»
14:31 sena_kun babydrop, something lie this, I think. But I didn't find any presence of using "~" in regex in our docs.
14:31 sena_kun s/lie/like/
14:31 mspo I was thinking like: ^Q\s(\w)\s<-[$0]>\s$0  but it doesn't seem to work
14:31 sena_kun It doesn't seem to me like concatenation.
14:33 babydrop Nope
14:34 babydrop It's START_DELIM ~ END_DELIM STUFF_BETWEEN_DELIMS
14:34 babydrop With the caveat that you need to account for greedy matching, as it won't stop at the first END_DELIM it can
14:34 babydrop m: say "Q ♥meows♥" ~~ /Q \s+ $<char>=. $<stuff>=.+? $<char>/
14:34 camelia rakudo-moar c4a601: OUTPUT«「Q ♥meows♥」␤ char => 「♥」␤ stuff => 「meows」␤»
14:35 babydrop this works too, I guess
14:35 sena_kun Great! babydrop++, it's time for a new doc ticket...
14:35 babydrop m: say '10$#' ~~ m:g/<-[$0]>/
14:35 camelia rakudo-moar c4a601: OUTPUT«(「1」 「#」)␤»
14:36 babydrop sena_kun: the course I learned that from says the ~ version gives better error reporting but I never understood or saw it.
14:36 babydrop It's used all over the place in Rakudo tho
14:36 mspo why isn't mine working?
14:37 mspo can I not sure a capture in the character class?
14:37 babydrop mspo: see my eval ebove. It's treating the dollar and zero literally, because it's in char class
14:37 sena_kun But non-greedy version is slightly more useful for me, so I'll stick with it.
14:37 babydrop You can write that as <!$0>+, but that'll likely hang because that matches "nothing" too
14:38 babydrop maybe <!$0<?[.]>> or something
14:38 mspo you lost me on that one :)
14:38 babydrop .tell dogbert17 I get same No such method 'consume-all-chars' for invocant of type 'Any' on my 32-bit box after 3 tries
14:38 yoleaux babydrop: I'll pass your message to dogbert17.
14:39 babydrop mspo: `<!` (not)  `$0` (the capture)  `<?[.]>` (look ahead, looking for a dot... and yeah, that was wrong, I guess it should be a lookahead for a "char" and not a dot, but then again, I don't know how that would work with the `<!` not at the start)
14:39 * babydrop &
14:40 mspo <!before>
14:40 mspo I was initially thinking of lookarounds but idk
14:40 mspo it's early
14:41 khw joined #perl6
14:41 babydrop m: say "Q |x|" ~~ /Q \s+ (.) <!$0 <before .> > $0/'
14:41 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at <tmp>:1␤------> 3say "Q |x|" ~~ /Q \s+ (.) <!$07⏏5 <before .> > $0/'␤»
14:41 dogbert17 babydrop: 99% certain that it is 58cdfd80b30444 which breaks t/spec/S17-procasync/no-runaway-file-limit.t
14:41 yoleaux 14:38Z <babydrop> dogbert17: I get same No such method 'consume-all-chars' for invocant of type 'Any' on my 32-bit box after 3 tries
14:41 babydrop well, alrighty then...
14:42 babydrop dogbert17: check with jnthn++ about it, 'cause he fixed the bug that allowed that commit.
14:42 babydrop m: say "Q |x|" ~~ /Q \s+ (.) [<!$0> <before .>]+ $0/
14:42 dogbert17 babydrop: ok
14:43 camelia rakudo-moar c4a601: OUTPUT«(timeout)»
14:43 babydrop oh wait, that won't work, cause "nothing before something" still matches nothing without moving forward :}
14:43 * babydrop &
14:43 lucasb what's the explanation for not allowing single quotes as delimiter in Q'...' ?
14:44 moritz m: say Q'a'
14:44 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say Q'a7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier␤        s…»
14:44 moritz lucasb: oh, it's ambiguous with identifier syntax
14:44 moritz Q'a is a valid identifier
14:44 lucasb ah, right
14:44 lucasb I forgot about that
14:47 babydrop lucasb: they are allowed.
14:47 babydrop m: say Q 'weeee'
14:47 camelia rakudo-moar c4a601: OUTPUT«weeee␤»
14:48 lucasb q-foo-  # Missing required term after infix
14:48 lucasb q'foo'  # Two terms in a row
14:48 babydrop You just need to disambiguate that you're not writing an identifier by adding the space
14:48 lucasb ^^ interesting, I would say the 2 are of the same kind of identifier error, but they give differents error
14:48 babydrop nope
14:49 babydrop lucasb: $<identifier>=q-foo $<infix>='-' .... -> missing term after infix
14:50 babydrop as for ttr, dunno, maybe it's parsing the second quote as start of a quoted string
14:50 babydrop m: q'foo'123'
14:50 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3q'foo7⏏5'123'␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        statement modifie…»
14:51 babydrop m: sub q'foo ($) { }; q'foo'123'
14:51 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3sub q'foo ($) { }; q'foo7⏏5'123'␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤      …»
14:51 babydrop m: sub q'foo ($) { }; q'foo '123'
14:51 camelia rakudo-moar c4a601: ( no output )
14:51 babydrop seems to
14:51 babydrop damn
14:51 babydrop Perl 6 is way more interesting than my job :P
14:51 * babydrop leaves again, in an attempt to do Actual Work™ for a change
14:54 babydrop lucasb: the ' and - are not allowed to be at the end of the identifier, so the second ones don't parse as part of the identifier, hence the different error messages.
14:55 lucasb token identifier { <.ident> [ <.apostrophe> <.ident> ]* }
14:55 lucasb It would arguably be a good idea to give a warning if the production matches <apostrophe> at the end of the identifier token?
14:56 lucasb I think Haskell people expects function' to work
14:56 babydrop m: sub function' {}
14:56 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub function7⏏5' {}␤    expecting any of:␤        new name to be defined␤»
14:57 babydrop m: constant function' = 42
14:57 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing initializer on constant declaration␤at <tmp>:1␤------> 3constant function7⏏5' = 42␤»
14:57 lucasb m: sub ::("foo'") { 42 }; say ::("&foo'")()
14:57 camelia rakudo-moar c4a601: OUTPUT«42␤»
14:58 babydrop :o
14:59 babydrop m: sub term:<''''''''''> { 42 }; say ''''''''''
14:59 lucasb obviously, calling it like foo'() doesn't work :)
14:59 camelia rakudo-moar c4a601: OUTPUT«42␤»
15:00 babydrop m: sub term:<''''''''''> { * + 42 }; say '''''''''(4)
15:00 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3sub term:<''''''''''> { * + 42 }; say ''7⏏5'''''''(4)␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement en…»
15:01 babydrop m: sub term:<''''''''''> { * + 42 }; say '''''''''.(4)
15:01 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3sub term:<''''''''''> { * + 42 }; say ''7⏏5'''''''.(4)␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement e…»
15:01 babydrop ewird
15:01 babydrop m: sub term:<''''''''''> { * + 42 }; say ''''''''''(4)
15:01 camelia rakudo-moar c4a601: OUTPUT«46␤»
15:02 pyrimidine joined #perl6
15:02 babydrop m: sub term:<foo'> { *.is-prime }; say foo'(31337)
15:02 camelia rakudo-moar c4a601: OUTPUT«True␤»
15:02 Xliff joined #perl6
15:02 babydrop \o/
15:03 lucasb oh! bind a term to a subroutine!
15:03 lucasb babydrop++
15:07 pyrimidine joined #perl6
15:09 pyrimidine joined #perl6
15:10 lucasb m: say sub { $^a }.('ok')
15:10 camelia rakudo-moar c4a601: OUTPUT«ok␤»
15:10 prammer joined #perl6
15:10 lucasb m: say -> { $^a }.('ok')
15:10 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Placeholder variable '$^a' cannot override existing signature␤at <tmp>:1␤------> 3say 7⏏5-> { $^a }.('ok')␤»
15:11 lucasb -> {} auto declares some signature?
15:11 babydrop empty one. same as sub () { }
15:11 lucasb can't it has a "blank" signature like sub {} ?
15:11 babydrop yes, that's just {}
15:11 babydrop without the arrow thing
15:11 babydrop m: say { $^a }('ok')
15:11 camelia rakudo-moar c4a601: OUTPUT«ok␤»
15:13 lucasb sometimes you want a subroutine that returns a callable
15:13 lucasb you could just write sub foo { { $^a + $^b } }, but this doesn't work, it's ok, understandable
15:14 lucasb now, you could just write sub foo { -> { $^a + $^b } }, but this doesn't work too
15:14 lucasb sub foo { sub { $^a + $^b } }, works alright
15:15 lucasb the second case is the one I'm complaing about. can't ->{...} be made to work the as sub {...} ?
15:15 babydrop m: sub gimme { return { $^a } }; my $callable = gimme; say $callable(42)
15:15 camelia rakudo-moar c4a601: OUTPUT«42␤»
15:16 lucasb oh, right, using return does the trick. thanks babydrop++, I didn't think about that
15:17 cdg_ joined #perl6
15:17 [Coke] pmurias++ #
15:18 skids joined #perl6
15:21 lucasb one more question, sorry
15:21 lucasb how can I create an alias of a sub or method?
15:21 lucasb like P5 '*foo = \&bar'
15:21 babydrop m: my &shout-loudly = &say; shout-sloudly 'meow'
15:21 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    shout-sloudly used at line 1. Did you mean 'shout-loudly'?␤␤»
15:21 babydrop :(
15:21 babydrop oh
15:22 babydrop m: my &shout-loudly = &say; shout-loudly 'meow'
15:22 camelia rakudo-moar c4a601: OUTPUT«meow␤»
15:22 babydrop \o/
15:22 lucasb easy! I should have thought more before asking. thanks again babydrop
15:22 babydrop any time.
15:25 lucasb class C { method foo { 42 }; my &bar = &foo }; say C.bar   # nope, this doesn't work. will need a little more tweaking
15:27 jnthn BEGIN C.^add_method('bar', C.^lookup('foo'));
15:28 jnthn Or similar
15:29 lucasb jnthn: I'll try, thanks!
15:30 lucasb ruby has an 'alias' instruction
15:30 perlpilot Is there a way to do something like multi sub foo(%h where %h<foo> eq 'bar') { }  but without the where clause?
15:30 babydrop m: class C { method foo { 42 }; BEGIN ::?CLASS.^add_method("bar", ::?CLASS.^lookup("foo")); }; say C.bar
15:30 camelia rakudo-moar c4a601: OUTPUT«42␤»
15:30 babydrop \o/
15:30 babydrop perlpilot: nope
15:30 lucasb I remember lizmat once wrote a trait named "aka" to use with methods, but it was removed from core
15:30 babydrop perlpilot: well, you can define a subset, but that'd still have a where clause
15:31 babydrop perlpilot: you can also use .<foo> instead of %h<foo> to avoid variable duplication
15:31 perlpilot yeah, I thought so.
15:31 babydrop perlpilot: oh
15:31 babydrop perlpilot: maybe there's a way with unpacking? I don't know anything about that
15:31 perlpilot I was hoping for something like  multi sub foo(%h ( :foo<bar> )) { }
15:32 lucasb anyway, I'll just leave here my wish that aliasing methods could be easier and builtin into the language with a little sugar
15:32 jnthn Well, tbh it's shorter just to write method bar(|c) { self.foo(|c) } if you've just one of them :)
15:33 jnthn Alternatively, look into FALLBACK
15:33 lucasb jnthn: I agree, but sometimes it could be desiredable to avoid the extra call
15:33 lucasb (maybe there's some optimization with regard to this that this difference wouldn't matter)
15:35 babydrop .oO( premature optimization is the root..... )
15:36 jnthn What's the use case for aliasing the same functionality with two names, ooc?
15:36 lucasb the possibility to create inconsitent named codebases :)
15:37 lucasb just kidding, idk, personal preference
15:37 perlpilot building a DSL where either name makes sense?
15:37 lucasb ruby has size/length aliased for most compound things
15:38 perlpilot I've occasionally wished that grep was named filter, but that's only when explaining grep to someone else
15:38 lucasb and yet, someone else prefered grep to be named 'where'
15:39 lucasb both of you would be happy with just alias &grep, 'filter'; alias &grep, 'where' :)
15:39 babydrop Clearly we need configurable method names!!! :D
15:39 babydrop done during installation
15:39 lucasb alias($target, $linkname) or alias($linkname, $target) or some other funky syntax
15:39 pmurias jnthn: any idea why this test for repossesion fails: http://paste.scsys.co.uk/540142 ?
15:40 perlpilot don't some JS frameworks have a thing called "select" that works like grep?
15:41 pmurias jnthn: by fail I mean why doesn't the object get a new value
15:41 perlpilot Use all the names :)
15:42 pmurias perlpilot: ruby does use select
15:45 jnthn pmurias: I suspect because the SC name is singificant for such tests
15:45 jnthn And 'TEST_SC_1_OUT' ne 'TEST_SC_1_IN'
15:47 pmurias jnthn: thank you, fixed the problem
15:50 babydrop samcv: fun glitch of perl6fe highlighter. The 'regex' gets interpreted as a regex method-thing, I guess? Messes up 30 lines: https://github.com/rakudo/rakudo/blob/c4a60110ef4282096697871c665c6b059d6cdebc/src/Perl6/Actions.nqp#L7676
15:50 prammer joined #perl6
15:52 pmurias jnthn: nqp::deserialize doesn't set the conflicts array on the jvm, is that a problem?
15:54 babydrop ooops
15:54 lucasb glitch in syntax highlighter? I found one in vim perl6 syntax
15:54 babydrop m: say 'foo'.match: :g, /x/
15:54 camelia rakudo-moar c4a601: OUTPUT«()␤»
15:54 lucasb is literal maintainig it?
15:54 babydrop for some reason that code killed commitable
15:54 lucasb can someone confirm? '$a <= $b and foo
15:55 lucasb after, "<=" everything turns into quoting color :)
15:55 babydrop .ask AlexDaniel did you say you gave anyone who wanted access to server with the bots? Any way for me to get it and to be taught to restart the bots after I murder them?
15:55 yoleaux babydrop: I'll pass your message to AlexDaniel.
16:00 psch m: sub f(@a [4, *@rest]) { }; say f [1, 2]
16:00 camelia rakudo-moar c4a601: OUTPUT«Constraint type check failed for parameter '<anon>' in sub-signature of parameter @a␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
16:00 psch m: sub f(%h {:foo<bar>}) { }
16:00 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub f(%h 7⏏5{:foo<bar>}) { }␤»
16:00 psch m: sub f(%h (:foo<bar>)) { }
16:00 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3sub f(%h (:7⏏5foo<bar>)) { }␤»
16:00 psch feels like that should work, for consistency if nothing else
16:01 perlpilot psch: I agree :)
16:01 psch hm, not sure on the unpack with { } though
16:01 psch s/on/about/
16:02 gfldex tbrowder: i will have a look at the failing tests
16:02 psch well, i've gotta go get groceries, bbl o/
16:03 tbrowder gfldex: thanks!
16:06 jnthn pmurias: I *think* it's an NYI
16:19 [Coke] (rakudo star isn't necessarily monthly)
16:20 lucasb I only said that because I felt the need for having direct hyperlinks to moarvm/nqp/rakudo monthly tarballs right in the front page of either rakudo.org or p6.org
16:21 lucasb but then, if R star is *almost* monthly, there's no need to publicize the 3 tarballs packages (I assume)
16:22 babydrop We restrict the announcement of other deliverables to perl6-compiler only, to avoid confusion in general public
16:22 lucasb I understand
16:23 babydrop *perl6-compiler@perl.org mailing list I meant
16:26 lucasb I thought one argument for the method aliases. P6 already has named params aliases like 'sub f(:a(:b(:$c)))'. I think the purpose of them is "interface convenience". method aliases would also help in this aspect.
16:27 lucasb did TimToady explicit rejected this idea before? sure it has been proposed before
16:28 * [Coke] sees no context on "method aliases"
16:28 [Coke] link to previous convo?
16:29 lucasb [Coke]: start on the backlog in:
16:29 lucasb 13:21 < lucasb> how can I create an alias of a sub or method?
16:29 babydrop [Coke]: https://irclog.perlgeek.de/perl6/2016-12-09#i_13710972
16:29 * babydrop is happy with the current way to do it
16:30 babydrop Especially if there was already an `aka` trait which was rejected from core...
16:30 [Coke] could easily write 'alias' in userspace.
16:31 lucasb [Coke]: is needs to run at BEGIN time
16:31 [Coke] you can write BEGIN in userspace :)
16:31 lucasb I mean, it's possible, but won't pretty having to type 'BEGIN' in the middle of the class
16:32 jnthn So put it in a trait?
16:32 lucasb ah, right
16:33 jnthn Then you can method bard() is aliased<bar ba b> { } or so
16:33 lucasb jnthn: thanks. I'll search how to do it
16:33 jnthn afk for a bit
16:38 babydrop star: "foo" ~~ S:2nd/o/x/; dd $/
16:38 camelia star-m 2016.10: OUTPUT«Potential difficulties:␤    Smartmatch with S/// is not useful. You can use given instead: S/// given $foo␤    at <tmp>:1␤    ------> 3"foo" ~~ 7⏏5S:2nd/o/x/; dd $/␤Str $/ = "fox"␤»
16:39 * babydrop notices that warning is kinda bogus, since $/ contains the result...
16:39 psch star: say "foo" ~~ S:2nd/o/x/; dd $/
16:39 camelia star-m 2016.10: OUTPUT«Potential difficulties:␤    Smartmatch with S/// is not useful. You can use given instead: S/// given $foo␤    at <tmp>:1␤    ------> 3say "foo" ~~ 7⏏5S:2nd/o/x/; dd $/␤False␤Str $/ = "fox"␤»
16:40 psch babydrop: i think the warning is about what the smart match returns
16:41 babydrop star: say "foo" ~~ S:2nd/o/x/ andthen $/
16:41 camelia star-m 2016.10: OUTPUT«Potential difficulties:␤    Smartmatch with S/// is not useful. You can use given instead: S/// given $foo␤    at <tmp>:1␤    ------> 3say "foo" ~~ 7⏏5S:2nd/o/x/ andthen $/␤WARNINGS for <tmp>:␤Useless use of $/ in sink context (line 1)␤False␤»
16:41 babydrop Yeah... I was just idly noticing stuff :)
16:42 psch m: say S:2nd/o/x/ given "foo"
16:42 camelia rakudo-moar c4a601: OUTPUT«fox␤»
16:42 babydrop m: say S:2nd/o/x/ with "foo"
16:42 camelia rakudo-moar c4a601: OUTPUT«fox␤»
16:42 * babydrop likes .subst: anyway
16:42 psch m: "foo".subst: anyway
16:42 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    anyway used at line 1␤␤»
16:42 psch :P
16:43 babydrop heh
16:43 psch m: class A { has $.x }; sub f(A.new(:4x)) { }
16:43 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3class A { has $.x }; sub f(A7⏏5.new(:4x)) { }␤    expecting any of:␤        constraint␤        formal parameter␤»
16:43 psch are literal Pairs special enough to not fall into that ^^^ kind of "doesn't work"?
16:44 psch 'cause that's what occured to me while walking to the store
16:44 psch i think probably constant folding is involved there somewhere and i'm not sure we do that -- or want to, either
16:49 gfldex tbrowder: can reproduce and believe to know where it comes from
16:52 lichtkind_ joined #perl6
17:00 nine Perl 6 is so lovely :)
17:00 nine Organizing my pictures by date: perl6 -e 'use Image::EXIF:from<Perl5>; my $source = "/run/media/nine/NO_NAME/DCIM/102NIKON"; for $source.IO.dir -> $file { next unless $file.extension ~~ rx:i/jpg/; my $exif = Image::EXIF.new($file); my ($y, $m, $d) = split /<[\:\ ]>/, $exif.get_image_info{"Image Created"}; my $date = "$y-$m-$d"; mkdir $date unless $date.IO.e; $file.copy("$date/" ~ $file.basename) }'
17:01 babydrop :)
17:01 nine Then I just look through the pictures and add some description of the event to the folder's name and be done with it.
17:01 nine I think, this is actually the first time, I've used Inline::Perl5 for my own purpose *g*
17:01 wamba joined #perl6
17:01 babydrop lol
17:12 gfldex tbrowder: fixed, version bumped
17:23 gfldex nine: i agree on the loveliness. I just fixex a module of mine by spotting a line that should have use a certain idiom (inplace change of a List) but didn't. I didn't have to understand what that line actually does. Just using the right idiom fixed the problem.
17:31 tbrowder gfldex: thanks! i look forward to using it.
17:36 RubioTerra joined #perl6
17:42 RubioTerra Hi, I was working on a grammar and found that matching against an array of alternatives is way slower than to use a normal alternation. Is this expected? Let me explain.
17:43 RubioTerra This is slow: my @options = <one two>; token mytoken { $<name>=@options }
17:43 RubioTerra This is about 10x faster: token mytoken { $<name>=[ 'one' | 'two' ] }
17:44 xinming_ joined #perl6
17:44 babydrop RubioTerra: not sure about "expected". It's just grammars aren't yet optimized
17:45 babydrop And I guess you get the impact from variable interpolation too, which I know is slow ATM
17:45 psch there's also a bug hiding in array interpolation in regex
17:45 babydrop yeah
17:49 domidumont joined #perl6
17:50 jnthn The alternation syntax with | matches the longest option
17:51 jnthn Quite aside from the indirection of the array, for the literal case it can compile it into an automata that is used to quickly figure out which, if any, option matches
17:51 jnthn whereas for the array case it needs to consider the lot
17:52 jnthn (OK, it can sort by length, but that's still considering everything in the array)
17:52 jnthn If getting the longest alternative isn't important, $<name>=[|| @options] may come out faster
17:54 xinming joined #perl6
17:55 jnthn pmurias++ # rakudo.js update
17:55 jnthn And for rakudo.js too :)
17:59 psch hm, i'm actually just now getting confused again about #126713
17:59 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=126713
17:59 psch m: say "abcd" ~~ /^(a | b | bc | cd)*?$/;
17:59 camelia rakudo-moar c4a601: OUTPUT«「abcd」␤ 0 => 「a」␤ 0 => 「b」␤ 0 => 「cd」␤»
17:59 psch that matches 'a', then 'bc', then can't match 'd' anymore, backtracks out of 'bc' to 'b' and then matches 'cd', right?
18:01 psch if that's true then the buggy array interpolation isn't necessarily about array interpolation but about "when do we backtrack" i think..?
18:01 psch m: my @a = < a b bc cd >; say "abcd" ~~ /^(@a)+$/
18:01 camelia rakudo-moar c4a601: OUTPUT«Nil␤»
18:04 jnthn I suspect the interpolation thing isn't be smart enough to backtrack
18:05 labster joined #perl6
18:08 RubioTerra joined #perl6
18:08 RubioTerra Let me try Jonathan's suggestion: '$<name>=[|| @options]'
18:10 RubioTerra It doesn't make much difference...
18:13 lukaramu joined #perl6
18:15 babydrop woo... sticking QAST::Op.new( :op('say'), .... ) with a curse word fixes the bug!
18:18 babydrop The fact that ends up on screen is just a minor side effect...
18:18 babydrop git commit; git push;
18:18 psch missing a '-m fix it'
18:18 psch :P
18:18 psch ...well, plus quotes -- or minus 'it' i guess
18:23 lucasb joined #perl6
18:26 AlexDaniel joined #perl6
18:27 skrshn joined #perl6
18:30 lucasb m: use v6.b
18:30 camelia rakudo-moar c4a601: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤No compiler available for Perl v6.b␤at <tmp>:1␤------> 3use v6.b7⏏5<EOL>␤»
18:30 lucasb ^^ did this ever worked in the pre-xmas era?
18:31 * psch would've asked commitable
18:31 lucasb when v6.d gets released, all 'use v6.c' programs will die like this?
18:31 psch but well :S
18:31 lucasb yes, I looked for commitable too
18:31 psch lucasb: hopefully not, but i don't know how far along efforts are to keep versioned compiler instances version-compliant
18:31 lucasb he was nowhere to be found
18:32 psch i'd speculate that 'use v6.c' would only die on 6.d features used in a scope where it's active
18:32 lucasb psch: ah, ok. I am not updated with regard compiler-vs-language version plans
18:33 psch lucasb: well, "only support the latest language version" is the easy solution, but we're kind of in the habit of tormenting implementors... :)
18:34 committable6 joined #perl6
18:34 benchable6 joined #perl6
18:34 babydrop yey
18:34 lucasb yay, thanks
18:34 psch committable6: 2015.11 use v6.b
18:34 committable6 psch, ¦«2015.11»:
18:34 lucasb right, it worked before
18:34 * psch isn't gonna volunteer for multiple language version inside one compiler
18:35 lucasb committable6: 2015.09 use v6.a
18:35 committable6 lucasb, ¦«2015.09»: ===SORRY!=== Error while compiling /tmp/uMi_iB7Ma_␤Confused␤at /tmp/uMi_iB7Ma_:1␤------> use v6.⏏a «exit code = 1»
18:35 lucasb committable6: 2015.11 use v6.a
18:35 committable6 lucasb, ¦«2015.11»: ===SORRY!=== Error while compiling /tmp/5Cm7KC45Ss␤No compiler available for Perl v6.a␤at /tmp/5Cm7KC45Ss:1␤------> use v6.a⏏<EOL> «exit code = 1»
18:35 psch lucasb: 6.b was 6.beta
18:35 lucasb 6.a was advent :)
18:35 AlexDaniel psch: in these situations perhaps you can try asking bisectable :D
18:35 yoleaux 15:55Z <babydrop> AlexDaniel: did you say you gave anyone who wanted access to server with the bots? Any way for me to get it and to be taught to restart the bots after I murder them?
18:35 psch but only as a language i think?
18:35 lucasb ah, ok
18:35 AlexDaniel babydrop: yes, I need your public key
18:36 psch AlexDaniel: yeah, didn't occur to me.  i mean, i knew which rakudo version i wanted, soo... :)
18:36 psch AlexDaniel: as in, not a case of "dear bot, please find where it worked"
18:36 AlexDaniel bisectable6: old=2015.09 new=2015.09 say ‘woohooo, committable!’
18:36 bisectable6 AlexDaniel, On both starting points (old=2015.09 new=2015.09) the exit code is 0 and the output is identical as well
18:36 bisectable6 AlexDaniel, Output on both points: woohooo, committable!
18:36 psch ...that feels wrong somehow :P
18:36 labster joined #perl6
18:37 psch lucasb: in any case, we definitely need a way to internally designate parts of the language as "belongs to this version"
18:37 babydrop AlexDaniel: last one in the list: https://github.com/zoffixznet.keys
18:37 psch lucasb: that's probably kinda hard though, and idk if we have anyone already thinking about it
18:37 Von_Cheam joined #perl6
18:37 lucasb AlexDaniel: can you make it accept a parameter 'bisectable6: exact=2015.09' that means the same as 'old=* new=*' for the same release ? :)
18:38 AlexDaniel lucasb: what would that mean?
18:38 AlexDaniel exact=2015.09 would mean old=2015.09 new=2015.10 ?
18:38 lucasb exact=2015.09 would mean the same as 'old=2015.09 new=2015.09', just that
18:38 AlexDaniel but that's just one commit
18:39 mohae_ joined #perl6
18:42 Von_Cheam Hey, all. Is there any chance anybody give me a simple example of code which uses the Perl6 NCurses wrapper module to read user-input strings? (I can output to the terminal just fine using the examples here [https://github.com/azawawi/perl6-ncurses/tree/master/examples], but can't figure out how to read anything in from the terminal..)
18:44 leedo_ joined #perl6
18:45 lucasb aww, perl 5 doesn't understand the version syntax :(
18:45 lucasb $ perl v6.pl   # Perl v6.0.0 required--this is only v5.24.0
18:45 lucasb $ perl v6c.pl  # syntax error at v6c.pl line 1, near "use v6."
18:45 babydrop Von_Cheam: never heard of that module, but this line suggests getch would return a code for a key pressed maybe? https://github.com/azawawi/perl6-ncurses/blob/master/examples/hello-world.pl6#L15
18:46 AlexDaniel committable6: all use v6.b
18:46 committable6 AlexDaniel, https://gist.github.com/574d3e47202e39513dff071c15242c9c
18:46 lucasb (I should have showed the command line was: perl -e 'use v6.c' )
18:47 AlexDaniel committable6: 6b use v6.b
18:47 committable6 AlexDaniel, ¦«6b»: Cannot find this revision
18:47 AlexDaniel committable6: v6.b use v6.b
18:47 committable6 AlexDaniel, ¦«v6.b»:
18:47 AlexDaniel there's v6.b tag? :o
18:47 lucasb right, when 2015.12 was released, the version was just incremented
18:48 psch committable6: v6.a 1
18:48 committable6 psch, ¦«v6.a»: Cannot find this revision
18:48 lucasb the was no nested version scope in place
18:48 lucasb *there was no...
18:49 babydrop Von_Cheam: umm.... I've no idea how to switch to 11th window in WeeChat, so I've no idea what you're trying to /msg me
18:49 psch babydrop: /w doesn't work?
18:50 psch babydrop: or /window for that matter
18:50 babydrop nope
18:50 babydrop "end of WHO list"
18:50 psch babydrop: how bout ^N or ^P until you're there..?
18:50 * psch never even saw WeeChat
18:51 Von_Cheam babydrop: Sorry - meant to reply to you, but am new to IRC (and Perl 6..)
18:51 babydrop Well, this was a waste of time....
18:52 babydrop Von_Cheam: just type a couple of chars of the nick and hit TAB key that should nick-complete and you can respond in channel
18:52 babydrop Von_Cheam: and yeah, an Int from getch makes sense to me. It's a key code.
18:52 babydrop It's probably some ASCII stuff innit?
18:52 babydrop m: say 'A'.ord
18:52 camelia rakudo-moar c4a601: OUTPUT«65␤»
18:52 * lucasb didn't know ^N ^P switched windows in irssi. he used alt-left alt-right
18:53 Von_Cheam babydrop: I figured as much; that means I'll have to figure out the encoding in use, etc. etc., right?
18:53 Von_Cheam babydrop: Was hoping not to have to do that, given that GNU ncurses can return strings, etc..!
18:54 babydrop No idea, I've never used ncurses
18:55 lucasb Von_Cheam: you don't want the function getstr?
18:56 AlexDaniel m: say ‘l’.ord
18:56 camelia rakudo-moar c4a601: OUTPUT«108␤»
18:56 psch getstr takes a char** from the caller where it stuffs the result into
18:56 psch and, well, it's a getch() loop until KEY_RETURN
18:57 AlexDaniel .oO( sometimes such stupid things give a good laugh after a good stressful day )
18:57 Von_Cheam lucasb: using getstr gives me this: Calling getstr() will never work with declared signature (Str --> int32)
18:58 Von_Cheam I figure the best thing for me to do would be try to coerce getch() output to string, probably..
18:58 lucasb int getstr(char *str);
18:58 lucasb sub getstr(Str) returns int32
18:59 lucasb well, it's C vs Perl 6 interface
18:59 lucasb C expects a string pointer to put the result there, right?
19:00 Von_Cheam lucasb: Ah, I see!
19:00 lucasb if I call P6 getstr($str), will the string be put into $str ?
19:01 psch i think that works with 'is rw'?  i'm really not that fluid in NC...
19:02 Von_Cheam lucasb: Trying that causes a segfault..
19:02 lucasb /o\
19:05 Von_Cheam lucasb: using getch() and coercing with $var.Str() works (sort of!) so I'll go with that for now; thanks anyhow!
19:09 pyrimidine joined #perl6
19:14 espadrine joined #perl6
19:21 lucasb hmm, interesting
19:21 lucasb m: my (42,) = 21
19:21 camelia rakudo-moar 524368: ( no output )
19:21 lucasb m: (42,) = 21
19:21 camelia rakudo-moar 524368: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
19:21 babydrop my () is buggy
19:21 Von_Cheam left #perl6
19:22 lucasb they should make my lists and signature lists distinct things
19:22 babydrop m: my ($x where {$_ ~~ Int and $_ == 42}) = "lulz nope";
19:22 camelia rakudo-moar 524368: ( no output )
19:23 * babydrop is hoping to crack that one on the weekend
19:26 psch actually, i think we should make my-lists and signature-lists more alike :P
19:27 psch m: sub f(@a ($h, *@t)) { say "head $h and tail @t[]"; [$h, @t] }; my (@a [$h, *@t]) = f [1, 2, 3]; say $h # this should totally work
19:27 camelia rakudo-moar 524368: OUTPUT«head 1 and tail 2 3␤(Mu)␤»
19:27 babydrop Well, the my () is already parsed with <signature> token :)
19:28 psch right, but there's probably something with $*IN_DECL or so that makes it different
19:28 babydrop will take a look.
19:28 psch orrr maybe my favorite doodad EXPR :P
19:28 babydrop There's a ticket for where broken but I'll check the unpacking too
19:30 lucasb psch: I agree that most features should work in both contexts, but somethings just doesn't make sense in 'my' lists
19:30 lucasb m: my (1,2,3)
19:30 camelia rakudo-moar 524368: ( no output )
19:30 psch that could get a "useless use ... in sink context" warning i guess
19:31 lucasb m: my @a = my (1,2,3); say @a
19:31 camelia rakudo-moar 524368: OUTPUT«[(Any) (Any) (Any)]␤»
19:31 psch although 'my (1, $x, *@rest) = ...' seems okay for "only allow assigning arrays that have 1 as 0th element"
19:32 lucasb that's a lot of magic what you are asking :)
19:32 psch nah, it's just consistency
19:32 psch with signatures, specifically
19:32 lucasb sub f(Int); f(@a) doesn't work
19:32 psch m: sub f(Int(Cool) $x) { say $x }; f [1, 2 ,3]
19:32 camelia rakudo-moar 524368: OUTPUT«3␤»
19:33 psch oh really :P
19:33 psch m: sub f(Int $x) { say $x }; f [1, 2 ,3]
19:33 camelia rakudo-moar 524368: OUTPUT«Type check failed in binding to $x; expected Int but got Array ($[1, 2, 3])␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
19:33 * psch stops snarking
19:33 psch lucasb: you are actually right.  the actual syntax for the feature i was thinking of above would be different
19:34 psch lucasb: it would have to be 'my @ (1, *@rest) = ...' to get the unpack going in the first place
19:34 psch lucasb: so, yes, it's not a my-list in the same sense -- i'd have to bind to get that
19:34 psch i.e. 'my (1, @a) := [1, [2, 3]]', and that actually is something completely different
19:34 psch lucasb: so yes, you're right, that is the wrong kind of magic
19:35 psch as in, it doesn't really follow the same consistency rules
19:38 pyrimidine joined #perl6
19:51 kyclark joined #perl6
19:53 jnthn I think much of the confusion would be avoided if the thing that produces a list and declarations for list assignment to work on would complain reliably if you used things that are too complex for that
19:53 jnthn Unpacking is a binding thing, not a list-assignment thing.
19:54 psch so we need more clarity around both types of infix:<=>?
19:54 RabidGravy moritz, no not a burden :)
19:54 zakharyas joined #perl6
19:55 jnthn my ($a, $b) = @c; # really sugar for: my $a; my $b; ($a, $b) = @c
19:55 jnthn Anything that is too complex to transform into declarations and a list assignment should be rejected outright
19:56 RabidGravy but the 12th slot was something I picked up because no-one else wanted it
19:56 jnthn my ($a where Int|Num, Str $b) = @c; # OK, because you can turn it into my $a where Int|Num; my Str $b; ($a, $b) = @c
19:56 jnthn But things with named parameters or sub-signatures or slurpies are no-go
19:57 jnthn (You need binding to do that)
19:57 psch jnthn: so we only know after finding (or not) the ':' whether the LHS is legal?
19:57 psch that is, the ':' in ':='
19:59 kyclark Is it possible to get the values of my enum e.g., enum Rank <NA Recruit Private PSC PFC Specialist>;
19:59 psch m: enum Rank <NA Recruit Private PSC PFC Specialist>; say Rank::.values
19:59 camelia rakudo-moar 524368: OUTPUT«(PFC Specialist Private Recruit NA PSC)␤»
20:01 kyclark When I try this in my code:
20:01 kyclark put "--rank must be one of: ", Rank::values.join(', ')
20:01 kyclark I get “Could not find symbol '&values’”
20:01 lucasb note the dot
20:01 kyclark Oh!  Sorry.
20:02 babydrop m: enum Rank <NA Recruit Private PSC PFC Specialist>; say Rank.enums
20:02 camelia rakudo-moar 524368: OUTPUT«Map.new((:NA(0),:PFC(4),:PSC(3),:Private(2),:Recruit(1),:Specialist(5)))␤»
20:02 babydrop also that
20:03 jnthn psch: Correct; we actually decide what to do with it after seeing whether it's a = or a :=
20:03 jnthn bbiab
20:04 kyclark Thanks, babydrop, I like that better.  To keep them in order, I’m doing this:
20:05 kyclark m: enum Rank <NA Recruit Private PSC PFC Specialist>; put Rank.enums.sort(*.value)>>.key
20:05 camelia rakudo-moar 524368: OUTPUT«NA Recruit Private PSC PFC Specialist␤»
20:05 kyclark (NA Recruit Private PSC PFC Specialist)
20:05 RabidGravy jnthn, btw https://github.com/jonathanstowe/Manifesto/blob/master/example/schedule was closer to what I hat in mind when I made Manifesto but I don't want to show my complete hand ;-)
20:05 kyclark Is that the bestest way?
20:05 rurban joined #perl6
20:05 babydrop kyclark: I think so. There's some other method that has them in order already, but it has an internalish smell to it
20:06 babydrop m: enum Rank <NA Recruit Private PSC PFC Specialist>; Rank.HOW.^methods».name.say
20:06 camelia rakudo-moar 524368: OUTPUT«(archetypes new new_type add_parent add_enum_value set_export_callback enum_values elems enum_from_value enum_value_list compose compose_values set_composalizer composalize is_composed role_typecheck_list submethod_table add_role can does generate_mixin rw…»
20:06 babydrop m: enum Rank <NA Recruit Private PSC PFC Specialist>; say Rank.^enum_values
20:06 camelia rakudo-moar 524368: OUTPUT«{NA => 0, PFC => 4, PSC => 3, Private => 2, Recruit => 1, Specialist => 5}␤»
20:06 babydrop m: enum Rank <NA Recruit Private PSC PFC Specialist>; say Rank.^enum_value_list
20:06 camelia rakudo-moar 524368: OUTPUT«(NA Recruit Private PSC PFC Specialist)␤»
20:06 kyclark I’m still getting used to >>, but it’s conceptually the same as map, no?
20:06 psch i mean, it depends on how you want to use it i guess?
20:06 babydrop m: enum Rank <NA Recruit Private PSC PFC Specialist>; say Rank.^enum_value_list.map: *.^name
20:06 camelia rakudo-moar 524368: OUTPUT«(Rank Rank Rank Rank Rank Rank)␤»
20:06 RabidGravy yeah, I've got something out there that has some stringy enums
20:07 psch kyclark: .map is in order, >> isn't -- by design at least, impl might not agree yet
20:07 psch kyclark: that only matters for sideeffect though, both return in-order
20:07 psch +s
20:07 babydrop kyclark: sort-of. It's autothreaded, so execution order isn't guaranteed and it also descends into nodal things, which I don't think map does...
20:07 kyclark Thanks.
20:07 babydrop or does it...
20:07 psch oh, right, the nodal thing
20:07 * psch never quite grok'd that
20:08 psch m: enum Rank <NA Recruit Private PSC PFC Specialist>; say Rank($_) for ^+Rank.enums
20:08 camelia rakudo-moar 524368: OUTPUT«NA␤Recruit␤Private␤PSC␤PFC␤Specialist␤»
20:08 psch ^^^ if you just want to do something with each in order
20:08 psch no sorting or anything needed :P
20:08 babydrop \o/
20:09 psch mind, i wouldn't bet on "it's faster" :)
20:09 kyclark That’s nice!
20:09 kyclark I’m writing a post on MAIN, and was thinking I could use Rank to constrain input, but it does not appear so.
20:09 babydrop m: [("a", "b", ("c", "d", ("e", "f", "g")))]».uc.say
20:09 camelia rakudo-moar 524368: OUTPUT«[A B (C D (E F G))]␤»
20:09 babydrop m: [("a", "b", ("c", "d", ("e", "f", "g")))].map(*.uc).say
20:09 camelia rakudo-moar 524368: OUTPUT«(A B C D E F G)␤»
20:09 babydrop This is the nodal difference
20:10 psch kyclark: enums in MAIN are weird
20:10 psch kyclark: we had a patch recently but i think it got reverted because it mucked up Bool arguments
20:10 kyclark OK, I’ll find another way.
20:10 babydrop m: [("a", "b", ("c", "d", ("e", "f", "g")))]».&{"|$_.uc()|"}.say
20:10 camelia rakudo-moar 524368: OUTPUT«[|A| |B| (|C| |D| (|E| |F| |G|))]␤»
20:10 babydrop m: [("a", "b", ("c", "d", ("e", "f", "g")))].map({"|$_.uc()|"}).say
20:10 camelia rakudo-moar 524368: OUTPUT«(|A| |B| |C D E F G|)␤»
20:10 babydrop Better image of what .map is doing
20:11 psch that probably should go into the docs for 'is nodal'
20:11 kyclark This doesn’t seem to work either:
20:11 kyclark subset Rank of Str where * eq any(<NA Recruit Private PSC PFC Specialist>);
20:11 babydrop prolly
20:11 psch if the nodal trait works in userspace
20:11 prammer joined #perl6
20:11 babydrop kyclark: work in where?
20:11 kyclark No, wait, just a sec...
20:11 psch m: BEGIN @*ARGS = "Private"; subset Rank of Str where * eq any(<NA Recruit Private PSC PFC Specialist>); sub MAIN(Rank $x) { }
20:11 camelia rakudo-moar 5476d6: ( no output )
20:11 psch m: BEGIN @*ARGS = "Private"; subset Rank of Str where * eq any(<NA Recruit Private PSC PFC Specialist>); sub MAIN(Rank $x) { say $ank }
20:11 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$ank' is not declared. Did you mean 'Rank'?␤at <tmp>:1␤------> 3C Specialist>); sub MAIN(Rank $x) { say 7⏏5$ank }␤»
20:12 psch m: BEGIN @*ARGS = "Private"; subset Rank of Str where * eq any(<NA Recruit Private PSC PFC Specialist>); sub MAIN(Rank $x) { say $x }
20:12 camelia rakudo-moar 5476d6: OUTPUT«Private␤»
20:12 psch m: BEGIN @*ARGS = "Noodle"; subset Rank of Str where * eq any(<NA Recruit Private PSC PFC Specialist>); sub MAIN(Rank $x) { say $x }
20:12 camelia rakudo-moar 5476d6: OUTPUT«Usage:␤  <tmp> <x> ␤»
20:12 psch looks fine :)
20:12 babydrop Um, this reminds me, we need to come up with the MAIN Enum solution for release
20:12 babydrop (or are we doing the same thing as last time and popping it out for release?)
20:12 babydrop kyclark: you're not using your enums in MAIN are you?
20:13 kyclark I was going to try.
20:13 psch babydrop: i have no idea.  i'm not sure how to solve it considering there's some semantic overlap between enum and IntStr
20:13 psch it's minor overlap, but it's there
20:13 babydrop What about an EnumStr, but make it just be constrained for MAIN parsing? You can only get it there, not in <....> quoters
20:14 psch babydrop: does that solve True and False?
20:14 kyclark Yeah, all good now.
20:14 babydrop Oh, you can't subclass enums tho
20:15 psch m: BEGIN @*ARGS = "True"; multi MAIN(Bool $x) { say "Bool" }; multi MAIN(Str $x) { say "Str" }
20:15 camelia rakudo-moar 5476d6: OUTPUT«Bool␤»
20:16 psch we'd need 'is default' again for anything that parses enums in MAIN
20:16 psch well, at least with the EnumStr solution, however it fits with liskov
20:16 babydrop it's that quaks like a duck guy?
20:17 psch substitution principle
20:17 psch any type fits for any parent type
20:17 psch +"of its" maybe
20:17 psch not sure in how far that relates to duck typing
20:18 psch anyway, that's probably stunted because EnumHOW doesn't inherit
20:19 babydrop kyclark: well, if you're using a release rakudo, you're fine. But current blead contains experimental MAIN enum handling that has a bug in it and will change.... Was just making sure you weren't showing that feature to your students :)
20:19 kyclark OK, I’m close to having an article I can publish about MAIN.  With permission, I stole the idea and title “The MAIN Thing” from brian d foy.  Looks like the Advent calendar is full, so I’ll put on blogs.perl.org.
20:19 babydrop nice
20:19 kyclark I’m done teaching for the semester!  \o/
20:20 mr_ron joined #perl6
20:20 tadzik nice :) Good for you
20:20 kyclark But my boss says that my book should be able to count for my master’s thesis. Doubleplusgood!  I will keep working on it.
20:20 psch hm
20:20 psch m: enum Foo <bar baz>; sub f(Foo $) { }; say f 1
20:20 camelia rakudo-moar 5476d6: OUTPUT«Type check failed in binding to <anon>; expected Foo but got Int (1)␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
20:21 psch m: enum Foo <bar baz>; sub f(Foo() $) { }; say f 1
20:21 camelia rakudo-moar 5476d6: OUTPUT«No such method 'Foo' for invocant of type 'Int'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
20:21 psch coercers..! *shakes fist*
20:21 [Coke] regarding use v6.d - the first compiler that supports that will also support use v6.c
20:21 pyrimidine joined #perl6
20:22 babydrop [Coke]: would { use v6.d; say "foo".comb; { use v6.c; say "foo".comb; } } work and potentially give different results if the workings of the method was changed?
20:22 Tonik joined #perl6
20:25 girafe joined #perl6
20:26 [Coke] That's the plan, yes.
20:26 babydrop :o
20:26 * psch assumed so
20:26 psch hence the whole "i'm not sure anyone is thinking about this yet" line of thought earlier :)
20:26 lucasb imagine the amount of work...
20:27 * babydrop wonder what would { use v6.d; my $x = "foo"; { use v6.c; say $x.comb; } } would work like...
20:27 psch the interesting one would be 'my TypeIn6dButNot6c $x = ...; { use v6.c; $x.doTheThing }'
20:28 babydrop you're calling a 6.d method from within 6.c language :i
20:28 babydrop But on a 6.d object.
20:28 babydrop That'll be interesting...
20:28 psch yes, that's what i'm saying :)
20:29 lucasb imagine doing all that inside a block in 6.e
20:29 lucasb inside a method in 6.f
20:29 lucasb inside a class in 6.g
20:29 babydrop Perlception...
20:29 lucasb is a stack of languages
20:30 lucasb stack of contexts, I mean
20:31 lucasb since things that didn't change in 6.(n+1) are expected to work exactly how it worked on 6.n, right?
20:31 psch honestly, i think it should just work
20:31 psch i mean...
20:31 psch j: use java::lang::System:from<JavaRuntime>; System.get_out.println("foo")
20:31 camelia rakudo-jvm 8ca367: OUTPUT«foo␤»
20:32 psch so yeah, we're in Perl 6, calling a method on an object from who-cares-where, and it works
20:32 psch the object is responsible for resolving its methods
20:32 babydrop neat
20:33 psch in turn, a 6.d 'sub comb(Promise $, Regex $pat)' would fail in 6.c
20:33 lucasb From within class C { method foo {} }, I can call method foo like $.foo, @.foo, %.foo, &.foo
20:34 samcv babydrop, I had thought about doing that, using [(+)], but was also wondering if there was a way to do edit mixhashes after they had been created
20:34 yoleaux 14:16Z <babydrop> samcv: I sent you an invite to perl6 org. So you should be able to commit to docs and some other repos directly.
20:34 lucasb If I have a private 'method !foo {}', I can't call $!foo, @!foo, etc. because that conflicts with private attrs
20:34 samcv nice thanks :)
20:34 lucasb can this be made to work? I mean, calling $!foo and expecting the result of a method
20:34 babydrop samcv: you can edit mixhashes after they have been created.
20:35 psch lucasb: explicitly not.  calling private methods is with 'self!method-name"
20:35 babydrop samcv: just use the object as key and adjust the weight or set weight to zero to purge the object..
20:35 psch -(bad quote alignment)
20:35 psch lucasb: $.foo is a shortcut for self.foo
20:35 psch lucasb: there is no such shortcut for private methods
20:36 lucasb $!foo would be symmetrically convenient, but ok, I understand if that's not possible
20:36 psch m: class A { method m { 1, 2, 3, 4 }; method n { say $.m.WHAT; say @.m.WHAT } }; A.n # the shortcuts don't even do different things yet
20:36 camelia rakudo-moar 5476d6: OUTPUT«(List)␤(List)␤»
20:36 psch lucasb: consider that $.foo is always the accessor
20:36 psch lucasb: but $!foo is always the Attribute
20:37 psch lucasb: so, yes, i see the symetry you're suggesting, but it's coming from the wrong end.  we only have $.foo because we shortcut it.  otherwise it'd always be $!foo or self.foo
20:37 lucasb psch: $. @. %. do different things
20:37 pmurias calling private method as $!foo would be just confusing
20:37 pmurias * methods
20:37 babydrop samcv: also, I've no idea what you mean by that [(+)] line so I think.... you responded to the wrong person?
20:37 babydrop :)
20:37 samcv xoh
20:38 psch lucasb: they don't wrt method table shortcut, that was my example just then
20:38 samcv i just unresumed my laptop read some lines and then it reconnected and i lost it
20:38 psch lucasb: they only do different things if you have autogenerated accessors
20:38 samcv since it's been asleep all night
20:38 pmurias m: class Foo {has $!foo; method !foo {say "hi ", $!foo()};method foo {$!foo = -> {"world"};self!foo }}; Foo.new.foo
20:38 camelia rakudo-moar 5476d6: OUTPUT«hi world␤»
20:38 samcv oh it was timo that said it
20:39 lucasb m: class C { method foo { a=>1 }; method m { $.foo, @.foo, %.foo } }; say C.m.perl
20:39 camelia rakudo-moar 5476d6: OUTPUT«(:a(1), (:a(1),), {:a(1)})␤»
20:39 pmurias lucasb: ^^ you can have both a !foo method and a $!foo attribute
20:39 babydrop :o
20:39 * psch is definitely bad at Perl 6 :P
20:40 psch or lucasb++ is just better
20:40 psch dunno
20:40 psch those things are hard to decide
20:40 psch so, right, there's a coercive aspect there
20:40 lucasb psch++
20:40 babydrop lucasb++ I've no idea you could use any sigil you wanted like that.
20:40 psch (i mean, if this goes to three in my current waking cycle, i'll... demand patches from lucasb..?)
20:40 lucasb the only oddball is of course the contextualizer &(...) that doesn't do anything
20:41 psch lucasb: yeah, there's at least one spot where & means the same as $ in Perl6::Grammar
20:41 babydrop m: class C { method foo { <a b c d> }; method m { $.foo, @.foo, %.foo } }; C.new.m.say
20:41 camelia rakudo-moar 5476d6: OUTPUT«((a b c d) (a b c d) {a => b, c => d})␤»
20:41 psch which is kind of weird
20:41 lucasb we should ask TimToady what he wants &(...) to do
20:41 psch i think there was a shortlived discussion about that, but heck if i remember the result... :)
20:42 lucasb pmurias: thanks for the snippet. it confirmed for me that all 3 are different $!foo, method foo and method !foo
20:43 psch seriously though, all this magic /o\
20:43 psch luckily it's consistent..? >_>
20:44 babydrop m: class C { method foo { <a b c d> }; method m { %$.foo, %@.foo, $@%.foo } }; C.new.m.say
20:44 camelia rakudo-moar 5476d6: OUTPUT«({a => b, c => d} {a => b, c => d} (a => b c => d))␤»
20:44 babydrop ehehe
20:44 psch m: say 4 [&({ $^a ~ " foo " ~ $^b })] 5
20:44 camelia rakudo-moar 5476d6: OUTPUT«4 foo 5␤»
20:44 psch m: say [[&({ $^a ~ " foo " ~ $^b })]] 4, 5
20:44 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say [[&({ $^a ~ " foo " ~ $^b })]]7⏏5 4, 5␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤       …»
20:44 psch not consistent, can't syntax-reduce with inline-infix /o\
20:45 psch woe is me :P
20:47 lucasb first time I see &(...) make some difference is here: $x [&(...)] $y
20:47 lucasb without it, it doesn't work
20:48 psch lucasb: that's the parser there.  it needs the & mostly
20:49 psch m: sub f($,$) { say "called!" }; say 2 [&f] 2 # like this
20:49 camelia rakudo-moar 5476d6: OUTPUT«called!␤True␤»
20:49 psch lucasb: but that gives us the backdoor of stuffing a Block in there
20:49 psch note, i'm not 100% that's an intented use :P
20:49 lucasb interesting trick
20:49 psch +convinced
20:52 masak m: say [&{ $^a + 2 * $^b }] 1..10
20:52 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say [&{ $^a + 2 * $^b }]7⏏5 1..10␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statemen…»
20:52 psch m: sub f($,$) { say "called!" }; [[&f]] 2, 2
20:52 camelia rakudo-moar 5476d6: OUTPUT«called!␤»
20:52 psch so, yeah, there's a difference
20:53 psch i suspect the syntax reduce form only takes '[' ~ ']' <ident> or so, while the infix form takes statement or something
20:54 psch or maybe EXPR, no idea without digging and it's a little late for that :)
20:54 masak m: say [[&{ $^a + 2 * $^b }]] 1..10
20:54 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say [[&{ $^a + 2 * $^b }]]7⏏5 1..10␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statem…»
20:54 masak m: say [[&{ $^a + 2 * $^b }]](1..10)
20:54 camelia rakudo-moar 5476d6: OUTPUT«Invocant requires a type object of type List, but an object instance was passed.  Did you forget a 'multi'?␤  in block <unit> at <tmp> line 1␤␤»
20:54 psch masak++
20:54 psch that is pretty great :)
20:56 lucasb m: say [[&({$^a+$^b})]] 2,3
20:56 camelia rakudo-moar 5476d6: OUTPUT«5␤»
20:56 jnthn RabidGravy: Looking at that, I wonder if we shouldn't have a Promise.at to go with Promise.in... :-)
20:56 lucasb m: [[&()]]
20:56 camelia rakudo-moar 5476d6: OUTPUT«Use of Nil in numeric context␤  in block <unit> at <tmp> line 1␤Cannot find method 'Nil' on object of type List␤  in block <unit> at <tmp> line 1␤␤»
20:56 lucasb m: [[ &() ]]
20:56 camelia rakudo-moar 5476d6: ( no output )
20:56 lucasb I wonder how '[[&()]]' is being parsed
20:58 jnthn m: [[ &() ]] ()
20:58 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3[[ &() ]]7⏏5 ()␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        statement modif…»
20:58 jnthn m: dd [[ &() ]]
20:58 camelia rakudo-moar 5476d6: OUTPUT«[Any]␤»
20:58 jnthn As an array composer
20:59 psch m: dd [[&min]]
20:59 camelia rakudo-moar 5476d6: OUTPUT«Inf␤»
20:59 jnthn m: dd [[&()]]
20:59 camelia rakudo-moar 5476d6: OUTPUT«Use of Nil in numeric context␤  in block <unit> at <tmp> line 1␤Cannot find method 'Nil' on object of type List␤  in block <unit> at <tmp> line 1␤␤»
20:59 jnthn The shitespace is makes a difference
20:59 jnthn *whitespace
20:59 lucasb shitspace? O.o
20:59 jnthn lol
20:59 * psch snickers
21:00 jnthn That's what typing too fast gets me :P
21:00 jnthn I *think* &() may be an...um...well
21:00 psch m: say &()
21:00 camelia rakudo-moar 5476d6: OUTPUT«Nil␤»
21:00 masak "shitespace" is the kind of designspace you don't want to make vital decisions in... :P
21:00 lucasb it is calling the sub! why? funny that
21:01 jnthn m: 'a' ~~ /foo { make 'bar' }/; say &()
21:01 camelia rakudo-moar 5476d6: OUTPUT«Nil␤»
21:01 lucasb ahhh, because it is a reducer!
21:01 jnthn m: 'a' ~~ /foo { make 'bar' }/; say $()
21:01 camelia rakudo-moar 5476d6: OUTPUT«Use of Nil in string context␤  in block <unit> at <tmp> line 1␤␤»
21:01 psch m: 'a' ~~ /(a) { make 'bar' }/; say $()
21:01 camelia rakudo-moar 5476d6: OUTPUT«bar␤»
21:01 psch m: 'a' ~~ /(a) { make 'bar' }/; say &()
21:01 camelia rakudo-moar 5476d6: OUTPUT«「a」␤ 0 => 「a」␤»
21:01 mohae joined #perl6
21:02 jnthn oh, damn
21:02 jnthn I needed a regex that matched
21:02 jnthn But yes, that's exactly what I was looking for. Thanks, psch
21:02 jnthn I guess there's probably a bit of code somewhere that says "is it @? is it %? OK, neither, it must be $ then" :)
21:03 jnthn And so &() just comes along for the ride
21:03 brahian joined #perl6
21:03 pyrimidine joined #perl6
21:04 brahian hi guys
21:04 psch doesn't quite clear up why we allow [&({ ... })] as infix but not as reduce
21:04 jnthn psch: That...does seem a bit inconsistent.
21:04 psch but yes, i did see that bit with 'if $<sigil> eq "@"' in Perl6::Actions somewhere
21:04 lucasb psch: what? [[&({$^a+$^b})]] 2,3   <-- this works
21:04 psch lucasb: ahh, so it's about no whitespace!  nice
21:05 psch m: say [[&({$^a+$^b})]] 2,3
21:05 camelia rakudo-moar 5476d6: OUTPUT«5␤»
21:05 lucasb no, it's about double squares [[...]]
21:05 psch m: say [[&({$^a +$^b})]] 2,3
21:05 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3say [[&({$^a +$^b})]]7⏏5 2,3␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement mod…»
21:05 psch nope
21:05 psch it's about "no white space" :)
21:05 lucasb ah, right, also, no white space :)
21:05 jnthn I was gonna say, I was sure that the reduce rule just delegates to parsing an infixish
21:05 jnthn But yeah, it also does a lookahead
21:05 jnthn Reduce meta-ops are one of the very small number of places in the Perl 6 grammar that we do that.
21:06 xinming_ joined #perl6
21:06 * psch doesn't dare having a opinion about that :P
21:06 brahian How to validate if a variable exists?
21:07 kurahaupo__ joined #perl6
21:07 psch m: if (try ::('$x')).VAR { say "hi" }; my $x; if (try ::('$x')).VAR { say "hi" }
21:07 camelia rakudo-moar 5476d6: OUTPUT«hi␤hi␤»
21:08 psch aw shucks
21:08 skids m: my $a; ::.hash<$a>:exists.say
21:08 camelia rakudo-moar 5476d6: OUTPUT«True␤»
21:08 psch m: { if (try ::('$x')).VAR { say "hi" } else { say "not hi" } }; { my $x; if (try ::('$x')).VAR { say "hi" } }
21:08 camelia rakudo-moar 5476d6: OUTPUT«not hi␤hi␤»
21:08 jnthn $x is late-bound enough that it's in scope by then... :)
21:08 jnthn uh, ::('$x') that is
21:08 psch jnthn: right, that's what i figured, hence the added scopes :)
21:08 lucasb m: if try EVAL '$x' { say "hi" }; my $x; if try EVAL '$x' { say "hi" }
21:08 camelia rakudo-moar 5476d6: ( no output )
21:08 skids m: ::.hash<$a>:exists.say
21:08 camelia rakudo-moar 5476d6: OUTPUT«False␤»
21:09 jnthn m: ::<$a>:exists.say
21:09 camelia rakudo-moar 5476d6: OUTPUT«False␤»
21:09 jnthn Stashes are already hashes so you don't need to coerce to hash first :)
21:09 lucasb (I forgot to assign some true value to $x)
21:09 psch lucasb: that's why i .VAR'd :)
21:09 lucasb ah
21:09 jnthn The EVAL way probably wins award for "most expensive means to check" :)
21:10 psch ...although i'm not actually sure .VAR does the right truthiness i want
21:10 brahian Thank you
21:10 psch ...heck, it still worked :)
21:10 psch oh, nvm, it's a Scalar instance
21:10 psch that should be truthy i suppose
21:11 psch m: my $x; say so $x.VAR
21:11 jnthn psch: It might be you in bother if you're looking up a symbol with something directly bound to it, rather than there being a Scalar there
21:11 camelia rakudo-moar 5476d6: OUTPUT«False␤»
21:11 psch jnthn: oh!  yes, that's a good point
21:15 brahian How to validate if a variable is empty?
21:16 r joined #perl6
21:16 r hi
21:16 Guest47841 i need extract metadata from files with extension .tiff, but i don't now how this
21:18 gfldex brahian: You are likely asking the wrong question.
21:19 gfldex m: my $a = Empty; say so $a ~~ Empty;
21:19 camelia rakudo-moar 5476d6: OUTPUT«True␤»
21:20 brahian if $a = empty{ say "hola"};
21:20 gfldex We do have Empty but it doesn't indicate a uninitialised variable
21:20 jnthn Probably !$a.defined
21:20 skids Yeah, we have quite a full assortment of ways to be empty.
21:20 gfldex https://docs.perl6.org/language/typesystem#Undefinedness
21:21 Guest47841 if $a eq Any
21:21 gfldex m: my $a; without $a { say ‚hola‘ }
21:21 camelia rakudo-moar 5476d6: OUTPUT«hola␤»
21:23 brahian thank you :D
21:37 * masak .oO( who needs $a anyway... )
21:40 PapaChub joined #perl6
21:40 lukaramu joined #perl6
21:40 PapaChub p6: (^10000).pick
21:40 camelia rakudo-moar 5476d6: ( no output )
21:41 PapaChub p6: say (^10000).pick
21:41 camelia rakudo-moar 5476d6: OUTPUT«5122␤»
21:41 PapaChub p6: say (^1e5).pick
21:41 camelia rakudo-moar 5476d6: OUTPUT«39329␤»
21:41 PapaChub I was astonished by how much slower the latter was...
21:41 psch m: say (0..1e5).pick; say now - INIT now
21:42 camelia rakudo-moar 5476d6: OUTPUT«56654␤6.3638192␤»
21:42 psch m: say (0e0..1e5).pick; say now - INIT now
21:42 camelia rakudo-moar 5476d6: OUTPUT«16176␤0.27731498␤»
21:42 jnthn Probably because 1e5 is a floating point number
21:42 * PapaChub strokes beard...
21:42 psch PapaChub: ^ has an implicit 0.Int as starting point, and mixing types is slow with infix:<..>
21:42 gfldex m: if .defined { say ‚hola‘ }
21:42 camelia rakudo-moar 5476d6: ( no output )
21:42 psch m: say (0..100000).pick; say now - INIT now
21:42 camelia rakudo-moar 5476d6: OUTPUT«2140␤0.0022122␤»
21:43 psch though pure Int is still notably faster...
21:43 jnthn I think .pick on Range only has the special case for integer endpoints too
21:43 psch PapaChub: we have that recording as a PERF ticket, fwiw
21:43 psch s/ing/ed/
21:43 PapaChub psch++
21:43 lizmat yes, int ranges are optimized
21:43 jnthn Meaning it's actually genreating the the list in memory
21:43 jnthn *generating
21:43 jnthn And then picking out of it
21:43 jnthn It's still astoundingly slow even for doing those two suboptimal things
21:44 PapaChub m: say (^1e5.Int).pick; say now - INIT now
21:44 camelia rakudo-moar 5476d6: OUTPUT«98086␤0.00309961␤»
21:44 psch jnthn: i mean, it's generating, coercing, unbox, comparing, boxing again
21:44 PapaChub ?lightbulb?
21:44 jnthn psch: Presumably :)
21:44 psch jnthn: i'm not sure that's not enough to justify the slowdown, but it surely sounds a lot
21:44 jnthn I *think* it also uses cmp
21:44 psch s:2nd/not//
21:45 jnthn And cmp on Numeric types that aren't the same then probably coerces them both to Num
21:45 psch PapaChub: .Int binds to 1e5 there, so yeah, you get the fastest path
21:45 jnthn Well, we could always stop guesing and feed it to the profiler :P
21:45 psch jnthn: proobably just points at &SEQUENCE :)
21:46 psch oh, actually all that inclusive and all stuff...
21:46 psch i think the profiler is probably smarter than that
21:46 psch m-profile: ^1e5.pick
21:46 jnthn It actually doesn't
21:46 * psch forgets if that actually works like that
21:46 jnthn (use sequence)
21:46 psch ah shucks, is that infix:<...>..?
21:46 jnthn Oh wow
21:47 jnthn It actually hits a multi-dispatch slow path too
21:47 psch ah, okay
21:47 jnthn Thus missing the cache
21:47 jnthn And so a ton of time goes on that
21:47 psch that's probably the bit that isn't explained by boxing and so on
21:47 psch i'd even assume it's more significant than boxing stuff
21:47 psch 'cause 0e0..1e5 probably hits some boxing too, no?
21:48 jnthn Yeah, it is, it's hugely costly
21:48 jnthn On === apparently
21:48 rburkholder joined #perl6
21:48 psch huh
21:49 jnthn Oh...
21:49 jnthn Found it
21:49 jnthn multi sub infix:<===>(NaN, NaN) { True;
21:49 jnthn }
21:49 jnthn That's syntax sugar for
21:49 jnthn multi sub infix:<===>($ where NaN, $ where NaN) { True; }
21:49 psch ohh
21:50 jnthn And for any Num case - which is what we have - it will always have to check that this candidate doesn't apply before hitting the normal one
21:50 jnthn Meaning the result is uncacheable
21:50 jnthn Which is why it's so costly
21:51 pyrimidine joined #perl6
21:52 psch hm, moving that into the proto might help i suppose?
21:52 * babydrop oh-ohs
21:52 psch the NaN, NaN check that is
21:52 nine use v6.c; will always work and will give you 6.c semantics.
21:52 nine oops...stale backlog
21:52 babydrop I only recently realized the literals get translated to wheres
21:52 psch but i don't think that's a great optimization technique... :)
21:52 babydrop And I stuck a bunch of those in core over the past couple of months
21:53 babydrop I guess I know what I'm doing this weekend
21:53 psch ...drink and cry? :P
21:53 babydrop even that NaN may be mine
21:53 babydrop Nah, fix all my crap :)
21:53 jnthn psch: I'd just move it into the multi candidates for (Num,Num) and (num,num)
21:53 psch jnthn: right, that's probably more sensible
21:54 psch jnthn: depending on whether we could potentially figure out a way to cache this dispatch case
21:54 psch (which, well, *i* am not going to do :) )
21:54 jnthn m: my num $a = NaN; my num $b = NaN; say $a === $b
21:54 camelia rakudo-moar 5476d6: OUTPUT«False␤»
21:54 jnthn m: my Num $a = NaN; my Num $b = NaN; say $a === $b
21:54 camelia rakudo-moar 5476d6: OUTPUT«True␤»
21:54 jnthn We also have that bug
21:54 babydrop :o
21:54 psch oh geez
21:54 jnthn Because num is tighter than Num
21:54 * babydrop clicks the invisible Take button
21:55 jnthn :)
21:55 jnthn Feel free, I've just about got the energy to look at profiler output, but not sure twiddling the code :-)
21:59 PapaChub m: sub xyz { 42 }; say xyz;
21:59 camelia rakudo-moar 5476d6: OUTPUT«42␤»
21:59 PapaChub m: sub Foo::xyz { 42 }; say Foo::xyz;
21:59 camelia rakudo-moar 5476d6: OUTPUT«Could not find symbol '&xyz'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
21:59 PapaChub Is there a simple way to DWIM, there?
22:00 babydrop DWIM being what? Define a sub in some other package?
22:00 psch m: sub Foo::xyz { 42 }; say MY::.keys
22:00 camelia rakudo-moar 5476d6: OUTPUT«($=pod !UNIT_MARKER &Foo::xyz EXPORT $_ $! ::?PACKAGE GLOBALish $¢ $=finish $/ $?PACKAGE)␤»
22:00 psch well, it gets installed correctly
22:00 psch not sure how you can reach it though
22:00 babydrop add an our
22:00 psch m: sub Foo::xyz { 42 }; say ::<Foo::xyz>()
22:00 camelia rakudo-moar 5476d6: OUTPUT«Cannot find method 'Nil' on object of type List␤  in block <unit> at <tmp> line 1␤␤»
22:00 psch m: sub Foo::xyz { 42 }; say ::<Foo::xyz>[0]()
22:00 camelia rakudo-moar 5476d6: OUTPUT«Cannot find method 'Nil' on object of type List␤  in block <unit> at <tmp> line 1␤␤»
22:01 babydrop before the the sub
22:01 psch m: sub Foo::xyz { 42 }; say ::('Foo::xyz')()
22:01 camelia rakudo-moar 5476d6: OUTPUT«No such symbol 'Foo::xyz'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:01 psch m: our sub Foo::xyz { 42 }; say ::('Foo::xyz')()
22:01 camelia rakudo-moar 5476d6: OUTPUT«No such symbol 'Foo::xyz'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:01 psch babydrop: it's in MY::
22:01 babydrop Oh, I thought you meant it installed into another package correctly
22:01 psch m: module Foo { our sub xyz { 42 } }; say MY::.keys
22:01 camelia rakudo-moar 5476d6: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! Foo ::?PACKAGE GLOBALish $¢ $=finish $/ $?PACKAGE)␤»
22:01 psch m: module Foo { our sub is export xyz { 42 } }; import Foo say MY::.keys
22:01 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3module Foo { our sub is7⏏5 export xyz { 42 } }; import Foo say MY:␤    expecting any of:␤        new name to be defined␤»
22:01 psch m: module Foo { our sub is export xyz { 42 } }; import Foo; say MY::.keys
22:01 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3module Foo { our sub is7⏏5 export xyz { 42 } }; import Foo; say MY␤    expecting any of:␤        new name to be defined␤»
22:02 jnthn m: our sub Foo::xyz { 42 }; say Foo::xyz; # curious if this works
22:02 camelia rakudo-moar 5476d6: OUTPUT«Could not find symbol '&xyz'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:02 babydrop .oO( I guess there's different WIM in here....)
22:02 * psch isn't sure either what's meant
22:02 psch i mean
22:02 psch intuitively i'd want the declaration to failparse
22:02 Guest47841 rakudo
22:02 psch m: module Foo { our sub xyz is export  { 42 } }; import Foo; say MY::.keys
22:02 camelia rakudo-moar 5476d6: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! Foo ::?PACKAGE GLOBALish $¢ &xyz $=finish $/ $?PACKAGE)␤»
22:03 psch anyway, the import puts it as &xyz
22:03 psch m: module Foo { our sub xyz { 42 } }; say MY::.keys
22:03 camelia rakudo-moar 5476d6: OUTPUT«($=pod !UNIT_MARKER EXPORT $_ $! Foo ::?PACKAGE GLOBALish $¢ $=finish $/ $?PACKAGE)␤»
22:03 PapaChub m:package Foo { our sub xyz { 42 } }; say Foo::xyz;
22:03 psch not importing it doesn't put it in MY::
22:03 PapaChub m: package Foo { our sub xyz { 42 } }; say Foo::xyz;
22:03 camelia rakudo-moar 5476d6: OUTPUT«42␤»
22:03 brahian I need to pass code from php to perl 6, I want to know if there is an equivalent to $ this?
22:03 brahian $this?
22:03 psch brahian: probably 'self'
22:04 PapaChub That's what *I* mean, anyway...  I just thought the "package {}" wrapper was a little superfluous
22:04 bjz joined #perl6
22:04 psch PapaChub: no, it's not, but it probably should complain if you put a longname behind a declarator
22:04 domidumont joined #perl6
22:04 psch m: my $Foo::bar = 1;
22:04 camelia rakudo-moar 5476d6: ( no output )
22:04 psch ...i think?
22:04 jnthn It should complain, I think
22:05 jnthn Unless you wrote "our sub ..." and then it could go and stuff it in a package, vivifying it for you
22:05 psch huggable: rakudobug
22:05 huggable psch, rakudobug@perl.org or use perl6 query on http://rt.perl.org ; see https://github.com/rakudo/rakudo/#reporting-bugs
22:05 jnthn our-scoped subs are not so common in Perl 6 generally, though
22:05 psch PapaChub: ^^^ if you're willing, please report this, with the caveat added by jnthn++
22:05 jnthn (And since the default is my, then a my-scoped sub with a package name makes no sense)
22:06 jnthn (Unless we make the my mean "and create a lexical package", but that's a tad odd too :))
22:12 brahian psch: Thanks if it worked
22:15 PapaChub I'm probably just bringing old [bad] habits and assumptions along...  If I have a Foo.pm with "class Foo::Noun { has $.value }", then Foo::Noun "shows up" in my MAIN, but "our sub Foo::verb { ... }" does not.
22:15 babydrop Guest47841: have you checked the ecosystem yet for a module? http://modules.perl6.org
22:15 babydrop Guest47841: what kind of information?
22:16 psch PapaChub: i can't make sense of that, i'd like a full code sample in a pastebin somewhere please :)
22:17 setty1 joined #perl6
22:18 babydrop Guest47841: you can also use modules from https://metacpan.org/ via Inline::Perl5 ( https://github.com/niner/Inline-Perl5 )
22:18 dalek doc: 37d0646 | samcv++ | doc/Type/Cool.pod6:
22:18 synopsebot6 Link: http://doc.perl6.org/type/Cool
22:18 dalek doc: Add `uniprop` documentation
22:18 dalek doc: review: https://github.com/perl6/doc/commit/37d0646eb4
22:19 TEttinger joined #perl6
22:20 zacts joined #perl6
22:25 samcv hmm regarding uniprop. the raw unicode property uses 0/1 for false/true. would it make more sense for perl6 to return true/false for true false values?
22:25 samcv don't see anything in roast testing that it returns an into or anything or testing the type returned by uniprop
22:25 samcv m: say 'a'.uniprop('Alphabetic')
22:25 camelia rakudo-moar 5476d6: OUTPUT«1␤»
22:25 samcv m: say 'a'.uniprop('Alphabetic').Bool
22:25 camelia rakudo-moar 5476d6: OUTPUT«True␤»
22:25 psch i suppose that could box, yes
22:26 samcv yeah not all the returns are 1/0, a lot of them are strings
22:26 psch well, then it can't
22:26 jnthn There's also numeric properties that have a wider range of integers
22:26 psch if there's properties that don't return 0/1 it cannot box to Bool
22:26 psch *"0 or 1"
22:27 jnthn I think (don't remember the code exactly) it is able to figure out if the prop is int based of str based
22:27 jnthn So it can return an Int or a Str
22:27 samcv http://userguide.icu-project.org/strings/properties well this has a list on which is binary
22:27 jnthn *or
22:27 psch ah, yes
22:27 jnthn Right, if we're going to do it, we'd have to have such a list to consult
22:27 psch switches on S, I, B
22:28 psch samcv: those could box to Str, Int, Bool respectively
22:28 psch not sure about the default case there though :)
22:28 jnthn Oh, we already switch on Bool?
22:28 jnthn Curious
22:28 psch jnthn: well, there's nqp::getuniprop_{int,str,bool}
22:29 jnthn yeah, just found them :)
22:29 samcv ah so we already have something that will return an int, str or bool?
22:30 samcv most of the returns are bool. and only like 2 or 3 return numbers that aren't bools and the rest strings
22:30 jnthn Oddly, I don't see us ever poking a B into that table
22:31 jnthn Anyway, I'm good with binary props returning Bool
22:31 jnthn m: say Bool ~~ Int
22:31 camelia rakudo-moar 5476d6: OUTPUT«True␤»
22:31 jnthn And thanks to that, we won't break any existing code that has type constraints around the result
22:33 jnthn But I think it'll need us to keep a list
22:33 jnthn (of which props are binary)
22:33 samcv is it better to keep a list of which are binary, or a list of ones that are integers. or would that not work
22:34 samcv since all but 3 are either strings or bool
22:34 samcv and only 3 are actual numbers
22:34 samcv about 3 maybe a few more, but not that many of them
22:35 jnthn I fear keeping a list on which ones are non-binary and assuming the rest are binary will come back to bite us if new props are introduced
22:35 jnthn (Which new versions of Unicode are free to do)
22:35 labster joined #perl6
22:35 jnthn state %prefs;  # could prepopulate this with various prefs
22:35 jnthn I'd go the path of pre-poulating it with the ones we know
22:35 samcv yeah
22:36 MasterDuke jnthn: a while ago i asked about where clause performance and you mentioned methods with wheres weren't cached (and pointed me to where that could be implemented). would implementing that have helped the "multi sub infix:<===>(NaN, NaN)" performance?
22:36 travis-ci joined #perl6
22:36 travis-ci Doc build failed. Samantha McVey 'Add `uniprop` documentation'
22:36 travis-ci https://travis-ci.org/perl6/doc/builds/182733730 https://github.com/perl6/doc/compare/f977dd540296...37d0646eb4f3
22:36 travis-ci left #perl6
22:36 jnthn MasterDuke: It would have made things less bad, but only somewhat
22:36 jnthn MasterDuke: So yes, it'd help, but not to the degree the suggested fix would
22:37 samcv uhm why did that build fail?
22:37 jnthn samcv: One other issue with the state var there is that it could cause us thread safety headaches
22:37 jnthn samcv: So we may just want to have a my constant %prefs = <put a table here>;
22:38 samcv for which type they should be?
22:38 jnthn And then for the ones we don't have in the table, just do the thing in default
22:38 samcv ah k
22:38 jnthn But don't update a prefs
22:38 MasterDuke jnthn: of course, your mention of wheres and caches just triggered my memory
22:38 jnthn Yeah, that's still worth doing
22:38 samcv should I make a list of all of them?
22:39 jnthn Yes, I think that'd be the best option.
22:39 samcv ok i'll do that
22:39 jnthn Nice, thanks.
22:40 MasterDuke psch: i took a look at the method cache code jnthn pointed me to, but it never clicked for me, but you might have better luck
22:40 PapaChub Poor man's pastebin:  http://dabe.com/misc/perl6-class_method.html
22:40 jnthn From the comments in that bit of code, I get the impression it was written with the intention of being improved.
22:40 psch PapaChub: sub is 'my' scoped by default
22:40 PapaChub "our" doesn't help
22:41 psch PapaChub: also you're still doing that "put a long-name behind the declarator" thing
22:41 jnthn PapaChub: Just to check: you know that you can write "our sub x P { }" inside of the class body too?
22:41 PapaChub My point is probably more that I was just "astonished" that it didn't Do What I Meant
22:41 jnthn (subs can live in classes too, not only methods)
22:42 psch PapaChub: right, which is we i asked you to submit a ticket that declarators erroneously allow longnames :)
22:42 psch s/we//
22:42 PapaChub :)
22:44 psch PapaChub: the general suggestion is to start a module file with the file-scope declarator
22:44 psch PapaChub: i.e. 'unit package Foo;' afair
22:47 samcv also i don't think that travis build failure was my fault? or maybe it was, but it properly processed the Cool doc file
22:47 psch samcv: fwiw, docs travis seems flakey from where i'm standing
22:47 psch samcv: i think there's something async-y in there that doesn't always work?  maybe sockets..?
22:48 psch samcv: don't take my word for it though, i hardly ever push docs :)
22:48 samcv hah k
22:49 PapaChub In my case, it's more like a module made up of a handful of component classes (think Foo::Person, Foo::Company).  Basically I just wanted to add a "Foo::start" function to orchestrate them.
22:50 psch PapaChub: right, so do 'module Foo; class Person { ... }; class Company { ... }; sub start(...) is export { ... }'
22:51 psch PapaChub: or, instead of 'is export' do 'our sub start ...'
22:51 PapaChub (AND I didn't want to pollute my caller's namespace with the start)
22:51 psch PapaChub: just don't do 'declarator longname', i.e. 'sub Foo::start'
22:51 psch PapaChub: because that wrongly doesn't die
22:52 PapaChub So is there an argument why "sub A::B {...}" SHOULDN'T be the same as "&A::B = sub {...}"
22:52 psch PapaChub: it's a bug that it parses in the first place, it doesn't make sense
22:52 jnthn Because sub in Perl 6 really means "my sub" not "our sub"
22:52 psch PapaChub: the latter makes more sense
22:53 psch and 'our sub $longname' working is just asking for spooky action at a distance
22:53 jnthn psch: I think I could cope woth "our sub $longname" working, fwiw
22:53 psch jnthn: well, i'll readily defer to you, but it feels really spooky to me :)
22:54 PapaChub "&A::B" is just as spooky, no?
22:54 jnthn Well, yeah. Culturally, we just don't really put subs in packages much in Perl 6
22:54 jnthn PapaChub: fwiw you don't actually have a namespace pollution issue with subs in the mainline of your module, because unless you write "our sub" then it's lexically scoped.
22:54 jnthn m: { sub foo() { }; }; foo() # won't work
22:54 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    foo used at line 1␤␤»
22:55 samcv https://cry.nu/uniprops.txt here are all the unicode props in json. how do you want them formatted psch. also we only seem to recognize the long name of the unicode properties atm
22:55 jnthn m: { sub foo() { }; }; GLOBAL::foo() # still won't work
22:55 camelia rakudo-moar 5476d6: OUTPUT«Could not find symbol 'foo'␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
22:55 jnthn The more typical way to deal with subs and modules in Perl 6 is to mark them with "is export", and then a "use" will import them lexically.
22:55 psch samcv: i'd suggest at what nqp::getuniprop_{str,int,bool} expect
22:55 psch +looking
22:55 PapaChub I wanted to explictly qualify "Foo::start"
22:56 PapaChub BTW ??I'm not saying what I *WANT* is at all justified...  It's just what a typical switcher is likely to stub their toe on.  :-}
22:56 psch m: module Foo { class Bar { }; our sub baz { say $?PACKAGE } }; say Foo::baz
22:56 camelia rakudo-moar 5476d6: OUTPUT«(Foo)␤True␤»
22:56 jnthn OK, well the `module Foo; class Bar { }; our sub start() { }` appraoch psch suggested would be neater, I think?
22:57 psch i mean, it *is* qualified
22:57 psch and you have to call it qualified
22:57 psch m: module Foo { class Bar { }; our sub baz { say $?PACKAGE } }; Foo::baz; Foo::Bar.new.perl.say
22:57 camelia rakudo-moar 5476d6: OUTPUT«(Foo)␤Foo::Bar.new␤»
22:58 jnthn But yes, I agree it silently doing nothing sensible with the fully qualified name *and* not giving an error is just asking for people to stub their toe on it and not have a clue what's going on.
22:58 psch the issue, as i see it, is that Perl 5 allows arbitrary additions to any given namespace, which we don't
22:58 psch *also* we have a bug with longnames after a declarator
22:58 jnthn psch: We do with package ;-)
22:58 psch m: package Foo { class A { } }; say Foo::A.perl; package Foo { class Bar {} }; say Foo::.keys
22:58 camelia rakudo-moar 5476d6: OUTPUT«Foo::A␤(A Bar)␤»
22:58 psch ...we do
22:58 psch i actually *am* bad at Perl 6 :P
22:59 psch m: module Foo { class A { } }; say Foo::A.perl; module Foo { class Bar {} }; say Foo::.keys
22:59 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Redeclaration of symbol 'Foo'␤at <tmp>:1␤------> 3ass A { } }; say Foo::A.perl; module Foo7⏏5 { class Bar {} }; say Foo::.keys␤    expecting any of:␤        generic role␤»
22:59 * psch resists making the post hoc excuse obvious
23:00 jnthn :)
23:02 PapaChub Thanks, all, for the lively and enlightening discussion!
23:03 pyrimidine joined #perl6
23:05 tailgate m: https://gist.github.com/ahalbert/748b49d697062a834057a03b30bf7396
23:05 camelia rakudo-moar 5476d6: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row across lines (missing semicolon or comma?)␤at <tmp>:8␤------> 3say $test.comb ~~ DirectionList7⏏5<EOL>␤    expecting any of:␤        infix␤        infix stopper␤        p…»
23:05 tailgate m: https://gist.github.com/ahalbert/748b49d697062a834057a03b30bf7396
23:05 camelia rakudo-moar 5476d6: OUTPUT«False␤Internal error: inconsistent bind result␤  in sub dl at <tmp> line 8␤  in block <unit> at <tmp> line 13␤␤»
23:06 tailgate how do I properly iterate over a subset of list?
23:06 samcv psch, i'll work on something for rakudo. looks like there's already a %hash that isn't used for doing this exact thing
23:07 psch ++samcv :)
23:14 DarthGandalf joined #perl6
23:16 AlexDaniel joined #perl6
23:23 DarthGandalf joined #perl6
23:23 samcv is there a way for 'Test' to only show incorrect answers?
23:23 samcv before I do this i'm going to make sure nqp has unicode property codes for both short and long names
23:23 samcv err i can just redirect stdout rigth?
23:24 samcv yes :) cool
23:35 jnthn 'night, #perl6
23:35 samcv looks like ther's some problems in Moar's data on unicode types.
23:36 samcv {"jt",25} {"jt",23} are both in the same data structure. no wonder it's causing problems for the tests
23:38 AlexDaniel samcv: what is that you are talking about exactly?
23:38 samcv uniprop 'jt' returns something different than 'Joining_Type'
23:38 samcv in perl 6
23:38 DarthGandalf joined #perl6
23:39 samcv it has two different values in the same datastructure in moar
23:40 samcv {"JT",23},{"jt",23},{"JV",23},{"jv",23}
23:40 samcv so it returns the result for JV instead of JT
23:42 timotimo oh, is it time for another advent post?
23:42 timotimo is there a review-preview already?
23:44 * timotimo found it
23:44 cdg joined #perl6
23:45 timotimo god damn it, i'm too tired to think straight
23:46 samcv also {"Sc",21},{"sc",21},{"Currency_Symbol",21}, the sc property is the short name for 'Script'
23:47 samcv so there's a few conflicting ones in the same data structure. and unicode property names != unicode general group names
23:48 samcv sc means the Script property, and
23:48 samcv #   Sc means the General_Category property value Currency_Symbol (Sc)
23:48 samcv yeah ok i think what happened is it was put in in both cases
23:48 samcv even though each case means something different
23:55 bjz joined #perl6
23:56 pyrimidine joined #perl6
23:57 DarthGandalf joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo