Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-02-28

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 eater joined #perl6
00:01 jkva_ joined #perl6
00:01 agentzh joined #perl6
00:01 unicodable6 joined #perl6
00:02 benchable6 joined #perl6
00:03 ajr_ bye
00:03 hoelzro joined #perl6
00:03 mcmillhj joined #perl6
00:05 isacloud joined #perl6
00:06 plicease joined #perl6
00:07 riatre joined #perl6
00:09 chansen_ joined #perl6
00:09 sjn Zoffix: btw, I can't seem to find any hyper operators on http://map.perl6.party/ ... is that a bug?
00:10 committable6 joined #perl6
00:11 Hotkeys joined #perl6
00:11 M-Illandan joined #perl6
00:11 sjn (also, if it isn't I'm also interested learning how one introspects Perl 6 in order to find available hyperops :)
00:11 Zoffix sjn: hyperops... like, which ones?
00:12 sjn »whatever«
00:12 sjn «+»
00:12 sjn etc.
00:13 domm1 joined #perl6
00:14 Zoffix sjn: those are generated dynamically.
00:14 sjn ok, so... how can I automatically figure out which ones are available? :)
00:14 Zoffix m: say &[RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR,]
00:14 camelia rakudo-moar 61a65c: OUTPUT: «-> |args is raw { #`(Block|38489944) ... }␤»
00:14 pyrimidine joined #perl6
00:15 Zoffix sjn: the subs that make them are in https://github.com/rakudo/rakudo/blob/nom/src/core/metaops.pm I don't know of any mapping that maps syntax to those subs; could be just grammar stuff
00:15 sjn hm
00:17 Zoffix m: say &infix_circumfix_meta_operator:sym<« »>
00:17 camelia rakudo-moar 61a65c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    infix_circumfix_meta_operator:sym<« »> used at line 1␤␤»
00:17 Zoffix Yeah, looks like these bits of grammar handle 'em: https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp#L4086-L4108
00:19 mcmillhj joined #perl6
00:19 * sjn has no idea on how to access that programatically
00:22 adu joined #perl6
00:24 cpage_ joined #perl6
00:26 muraiki joined #perl6
00:32 lizmat joined #perl6
00:34 TimToady they can't be, currently, because they're more-or-less hardwired syntax, and it would be difficult to put them in as mere higher-order functions because they are smart about thunking thunky operators, which functions can't do
00:34 llfourn joined #perl6
00:35 TimToady m: say [||] 1, 2, die "oops"
00:35 camelia rakudo-moar 61a65c: OUTPUT: «1␤»
00:35 TimToady m: say (1, 2, die "oops").reduce(&infix:<||>)
00:35 camelia rakudo-moar 61a65c: OUTPUT: «oops␤  in block <unit> at <tmp> line 1␤␤»
00:36 TimToady so while you could say that .reduce is the HOF underneat [||], it's not entirely accurate
00:37 TimToady really, what you'd need to do is pull proto-rules out of the Perl 6 grammar
00:37 sammers hi #perl6
00:38 TimToady which is pretty much what Zoffix++ was saing already
00:38 TimToady *saying
00:40 dalek joined #perl6
00:46 TimToady m: .say when /meta_operator/ for $?LANG.grammar.^methods».name
00:46 camelia rakudo-moar 61a65c: OUTPUT: «prefix_circumfix_meta_operator␤infix_postfix_meta_operator␤infix_prefix_meta_operator␤infix_circumfix_meta_operator␤postfix_prefix_meta_operator␤prefix_postfix_meta_operator␤postfix_prefix_meta_operator:sym<»>␤prefix_postfix_meta_operator:…»
00:47 TimToady sjn: ^^^
00:47 aborazmeh joined #perl6
00:47 aborazmeh joined #perl6
00:49 TimToady m: .say when /fix '_meta_operator'? ':'/ for $?LANG.grammar.^methods».name
00:49 camelia rakudo-moar 61a65c: OUTPUT: «statement_prefix:sym<BEGIN>␤statement_prefix:sym<COMPOSE>␤statement_prefix:sym<TEMP>␤statement_prefix:sym<CHECK>␤statement_prefix:sym<INIT>␤statement_prefix:sym<ENTER>␤statement_prefix:sym<FIRST>␤statement_prefix:sym<END>␤statement_prefix…»
00:49 TimToady heh
00:50 TimToady well, there's a sense in which statement_prefixes are operators too...
00:50 astj joined #perl6
00:50 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2017/02/28/2017-09-the-ios-are-a-changin/
00:59 TimToady m: .say when /^ < pre in post circum postcircum> fix .*? ":sym" / for $?LANG.grammar.^methods».name
00:59 camelia rakudo-moar 61a65c: OUTPUT: «infix:sym<lambda>␤circumfix:sym<STATEMENT_LIST( )>␤circumfix:sym<( )>␤circumfix:sym<[ ]>␤circumfix:sym<ang>␤circumfix:sym«<< >>»␤circumfix:sym<« »>␤circumfix:sym<{ }>␤postfix_prefix_meta_operator:sym<»>␤prefix_postfix_meta_operator…»
01:00 mcmillhj joined #perl6
01:05 mcmillhj joined #perl6
01:26 agentzh joined #perl6
01:28 sjn TimToady: oh, nice! :D
01:29 timotimo put a <( after ":sym" to make the stuff a bit more compact:
01:29 timotimo m: $/.Str.say when /^ < pre in post circum postcircum> fix .*? ":sym" <( / for $?LANG.grammar.^methods».name
01:29 camelia rakudo-moar 61a65c: OUTPUT: «␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤␤…»
01:29 timotimo whoops :D
01:30 timotimo m: $/.Str.say when /^ < pre in post circum postcircum> fix .*? ":sym" / for $?LANG.grammar.^methods».name
01:30 camelia rakudo-moar 61a65c: OUTPUT: «infix:sym␤circumfix:sym␤circumfix:sym␤circumfix:sym␤circumfix:sym␤circumfix:sym␤circumfix:sym␤circumfix:sym␤postfix_prefix_meta_operator:sym␤prefix_postfix_meta_operator:sym␤infix_circumfix_meta_operator:sym␤infix_circumfix_meta_ope…»
01:30 timotimo m: $/.Str.say when /^ < pre in post circum postcircum> fix .*? ":sym" <( .* / for $?LANG.grammar.^methods».name
01:30 camelia rakudo-moar 61a65c: OUTPUT: «<lambda>␤<STATEMENT_LIST( )>␤<( )>␤<[ ]>␤<ang>␤«<< >>»␤<« »>␤<{ }>␤<»>␤<«>␤<« »>␤«<< >>»␤<[ ]>␤<{ }>␤<ang>␤«<< >>»␤<« »>␤<( )>␤<[; ]>␤<{; }>␤<i>␤<++>␤<-->␤<++>␤<-->␤<ⁿ>␤«->»␤<**>␤<…»
01:30 timotimo of course it then has to match stuff after the "beginning" marker :D
01:32 Actualeyes joined #perl6
01:33 * sjn isn't familiar with the <( syntax
01:34 sjn Aah, it's the capture marker... didn't make sense to me that there was only one of it
01:40 unicodable6 joined #perl6
01:40 committable6 joined #perl6
01:40 benchable6 joined #perl6
01:40 bisectable6 joined #perl6
01:40 evalable6 joined #perl6
01:40 statisfiable6 joined #perl6
01:41 timotimo what's worse, you can put )> before <(
01:42 sjn what's the rationale behind that?
01:42 elaADnlxie significantly reworked versions of *ables are up. Please report issues if there are any
01:42 elaADnlxie (though gonna commit that all tomorrow)
01:43 jeffthedragonsla joined #perl6
01:45 llfourn joined #perl6
01:51 timotimo the rationale? behind being able to put it whereever you want?
01:51 timotimo for one, you can put it into optional groups, for example
01:53 sammers is there a way to create a prefix that captures a subroutine call without executing it? for example, say my prefix is called 'runlater': runlater foo 123; where runlater captures the "foo 123" call without actually running foo(123);
01:53 timotimo that's called "thunking"
01:53 timotimo you need a macro for that purpose
01:53 sammers ok
01:53 obfusk joined #perl6
01:54 sjn hm
01:55 sammers timotimo, the docs don't have anything on macros / thunking yet. Are there any examples you can point me to?
02:00 sammers ok, "use experimental :macros;", nevermind, I will hold off on this idea for now.
02:01 yoleaux joined #perl6
02:01 timotimo we should rename that "use experimental :oldmacros" in anticipation of the new macros landing this or next year
02:01 sammers thanks timotimo, found this older post about macros if anyone is interested http://strangelyconsistent.org/blog/macros-what-are-they-really
02:02 timotimo yeah, mäsak is our macro implementor
02:02 sammers on the topic of experimental features, is there a schedule anywhere with ETAs for upcoming features?
02:03 timotimo hm, what experimental features do we even have? i seem to recall only macros and pack
02:03 sammers also, cache
02:03 sammers collation
02:03 gdonald_ joined #perl6
02:03 timotimo oh, yeah, collation is super new
02:04 sammers what is the idea behind cache?
02:06 timotimo the idea behind the feature or the idea behind making it experimental?
02:07 sammers ok, on the Experimental features page it lists cache as experimental, but we can already use .cache on Lists today. Is it the same method?
02:07 timotimo that's different
02:07 sammers ah
02:07 timotimo the cache thing from experimental is about marking your subs and methods "is cached"
02:08 timotimo which will install a hash for you that is keyed on arguments passed to the sub or method and its values are what it returned the first time it ran with those arguments
02:08 timotimo from then on it'll just return the values from the hash instead of running your sub or method
02:08 timotimo but it's extremely problematic to just choose one way to make the key and be done with it
02:08 timotimo especially for methods
02:09 timotimo like, do you use the actual objects that were passed? then you'll be keeping objects alive until the process dies
02:09 timotimo do you stringify values? then you'll lose the subtle differences between values that stringify to the same thing - especially problematic for user-made types that don't have a fully thought-out .Str method - or none at all!
02:10 sammers will there be a way of doing introspection on the cached subs? to see what actually cached?
02:10 timotimo and if you "is cached" a method, what parts of the invocant (aka the "self") get put into the key? all public attributes? all private attributes, too?
02:10 timotimo that's easy to do, but who knows if we want to offer that
02:11 timotimo i'm actually not sure where the implementation of our experimental "is cached" lives at the moment
02:11 sammers it might be useful when constructing a sub to take advantage of caching more effectively
02:11 astj joined #perl6
02:11 pyrimidine joined #perl6
02:12 timotimo if you're already going past what the thing supplies by default, it's pretty much trivial to write your own cache
02:13 timotimo you can find the implementation of "is cached" in rakudo's lib/experimental.pm6
02:13 sammers thanks, I will take a look
02:14 timotimo all you'd need to do to make the hash available for introspection and manipulation: apply a role to the sub that is parameterized with the hash
02:14 timotimo and create a method that just returns that hash
02:18 user__ joined #perl6
02:23 ZzZombo Sounds like a bug:
02:23 ZzZombo Ambiguous call to 'postcircumfix:<{ }>'; these signatures all match:
02:23 ZzZombo :(Str:D \s, \x, *%_)
02:23 ZzZombo :(\SELF, Iterable \key, :$delete!, *%other)
02:23 ZzZombo called like
02:23 ZzZombo say 'qeegrhddvs'<as for loop>:delete;
02:23 timotimo what were you expecting :D
02:23 ZzZombo Str:D should have precedence, shouldn't it?
02:23 ZzZombo as a less general
02:23 ZzZombo -a
02:24 timotimo actually with the Iterable key and :delete! it might not
02:24 timotimo m: say &postcircumfix:<{ }>.candidates
02:24 camelia rakudo-moar 61a65c: OUTPUT: «(sub postcircumfix:<{ }> (\SELF, \key) { #`(Sub|52618544) ... } sub postcircumfix:<{ }> (\SELF, \key, Mu \ASSIGN) { #`(Sub|52614592) ... } sub postcircumfix:<{ }> (\SELF, \key, Mu :$BIND! is raw) { #`(Sub|52617480) ... } sub postcircumfix:<{ }> (\SELF, \…»
02:24 timotimo m: say &postcircumfix:<{ }>.candidates>>.signature
02:24 camelia rakudo-moar 61a65c: OUTPUT: «((\SELF, \key) (\SELF, \key, Mu \ASSIGN) (\SELF, \key, Mu :$BIND! is raw) (\SELF, \key, :$delete!, *%other) (\SELF, \key, :$exists!, *%other) (\SELF, \key, :$kv!, *%other) (\SELF, \key, :$p!, *%other) (\SELF, \key, :$k!, *%other) (\SELF, \key, :$v!, *%ot…»
02:24 retupmoca joined #perl6
02:28 timotimo anyway, i'm late for bed
02:28 timotimo oh, also: the less general a signature is, the less precedence it gets
02:29 timotimo more clearly:
02:29 ZzZombo what
02:29 timotimo the more specific signature is the one that will get called
02:29 timotimo i think what you get here is the problem where you have parameter 1 with a type constraint in candidate A, and parameter 2 with a type constraint in candidate B
02:29 timotimo and both type constraints match
02:30 timotimo m: multi sub aaaaaah(Str $a, $b) { "first" }; multi sub aaaaaah($a, Int $b) { "second" }; say aaaaaah("hi", 10)
02:30 camelia rakudo-moar 61a65c: OUTPUT: «Ambiguous call to 'aaaaaah'; these signatures all match:␤:(Str $a, $b)␤:($a, Int $b)␤  in block <unit> at <tmp> line 1␤␤»
02:30 timotimo m: multi sub aaaaaah(Str $a, $b) { "first" }; multi sub aaaaaah($a, Int $b) { "second" }; say aaaaaah("hi", "oh")
02:30 camelia rakudo-moar 61a65c: OUTPUT: «first␤»
02:30 ZzZombo that really... comes unexpected
02:30 timotimo m: multi sub aaaaaah(Str $a, $b) { "first" }; multi sub aaaaaah($a, Int $b) { "second" }; say aaaaaah(9, 9)
02:30 camelia rakudo-moar 61a65c: OUTPUT: «second␤»
02:30 timotimo why would it?
02:30 ZzZombo and different to all other languages with overloading.
02:31 timotimo i think we are using the word "general" with complete opposite meanings then
02:31 timotimo which is the more general one, DoTheThing(Object a, Object b) or DoTheThing(String a, String b)?
02:31 ZzZombo none?
02:31 timotimo wat
02:32 timotimo in that case, you're using "general" in a third way that i was not aware of even existed
02:33 ZzZombo "general" as in "more wide", "matches more things", what other meanings does it have here?
02:33 timotimo yeah, "general" is "more wide"
02:33 timotimo so then why would (Object, Object) not be more general than (String, String)?
02:34 timotimo every String is also Object, so Object, Object will match String, String, but every other possible combination of things as well
02:34 timotimo so Object, Object clearly is more general?
02:34 timotimo but you want the *less* general one to be called
02:34 timotimo otherwise you could never ever reach the (String, String) candidate in my example
02:34 ZzZombo if you talk about P6, there is no Object type I'm aware of, so it has to be a user type unrelated to String,
02:34 timotimo you were the one who started with "{ll other languages with overloading"
02:35 timotimo p6 also has no String type either
02:35 ZzZombo languages differ, in many of them strings don't inherit from any objects, so this example was hard to judge.
02:35 timotimo what, really?
02:35 timotimo certainly that's the case in java and c#
02:35 ZzZombo well... yea
02:36 timotimo c++ doesn't have something like Object, except if you count "void *"
02:36 timotimo python is that way, too
02:36 timotimo i mean, not the same way as c++, the same way as java and c#
02:36 timotimo also ruby i believe
02:37 timotimo i imagine haskell has something like the bottom type that everything is derived of (or maybe i mean the top type?)
02:37 ZzZombo Pascal and C++ don't have strings as objects.
02:37 timotimo well, you can surely claim std:: doesn't belong to the language, but i'd call that cheating
02:37 ZzZombo ow,
02:37 ZzZombo I meant C
02:37 timotimo ah
02:37 timotimo yeah, C doesn't really have a native notion of objects in the first place
02:38 timotimo also, C doesn't do any overloading, and i'm not sure if pascal does
02:38 timotimo object pascal probably does, though
02:38 ZzZombo Well, can we go back to topic of why does the Str:D candidate loses, exactly?
02:39 timotimo it doesn't lose
02:39 timotimo it ties with the other candidate
02:39 ZzZombo it doesn't win, I mean
02:39 timotimo candidate one wants the first argument to be a defined string
02:39 timotimo candidate two wants the key to be Iterable
02:39 timotimo the first argument is a defined string, the second argument is an Iterable
02:40 timotimo the second candidate also wants a :delete argument to exist, which it does in this case
02:41 timotimo the second candidate is theoretically narrower (less general) but named arguments don't factor into the calculation at all in p6
02:42 timotimo oh, and the first candidate allows any named to exist, so it doesn't get kicked out because of the :delete you've passed
02:42 timotimo i'm not sure if i'm explaining well
02:47 timotimo which part of what i say doesn't make sense to you?
02:47 SmokeMachine moritz: my Punnable wasnt mentioned... :(
02:47 SmokeMachine https://modules.perl6.org/?q=Punnable
02:47 timotimo wasn't mentioned where?
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!
02:48 timotimo i think my tone was a bit overbearing; sorry about that, i'm dealing with weird withdrawal effects :\
02:49 LeCamarade joined #perl6
02:50 ZzZombo Well, anyway, the bit what makes no sense to me how does it ignore the less generic arguments to the left when deciding what to use in case of a tie.
02:51 timotimo that's just because perl6 doesn't have a rule where matches earlier in the signature win over matches later in the signature
02:51 timotimo i.e. if candidate A matches parameter 1 and candidate B matches parameter 2, no-one wins
02:51 timotimo well, there's the splattering water noise again :\
02:52 ZzZombo I've just refreshed my memory regarding how overloading works, say, in C++: http://cpp.sh/3milb
02:52 timotimo it's not the romantic kind of rain noise you'd get from a "rainy mood website" or something
02:52 ZzZombo The compiler guessed the candidate using the type of the first argument, so there was no ambigous call.
02:53 ZzZombo Why does P6 differ?
02:53 timotimo your c++ example doesn't map to the p6 example
02:53 ZzZombo Well, it was simplified, what do you think? Unless you want to say it's different enough not to illustrate anything.
02:53 mcmillhj joined #perl6
02:54 timotimo http://cpp.sh/23blg
02:54 timotimo this is the equivalent of what you're trying to do and it gives this message:
02:54 timotimo In function 'int main()':
02:54 timotimo 18:12: error: call of overloaded 'x(int*, int*)' is ambiguous
02:54 timotimo 18:12: note: candidates are:
02:54 timotimo 5:6: note: void x(int*, void*)
02:54 timotimo 9:6: note: void x(void*, int*)
02:56 timotimo note how C++ doesn't let the first one win because the earlier parameter matches
02:56 timotimo matches exactly*
03:00 regreg joined #perl6
03:01 * timotimo finally goes to bed
03:06 adu joined #perl6
03:10 pyrimidine joined #perl6
03:11 agentzh joined #perl6
03:12 kyan joined #perl6
03:13 mcmillhj joined #perl6
03:18 xtreak joined #perl6
03:20 pyrimidine joined #perl6
03:22 noganex_ joined #perl6
03:33 _sfiguser joined #perl6
04:04 pyrimidine joined #perl6
04:15 ZzZombo Why all of the sudden my AT-KEY gets a capture for the key?
04:16 ZzZombo multi method AT-KEY(::?CLASS:D: \key) { print 'AT-KEY: ',\key,"\n"; say key.WHAT; <-- Capture }
04:22 mcmillhj joined #perl6
04:28 gdonald_ joined #perl6
04:49 Cabanoss- joined #perl6
04:51 xtreak joined #perl6
04:55 wamba joined #perl6
05:02 TimToady m: my regex abc { ‘aaa’ }; my regex xyz { <&abc> }; say ‘aaa’ ~~ /<xyz>/
05:02 camelia rakudo-moar 61a65c: OUTPUT: «「aaa」␤ xyz => 「aaa」␤»
05:08 pyrimidine joined #perl6
05:16 pyrimidine joined #perl6
05:25 mcmillhj joined #perl6
05:28 xtreak joined #perl6
05:42 Actualeyes joined #perl6
06:04 pyrimidine joined #perl6
06:20 darutoko joined #perl6
06:23 pyrimidine joined #perl6
06:43 xtreak joined #perl6
06:44 ZzZombo joined #perl6
06:44 ZzZombo joined #perl6
06:52 RabidGravy joined #perl6
07:01 mcmillhj joined #perl6
07:05 pyrimidine joined #perl6
07:18 mcmillhj joined #perl6
07:18 cyphase joined #perl6
07:19 bjz joined #perl6
07:19 wamba joined #perl6
07:23 abraxxa joined #perl6
07:25 mcmillhj joined #perl6
07:26 salva0 joined #perl6
07:28 pyrimidine joined #perl6
07:31 andrzejku joined #perl6
07:33 abraxxa joined #perl6
07:48 mcmillhj joined #perl6
07:57 domidumont joined #perl6
08:06 ufobat joined #perl6
08:13 mcmillhj joined #perl6
08:19 _28_ria joined #perl6
08:20 domidumont joined #perl6
08:27 xtreak joined #perl6
08:28 parv joined #perl6
08:28 brrt joined #perl6
08:32 mcmillhj joined #perl6
08:32 zakharyas joined #perl6
08:33 rindolf joined #perl6
08:33 xtreak joined #perl6
08:40 mcmillhj joined #perl6
08:42 llfourn joined #perl6
08:49 mcmillhj joined #perl6
08:55 rindolf joined #perl6
09:02 mcmillhj joined #perl6
09:04 jonas1 joined #perl6
09:04 dakkar joined #perl6
09:21 Ven joined #perl6
09:26 mcmillhj joined #perl6
09:30 ZzZombo m: sub x{ my $*x=$*x // 'abc'};my $*x=123;x
09:30 camelia rakudo-moar 61a65c: ( no output )
09:30 ZzZombo m: sub x{ my $*x=$*x // 'abc'};my $*x=123;say x
09:30 camelia rakudo-moar 61a65c: OUTPUT: «abc␤»
09:30 ZzZombo m: sub x{ my $*x=$*x // 'abc'};my $*x=123;say x,$*x
09:30 camelia rakudo-moar 61a65c: OUTPUT: «abc123␤»
09:33 ZzZombo m: sub x{ with $*x {.say} };my $*x=123;say x,$*x
09:33 camelia rakudo-moar 61a65c: OUTPUT: «123␤True123␤»
09:34 ZzZombo m: sub x{ with $*x {.say} else {say 'NULL'} };my $*x=123;say x,$*x
09:34 camelia rakudo-moar 61a65c: OUTPUT: «123␤True123␤»
09:34 ZzZombo m: sub x{ with $*x {.say} else {say 'NULL'} };x
09:34 camelia rakudo-moar 61a65c: OUTPUT: «NULL␤»
09:34 ZzZombo WTF, doesn't work for me.
09:35 xtreak joined #perl6
09:36 wamba joined #perl6
09:38 gdonald_ joined #perl6
09:44 robertle joined #perl6
09:46 moritz seems to work fine
09:51 Ven maybe upgrade your local rakudo™ :)
09:59 mcmillhj joined #perl6
10:03 masak TimToady: in the case of `my $x; quasi { my $x; quasi { {{{$x}}} } }`, which $x gets bound in the unquote?
10:04 masak TimToady: I've understood earlier remarks from you to mean the answe is "the outer one"; just double-checking
10:04 llfourn joined #perl6
10:04 brrt joined #perl6
10:10 mcmillhj joined #perl6
10:12 * lizmat clickbaits https://p6weekly.wordpress.com/2017/02/28/2017-09-the-ios-are-a-changin/
10:13 Ven lizmat++
10:19 moritz lizmat++
10:21 cyphase joined #perl6
10:21 bbkr_ joined #perl6
10:22 masak lizmat++
10:22 * masak read that as "the iOS are a-changin'" :P
10:23 lizmat :-)
10:23 bbkr_ p6: say (0+1i) * (0+1i); say (0+1i) ** 2   # power Num-ifies aruments? looks like bug to me
10:23 camelia rakudo-moar 61a65c: OUTPUT: «-1+0i␤-1+1.22464679914735e-16i␤»
10:24 huggable joined #perl6
10:24 masak bbkr_: doesn't look like a bug to me
10:24 masak bbkr_: not if you take into account the definition of pow() for complex numbers
10:25 mcmillhj joined #perl6
10:25 masak that, plus, if you're doing complex numbers you're already doing Num under the hood, so on your head be it
10:25 jnthn A complex is defined as two floating point arguments
10:25 masak right
10:26 Ven Zoffix: your M module is very cute, but once again I wish we had a .grep-not :)
10:27 masak Ven: M module?
10:27 masak url?
10:27 Ven https://github.com/zoffixznet/perl6-M masak
10:27 jnthn Ven: is .grep(!*.foo) or .grep({ not .foo }) not enough? :-)
10:27 agentzh joined #perl6
10:28 masak indeed cute
10:28 Ven jnthn: not for the smartmatch-y cases. .grep(/foo/) is nice
10:28 Ven but .grep(* !~~ /foo/) breaks the magic :).
10:28 bbkr_ thanks for explanation. this looks weird that "(0+1i) * (0+1i) == (0+1i) ** 2" gives False :(
10:28 jnthn As in, is too much to type, or doesn't work?
10:28 wictory[m] joined #perl6
10:28 xtreak joined #perl6
10:29 masak bbkr_: welcome to floating-point.
10:29 Ven no, it does work, I'd just like to have something that does !~~ for me, like the current grep does ~~ for me
10:29 jnthn bbkr_: This is exactly why 1.2 and similar are Rat, not Num, in Perl 6.
10:30 masak bbkr_: http://www.floating-point-gui.de/ ;)
10:30 * masak hopes that last URL doesn't come across as too patronizing
10:30 bbkr_ :)
10:30 masak it's a good resource.
10:30 jnthn bbkr_: But for Complex, Rat would probably be an odd default given most use cases for them would want floating point.
10:30 jnthn Warts and all
10:31 jnthn I think it's been speculated that there could be a Complex[Rat,Rat] at some point in the future
10:31 brrt joined #perl6
10:32 masak not sure you need one type parameter for each axis... :P
10:32 * masak .oO( I'll have a complex number with the reals being integers and the imaginaries being 2-adic numbers, please )
10:33 jnthn hah, point :P
10:34 bbkr_ masak: that's exactly what I was thinking after reading "If the right-hand side is a non-negative integer and the left-hand side is an arbitrary precision type (Int, FatRat), then the calculation is carried out without loss of precision." in docs. that Complex is made of 2 Ints, therefore it should be calculated without precision loss
10:34 mcmillhj joined #perl6
10:35 moritz bbkr_: we don't have Complex made of Ints yet
10:35 moritz bbkr_: all our Complex are (num, num) right now
10:35 masak jnthn: the one thing I'm looking forward to, though, is Complex[Complex] :P
10:35 moritz and nobody seems to bother enough to do anything about it
10:36 masak my pet peeve about Complex is when people use them as a pair of numbers (and nothing more)
10:37 jnthn Why? 'cus it's...an overly-complex solution? :P
10:37 masak something like that
10:38 masak it doesn't carry the right kind of intent for me
10:38 jnthn *nod*
10:38 masak to me, the notable thing about complex numbers isn't "a pair of numbers" (though I guess it is for many, which kind of explains it)
10:38 masak it's the fact that i * i == -1
10:38 masak m: say i * i
10:38 camelia rakudo-moar 61a65c: OUTPUT: «-1+0i␤»
10:39 Ven .oO( How could you not use this opportunity to showcase ² )
10:39 Ven m: -1² # I have no idea what the priority is
10:39 camelia rakudo-moar 61a65c: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "-" in expression "-1²" in sink context (line 1)␤»
10:40 Ven m: say -1² # looks like - comes later?
10:40 camelia rakudo-moar 61a65c: OUTPUT: «-1␤»
10:40 masak yes, prefixes tend to be looser than postfixes
10:40 masak the exception being :
10:40 Ven I guess, much like in JS and others, we don't have negative literals :).
10:40 masak m: my $d = 42; say :$d.perl
10:40 camelia rakudo-moar 61a65c: OUTPUT: «:d(42)␤»
10:40 Ven m: my %h = -1 => a; say %h.perl;
10:40 camelia rakudo-moar 61a65c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    a used at line 1␤␤»
10:41 Ven m: my %h = -1 => 'a'; say %h.perl; # barefails
10:41 camelia rakudo-moar 61a65c: OUTPUT: «{"-1" => "a"}␤»
10:41 Ven m: my %h = 1 => 'a'; say %h.perl; # look ma, no strings(?)
10:41 camelia rakudo-moar 61a65c: OUTPUT: «{"1" => "a"}␤»
10:41 masak Ven: we don't, but thankfully the "constant parameter default" mechanism recognizes prefix:<-> as a part of a constant value
10:41 masak thanks to jnthn++, I believe
10:42 mcmillhj joined #perl6
10:42 Ven okay, thanks. we're better off than the aforementioned JS, where {-1: 1} is a parse error (because it expects a literal) :)
10:42 jnthn masak: I don't think that was me, fwiw :)
10:42 jnthn Or at least, I don't remember doing that :)
10:42 masak Ven: Perl 6's object notation isn't so literal-minded :P
10:43 masak jnthn: I'm not gonna retract that increment, if that's what you're hoping for :P
10:43 Ven .oO( I always pretend I didn't do anything, in case it ever breaks )
10:43 xtreak joined #perl6
10:47 cyphase joined #perl6
10:50 mcmillhj joined #perl6
10:51 andrzejku joined #perl6
10:56 n1ce joined #perl6
11:01 ZzZombo I had to replace
11:01 ZzZombo callwith SELF,@a,|%_;
11:01 ZzZombo with
11:01 ZzZombo CORE::{'&postcircumfix:<{ }>'}(SELF,@a,|%_);
11:01 ZzZombo because the first complained about too many positional arguments (2), expected 1.
11:02 ZzZombo Why tho?
11:02 Zoffix - with ints in sig was TimToady's doing IIRC and I made it work for all numerics.
11:03 Zoffix The priority in -1² is exactly the same as in regular math: -(1²)
11:03 Zoffix I don't get how .grep-not(/foo/) is better than .grep({!/foo/})
11:11 mcmillhj joined #perl6
11:12 Zoffix lizmat++ good weekly
11:12 zakharyas joined #perl6
11:18 cyphase joined #perl6
11:19 ZzZombo This is stupid. Why should Ranges somehow get messed up when passing them around, unlike other objects?
11:19 ZzZombo m: say my $x=0..*
11:19 camelia rakudo-moar 61a65c: OUTPUT: «0..Inf␤»
11:20 ZzZombo m: my $x=0..*;sub x($x){ $x.say };x $x;
11:20 camelia rakudo-moar 61a65c: OUTPUT: «0..Inf␤»
11:20 ZzZombo wtf
11:21 moritz ZzZombo: please tone done your swearing a bit
11:21 ZzZombo m: my $x=0..*;sub x($x){ (1,2,3,4,5,6)[$x] };say x $x;
11:21 camelia rakudo-moar 61a65c: OUTPUT: «Cannot coerce Inf to an Int␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
11:21 ZzZombo m: my $x=0..*;sub x($x is raw){ (1,2,3,4,5,6)[$x] };say x $x;
11:21 camelia rakudo-moar 61a65c: OUTPUT: «Cannot coerce Inf to an Int␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
11:21 grondilu joined #perl6
11:21 ZzZombo m: my $x:=0..*;sub x($x is raw){ (1,2,3,4,5,6)[$x] };say x $x;
11:21 camelia rakudo-moar 61a65c: OUTPUT: «(1 2 3 4 5 6)␤»
11:21 ZzZombo why is that?
11:23 ZzZombo Now I have to track down where exactly did I forget `is raw` or binding it instead of assigning.
11:23 jnthn Because $x is a Scalar container
11:23 moritz might be a difference in how the [] subscript deals with containerized vs. not-containerized values
11:23 jnthn If you assign into it you are putting something into the container
11:23 jnthn If you bind, you're replacing the container with a value
11:24 jnthn And then [...] subscripting cares about whether there's an item or not
11:24 jnthn m: my @a = 1..5; my @b = 1..3; say @a[@b]; say @a[$@b]
11:24 camelia rakudo-moar 61a65c: OUTPUT: «(2 3 4)␤4␤»
11:24 mcmillhj joined #perl6
11:25 jnthn Probably better to just use sigilless vars which imply no context
11:25 jnthn That's primarily why they exist
11:25 ZzZombo But it comes from within a hash :S
11:26 ZzZombo unless there is a way to make it as a whole "sigilles"... is there?
11:28 jnthn Could also bind into the hash in the first place, or just do <> at the point of use
11:28 ZzZombo it was bound in the hash
11:29 ZzZombo %h<range>:=0..* if %h<range>:!exists;
11:29 ZzZombo and it is not set up otherwise in the test.
11:30 jnthn m: my %h; %h<range> := 0..*; m: my @a = 1..5; say @a[%h<range>];
11:30 camelia rakudo-moar 61a65c: OUTPUT: «(1 2 3 4 5)␤»
11:31 jnthn m: my %h; %h<range> := 0..*; sub x(\r) { my @a = 1..5; say @a[r] }; x %h<range>;
11:31 camelia rakudo-moar 61a65c: OUTPUT: «(1 2 3 4 5)␤»
11:32 ZzZombo m: my %h; %h<range> := 0..*; sub x(%_) { my @a = 1..5; say @a[%_<range>] }; x %h; # more like this in my code
11:32 camelia rakudo-moar 61a65c: OUTPUT: «(1 2 3 4 5)␤»
11:33 ZzZombo duh
11:34 _sfiguser joined #perl6
11:36 ZzZombo m: my %h; %h<range> := 0..*; sub x(%_) { my @a = 1..5; say @a[%_<range>] }; my %h2=%h; x %h2
11:36 camelia rakudo-moar 61a65c: OUTPUT: «Cannot coerce Inf to an Int␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in sub x at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
11:36 ZzZombo Bingo
11:36 ZzZombo this is really so fragile, I can't believe.
11:37 avalenn joined #perl6
11:37 lukaramu joined #perl6
11:37 dp[m] joined #perl6
11:37 M-Illandan joined #perl6
11:37 tadzik joined #perl6
11:37 Matthew[m] joined #perl6
11:37 unclechu joined #perl6
11:37 ilmari[m] joined #perl6
11:37 xui_nya[m] joined #perl6
11:37 CIAvash[m] joined #perl6
11:38 moritz it's mostly fragile because there are so many edge cases you need to consider
11:38 mienaikage joined #perl6
11:39 jnthn ZzZombo: If you know it's going to be a range at the point of use, it'd probably be better to do <>
11:39 moritz and it took us quite some time (like, years) to get it right
11:41 ZzZombo jnthn: can you show what exactly do you mean?
11:43 mcmillhj joined #perl6
11:44 Zoffix Can I somehow get at Perl6::Compiler?
11:44 Zoffix Wanna do REPL.new(compiler, %).repl-eval("die"); but I can't figure out where to get the compiler from
11:45 brrt iirc, there was something called 'getcomp'
11:46 moritz m: use nqp; say nqp::getcomp('perl6').^name
11:46 camelia rakudo-moar 61a65c: OUTPUT: «Perl6::Compiler␤»
11:46 jnthn nqp::getcomp
11:46 Zoffix m: use Perl6::Compiler:from<NQP>; Perl6::Compiler.new
11:46 camelia rakudo-moar 61a65c: ( no output )
11:46 Zoffix Thanks.
11:46 jnthn m: my $a = 0..*; my @a = 1..5; say @a[$a<>]
11:46 camelia rakudo-moar 61a65c: OUTPUT: «(1 2 3 4 5)␤»
11:46 jnthn ZzZombo: ^^
11:46 jkva_ joined #perl6
11:46 adu joined #perl6
11:48 regreg joined #perl6
11:48 ZzZombo but the thing is, I wanted to cover as many possibilities to index the object in a single parameter.
11:49 ZzZombo like [*], [], [1..2], [*-3,*-1], etc
11:50 mcmillhj joined #perl6
11:53 TBSliver joined #perl6
11:53 andrzejku joined #perl6
11:53 xui_nya[m] joined #perl6
11:56 zakharyas joined #perl6
11:57 chee joined #perl6
12:03 lizmat joined #perl6
12:07 mienaikage joined #perl6
12:08 user9 joined #perl6
12:08 ilmari[m] joined #perl6
12:08 darutoko joined #perl6
12:09 aindilis joined #perl6
12:09 gregf_ joined #perl6
12:10 tbrowder mornin' #perl6
12:11 araraloren joined #perl6
12:12 xtreak joined #perl6
12:12 mcmillhj joined #perl6
12:14 tbrowder i was just looking at the perl6 home page and wonder what you think about two possible changes: (1) make the upper-left Camelia a hot link to the home page from all the other perl6 pages and (2) add some kind of modest svh animation to one or more pages.
12:14 tbrowder s/svh/svg/
12:19 DrForr I'd agree to the Camelia link, in retrospect I'm a bit surprised it wasn't that way already.
12:19 tbrowder one example of animation is to make the larger Camelia flutter a small amount periodically. the flutter could be just a minor rotation cw then ccw a few degrees. the time interval and flutter amount could be randomized. of course TimToady would have to approve since Camelia is his and the orientation is currently fixed as is.
12:21 * masak laughs out loud at "of course TimToady would have to approve"
12:21 tbrowder well it's his copyright
12:21 masak we're talking about rotating a logo by a few degrees
12:23 dp[m] joined #perl6
12:23 Zoffix -1 to any animation or fluttering unless there's an easy way to disable it. For me, it'd make the page completely unreadable.
12:24 abraxxa joined #perl6
12:24 Zoffix https://www.webaccessibility.com/best_practices.php?technology_platform_id=11
12:24 masak there used to be a time when Esc in the browser stopped all animations
12:24 masak I miss that
12:25 Zoffix Yeah, I don't get why it was apparently rwmoved.
12:26 tbrowder i don't think minor and slow reorientation occasionally would trigger an epilepticc fit or bting on the internet police
12:27 masak Zoffix: there's probably an interesting story behind that, but I don't know it
12:27 tbrowder (mumble stupid virtual keyboard...)
12:28 masak tbrowder: I would agree, but I could also argue Zoffix's PoV. in this case, what would be the *usability* story for such an animation
12:28 masak other that "we're cute!", I guess
12:28 DrForr Accessibility isn't about triggering epilepsy or being PC, it's about being available to the widest crowd possible.
12:28 masak if the animation doesn't work, it doesn't work
12:28 masak can still view the page in lynx
12:28 tbrowder yeah, "cute" to make Camelia seem alive
12:30 lizmat joined #perl6
12:30 cyphase joined #perl6
12:30 masak I'm not sure making Camelia seem alive is a goal of perl6.org
12:30 masak do you know any other languages (python, ruby, etc) whose logotype moves?
12:31 DrForr I empathize with the desire, my problem is that movement is going to distract, and a fluttering of wings in the UL corner of the screen is going to make my eyes flicker to that corner of the screen when I'm trying to puzzle out what @f>><==@bar means, which is going to be distracting as all f*ck.
12:31 brrt i'm not sure which part of this is not bikeshedding :-)
12:31 tbrowder DrForr: i was just referring to a bit of the rules Zoffix pointed out--don't think it would fall under the guidelines if done modestly--wouldn't affect content really
12:31 Zoffix tbrowder: a person with cognitive disability just told you the feature would make the page unreadable... feels strange to me you dismiss it as "internet police". There are user scrips to fight it, of course...
12:31 tbrowder why would it be unreadable?
12:32 tbrowder i'm not unsympathetic, just trying to understand...
12:33 DrForr I could argue for it on the front page where your eyes are already flickering around trying to find the topic you're after, it gives some action and life to the page. But if I'm reading docs, the last thing I want is some damn animation distracting me from trying to read the text. I'm already assaulted by enough of that crap on an hourly basis.
12:34 lucasb joined #perl6
12:34 Zoffix tbrowder: every time the butterfly would move your full attention moves to it, then you have to go back and try to find where you were reading, until it moves again, and quickly the brain starts to anticipate the next movement, just focusing on it, so you have to block it out by scrolling away or with your hand or movinf another window over it
12:34 lucasb re animated logos: you can play with Crystal logo here: https://crystal-lang.org/ , try spinning it
12:35 Zoffix or using AdBlock to block the image, if it is an image
12:35 lucasb cute, no?
12:35 DrForr That's why I like focus-follows-mouse on window managers that have it. I can scroll around in a window at the bottom of a stack of 10 to find a line and mouse back to the terminal without losing my hierarchy.
12:37 masak lucasb: not really :P
12:37 lucasb :)
12:38 mcmillhj joined #perl6
12:38 timotimo i just made my xfwm4 not raise windows when i use the scrollwheel on 'em
12:39 DrForr Again, just to make myself clear, I'm fine with it on the home page and maybe pages like 'download' where you're either making a decision or waiting for software. Not on documentation, especially language docs where we have long pages of text.
12:39 timotimo (window manager tweaks -> accessibility -> raise windows when any mouse button is pressed"
12:39 timotimo ")
12:39 timotimo ZzZombo: you still awake? interested in talking about the ambiguous dispatch case any more, or is that no longer an issue?
12:40 DrForr Also on some mobile browsers animations refocus the page to the top when they cycle.
12:40 brrt pro: cute; con: everything
12:40 timotimo m(
12:41 timotimo there's a subreddit that has an animated banner that scrolls through from right to left and it has a "stop animation" button that just links to the mobile version of reddit on that same subreddit
12:42 Zoffix heh
12:42 movl joined #perl6
12:44 pmurias joined #perl6
12:46 ZzZombo timotimo: uh, I don't even remember what my code looked like this morning anymore.
12:47 cibs joined #perl6
12:47 pyrimidine joined #perl6
12:48 mcmillhj joined #perl6
12:49 timotimo that's cool
12:50 rindolf joined #perl6
12:53 pyrimidine joined #perl6
13:02 cibs joined #perl6
13:04 lucasb when 6.d is scheduled? can I leave my suggestions here on the channel?
13:05 lizmat #perl6-dev may be a better place ?
13:05 lucasb right, thanks lizmat
13:06 Zoffix Wow, $5 Linode... RIP shared hosting.
13:08 chee joined #perl6
13:08 buggable joined #perl6
13:08 Geth joined #perl6
13:08 huggable joined #perl6
13:08 newbie1 joined #perl6
13:09 NeuralAnomaly joined #perl6
13:09 mcmillhj joined #perl6
13:13 lichtkind joined #perl6
13:14 timotimo ugh, reading about the CloudPets database situation makes me sick
13:15 timotimo https://www.troyhunt.com/data-from-connected-cloudpets-teddy-bears-leaked-and-ransomed-exposing-kids-voice-messages/ - if you want to vomit alongside me
13:17 DrForr Just read that from another source.
13:17 DrForr Or at least the headline portion.
13:20 timotimo yeah, guess what
13:20 timotimo they left their mongodb accessible from the public internet
13:20 timotimo multiple parties copied their whole database off-site and left a ransom demand database next to the original data
13:20 El_Che well
13:20 El_Che in my view that part is irrelevant
13:20 El_Che the part that matters is why are they keeping all that stuff
13:20 timotimo to put a cherry on top, the company later responded saying it's just "a very minimal issue"
13:21 timotimo that's not surprising
13:21 timotimo it's just how the app works
13:21 El_Che the fly on top the Internet-Of-Shit
13:22 DrForr So they got hit by the MongoDB "exploit" that made the rounds last month or so, and just now were forced to report it due to whatever timeline issues?
13:23 timotimo at least this time the physical addresses of folks weren't in the database
13:23 timotimo i don't remember an exploit
13:23 DrForr Freely accessible, I see.
13:23 timotimo yes
13:24 timotimo and every voice message and profile photo was just put onto s3 without any further requirements for authentication
13:26 SmokeMachine m: say True ⁇ "OK" ‼︎ "NOK" # :(
13:26 camelia rakudo-moar 2ad93c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say True7⏏5 ⁇ "OK" ‼︎ "NOK" # :(␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement m…»
13:27 SmokeMachine u: ⁇
13:27 unicodable6 SmokeMachine, U+2047 DOUBLE QUESTION MARK [Po] (⁇)
13:28 SmokeMachine u: ‼︎
13:28 unicodable6 SmokeMachine, U+203C DOUBLE EXCLAMATION MARK [Po] (‼)
13:28 unicodable6 SmokeMachine, U+FE0E VARIATION SELECTOR-15 [Mn] (◌︎)
13:28 SmokeMachine m: say True ⁇ "OK" ‼ "NOK"
13:28 camelia rakudo-moar 2ad93c: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3say True7⏏5 ⁇ "OK" ‼ "NOK"␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statement modifier…»
13:28 ZzZombo wait, what is the difference between a package and a module?
13:29 dp[m] joined #perl6
13:30 SmokeMachine shouldn't ⁇ ‼ work?
13:30 timotimo you can make it work
13:31 lizmat .u ⁇
13:31 yoleaux U+2047 DOUBLE QUESTION MARK [Po] (⁇)
13:31 lizmat .u ‼
13:31 yoleaux U+203C DOUBLE EXCLAMATION MARK [Po] (‼)
13:31 lizmat wow
13:31 SmokeMachine timotimo: I can try... but should it work?
13:31 timotimo why does it stop at double, though? why can't we have triple?
13:31 timotimo i mean we have triple period in …
13:32 timotimo also, it'd be lovely if we could have TRIPLE LATIN CAPITAL LETTER X for the bad-ass action movie
13:32 lukaramu_ joined #perl6
13:33 DrForr Tempted to s/.ass// there but will reserve as it was kinda fun.
13:33 avalenn joined #perl6
13:33 timotimo i was still a little child, very impressionable, when that movie came out
13:36 DrForr I just saw the latest outing in the franchise last week.
13:37 gdonald_ joined #perl6
13:38 DrForr Must've missed at least one because I had no idea why they needed the deus ex at the end, but I guess there was at least one movie I missed.
13:38 SmokeMachine u: EXCLAMATION MARK
13:38 unicodable6 SmokeMachine, U+0021 EXCLAMATION MARK [Po] (!)
13:38 unicodable6 SmokeMachine, U+00A1 INVERTED EXCLAMATION MARK [Po] (¡)
13:38 Khisanth joined #perl6
13:38 unicodable6 SmokeMachine, 22 characters in total: https://gist.github.com/00ab817a6ac83f34f13e3cba996eb085
13:39 * DrForr looks to see if there's a COMBINING RIGHT EXCLAMATION MARK...
13:41 DrForr .u  ⃒
13:41 yoleaux U+20D2 COMBINING LONG VERTICAL LINE OVERLAY [Mn] (◌⃒)
13:41 DrForr That's close but not there.
13:42 sammers joined #perl6
13:42 ZzZombo m: say 1234 ~~ all(* > 0,* %% 2==0,*-4==1230)
13:42 camelia rakudo-moar 2ad93c: OUTPUT: «False␤»
13:42 ZzZombo m: say 1234 ~~ all(* > 0,* % 2==0,*-4==1230)
13:42 camelia rakudo-moar 2ad93c: OUTPUT: «True␤»
13:43 ZzZombo m: say 1234 ~~ all((* > 0,* % 2==0,*-4==1230))
13:43 camelia rakudo-moar 2ad93c: OUTPUT: «True␤»
13:43 ZzZombo so is it deep?
13:43 mcmillhj joined #perl6
13:43 ZzZombo m: say 1234 ~~ all()
13:43 camelia rakudo-moar 2ad93c: OUTPUT: «True␤»
13:44 timotimo all implements "single-arg rule" semantics, i think
13:44 timotimo so you can do stuff like all(@a) > 4
13:44 timotimo it's not "deep" though, it just iterates the outermost list
13:45 ZzZombo hmm
13:45 abraxxa joined #perl6
13:46 ZzZombo what if I have a list of conditions to pass, with nested lists to AND-group them, how would I do it nicely and concise?
13:50 moritz you can nest all() junctions inside any() junctions
13:50 moritz but in general, people tend to over-use junctions. Don't
13:51 moritz they are need for short boolean matchers, but if you base the design of your programs on junctions, it'll byte you
13:52 rindolf joined #perl6
13:54 * masak .oO( it'll nybble you )
13:54 * DrForr sets out the playtes.
13:56 Zoffix m: class Foo { has $.bar = 72 }.perl.say
13:56 camelia rakudo-moar 2ad93c: OUTPUT: «Foo␤»
13:56 Zoffix I thought .perl included public attributes?
13:56 Zoffix Oh
13:56 Zoffix m: class Foo { has $.bar = 72 }.new.perl.say
13:56 camelia rakudo-moar 2ad93c: OUTPUT: «Foo.new(bar => 72)␤»
13:56 Zoffix never mind
13:56 masak in related news, I realized the other day that what I tried to do by overriding infix:<&&> (which didn't work), can instead be done by just using infix:<&>
13:56 masak moritz' advice still stands, though -- they are overused
13:57 * perlpilot actually tends to under-use junctions
13:57 lizmat masak: related to that, I was hoping for another type of signature that would make infix:<&&> a normal sub
13:58 masak lizmat: reminds me of one of my early macros blog posts
13:58 timotimo masak: in my shooter game i'm using complex numbers for cartesian coordinates. would it be fine to you if i implemented "rotate 90 degrees around origin" by multiplying with i? :)
13:58 * DrForr just converted a bunch of stuff in Perl6::Parser to use method sigil { Q{$} } just to get an attribute out of the data dump.
13:58 lizmat in any case, that would require some new binding code
13:58 lizmat and a general slowdown  :-(
13:58 timotimo it's only a compile-time slowdown, though?
13:58 masak lizmat: also, https://github.com/masak/007/issues/154
13:58 Geth ¦ specs: eccde7873a | (Zoffix Znet)++ | v6d.pod
13:58 Geth ¦ specs: Reword requirem,ents for idea  submitions
13:58 Geth ¦ specs: review: https://github.com/perl6/specs/commit/eccde7873a
13:59 masak timotimo: I think so, yes. if you got any actual use out of the rotation.
13:59 jnthn lizmat: The "another type of signature" is actually "another type of sub", called a macro. ;-)
13:59 timotimo masak: well ... not yet! but maybe in the future?
13:59 masak jnthn: (but see the linked issue)
13:59 timotimo also, i use .polar and .unpolar a bunch, even though in my case it's quite a bit of unnecessary overhead
14:00 lizmat jnthn: I could live with that  :-)
14:00 masak jnthn: tl;dr: there's a tendency to write macros as if they were subs with lazily-evaluated parameters. that "shortcoming" or thinko could *itself* be turned into a macro (trait), which code-walks the sub and turns it into the corresponding macro
14:01 masak issue #151 shows an example with infix:<//> (also a macro)
14:02 timotimo is that an issue in 007?
14:02 timotimo oh
14:02 timotimo now i see the link
14:02 koki joined #perl6
14:02 jnthn masak: I'd expect it to be something like macro infix:<&&>($a, $b) { quasi { my \tmp = {{{$a}}}; if tmp { tmp } else { {{{$b}}} } } }
14:02 Juerd What are those group-hugged variables?
14:03 masak jnthn: aye
14:03 masak Juerd: unquotes
14:03 Juerd Oh, macro specific?
14:03 timotimo yup
14:03 masak aye
14:03 Juerd Thanks
14:03 timotimo that's old-style macros, though :)
14:04 timotimo will new-style macros only differ by having an "@ expression" part inside the hugs?
14:04 masak {{{Q::Term @ $a}}}
14:05 masak but Q::Term is the default, so you can shorten it to just {{{$a}}}
14:05 masak there's also a "cleaner" competing syntax that we're still evaluating: unquote(Q::Term @ $a) and unquote($a)
14:05 timotimo oh, it's the other way around
14:05 masak it is now, yes
14:06 masak for reasons similar to why we put the regex adverbs at the front of the regex
14:06 timotimo that looks kind of like you could also write unquote($type @ $stuff)
14:06 timotimo which i suppose you can
14:06 masak you mean with an actual variable $type?
14:06 timotimo yup
14:07 masak no, not unless it's a constant, and maybe not even then
14:07 masak remember that this affects the *parser*
14:07 masak :)
14:07 timotimo hm. so it'd have to be a big if/else
14:07 timotimo maybe you mean a different kind of variable there, though
14:07 timotimo i mean a variable that's inside the macro, not inside the quasiquote
14:07 timotimo so it essentially is a constant at the time of constructing the AST to use
14:08 masak it needs to be a value known at parse time
14:08 masak because the parser is going to go into some state based on the shape of the unquote
14:08 masak "always know what language you're parsing"
14:08 timotimo right
14:09 perlpilot .oO(  Macros need a better vocabulary so that we can talk about macro-ish concepts without getting confused about timing or "level" )
14:09 masak perlpilot: "early", "late" :)
14:09 timotimo %)
14:10 timotimo essentially i was thinking of something at the same level as this:
14:10 timotimo if $type eq "term" { return quasi { unquote(Q::Term @ $foo) } } elif $type eq "statement" { return quasi { unquote(Q::Stmt @ $foo) } } elif $type eq "duck" { ... }
14:13 eroux joined #perl6
14:13 Zoffix m: sub foo { return ($^a, False) }; my ($a, $b) = foo Slip; dd [$a, $b]
14:13 camelia rakudo-moar 05add4: OUTPUT: «[Slip, Bool::False]␤»
14:13 CIAvash[m] joined #perl6
14:13 Zoffix Is there a way to call foo with some value that would affect what ends up being in $b?
14:14 masak correction: junctions didn't work. instead they byted me :P
14:14 timotimo m: sub foo { return ($^a, False) }; my ($a, $b) = foo Slip.new(); dd [$a, $b]
14:14 camelia rakudo-moar 05add4: OUTPUT: «[Bool::False, Any]␤»
14:14 timotimo hm
14:15 Zoffix m: sub foo { return ($^a, False) }; my ($a, $b) = foo Slip.new(42, 55); dd [$a, $b]
14:15 camelia rakudo-moar 05add4: OUTPUT: «[42, 55]␤»
14:15 Zoffix timotimo++
14:15 timotimo i wrote "hm" because i thought it didn't work, but it did actually work
14:15 timotimo so that's nice
14:19 Zoffix I'm guessing nqp::getcomp("perl6").eval does not get the lexical scope of the code it's run it? As in, I can safely use a dynamic variable and it won't see it?
14:20 jnthn Dyanmic variables use dynamic scope
14:20 timotimo dynamic variables aren't lexically scoped, they are dynamically scoped
14:20 jnthn So lexical scope is irrelevant
14:20 jnthn And yeah, it'll be seen
14:20 Zoffix Ph
14:20 Zoffix *Oh
14:21 jnthn m: sub foo() { my $*a = 42; bar() }; sub bar() { EVAL 'say $*a' }; foo
14:21 camelia rakudo-moar 05add4: OUTPUT: «42␤»
14:21 Zoffix OK, lexical variables aren't seen at  least.
14:21 jnthn Right, you have to arrnage specially for lexicals via outer_ctx
14:21 cyphase joined #perl6
14:21 Zoffix Oh, so you still can reach them from within the evaled code?
14:22 timotimo only if you supply the outer_ctx to EVAL
14:22 Zoffix Ah
14:22 Zoffix OK
14:22 Zoffix Thanks
14:22 SmokeMachine timotimo: it passed on the tests... but im sure that's not the best way to do it: https://github.com/FCO/rakudo/commit/aeaa7f46d8143bb059461e530c75ae34e551c14d
14:23 timotimo huh, that <!before '??'> looks suspicious
14:23 timotimo oh, that's for ???, not for ??
14:24 timotimo i'd throw out the ⁇ there unless you want to make ??? spell-able as ?⁇
14:24 timotimo and i think the dupprefix for ⁇ is not an issue
14:24 Zoffix You're add ⁇ as Mexican version of ?? !! ?
14:24 Zoffix *adding
14:24 timotimo is "mexican" the opposite of "texas" now?
14:25 Zoffix Yes :)
14:25 SmokeMachine Zoffix: why mexican?
14:25 SmokeMachine hum!
14:25 Zoffix Because it's opposite of Texas
14:25 Zoffix duh :)
14:25 huf but surely texas is basically mexico
14:25 timotimo now do we want to allow a texmex for that?
14:25 lizmat hmmm.....  isn't this 6.d worthy ?
14:26 Zoffix lizmat: how come? I don't think it'd break any of 6.c-errata tests.
14:26 lizmat I seem to recall a discussion about ≥ and friends ?
14:26 Zoffix My recollection of tha tdiscussion is TimToady wanting to make it possible for users to declare such ops first.
14:26 cdg joined #perl6
14:26 lizmat I mean, why don't we have ≥ and ⪬ as well ?
14:27 brrt it does rather shaft things into the namespace of the user, imho
14:27 brrt if we are to do that, it'd be very nice to collect all these changes together and do it at one go
14:27 Zoffix Agreed.
14:28 timotimo do we want to put some wording into rakudobrew's readme to suggest to people that they probably don't want this?
14:28 Zoffix lizmat: I doubt I'd find it in logs, but I fuzzily remember TimToady wanted to make it possible for users to declare such ops and then we'd just add an op in SETTING
14:30 bwisti joined #perl6
14:30 Zoffix timotimo: yes
14:31 Zoffix maybe even some message on installation or something.
14:32 ZzZombo m: say $x for (1,2,3)->$x
14:32 camelia rakudo-moar 05add4: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$x' is not declared␤at <tmp>:1␤------> 3say 7⏏5$x for (1,2,3)->$x␤»
14:32 ZzZombo :(
14:32 SmokeMachine so, shouldn't I PR the mexican version of ?? !! ?
14:32 timotimo ZzZombo: write a slang to make that work, i guess?
14:32 timotimo the reason why you can use -> with for is because for just takes a block
14:32 Zoffix SmokeMachine: I'd want to hear TimToady's opinion on the matter first.
14:32 kaare_ joined #perl6
14:32 timotimo and blocks can start with -> if they want to have a signature
14:33 timotimo but also:
14:33 timotimo you can't use $x before it's declared
14:33 timotimo so the code would have to be "say my $x for (1,2,3)->$x"
14:33 SmokeMachine Zoffix: ok... Ill save that on my repo... :)
14:33 Zoffix SmokeMachine: it's easy to shove all sorts of weird operators because they look cute to you on IRC, but the amount of people who'll actually use them is pretty small, I'd think.
14:34 * Zoffix still has nightmares from U+2212 minus
14:34 Zoffix It's not even entirely fixed.
14:34 Zoffix m: printf '%−2s', 'foo'
14:34 camelia rakudo-moar 05add4: OUTPUT: «Directive −2s is not valid in sprintf format sequence %−2s␤␤»
14:34 Zoffix ^ and fixing that would bleed it into nqp
14:34 SmokeMachine Zoffix: probably just me... (just because "I am writing it")
14:34 Zoffix well, proper way of fixing it would
14:36 Zoffix I highly doubt there's any programming shop with more than 3 people who'd allow their programmers to use Mexican operators.
14:37 [Coke] any sixers going to the NY pm meeting on 3/14 ?
14:38 SmokeMachine timotimo: did you mean this? https://github.com/FCO/rakudo/commit/e9f277795d79f3ccb73c3496cbc269ba3cd086c1 it still works and the tests are passing...
14:38 ZzZombo m: say :a(123)
14:38 camelia rakudo-moar 05add4: OUTPUT: «Unexpected named argument 'a' passed␤  in block <unit> at <tmp> line 1␤␤»
14:39 ZzZombo m: say (:a(123))
14:39 camelia rakudo-moar 05add4: OUTPUT: «a => 123␤»
14:39 SmokeMachine m: say 'a' => 123
14:39 camelia rakudo-moar 05add4: OUTPUT: «a => 123␤»
14:39 tadzik joined #perl6
14:40 Zoffix m: say 123 R=> 'a'
14:40 camelia rakudo-moar 05add4: OUTPUT: «a => 123␤»
14:40 Zoffix m: say [=>] 'a', 123
14:40 camelia rakudo-moar 05add4: OUTPUT: «a => 123␤»
14:41 masak m: my $x = "a"; $x =>= 123; say $x
14:41 camelia rakudo-moar 05add4: OUTPUT: «Potential difficulties:␤    Useless use of =>= in sink context␤    at <tmp>:1␤    ------> 3my $x = "a"; $x 7⏏5=>= 123; say $x␤a => 123␤»
14:42 masak TimToady: ^ what do you think about the above "useless use"?
14:42 masak (seems discriminating to the mutating-cons crowd) :P
14:44 jnthn I'd have somewhat expecting that to complain it was too fiddly :)
14:44 masak that was my expectation too!
14:44 masak but given that it works, I'm instead annoyed that it complains :P
14:44 CIAvash[m] lizmat: http://irclog.perlgeek.de/perl6/2016-01-09#i_11859391 the issue is that if users define those operators, the chaining won't work
14:45 lichtkind_ joined #perl6
14:45 Zoffix huggable: ≥ :is: http://irclog.perlgeek.de/perl6/2016-01-09#i_11859391
14:45 huggable Zoffix, Added ≥ as http://irclog.perlgeek.de/perl6/2016-01-09#i_11859391
14:49 llfourn joined #perl6
14:49 timotimo SmokeMachine: i think that's correct, but i probably haven't looked closely enough
14:51 SmokeMachine timotimo: :)
14:51 hoelzro joined #perl6
14:52 wamba joined #perl6
14:52 Zoffix With so many people using rakudobrew, maybe we should make it better instead?
14:54 [Coke] that's always an option, sure.
14:55 Zoffix defaulting to latest release instead of HEAD by default and shimming zef to run `rakudobrew rehash` will probably fix a lot of problems users are currently experiencing
14:56 timotimo also: ugh, not being able to "which" the wrapper scripts
14:56 Zoffix $ which perl6
14:56 Zoffix /home/zoffix/.rakudobrew/bin/perl6
14:56 timotimo that totally helps. not.
14:57 Zoffix But that is where the wrapper script is? :S
14:57 timotimo okay
14:57 timotimo you can't which "through" the wrapper scripts
14:57 Zoffix to what end?
14:57 timotimo to the end of "wtf how do i get at the source code of what it's running when i invoke this command?"
14:58 Zoffix I guess the sourcecode when I open the file... ¯\_(ツ)_/¯
14:59 timotimo huh?
14:59 timotimo oh, rakudobrew does have a which and a whence command though
15:00 Zoffix s/guess/get/;
15:00 timotimo when i open the files i get rakudobrew's source code
15:01 masak colomon++ # https://news.ycombinator.com/item?id=13753894
15:02 koki joined #perl6
15:05 cdg joined #perl6
15:06 ZzZombo my @children=create xx (0..2).pick; #Undeclared routine: xx used
15:07 ZzZombo create is a sub
15:07 ZzZombo help, please
15:07 Zoffix ZzZombo: create()
15:08 skids joined #perl6
15:08 ZzZombo doesn't change anything
15:08 Zoffix u lie
15:08 ZzZombo no
15:08 Zoffix m: sub create {rand}; my @children=create xx (0..2).pick;
15:08 camelia rakudo-moar 2973cc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    xx used at line 1␤␤»
15:08 Zoffix m: sub create {rand}; my @children=create() xx (0..2).pick;
15:08 camelia rakudo-moar 2973cc: ( no output )
15:15 ZzZombo damn, forgot to hit 'save' the other time.
15:15 Zoffix :)
15:15 ZzZombo but!
15:15 sena_kun joined #perl6
15:15 ZzZombo "returns five distinct arrays (but with the same content each time), and
15:15 ZzZombo rand xx 3"
15:15 ZzZombo no ()
15:16 Zoffix ZzZombo: because rand is a term
15:16 ZzZombo huh
15:16 ZzZombo m: rand
15:16 camelia rakudo-moar b4118a: ( no output )
15:16 ZzZombo m: say rand
15:16 camelia rakudo-moar b4118a: OUTPUT: «0.153238475468308␤»
15:16 Zoffix m: sub term:<create> {rand}; my @children=create xx (0..2).pick;
15:16 camelia rakudo-moar b4118a: ( no output )
15:16 lucasb it's thunking
15:17 ZzZombo can you remind me how do you mix-in a role into a variable? My array refuses to comply :(
15:17 gregf_ *finally Zoffix is back*
15:17 Zoffix ZzZombo: but
15:17 lucasb $var does Role ?
15:18 Zoffix Oh wait, yeah, does. but copies
15:18 ZzZombo m: my @a but role{ method duh { die 'Duh
15:18 camelia rakudo-moar b4118a: OUTPUT: «5===SORRY!5===␤Whitespace required after keyword 'role'␤at <tmp>:1␤------> 3my @a but role7⏏5{ method duh { die 'Duh␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3my @a but role{ method d…»
15:18 ZzZombo m: my @a but role{ method duh { die 'Duh'}};@a.duh
15:18 camelia rakudo-moar b4118a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Whitespace required after keyword 'role'␤at <tmp>:1␤------> 3my @a but role7⏏5{ method duh { die 'Duh'}};@a.duh␤»
15:18 ZzZombo m: my @a but role { method duh { die 'Duh'}};@a.duh
15:18 camelia rakudo-moar b4118a: OUTPUT: «No such method 'duh' for invocant of type 'Array'␤  in block <unit> at <tmp> line 1␤␤»
15:18 brrt joined #perl6
15:18 ZzZombo see
15:18 ZzZombo I can't make it
15:18 ZzZombo m: my @a does role { method duh { die 'Duh'}};@a.duh
15:18 camelia rakudo-moar b4118a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'role'␤at <tmp>:1␤------> 3my @a does role7⏏5 { method duh { die 'Duh'}};@a.duh␤»
15:19 Zoffix m: my @a.^mixin: role { method duh { die "Duh"}}; @a.duh
15:19 camelia rakudo-moar b4118a: OUTPUT: «Duh␤  in method duh at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:19 ZzZombo Thanks!
15:19 Zoffix m: my @a; @a does role { method duh { die "Duh"}}; @a.duh
15:19 camelia rakudo-moar b4118a: OUTPUT: «Duh␤  in method duh at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:20 Zoffix ZzZombo: as for the () thing. It parses your call as create(xx (0..2).pick) so `xx` ends up being a term instead of the operator so it complains when it can't find it. Terms can't take args, so rand xx 5 is not ambiguouis
15:20 Zoffix And exactly why rand was made a term (despite there being a proper sub under the hood for it)
15:21 Zoffix s: &rand
15:21 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/05add43/src/core/Num.pm#L486
15:21 cdg_ joined #perl6
15:21 Zoffix .oO( why not just make sub term:<rand> {...} )
15:22 Zoffix m: sub term:<foo> { 42 }; say foo()
15:22 camelia rakudo-moar b4118a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    foo used at line 1␤␤»
15:22 Zoffix I guess so it could complain at people.
15:23 Zoffix m: say rand()
15:23 camelia rakudo-moar b4118a: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of rand(); in Perl 6 please use rand␤at <tmp>:1␤------> 3say rand7⏏5()␤»
15:23 lucasb m: say &rand()  # just testing
15:23 camelia rakudo-moar b4118a: OUTPUT: «0.60544234643555␤»
15:25 xui_nya[m] joined #perl6
15:26 kurahaupo joined #perl6
15:29 [Coke] u: -
15:29 unicodable6 [Coke], U+0000 <control-0000> [Cc] (control character)
15:29 unicodable6 [Coke], U+0001 <control-0001> [Cc] (control character)
15:29 unicodable6 [Coke], 5694 characters in total: https://gist.github.com/343bb2c24d80ebaf26d7a144376b3e0d
15:29 [Coke] ... I did not expect that.
15:30 [Coke] ooooh.
15:30 kurahaupo joined #perl6
15:30 [Coke] oops.
15:30 timotimo haha :)
15:30 timotimo you meant to ask for "what is this"
15:30 timotimo instead you got "which characters have this in their name"
15:30 Zoffix m: '-'.uniname.say
15:30 camelia rakudo-moar b4118a: OUTPUT: «HYPHEN-MINUS␤»
15:31 Zoffix .u -
15:31 yoleaux U+002D HYPHEN-MINUS [Pd] (-)
15:32 tadzik joined #perl6
15:32 ZzZombo joined #perl6
15:32 M-Illandan joined #perl6
15:32 ZzZombo I'm about to kill something
15:33 Zoffix Lik what?
15:33 ZzZombo m: role R[$x is copy='Die'] { sub Die{ die 'Ded'}};my $a does R;$a.Die
15:33 camelia rakudo-moar 7f9235: OUTPUT: «No such method 'Die' for invocant of type 'Scalar+{R}'␤  in block <unit> at <tmp> line 1␤␤»
15:33 timotimo lik the bread?
15:34 ZzZombo m: role R[$x is copy='Die'] { sub Die{ die 'Ded'}};my $a;$a does R;$a.Die
15:34 camelia rakudo-moar 7f9235: OUTPUT: «Cannot use 'does' operator with a type object.␤  in block <unit> at <tmp> line 1␤␤»
15:34 ZzZombo m: role R[$x is copy='Die'] { sub Die{ die 'Ded'}};my $a=123;$a does R;$a.Die
15:34 camelia rakudo-moar 7f9235: OUTPUT: «No such method 'Die' for invocant of type 'Int+{R}'␤  in block <unit> at <tmp> line 1␤␤»
15:34 ZzZombo m: role R[$x is copy='Die'] { method Die{ die 'Ded'}};my $a=123;$a does R;$a.Die
15:34 camelia rakudo-moar 7f9235: OUTPUT: «Ded␤  in method Die at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:34 timotimo why do you have "sub Die" but try to call a method die?
15:34 ZzZombo m: role R[$x is copy=Nil] { method Die{ die 'Ded'}};my $a=123;$a does R;$a.Die
15:34 camelia rakudo-moar 7f9235: OUTPUT: «Ded␤  in method Die at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:34 kurahaupo_ joined #perl6
15:34 timotimo looks like it works perfectly fine
15:35 ZzZombo similar code just killed my laptop.
15:35 Zoffix haha :)
15:36 Zoffix m: role R[$x is copy] { method Die { $x.Die } }; my $a=123; $a does R[$a]; $a.Die
15:36 camelia rakudo-moar 7f9235: OUTPUT: «(timeout)»
15:36 ZzZombo yea, keeps on hanging
15:37 Zoffix Well, what's the code?
15:37 timotimo stuff that "kills my laptop" is probably doing infinite recursion
15:38 timotimo yeah
15:38 timotimo test { test }; test gives me a laggy computer for three seconds
15:38 timotimo and my swap filled up a whole bunch
15:39 timotimo can't kill it. probably because it's doing a coredump right now?
15:40 Sound joined #perl6
15:41 ZzZombo silly that Windows doesn't prevent one application from clogging up all resources.
15:41 timotimo there must be a way
15:41 timotimo windows actually has many features you'd wish it had. but they are usually very unobvious to find
15:41 timotimo which is weird because GUI is all about discoverability of functionality
15:41 brrt har har har har har har har har har
15:42 timotimo maybe this discoverability benefit really only goes skin-deep
15:42 Zoffix C'mon, if it were easy to discover the sales of Windows books would plummet!
15:43 ZzZombo Zoffix: nevermind, I rewrote eveything just because it was too bloated.
15:43 Zoffix cool
15:43 ZzZombo Now I'm not sure if .TWEAK is supposed to be a method, not a submethod.
15:43 timotimo btw, you weren't applying the role R to the variable, but to the variable's contents
15:43 timotimo it's supposed to be a submethod
15:44 timotimo just like BUILD
15:44 timotimo are you having trouble with it?
15:44 ZzZombo "TWEAK After the BUILD methods have been called, methods named TWEAK are called, if they exist, again with all the named arguments that were passed to new."
15:44 timotimo oh, is that on docs.perl6.org?
15:44 ZzZombo Yea
15:45 timotimo that wants fixed
15:45 timotimo actually
15:45 timotimo it uses find_method to find TWEAK methods
15:46 timotimo m: class Test { method TWEAK { say "tweaking" } }; class B is Test {}; class C is B {}; class D is C {}; D.new()
15:46 camelia rakudo-moar 7f9235: OUTPUT: «tweaking␤tweaking␤tweaking␤tweaking␤»
15:46 timotimo m: class Test { submethod TWEAK { say "tweaking" } }; class B is Test {}; class C is B {}; class D is C {}; D.new()
15:46 camelia rakudo-moar 7f9235: OUTPUT: «tweaking␤»
15:46 lucasb well, both BUILD and TWEAK *can* be methods, and it wil work, but it'll also get inherited by subclasses, no?
15:46 timotimo m: class Test { method TWEAK { say "tweaking" } }; class B is Test { method TWEAK { say "tweaking B" }}; class C is B {}; class D is C {}; D.new()
15:46 camelia rakudo-moar 7f9235: OUTPUT: «tweaking␤tweaking B␤tweaking B␤tweaking B␤»
15:46 timotimo correct
15:48 ZzZombo m: my @a;@a does role { multi method elems { say 'ahaha';-1} };say @a+0
15:48 camelia rakudo-moar 7f9235: OUTPUT: «ahaha␤-1␤»
15:49 Zoffix heh
15:49 ZzZombo but
15:49 * Zoffix finds the conversation that explains why moritz is changing the logo.
15:49 ZzZombo "A method defined directly in a class will always override definitions from applied roles or from inherited classes."
15:50 ZzZombo another lie on the Internet?
15:50 llfourn joined #perl6
15:50 Zoffix ZzZombo: why a lie?
15:51 dp[m] joined #perl6
15:51 ZzZombo because the role has just overridden method that was declared in (Array), no?
15:51 Zoffix ZzZombo: is it declared in Array?
15:51 ZzZombo where else?
15:51 lucasb I think there's a difference between mixing a role into a class and into a object
15:51 timotimo that's the difference between "class Array does MyRole { ... }" and "$foo but MyRole"
15:51 ZzZombo I have no idea, but seems like it should
15:51 lucasb class C does R {} works like you stated
15:52 lucasb $x does R works the other way around
15:52 timotimo otherwise roles would be pretty much useless :)
15:52 ZzZombo m: my @a;@a but role { multi method elems { say 'ahaha';-1} };say @a+0
15:52 camelia rakudo-moar 7f9235: OUTPUT: «0␤»
15:52 Zoffix you're throwing away your mixed in version
15:53 Zoffix s: [], 'elems', \()
15:53 SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/7f9235c/src/core/List.pm#L455
15:53 Zoffix Surprise! :)
15:53 ZzZombo m: my @a;@a=@a but role { multi method elems { say 'ahaha';-1} };say @a+0
15:53 camelia rakudo-moar 7f9235: OUTPUT: «0␤»
15:53 ZzZombo you mean that ^?
15:53 Zoffix Nope
15:54 timotimo m: my @a;@a := @a but role { multi method elems { say 'ahaha';-1} };say @a+0
15:54 camelia rakudo-moar 7f9235: OUTPUT: «ahaha␤-1␤»
15:54 timotimo your code was throwing away the @a variant with the role applied to it immediately
15:54 timotimo because assigning to an array will iterate when storing
15:55 ZzZombo ah
15:55 kurahaupo joined #perl6
15:55 timotimo can you give a link to the sentence from the docs you quoted?
15:55 ZzZombo https://docs.perl6.org/syntax/role
15:56 timotimo thanks
15:56 ZzZombo in "Pecking order"
15:57 timotimo right, just found it
15:57 timotimo the thing is, on that page there wasn't yet any mention of the infix operator "does" or "but"
15:57 timotimo only the stuff you can put into your class declaration
15:58 Zoffix m: (() but role { multi method elems($ where ::?ROLE:) { say "ahaha";-1} }).elems.say
15:58 camelia rakudo-moar 7f9235: OUTPUT: «0␤»
15:58 Zoffix Wonder why the method doesn't get chosen...
15:58 timotimo does ::?ROLE work properly?
15:58 Zoffix nope
15:58 Zoffix Oh,
15:59 Zoffix I tried with $?ROLE too... both output the name when I use them in a method
15:59 timotimo m: (() but role { multi method elems($ where { say ::?ROLE; $_ ~~ ::?ROLE: }) { say "ahaha";-1} }).elems.say
15:59 camelia rakudo-moar 7f9235: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> 3ms($ where { say ::?ROLE; $_ ~~ ::?ROLE:7⏏5 }) { say "ahaha";-1} }).elems.say␤»
15:59 Zoffix m: role { method x { say ::?ROLE } }.x
15:59 camelia rakudo-moar 7f9235: OUTPUT: «(<anon|41591216>)␤»
15:59 timotimo m: (() but role { multi method elems($ where { say ::?ROLE; $_ ~~ ::?ROLE }:) { say "ahaha";-1} }).elems.say
15:59 camelia rakudo-moar 7f9235: OUTPUT: «0␤»
15:59 timotimo doesn't try it, apparently
15:59 Zoffix Oh, doh
15:59 Zoffix m: (() but role { multi method elems(List:D $ where ::?ROLE:) { say "ahaha";-1} }).elems.say
15:59 camelia rakudo-moar 7f9235: OUTPUT: «ahaha␤-1␤»
16:03 lukaramu joined #perl6
16:04 sufrostico joined #perl6
16:08 Dunearhp joined #perl6
16:09 CIAvash[m] joined #perl6
16:10 dp[m] joined #perl6
16:12 brrt joined #perl6
16:13 khw joined #perl6
16:22 IOninja hmmm...
16:22 * IOninja is about to pessimise biog... :o
16:22 IOninja *big
16:23 timotimo we have a logic problem that requires something we have to be less optimal?
16:23 IOninja IO::Path caches .e and then tries to keep state of it, but that makes the assumption nothing changes on the filesystem
16:24 IOninja m: start { sleep 1; "/tmp/foo42".IO.spurt: "meow"; say "done creating file!" }; my $p = "/tmp/foo42".IO; say $p.e; sleep 2; say $p.e
16:24 camelia rakudo-moar 7f9235: OUTPUT: «False␤done creating file!␤False␤»
16:25 brrt joined #perl6
16:25 IOninja Well, I'll pessimize it right now as a fix for RT#130889 and then think harder if stuff can be improved
16:25 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=130889
16:26 brrt left #perl6
16:29 IOninja would be handy to have `make perftest`
16:29 IOninja Like a spectest that would complain if your changes are way slower than expected :P
16:30 agentzh joined #perl6
16:35 dp[m] joined #perl6
16:35 perlpilot IOninja: It would be interesting if you could get timings from each test hat could be compared over many runs.
16:35 perlpilot *that
16:37 IOninja Should be pretty trivial, considering we've got PERL6_TEST_TIMES var
16:37 mcsnolte joined #perl6
16:37 araraloren Anyone help me ? A problem about nativecall : https://gist.github.com/araraloren/f9a647a4d95eab08f3d94a593df2fec9
16:40 IOninja I wasn't paying attention but I thought I saw someone mention callbacks with NativeCall were problematic/NYI
16:42 araraloren Oh .
16:42 jnthn Seems you can't currently use a native function directly as the callback
16:43 jnthn Just wrap it up in a block that calls it
16:43 araraloren jnthn, thanks, I will try it.
16:45 cdg joined #perl6
16:47 captain-adequate joined #perl6
16:49 llfourn joined #perl6
16:53 araraloren It works just fine, not so bad ..
16:53 araraloren Night..
16:54 pyrimidine joined #perl6
16:56 tadzik joined #perl6
16:58 timotimo joined #perl6
16:58 timotimo until further notice, you can use "dlsym" to get the pointer value for the callback and have a second sub for setint (with a different name that you can fix up with 'is symbol') that just takes a pointer-sized int as second arg
17:01 timotimo a bit surprising that it took so long until someone stumbled upon this use-case
17:01 timotimo m: use NativeCall; nativecast(&cb(--> int32), Pointer.new(0x12345))()
17:01 camelia rakudo-moar 76f718: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3use NativeCall; nativecast(&cb(7⏏5--> int32), Pointer.new(0x12345))()␤    expecting any of:␤        a…»
17:01 timotimo m: use NativeCall; nativecast(&cb:(--> int32), Pointer.new(0x12345))()
17:01 camelia rakudo-moar 76f718: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤You can't adverb ␤at <tmp>:1␤------> 3e NativeCall; nativecast(&cb:(--> int32)7⏏5, Pointer.new(0x12345))()␤»
17:02 timotimo m: use NativeCall; nativecast(Callable, Pointer.new(0x12345))()
17:02 camelia rakudo-moar 76f718: OUTPUT: «Internal error: unhandled target type␤  in sub nativecast at /home/camelia/rakudo-m-inst-1/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 411␤  in block <unit> at <tmp> line 1␤␤»
17:03 robertle anyone know a http server component that actually reads the request body? as in post/put?
17:04 timotimo i seem to recall there's at least one that gives you a filehandle-like that you can read the body from
17:04 timotimo might be hallucinating, though
17:04 robertle that would be awesome actually, I think I prefer that over a buffer or string
17:06 tadzik joined #perl6
17:07 timotimo oh, damn
17:07 timotimo i was thinking of HTTP::Server::Async
17:07 timotimo but it gives you the data as a Buf
17:08 mcsnolte joined #perl6
17:09 IOninja Where are our stats for the sites? I wanna see how many unique users we get on docs.perl6.org a year
17:09 timotimo ISTR we had a visitors running somewhere
17:10 timotimo visitors is certainly installed
17:11 domidumont joined #perl6
17:11 moritz IOninja: http://www.p6c.org/stats/doc.perl6.org
17:11 timotimo aha!
17:11 IOninja Thanks
17:11 moritz looks like we had between 21k and 35k visitors a month
17:12 timotimo where liveth a cron job for this?
17:12 zakharyas joined #perl6
17:12 timotimo october 07 is a really hot day
17:13 timotimo http://localhost:1313/post/2016-10-19-Perl6%E4%B8%AD%E7%9A%84Block/
17:13 IOninja m: say 11543/11543
17:13 camelia rakudo-moar 76f718: OUTPUT: «1␤»
17:13 timotimo i wonder who got referred to the docs this way :D
17:13 moritz timotimo: root's crontab
17:13 timotimo fantastic, thanks
17:13 IOninja wtf
17:13 IOninja oh
17:13 timotimo copy-pasto
17:13 IOninja copy-paste fail :P
17:13 IOninja m: say 31290/11543
17:13 camelia rakudo-moar 76f718: OUTPUT: «2.710734␤»
17:14 IOninja So our users grown 2.7x in a year
17:14 timotimo the visitors we're using really wants to have a few more things listed as spiders
17:14 IOninja .oO( there are lies, damned lies, and... )
17:14 timotimo baiduspider alone is 52k visits
17:15 pyrimidine joined #perl6
17:16 timotimo "visitors" is *really* difficult to google stuff for
17:16 timotimo like "has someone forked visitors and built a more comprehensive list of bots?"
17:18 domidumont joined #perl6
17:18 kybr joined #perl6
17:19 IOninja m: ␤=begin pod␤␤=head2 meows␤␤foos␤␤=end pod␤␤say $=pod[0].contents[1]
17:19 camelia rakudo-moar 76f718: OUTPUT: «Pod::Block::Para␤  foos␤␤»
17:19 IOninja There's no line info for where the pod block came from, is there?
17:19 [Coke] IOninja: don't believe so, nope.
17:20 IOninja Ah..
17:20 [Coke] Was looking for it as part of the doc examples work, didn't find it
17:20 IOninja I was gonna say https://github.com/perl6/doc/issues/1212 is easy to do, until I remembered htmlify.p6 doesn't actually parse all the pod files
17:21 pyrimidine joined #perl6
17:21 [Coke] it's not just passthrough pod parsing, no
17:21 [Coke] it's extracted, then mined, then put back together elsewise.
17:23 * [Coke] tags that "wishlist"
17:23 Geth ¦ doc: 3ed1803f11 | (Zoffix Znet)++ | doc/Type/Signature.pod6
17:23 Geth ¦ doc: Add note on where-clause side-effects
17:23 Geth ¦ doc:
17:23 Geth ¦ doc: https://rt.perl.org/Ticket/Display.html?id=130886
17:23 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3ed1803f11
17:26 agentzh joined #perl6
17:26 [Coke] IOninja: while I'd love to make it easier for people, I think opening an issue as as simple as that's going to get for now.
17:27 IOninja It's easy to learn how to find what to edit tho
17:33 grondilu joined #perl6
17:40 timotimo the damn perl6 -e 'sub test { test }; test' thing isn't going away >_<
17:40 timotimo can't ctrl-c it, can't ctrl-\ it, doesn't show up in htop ...
17:40 IOninja lol
17:40 IOninja glad I didn't run it then, when I had the temptation
17:42 IOninja $ ./perl6 -e 'sub test { test }; test'
17:42 IOninja Killed
17:42 IOninja :) ♥ Debian
17:42 wictory[m] joined #perl6
17:42 IOninja I see it in htop too
17:43 IOninja chewed through 24GB of RAM in 7 seconds
17:43 rindolf joined #perl6
17:43 bwisti joined #perl6
17:43 IOninja Ah no, in 22 seconds
17:44 IOninja I can CTRL+C it too. What OS are you on?
17:44 timotimo this is fedora with fish
17:46 gregf_ wonders why one would want to shoot themselves in the foot :)
17:47 vike joined #perl6
17:47 sena_kun on a gentoo with fish it is totally possible to kill
17:48 sena_kun with Ctrl-C or Ctrl-Z
17:49 IOninja gregf_: sometimes the shooting may be accidental:
17:49 IOninja m: Numeric.new + 42
17:49 camelia rakudo-moar 76f718: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "+" in expression ".new + 42" in sink context (line 1)␤MoarVM panic: Memory allocation failed; could not allocate 131072 bytes␤»
17:49 IOninja the sub test thing ^ behaves exactly the same on my box. Just nomming through RAM
17:50 llfourn joined #perl6
17:52 agentzh joined #perl6
18:06 sufrostico joined #perl6
18:14 buggable joined #perl6
18:17 zakharyas joined #perl6
18:20 cyphase joined #perl6
18:20 IOninja Is Suman Khanal in channel? They keep pinging and mentioning me on Twitter and it's starting to get a bit annoying. Mostly because half the time I don't understand why the mention was made...
18:21 IOninja Like this one: https://twitter.com/suman12029/status/836621336344576000 I don't understand. Do I need to do something?
18:24 * IOninja tries making a polite request to stop
18:24 timotimo that mention was probably "hey look perl6devs, they put a perl6 course on their wishlist!"
18:25 IOninja Feels like it. Gonna tell them to come announce stuff like that over here.
18:29 eliasr joined #perl6
18:32 * IOninja is amused Freenode never bothered to replace default Apache page http://irc.freenode.net/#perl6
18:32 IOninja You'd figure that would redirect to the webchat thing
18:38 cdg joined #perl6
18:39 DrForr swcarpentry is an aggregator site for programming lessons. All I think they've got to do is add something from the tutorial page.
18:39 timotimo why does irc.freenode.net even have a web server on it in the first place?
18:42 IOninja 'cause they have a website, I guess freenode.net
18:42 cibs joined #perl6
18:46 gdonald_ joined #perl6
18:46 lostinfog joined #perl6
18:51 llfourn joined #perl6
18:58 M-Illandan joined #perl6
18:58 tadzik joined #perl6
18:58 dp[m] joined #perl6
18:58 Matthew[m] joined #perl6
18:58 unclechu joined #perl6
18:58 ilmari[m] joined #perl6
18:58 CIAvash[m] joined #perl6
18:58 mienaikage joined #perl6
18:58 xui_nya[m] joined #perl6
19:12 IOninja m: say "Rakudo has seen an average of {round 6217/(Date.today - Date.new("2015-07-26"))} commits per day for the past year and a half"
19:12 camelia rakudo-moar 76f718: OUTPUT: «Rakudo has seen an average of 11 commits per day for the past year and a half␤»
19:12 IOninja pretty good
19:27 timotimo oh what?! amazon s3 is down?!
19:28 arnsholt Maybe they checked in the SHA-1 colliding PDFs into their SVN repo?
19:28 arnsholt That was the most hilarious thing about that, TBH
19:29 Ven joined #perl6
19:30 IOninja timotimo: so should 130886 be closed? (it's the where-clause one)
19:31 timotimo i think so, but i wanted to wait for others to comment ... maybe
19:31 IOninja OK
19:31 * IOninja has no comments...
19:36 andrzejk_ joined #perl6
19:39 _sfiguser joined #perl6
19:40 IOninja c: 2017.02 say "hi"
19:40 committable6 IOninja, ¦«2017.02»: Cannot find this revision (did you mean “2017.01”?)
19:40 IOninja AlexDaniel: ^ seems again it's buggy with the tags
19:45 regreg joined #perl6
19:47 pyrimidine joined #perl6
19:50 effbiai joined #perl6
19:50 effbiai joined #perl6
19:52 agentzh joined #perl6
19:53 llfourn joined #perl6
19:55 pyrimidine joined #perl6
20:02 hankache joined #perl6
20:11 TimToady m: #|meows␤sub x { }; say &x.WHY
20:11 camelia rakudo-moar 7966da: OUTPUT: «Nil␤»
20:11 TimToady m: #|{meows}␤sub x { }; say &x.WHY
20:11 camelia rakudo-moar 7966da: OUTPUT: «meows␤»
20:11 TimToady apparently only the #|{} variant is implemented
20:11 TimToady timotimo: ^^
20:12 TimToady well, and Zoffix
20:12 IOninja :)
20:13 TimToady but yeah, #= is only for after, just as #| is only for before
20:15 IOninja Reminder to test writers: after your test in, be sure to close the ticket its for (or find someone with perms to close tickets and ask them to close it).
20:19 IOninja It's thread-safe to do a my @stuff; react { whenever ... { @stuff.push: 42 } }; right? 'cause whenever uses .act on supply?
20:20 lizmat IOninja: yes, that's the idea I think  :-)
20:21 IOninja Thanks.
20:23 jnthn Yes, that is safe
20:23 jnthn It doesn't actually use .act on the Supply, that wouldn't be sufficient
20:23 jnthn The concurrency control is across the whole react block
20:23 IOninja Ah cool
20:27 zakharyas joined #perl6
20:30 ufobat joined #perl6
20:34 labster joined #perl6
20:34 wamba joined #perl6
20:38 ajr_ joined #perl6
20:40 ajr_ The failure to make Rakudo* on a Pi (3) appears to be when it's trying to make CORE.setting.moarvm (in the Stage parse
20:41 ajr_ I think it's running out of memory (using at least 703 of 750MB available)
20:41 ajr_ Is there any way to limit the memory usage of this process?
20:41 IOninja It uses about 1.2-1.4GB to build.
20:41 IOninja Make lots of swap, if there's a way?
20:43 IOninja buggable: tag TESTNEEDED
20:43 buggable IOninja, There are 22 tickets tagged with TESTNEEDED; See http://perl6.fail/t/TESTNEEDED for details
20:45 IOninja ^^^^^^^ lots of easy tasks if you want to contribute. Write tests to https://github.com/perl6/roast/ to test the fixed bugs. Tests for texttual content of error messages (if you have to write such) should go to https://github.com/rakudo/rakudo/tree/nom/t/05-messages  REPL tests are usually placed in https://github.com/rakudo/rakudo/blob/nom/t/02-rakudo/repl.t
20:46 * IOninja relocates
20:48 lichtkind__ joined #perl6
20:54 llfourn joined #perl6
20:55 geekosaur joined #perl6
20:57 ajr_ IOninja - I've found some information on extending the swap space, so I'll try that later and report results tomorrow.
21:05 grumble joined #perl6
21:08 TEttinger joined #perl6
21:19 Sound joined #perl6
21:19 cdg joined #perl6
21:22 sufrostico joined #perl6
21:22 cdg joined #perl6
21:30 agentzh joined #perl6
21:31 rindolf joined #perl6
21:36 cale2 joined #perl6
21:37 cale2 off topic question: why is packaging and importing so confusing in python?
21:37 yoleaux 25 Feb 2017 17:53Z <IOninja> cale2: note that since you have a commit bit in perl6 repos, any time you use online editor to make a PR you create a branch in the repo; once PR is processed, don't forget to use the "Delete branch" button. I see there's a couple of `WildYorkies-patch-` branches in perl6/doc. Would you mind deleting them if they were merged/closed already?
21:38 moritz cale2: I find importing rather intuitive in python; how it locates modules/packages is the confusing part, IMHO
21:39 cale2 __init__ files and all that
21:39 espadrine joined #perl6
21:39 moritz right
21:39 moritz there's two way to get to a foo, foo.py and foo/__init__.py
21:40 cale2 idk, i've read docs and tutorials. But it's still easier to just keep everything in the same directory and reference them that way haha
21:41 cale2 so many relative import errors otherwise
21:43 moritz speaking of off-topic stuff: https://opensource.com/article/17/2/mysql-8-coming mysql gets transactional DDL, it seems. Yay!
21:44 moritz and my hopefully final question for the night: can any of you recommend some tech publishers?
21:44 moritz besides the obvious ones (O'Reilly, Addison Wesley)
21:44 lizmat Wrox ?
21:46 sena_kun joined #perl6
21:46 lizmat https://pragprog.com ?
21:46 moritz lizmat: never heard of wrox, thanks
21:46 moritz pragprog is on my list, as well as Packt and Apress
21:49 cdg joined #perl6
21:50 cdg_ joined #perl6
21:56 llfourn joined #perl6
21:58 smls joined #perl6
21:59 smls m: say ([o] {$_ + 1} xx 3)(5)
21:59 camelia rakudo-moar 7966da: OUTPUT: «8␤»
21:59 smls m: say ([o] {$_ xx 3} xx 3)(5)
21:59 camelia rakudo-moar 7966da: OUTPUT: «Too many positionals passed; expected 0 or 1 arguments but got 3␤  in block <unit> at <tmp> line 1␤␤»
21:59 smls Does anyone know why that fails? ^^
22:01 smls m: say ({$_ x 2} o {$_ x 2} o {$_ x 2})(5)
22:01 camelia rakudo-moar 7966da: OUTPUT: «55555555␤»
22:01 smls m: say ({$_ xx 2} o {$_ xx 2} o {$_ xx 2})(5)
22:01 camelia rakudo-moar 7966da: OUTPUT: «Too many positionals passed; expected 0 or 1 arguments but got 2␤  in block <unit> at <tmp> line 1␤␤»
22:02 gdonald_ joined #perl6
22:02 smls Something about the xx operator it seems...
22:04 IOninja smls: what did you expect it to do? The m: say ([o] {$_ xx 3} xx 3)(5)
22:05 * IOninja is somewhat glad such monstrocities fail...
22:05 grumble joined #perl6
22:05 moritz $_ xx 2 returns two elements, so you call the next one in the chain with two arguments instead of one
22:05 moritz hence the error
22:06 IOninja Ah
22:06 smls IOninja: Create a 3x3x3 List filled with 5's
22:07 smls moritz: Why is the next one called with two arguments instead of one List argument?
22:07 smls does the `o` operator automatically interpolate lists into the argument list?
22:08 IOninja smls: if the .count of the callable is more than one, then yes
22:08 cale2 moritz: No Starch Press
22:08 IOninja Hm..
22:08 smls m: say {$_ xx 2}.count
22:08 camelia rakudo-moar 7966da: OUTPUT: «1␤»
22:08 IOninja Yeah...
22:09 IOninja m: dd ({$_ xx 3} xx 3)(5)
22:09 camelia rakudo-moar 7966da: 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␤␤»
22:10 IOninja m: dd ({$_ xx 3} xx 3)».(5)
22:10 camelia rakudo-moar 7966da: OUTPUT: «((5, 5, 5), (5, 5, 5), (5, 5, 5))␤»
22:11 IOninja s: &infix:<o>
22:11 SourceBaby IOninja, Sauce is at https://github.com/rakudo/rakudo/blob/7966dad/src/core/operators.pm#L714
22:12 smls m: say ({$_ xx 2} o {$_ xx 2}).count;  # Possibly interesting...
22:12 camelia rakudo-moar 7966da: OUTPUT: «Inf␤»
22:12 IOninja s: &infix:<[o]>
22:12 SourceBaby IOninja, Something's wrong: ␤ERR: ===SORRY!=== Error while compiling -e␤Undeclared routine:␤    infix:<[o]> used at line 6. Did you mean 'infix:<o>', 'infix:<+|>', 'infix:<∖>'?␤␤
22:12 IOninja oohhh
22:12 cale2 Why do the best programming communities use the most esoteric and complex languages?
22:12 IOninja m: -> | {}.count.say
22:12 camelia rakudo-moar 7966da: OUTPUT: «Inf␤»
22:12 IOninja That's why
22:12 IOninja smls++
22:13 smls Thats why it works with just two copies of the block chained with o
22:13 smls But not with 3 or more
22:13 IOninja smls: the second combination's callables have > 1 count, so the lists get slipped in
22:14 smls Shouldn't `o` return something with the same .count as its left argument?
22:15 IOninja dunno
22:16 IOninja Not really. Why the left argument? Currently the left arg can return whatever it wants.
22:16 rindolf joined #perl6
22:17 smls Yeah, I mean the right argument (which gets the input first)
22:17 IOninja Wonder how that would work with multies, tho.
22:18 IOninja m: multi x ($) {}; multi x($, $) {}; &x.count.say
22:18 camelia rakudo-moar 7966da: OUTPUT: «Inf␤»
22:18 IOninja :S
22:18 IOninja Oh, right, you need to call it on individual multi.
22:19 IOninja So yeah, how'd you pick which can candidate to take the .count from
22:21 smls Well if something (multi or otherwise) already has count=Inf, then the result of using it as the right argument of `o` would also have count=Inf
22:21 smls But chaining two count=1 functions and getting count=Inf, seems LTA
22:21 IOninja fair enough
22:22 smls Although you're right that the given example is a monstrosity... :)
22:22 smls I was trying to make something like   ->\n{[o]({$_ xx n}xx n)(n)}   work for this code golf: http://codegolf.stackexchange.com/a/111728/14880
22:23 smls But there are more legit cases where this could matter, like chaining two simple functions with `o` and passing the result to .sort or .map or amything else that cares about count.
22:27 * smls will RT
22:28 IOninja m: use nqp; sub x($, $) {}; my $c = -> {}; nqp::bindattr(nqp::decont($c), Code, '$!signature', nqp::getattr(nqp::decont(&x), Code, '$!signature').clone); say $c.count
22:28 camelia rakudo-moar 7966da: OUTPUT: «2␤»
22:28 * IOninja wonders if that's a bad idea™....
22:29 IOninja Is there a sane way to transplant a copy of a signature onto a block?
22:30 IOninja Oh wait, that ain't gonna work, how would I pass the args to the combined function :P
22:30 IOninja m: use nqp; sub x($a, $b) {}; my $c = -> { say $a, $b }; nqp::bindattr(nqp::decont($c), Code, '$!signature', nqp::getattr(nqp::decont(&x), Code, '$!signature').clone); say $c.count
22:30 camelia rakudo-moar 7966da: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3nqp; sub x($a, $b) {}; my $c = -> { say 7⏏5$a, $b }; nqp::bindattr(nqp::decont($c),␤»
22:30 IOninja hehe
22:33 cibs joined #perl6
22:38 avar nine: Any idea why the rest of the tests would work but https://metacpan.org/source/NINE/Inline-Perl6-0.08/t/use.t fails with undef $tester value on ->get_one
22:43 dj_goku joined #perl6
22:44 Voldenet joined #perl6
22:44 Voldenet joined #perl6
22:44 avar also now e.g.:
22:44 avar perl -MInline::Perl6 -wE 'my $p6 = Inline::Perl6->new; $p6->run(q["hi".say])'
22:45 avar vomits out an inordinate amount of p5 subs redefined, but not:
22:45 avar perl -mInline::Perl6 -wE 'my $p6 = Inline::Perl6->new; $p6->run(q["hi".say])'
22:45 avar i.e. -m v.s. -M
22:45 pyrimidine joined #perl6
22:53 kurahaupo joined #perl6
22:53 elaADnlxie joined #perl6
22:57 llfourn joined #perl6
22:59 IOninja First time running a Rakudo Star installer... a bit confusing
23:00 IOninja 'cause instructions say run make/make install, but the output of Configure.pl suggests those are to install Rakudo only ("'make install' will install Rakudo.") so how to install modules? Didn't see anything on the topic in the README
23:00 IOninja so I just ran `make install` to see what happens... and after a bit, it says "== Installing modules for MoarVM"
23:01 IOninja MoarVM? Wtf is MoarVM? I wanted modules for Perl 6
23:01 cdg joined #perl6
23:01 avar it's really confusing
23:01 avar Configure.pl actually builds most of the software
23:02 avar Then 'install' builds some of the rest, then runs tests on it, then actually installs it
23:08 pyrimidine joined #perl6
23:11 sufrostico joined #perl6
23:20 sufrostico joined #perl6
23:25 IOninja Hm. Looks like https://github.com/rakudo/star/issues/78 is 'cause zef is made to ignore test results :/ It still continues to install a module after failed tests, even though if you run `make install` twice it does abort and the error code is available in $?
23:26 IOninja I think I'll leave it at that for today. Need to relax and then do IO ninjaing.
23:27 samcv good * everyone
23:27 drrho_ joined #perl6
23:27 IOninja \o
23:29 avar IOninja: Thanks, I filed that bug, doesn't 'make install' fail the second time for unrelated reasons, it does for me due to 'hey we installed this already' or whatever
23:29 avar i.e. nothing to do with the test failures
23:30 IOninja yeah, zef bails out when a module's already installed; and normally it bails out if tests fail too, but there I see it still installs a module; not sure if that's on purpose or not, but because zef is made to ignore test failures, it never gives make install the failure code
23:30 IOninja (that's my interpretation of results I saw so far, at least0
23:32 avar *nod*, would be consistent with what I saw
23:34 avar But it's quite unnerving to encounter these "surely if anyone used this not-from-source this would be fixed already" bugs
23:34 sufrosti1o joined #perl6
23:35 avar i.e. the test suite failing for non-network access environments, and 'make install' just ignoring failures, both of which I've spotted, but would be spotted in pretty much any distro packaging
23:36 IOninja We had a team come to us about Rakudo's test suite returing 0 for failures :)
23:37 IOninja Dunno, maybe not many people want to hack on Star. Today's the first time I ever cloned a repo and ran the build TBH. And I've been with Perl 6 for ~1.5 years
23:38 samcv i've never installed star either
23:38 drrho_ joined #perl6
23:39 lep_ joined #perl6
23:41 avar I'm packaging perl6 for centos, so I'm grabbing the "latest stable"
23:41 avar and the rakudostar distro makes it fairly idiot proof to ship with a few modules
23:42 sufrostico joined #perl6
23:43 sufrosti1o joined #perl6
23:43 sufrosti2o joined #perl6
23:54 samcv great avar
23:54 samcv we need more packaging
23:56 avar It's quite a hack, but it sort of mostly works
23:57 avar packaging rakudo* as a perl5 module, due to it needing interop with Inline::*
23:57 samcv hmm
23:58 samcv seems a weird classification
23:58 samcv i mean it has a perl 5 module in it
23:59 llfourn joined #perl6

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

Perl 6 | Reference Documentation | Rakudo