Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-01-24

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:05 keusej joined #perl6
00:08 ely-se ZoffixWin: https://github.com/rightfold/Inline​-FALSE/blob/master/t/Inline/FALSE.t :)
00:09 ZoffixWin ely-se, there's Test::Output :}
00:09 ely-se :O
00:09 emdashcomma joined #perl6
00:09 ely-se Now the slang part. :P
00:09 ZoffixWin I forget which state it's in though... I recall I was trying to make it capture output from Test.pm6 and wrote IO::MiddleMan just for that... and then I went on vacation :)
00:09 ZoffixWin ely-se, cool, I wanna see the slang part :)
00:10 ely-se Also not sure whether I'll do the inline assembly part.
00:10 ely-se Would be fun but difficult.
00:31 sortiz m: say Cursor.^methods
00:31 camelia rakudo-moar fb0a13: OUTPUT«Method 'gist' not found for invocant of class 'NQPRoutine'␤  in block <unit> at /tmp/8POc9k7lYQ line 1␤␤»
00:31 sortiz ?!?!
00:31 Sgeo_ joined #perl6
00:32 sortiz What is a Cursor?
00:34 ely-se m: Cursor.WHY.say
00:34 camelia rakudo-moar fb0a13: OUTPUT«(Any)␤»
00:34 ely-se nobody knows!
00:35 sortiz Is something regex related!
00:35 ely-se m: sub f { 1.List }; f.perl.say
00:35 camelia rakudo-moar fb0a13: OUTPUT«(1,)␤»
00:35 ely-se m: sub f { 1.List }; f eqv 1
00:35 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/kj8HJBJej9␤Undeclared routine:␤    eqv used at line 1␤␤»
00:36 ely-se m: sub f { 1.List }; say f eqv 1
00:36 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Q3oJNeyMmf␤Undeclared routine:␤    eqv used at line 1␤␤»
00:36 ely-se m: sub f { 1.List }; say(f() eqv 1)
00:36 camelia rakudo-moar fb0a13: OUTPUT«False␤»
00:37 ely-se Is there a slang creation guide?
00:38 sortiz Nope, but some examples in ecosystem, see Slang:*
00:38 sortiz s/:/::/
00:40 ely-se ok :)
00:43 richi235 joined #perl6
00:45 sortiz Cursor has a page in docs/Types, but only to say "Internal state of the regex engine...", ok.
00:50 alpha123 joined #perl6
00:57 araujo_ joined #perl6
00:59 awesomess3 joined #perl6
00:59 awesomess3 Failed running /usr/bin/perl Configure.pl
00:59 awesomess3 do I need to apt-get install some more gcc libraries or something?
01:00 awesomess3 probing whether your compiler thinks that it is gcc  Can't compile simple gcc probe, so something is badly wrong at build/probe.pm line 92.
01:00 ZoffixWin do you have build-essential?
01:00 araujo__ joined #perl6
01:01 awesomess3 aha! that was it
01:05 awesomess3 the building froze at "Stage parse"
01:05 awesomess3 oh there we go it's doing something now
01:06 geekosaur parse is pretty slow currently, yes
01:08 geekosaur sortiz, Cursor is an internal implementation detail that I don't think is supposed to be visible, but due to known bugs sometimes is?
01:09 geekosaur (hence the errors referring to nqp things, which are internal details)
01:11 dalek ecosystem/rightfold-patch-1: 6e3cc66 | rightfold++ | META.list:
01:11 dalek ecosystem/rightfold-patch-1: Add Inline::FALSE
01:11 dalek ecosystem/rightfold-patch-1:
01:11 dalek ecosystem/rightfold-patch-1: See https://github.com/rightfold/Inline-FALSE
01:11 dalek ecosystem/rightfold-patch-1: review: https://github.com/perl6/e​cosystem/commit/6e3cc669b3
01:11 araujo_ joined #perl6
01:13 jack_rabbit joined #perl6
01:15 sortiz geekosaur, Thank you. IMO that class should inside a Internal package, if only to avoid trip over it.
01:15 sortiz s/a/an/
01:16 geekosaur well, it is inside a internal package (nqp). but if one leaks out somehow, better to provide some information about what it is than none at al
01:17 geekosaur othrwise debugging such leaks becomes rather difficult
01:17 sortiz m: say Global.WHAT
01:17 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CuAQXyxWGo␤Undeclared name:␤    Global used at line 1␤␤»
01:18 sortiz m: say Cursor.WHAT
01:18 camelia rakudo-moar fb0a13: OUTPUT«(Cursor)␤»
01:18 geekosaur hm. no, I don't think thats supposed to be there
01:19 geekosaur but I am also be confused about where Cursor sits; possibly it's exposed for a reason (to let you do something clever with regexes)
01:19 geekosaur (in which case maybe it should be a MONKEY)
01:19 TimToady Cursor is the part of Grammar that tracks position during parsing
01:19 TimToady all grammars and regex derive from Cursor
01:20 awesomess3 so I did `panda install Task::Star' and it doesn't even say how many packages it's gonna install :/ :( :'(
01:20 sortiz But need to seat in GLOBAL:: ?
01:21 TimToady nothing much is in GLOBAL unless you put it there
01:21 TimToady m: say GLOBAL::.keys
01:21 camelia rakudo-moar fb0a13: OUTPUT«()␤»
01:22 geekosaur m: say OUTER::.keys
01:22 camelia rakudo-moar fb0a13: OUTPUT«()␤»
01:22 geekosaur heh
01:24 sortiz So why is visible at this level?
01:24 TimToady m: say grammar { }.^mro
01:24 camelia rakudo-moar fb0a13: OUTPUT«((<anon|72129712>) (Grammar) (Cursor) (Any) (Mu))␤»
01:24 TimToady for the same reason Any and Mu are
01:25 sortiz Ok, I understand now. Thanks!
01:30 pierre-vigier joined #perl6
01:32 BenGoldberg joined #perl6
01:51 dalek ecosystem: 1a0a939 | (Pierre VIGIER)++ | META.list:
01:51 dalek ecosystem: Add AttrX::Lazy
01:51 dalek ecosystem:
01:51 dalek ecosystem: See https://github.com/pierre-vigier/Perl6-AttrX-Lazy
01:51 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/1a0a9394b9
01:51 dalek ecosystem: 21303d7 | (Zoffix Znet)++ | META.list:
01:51 dalek ecosystem: Merge pull request #133 from pierre-vigier/master
01:51 dalek ecosystem:
01:51 dalek ecosystem: Add AttrX::Lazy
01:51 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/21303d748c
01:52 dalek ecosystem: 6e3cc66 | rightfold++ | META.list:
01:52 dalek ecosystem: Add Inline::FALSE
01:52 dalek ecosystem:
01:52 dalek ecosystem: See https://github.com/rightfold/Inline-FALSE
01:52 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/6e3cc669b3
01:52 dalek ecosystem: 5307b79 | (Zoffix Znet)++ | META.list:
01:52 dalek ecosystem: Merge pull request #134 from perl6/rightfold-patch-1
01:52 dalek ecosystem:
01:52 dalek ecosystem: Add Inline::FALSE
01:52 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/5307b795b7
01:53 ZoffixWin pierre-vigier, umm... what happened to your repo?
01:54 ZoffixWin Oh, never mind\
01:54 pierre-vigier ?
01:54 pierre-vigier what do you mean?
01:55 pierre-vigier Hi #perl6
01:55 dalek ecosystem: 25d4255 | (Zoffix Znet)++ | META.list:
01:55 dalek ecosystem: Fix URL for pierre-vigier/Perl6-AttrX-Lazy
01:55 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/25d4255bfe
01:55 ZoffixWin You renamed the repo after adding a URL to META.list
01:56 colomon joined #perl6
01:56 pierre-vigier hum, really, let me check
01:57 ZoffixWin I already fixed it
01:58 pierre-vigier sorry :(
01:58 ZoffixWin I'll never forgive you! :)
01:58 laz78 joined #perl6
02:04 AlexDaniel joined #perl6
02:10 mprelude joined #perl6
02:17 adu joined #perl6
02:20 psy_ joined #perl6
02:30 laz78 joined #perl6
02:42 secwang joined #perl6
02:46 pierre-vigier joined #perl6
02:49 molaf_ joined #perl6
02:51 Herby_ joined #perl6
02:51 Herby_ Good evening, everyone!
02:51 Herby_ o/
02:51 adu hi
02:51 adu how are you?
02:52 Herby_ I'm doing well!  How you doing?
02:52 adu I'm in a cold place
02:52 adu but I have internet! :)
02:52 Herby_ You in that big storm that the northeast US is getting?
02:53 adu https://en.wikipedia.org/wiki/Janua​ry_2016_United_States_winter_storm
02:53 adu it's even on Wikipedia!
02:53 adu :)
02:53 Herby_ I'm hanging out here in Colorado.  Was actually in the 50s today!
02:53 adu nice
02:54 adu Herby_: so any Perl6-specific questions?
02:54 Herby_ At the moment, no.  Just trying to brainstorm for a simple project to learn Perl 6
02:54 Herby_ I've worked my way through the intro tutorial
02:54 adu I bought several bottle of wine before the storm, so I'm quite happy
02:55 Herby_ red?
02:55 adu Herby_: do you want to learn correspondances or uniquenesses?
02:55 adu white, and hard apple cider
02:55 Herby_ ehhh, not sure of the difference!
02:56 adu Herby_: if you wanted to learn how to do what you do in other languages in perl6, then do something like design a filesystem api
02:56 adu Herby_: if you wanted to learn things that are uniquely describable in perl6, then try and implement something like csv from scratch
02:56 ZoffixWin :S
02:57 Herby_ that sounds a tad beyond my current knowledge/skills!
02:57 adu Herby_: in every language, you're going to have a Directory class, a File class, a Node class that is a superclass, etc.
02:57 Herby_ I'd like to start simpler, with learning OO programming through Perl 6
02:57 adu Herby_: oh, so you want to learn programming
02:57 Herby_ yesss
02:58 adu Herby_: why are you starting with Perl6?
02:58 Herby_ I have a grasp of conditional statements, workflow etc
02:58 Herby_ I'm not
02:58 Herby_ I've toyed with PYthon and Perl 5
02:58 Herby_ but haven't gone beyond the basics
02:58 Herby_ purely as a hobby
02:58 adu Herby_: programming is about rules, and in ideal circumstances, math
02:59 adu math has something that programming doesn't: "referential transparency"
02:59 adu in other words, if x = 5, then x = 5 for all of time, that is, anytime you see x, you can replace it with 5
03:00 adu Herby_: one concept that is pretty universal is OOP
03:01 adu in OOP, there are methods (which is the OOP word for function), and classes (which are a description of fields + methods, where field is an OOP word for variable attached to an object)
03:01 adu Herby_: let me know if I'm talking too much
03:01 Herby_ Nope, I'm following :)
03:02 adu Herby_: in perl6, there are many different kinds of methods: sub, submethod, method, regex, token, rule, etc
03:03 adu Herby_: there are also many different kinds of classes, I only know of 2: classes and grammars
03:03 adu Herby_: a collection of classes is generally called a "module" (Java calls them packages), Perl6 also has these
03:04 adu C++ calls them "namespaces"
03:04 secwang joined #perl6
03:04 Herby_ ok
03:04 colomon joined #perl6
03:05 adu Java enforces a 1-to-1 correspondance between Classes, Packages, and Files, but Perl6 doesn't enforce this
03:05 adu you can have many classes in a file
03:05 adu you can have many modules in a file
03:06 adu Herby_: there are several things that could probably propell your programming career
03:06 adu (1) https://www.checkio.org/
03:07 adu (2) http://rosettacode.org/wiki/Rosetta_Code
03:07 Herby_ ok, let me bookmark
03:07 adu (3) https://projecteuler.net/archives
03:07 adu (4) http://oeis.org/
03:08 adu (1) is a programming game
03:08 adu (2) is a dictionary of algirhthms with other languages intermixed
03:08 adu (3) is challenges that will improve your problem solving skills
03:09 adu and (4) are simple patterns similar to (3) like fibonacci and factorials
03:10 araujo_ joined #perl6
03:13 * ZoffixWin wishes CodeEval added Perl 6 :(
03:13 ZoffixWin Contacted them. They said they won't.
03:13 Herby_ they are threatened by the beauty of the language?
03:16 araujo joined #perl6
03:16 araujo joined #perl6
03:25 lucs shell('exit 42', :err).err.close;  # Doesn't capture :err, and prints 「The spawned process exited unsuccessfully (exit code: 42)⋯」
03:25 lucs my $x = shell('exit 42', :err).err.close;  # Captures sorrectly, prints nothing, as it should :/
03:25 secwang joined #perl6
03:26 lucs A variation on https://rt.perl.org/Public/​Bug/Display.html?id=125757
03:26 adu ZoffixWin: CodeEval sounds cool!
03:27 * lucs having found that assignment work-around for his code, goes to bed
03:28 ZoffixWin Yeah, and companies post challenges and if you pass them, can apply for a position. At least in theory, but I imagine it makes it easier to get rid of completely incompetent coders fast.
03:28 araujo_ joined #perl6
03:30 araujo_ joined #perl6
03:41 kris joined #perl6
03:43 noganex joined #perl6
03:45 AlexDaniel huggable: exitcode :is: https://rt.perl.org/Public/​Bug/Display.html?id=125757
03:45 huggable AlexDaniel, Added exitcode as https://rt.perl.org/Public/​Bug/Display.html?id=125757
03:52 secwang joined #perl6
03:59 Herby_ ok.  Question: I want to create a class called "Customer".  The customer has a name, and starts with $balance = 0
03:59 Herby_ how do I go about setting balance = 0 for each new customer object created?
03:59 Herby_ if that makes sense
04:01 Herby_ well, when a customer object is created, initialize the balance as 0
04:02 AlexDaniel m: class Customer { has $.balance = 42 }; say Customer.new.balance
04:02 camelia rakudo-moar fb0a13: OUTPUT«42␤»
04:02 AlexDaniel Herby_: ↑ ?
04:02 Herby_ Wow, ok.  That simple?  Then I can add a method to the Class, so that the customer can make a deposit and it will update $balance?
04:04 AlexDaniel m: class Customer { has $.balance = 42; method buy-beer { $!balance -= 10 } }; my $c = Customer.new; $c.buy-beer; say $c.balance
04:04 camelia rakudo-moar fb0a13: OUTPUT«32␤»
04:04 Herby_ Sweet, thanks!
04:04 AlexDaniel yeah, it is really short in Perl 6
04:05 revhippie what unit is the balance in?  seems like a pricey beer in the US
04:05 AlexDaniel revhippie: in bottles
04:05 Hotkeys lol
04:06 Herby_ One more question while you're helping :)
04:06 AlexDaniel empty bottles I mean
04:07 Herby_ how would I adjust that if I want the customer class to require a name when the object is created?
04:07 Herby_ my $c = Customer.new("Jimmy")
04:07 Herby_ and jimmy would start with his balance of zero
04:08 AlexDaniel m: class Customer { has $.name; has $.balance = 42; method buy-beer { $!balance -= 10 } }; my $c = Customer.new(name => ‘Larry’); say $c.name
04:08 Herby_ I'm poking my way through perl6maven tutorial on OO but its going on 4 years old, and its pretty brief
04:08 camelia rakudo-moar fb0a13: OUTPUT«Larry␤»
04:08 Herby_ would that let you create a Customer object without passing it a name?
04:08 Hotkeys make sure you put 'is required' on name
04:08 Herby_ ah ok
04:08 Herby_ yeah, thats what I was curious about
04:08 AlexDaniel Hotkeys: right. Good point
04:08 Hotkeys I think
04:08 Hotkeys is it 'is required'
04:08 Hotkeys I can't remember
04:09 Hotkeys yeah it is
04:09 AlexDaniel yes
04:10 Herby_ m: class Customer { has $.name is required; has $balance = 0; method deposit { $!balance += 10 } }; my $c = Customer.new( name => 'James' ); say $c.name;
04:10 camelia rakudo-moar fb0a13: OUTPUT«James␤»
04:10 Herby_ m: class Customer { has $.name is required; has $balance = 0; method deposit { $!balance += 10 } }; my $c = Customer.new; say $c.name;
04:10 camelia rakudo-moar fb0a13: OUTPUT«The attribute '$!name' is required, but you did not provide a value for it.␤  in block <unit> at /tmp/Ay8_b8IHuU line 1␤␤»
04:10 Herby_ great
04:10 Herby_ m: class Customer { has $.name is required; has $balance = 0; method deposit { $!balance += 10 } }; my $c = Customer.new( name => 'James' ); say $c.name; $c.deposit; say $c;
04:10 camelia rakudo-moar fb0a13: OUTPUT«James␤Customer.new(name => "James")␤»
04:11 Herby_ m: class Customer { has $.name is required; has $balance = 0; method deposit { $!balance += 10 } }; my $c = Customer.new( name => 'James' ); say $c.name; $c.deposit; say $c.balance;
04:11 camelia rakudo-moar fb0a13: OUTPUT«James␤Method 'balance' not found for invocant of class 'Customer'␤  in block <unit> at /tmp/hXRrVoE9fY line 1␤␤»
04:11 Herby_ m: class Customer { has $.name is required; has $!balance = 0; method deposit { $!balance += 10 } }; my $c = Customer.new( name => 'James' ); say $c.name; $c.deposit; say $c.balance;
04:11 camelia rakudo-moar fb0a13: OUTPUT«James␤Method 'balance' not found for invocant of class 'Customer'␤  in block <unit> at /tmp/tq0rcNMa1v line 1␤␤»
04:11 Herby_ ?
04:11 AlexDaniel yeah, it has to be $.balance
04:11 AlexDaniel otherwise you don't get public getter
04:11 Herby_ m: class Customer { has $.name is required; has $.balance = 0; method deposit { $.balance += 10 } }; my $c = Customer.new( name => 'James' ); say $c.name; $c.deposit; say $c.balance;
04:11 camelia rakudo-moar fb0a13: OUTPUT«James␤Cannot assign to an immutable value␤  in method deposit at /tmp/5TMKtXUmE1 line 1␤  in block <unit> at /tmp/5TMKtXUmE1 line 1␤␤»
04:12 AlexDaniel $balance is probably equivalent to $!balance
04:12 Herby_ i'm hosing something up
04:12 Herby_ m: class Customer { has $.name is required; has $.balance = 0; method deposit { $!balance += 10 } }; my $c = Customer.new( name => 'James' ); say $c.name; $c.deposit; say $c.balance;
04:12 camelia rakudo-moar fb0a13: OUTPUT«James␤10␤»
04:12 Herby_ there we go
04:12 Herby_ not positive I understand when/where to use '.' or '!'
04:12 AlexDaniel yeah this is explained in one of the traps
04:12 Psyche^ joined #perl6
04:12 AlexDaniel huggable: traps
04:12 revhippie hmm.  the error earlier referred to $!name, though.  mild confusion.
04:12 huggable AlexDaniel, https://doc.perl6.org/language/traps
04:13 AlexDaniel https://doc.perl6.org/language​/traps#Assigning_to_attributes
04:14 AlexDaniel revhippie: yeah, I'm doing the wrong thing. Looking at the code instead of reading the error :)
04:14 treaki__ joined #perl6
04:14 revhippie AlexDaniel: $.foo is just shorthand for $!foo-with-accessors, right?
04:15 AlexDaniel revhippie: yeah
04:16 Herby_ Alex, in that 'trap's link that huggable posted, it shows using 'self' in class methods
04:16 Herby_ is that needed?
04:16 Herby_ or rather, when is that needed?
04:17 AlexDaniel Herby_: if you want to get the same object when using methods
04:18 AlexDaniel m: class Foo { has $.x = 5; method bar { $!x *= 2; self } }; say Foo.new.bar.bar.bar.bar.bar
04:18 camelia rakudo-moar fb0a13: OUTPUT«Foo.new(x => 160)␤»
04:18 AlexDaniel m: class Foo { has $.x = 5; method bar { $!x *= 2 } }; say Foo.new.bar.bar.bar.bar.bar
04:18 camelia rakudo-moar fb0a13: OUTPUT«Method 'bar' not found for invocant of class 'Int'␤  in block <unit> at /tmp/RZHGCDNoQH line 1␤␤»
04:19 AlexDaniel not necessary unless you really mean it
04:19 Herby_ Ok, think I get that
04:19 AlexDaniel though otherwise method “double” in that example is going to return some garbage
04:20 AlexDaniel that is, it does “return $!y *= 2;” which is hardly something meaningful
04:21 AlexDaniel so in that particular case it might be a good idea to return self
04:21 AlexDaniel another option is to return nothing…
04:22 Hotkeys Unrelated to current discussion
04:22 Hotkeys but
04:22 Hotkeys I can't build rakudo on windows 7 after this commit https://github.com/rakudo/rakudo/commit/​58964c5906c6761e78f3696c1a01363bd2127f95
04:22 Hotkeys including and after*
04:25 Hotkeys actually
04:25 Hotkeys hold on
04:26 adu joined #perl6
04:27 AlexDaniel Herby_: perhaps later it will become a good style to return self when you don't want to return anything
04:28 Herby_ thanks for the tips, Alex.  I'm working my way through this python OO tutorial and trying to transfer it into Perl 6: https://www.jeffknupp.com/blog/2014/0​6/18/improve-your-python-python-class​es-and-object-oriented-programming/
04:28 Hotkeys I'll make the claim that it's after https://github.com/rakudo/rakudo/commit/​7934ffe7b9538d9bbf188f821964ef33487a5cbf
04:28 Hotkeys since that's where my current problem starts
04:29 AlexDaniel Herby_: have you tried https://doc.perl6.org/language/classtut already?
04:29 Hotkeys C:\Users\John\rakudobrew\moar-7934ffe7b9​538d9bbf188f821964ef33487a5cbf\install/i
04:29 Hotkeys nclude/moar\platform/inttypes.h(2) : fatal error C1083: Cannot open include file
04:29 Hotkeys : 'msinttypes/inttypes.h': No such file or directory
04:29 Hotkeys NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
04:29 Hotkeys \VC\BIN\amd64\cl.EXE"' : return code '0x2'
04:29 Hotkeys oh oops
04:29 Hotkeys didn't mean to do that
04:29 Hotkeys sorry chat
04:30 Hotkeys anyway that's the error
04:30 Herby_ AlexDaniel, I have but it seems to go from 0 to 100 pretty quick.  I'm
04:30 Herby_ I'm still struggling with the basics of OO
04:31 Hotkeys hoelzro: there's the issue I meant the other day if you're around
04:32 AlexDaniel haha, here is a quiz
04:32 AlexDaniel m: class Foo { has $!.name }; say Foo.new
04:32 camelia rakudo-moar fb0a13: OUTPUT«Foo.new␤»
04:32 AlexDaniel how does it work? :)
04:32 araujo__ joined #perl6
04:33 Herby_ creates an object of type Foo, with no name?
04:33 Hotkeys this issue is too deep for me
04:34 Hotkeys seems like it goes all the way down to moarvm
04:34 xinming_ joined #perl6
04:34 araujo__ joined #perl6
04:34 AlexDaniel Herby_: !. part is tricky
04:35 AlexDaniel m: class Foo { has $!.name }; say Foo.new.^attributes
04:35 camelia rakudo-moar fb0a13: OUTPUT«(Mu $!!)␤»
04:36 Herby_ you done lost me :)
04:36 araujo__ joined #perl6
04:36 AlexDaniel m: class Foo { has $.name }; say Foo.new.^attributes
04:36 camelia rakudo-moar fb0a13: OUTPUT«(Mu $!name)␤»
04:37 AlexDaniel m: class Foo { has Str $.name }; say Foo.new.^attributes
04:37 camelia rakudo-moar fb0a13: OUTPUT«(Str $!name)␤»
04:37 AlexDaniel but wtf is $!. …
04:38 araujo_ joined #perl6
04:39 Hotkeys oh
04:39 Hotkeys well
04:39 Hotkeys I found a solution to the problem
04:40 Herby_ do tell
04:40 AlexDaniel Hotkeys: downgrade? :)
04:40 Hotkeys I copied the msinttypes folder from somewhere in nqp includes to /install/include
04:40 Hotkeys and now it works fine
04:41 Hotkeys but how do I commit this change
04:41 * adu is cold
04:41 Hotkeys or PR it rather
04:42 Herby_ adu, drink wine to warm up
04:42 Hotkeys I need someone who knows about the build process
04:43 adu Herby_: done, now what?
04:44 Hotkeys https://github.com/MoarVM/MoarVM/b​lob/3ffc45301a3583efe13c81e9557440​61a972e461/src/platform/inttypes.h
04:44 Hotkeys this file tries to do msinttypes/inttypes.h for windows
04:44 Herby_ adu: now embrace the warmth
04:44 Hotkeys but it can't find it
04:44 revhippie left #perl6
04:44 Hotkeys oh is that not the current location
04:45 Hotkeys oops
04:46 Hotkeys yeah it is nvm
04:46 Herby_ Ok. next level question:  now that I have a bunch of Customer objects... how do I create another class called Accounts, that contains all my Customer objects?
04:47 Herby_ at a high level
04:47 adu Herby_: I have 4 bottles left, I can email one of them to you :)
04:48 adu Herby_: I think you want a list
04:48 Hotkeys oh
04:48 Hotkeys the problem is here https://github.com/MoarVM/MoarVM/commit/​ba7bdeb0ec4d37de40517ac1cc24fef1ef94cd25 I *think*
04:49 adu Herby_: in that case you generally want (A) The account class to be responsible for creating customers, or (B) the customer is given an account to "register" with
04:49 AlexDaniel Herby_: do you want it to happen automatically?
04:50 AlexDaniel Herby_: and are you sure that it has to be a separate class?
04:50 adu Herby_: also, I wouldn't call it "Accounts" I would call the classes "Customer" and "CustomerFactory"
04:50 Herby_ Well.  Lets say I wanted to give all my Customers a $200 bonus deposit
04:51 adu Herby_: that sounds like a method on CustomerFactory
04:51 adu CustomerFactory.universal_bonus(200)
04:51 Herby_ how would CustomerFactory know which Customers exist?
04:51 Herby_ not sure if I'm asking that
04:51 Herby_ correctly
04:52 adu Herby_: I assume that CustomerFactory as created every Customer
04:52 adu Herby_: so every time it creates a customer, it remembers it
04:52 Herby_ hmmm
04:52 adu Herby_: so you just iterate through every Customer that the CustomerFactory has created
04:53 adu Herby_: another option is SQL
04:53 skids Usually "Factory" connotes something that makes classes, AFAIK.
04:54 adu skids: perhaps there are many different types of customers...
04:54 AlexDaniel m: class Customer { my @all; submethod BUILD() { @all.push: self }; method customers { return @all } }; Customer.new; Customer.new; say Customer.customers
04:54 camelia rakudo-moar fb0a13: OUTPUT«[Customer.new Customer.new]␤»
04:54 * skids should probably backlog some.
04:54 AlexDaniel as easy as that
04:54 adu B2BCustomer, SmallCustomer, MultiNationalCustomer, DistributorCustomer, ...
04:55 Herby_ I think I get that AlexDaniel.  What is the gist of submethod BUILD?
04:55 Herby_ adu, I'm looking at learning a little SQL too :)
04:56 adu Herby_: C++ has 2 "special" methods, creation and destruction, I think Perl6 has more than 2 special methods
04:56 skids Herby_: It's for initializing attributes, when plain old initializers are not enough.
04:56 adu Herby_: what you're talking about is simple with SQL
04:57 AlexDaniel can anybody tell me how to have both custom BUILD and the default one?
04:58 AlexDaniel that is, if I want to run some code on object creation yet not to set fields manually
04:59 AlexDaniel Herby_: BUILD is… like a constructor
04:59 skids m: class Customer { my @all; method new(|c) { my $ret; @all.push($ret = self.bless(|c)); $ret; }; method customers { return @all } }; Customer.new; Customer.new; say Customer.customers # you don't need build just to set a class var
04:59 camelia rakudo-moar fb0a13: OUTPUT«[Customer.new Customer.new]␤»
05:00 AlexDaniel skids: not something I'd like to see in the code…
05:01 skids m: class Customer { my @all; method new(|c) { @all.push(self.bless(|c)); }; method customers { return @all } }; Customer.new; Customer.new; say Customer.customers # you don't need build just to set a class var
05:01 camelia rakudo-moar fb0a13: OUTPUT«[Customer.new Customer.new]␤»
05:01 skids I guess the self is good enough to push already.
05:01 skids Oh but you'd need to break off the actual return value.
05:02 skids m: class Customer { my @all; method new(|c) { @all.push(self.bless(|c))[*-1]; }; method customers { return @all } }; Customer.new.say; Customer.new.say; say Customer.customers
05:02 camelia rakudo-moar fb0a13: OUTPUT«Customer.new␤Customer.new␤[Customer.new Customer.new]␤»
05:02 Herby_ lol I'm lost :)
05:02 adu what's the difference between new() BUILD() and BUILDALL()?
05:03 skids BUILDALL by default is what calls all the BUILDs.  New does not have an actual object until bless is called.  Build has an allocated object.
05:04 adu so in the Python world, new is __new__ and BUILD is __init__
05:04 zostay goodness gracious sakes alive... i just discovered @x.combinations and crapped my pants... perl6 rocks
05:05 adu zostay: what's combinations?
05:06 zostay m: my @x = 1 .. 9; say @x.combinations(2)
05:06 camelia rakudo-moar fb0a13: OUTPUT«((1 2) (1 3) (1 4) (1 5) (1 6) (1 7) (1 8) (1 9) (2 3) (2 4) (2 5) (2 6) (2 7) (2 8) (2 9) (3 4) (3 5) (3 6) (3 7) (3 8) (3 9) (4 5) (4 6) (4 7) (4 8) (4 9) (5 6) (5 7) (5 8) (5 9) (6 7) (6 8) (6 9) (7 8) (7 9) (8 9))␤»
05:06 adu skids: yeah, a class var is how I would do it in Python
05:06 zostay gives you all the possible pick-2 combinations or pick-n or with no n pick-n for all n
05:06 adu zostay: oh, that's like Haskell list comprehensions
05:07 zostay great, i'm glad we stole that too then
05:07 adu zostay: Haskell list comprehensions are pretty cool
05:07 Herby_ skids
05:08 Herby_ in your example 'method new(|c)'.... what does '|c' do?
05:08 skids Herby: it is used to move the arguments to new over to bless.  It is called a Capture.
05:08 adu zostay: also, you can do the same thing with a for-loop
05:09 skids m: sub f(|c) { c.perl.say }; f(1,2,3,:named);
05:09 camelia rakudo-moar fb0a13: OUTPUT«\(1, 2, 3, :named)␤»
05:10 adu Herby_: do you know any other languages?
05:10 AlexDaniel adu: wow, it looks so complicated https://github.com/rakudo/rakudo/blob/a28270f009e​15baa04ce76e53e9d5cb77618fcf7/src/core/List.pm#L9
05:10 Herby_ i have very basic knowledge of python and perl
05:10 Herby_ conditional statements, loops etc
05:10 Herby_ this 'bless' stuff is kind of new to me
05:11 skids AleDaniel: It has to be lazy, that's how lazy things are implemented under the hood, if they don;t just hang of another existing lazy construct.
05:12 AlexDaniel skids: yeah I understand
05:12 adu Herby_: a Perl6 Capture is similar to Python's (*args, **kwargs)
05:13 Herby_ k
05:13 adu Herby_: "bless" is unique to Perl5 and Perl6, from what I understand it magically transforms data into "objects"
05:13 zostay or if you don't care about what other languages do, just think of a capture as the way you can say "take whatever arguments they pass and capture them, i don't care what they actually are"
05:14 zostay you can look into the capture to see what they are in case you care, but you don't have to care
05:14 Herby_ gotcha
05:14 adu zostay: well, at least Python distinguishes between positional and keywords
05:14 zostay if you just want to pass arguments on, it's the easiest way
05:14 zostay Perl6 distinguishes between positionals and named arguments too
05:14 AlexDaniel but still, how can I run some code during the object initialization (e.g. when the constructor should normally run)?
05:15 AlexDaniel without destroying autogenerated BUILD
05:15 AlexDaniel and without messing around with bless
05:16 AlexDaniel do I want too much? I don't think so. In fact, I remember that there was a way to do that
05:16 AlexDaniel it was hidden but at least it existed
05:18 skids AlexDaniel: call a sub durin initialzation of an attribute -- it's sleazy but a reliable workaround.
05:19 AlexDaniel skids: I don't think that 「self」 is available at that point
05:19 skids It is, actually.
05:19 AlexDaniel m: class Foo { $!x = say self }; Foo.new
05:19 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/O1U2W1Bamk␤Variable $!x used where no 'self' is available␤at /tmp/O1U2W1Bamk:1␤------> 3class Foo { $!x7⏏5 = say self }; Foo.new␤»
05:20 AlexDaniel m: class Foo { $!x = zzz; method zzz { say self } }; Foo.new
05:20 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CSZUcwlTNL␤Variable $!x used where no 'self' is available␤at /tmp/CSZUcwlTNL:1␤------> 3class Foo { $!x7⏏5 = zzz; method zzz { say self } }; Foo.n␤»
05:20 AlexDaniel skids: ?
05:20 skids Hrm, hold on let me find that.
05:20 AlexDaniel ah
05:20 AlexDaniel m: class Foo { has $!x = zzz; method zzz { say self } }; Foo.new
05:20 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/pZfArlQ7w2␤Undeclared routine:␤    zzz used at line 1␤␤»
05:21 AlexDaniel m: class Foo { method zzz { say self }; has $!x = zzz }; Foo.new
05:21 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/k3JRBXgfgl␤Undeclared routine:␤    zzz used at line 1␤␤»
05:21 AlexDaniel that's not how you call methods, right? :)
05:23 zostay m: class A { has $x. = self.zzz; method zzz { say self } }; A.new
05:23 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/OeSCXGqg9P␤Unsupported use of . to concatenate strings; in Perl 6 please use ~␤at /tmp/OeSCXGqg9P:1␤------> 3class A { has $x.7⏏5 = self.zzz; method zzz { say self } }; ␤»
05:23 zostay m: class A { has $.x = self.zzz; method zzz { say self } }; A.new
05:23 camelia rakudo-moar fb0a13: OUTPUT«A.new(x => Any)␤»
05:24 zostay stupid typo
05:24 lokien_ joined #perl6
05:25 AlexDaniel m: class A { has $.x = { say self }() }; A.new; A.new
05:25 camelia rakudo-moar fb0a13: OUTPUT«A.new(x => Any)␤A.new(x => Any)␤»
05:26 skids zostay++
05:27 AlexDaniel this workaround does not really make me happy
05:27 skids Roles need some work.
05:27 skids And I expect that that will jog loose some things.
05:29 skids (the only real reason to *need* that workaround is for roles)
05:34 Hotkeys is there a moarvm channel?
05:37 skids http://irclog.perlgeek.de/moarvm/
05:38 Hotkeys found it, thanks
05:39 21WAAVSZC joined #perl6
05:47 Hotkeys oh
05:47 Hotkeys So it seems
05:47 Hotkeys the problem is simply that the rakudo moarvm version is out of date
05:48 kaare_ joined #perl6
05:50 Hotkeys Who do I talk to about getting the moar revision bumped
05:52 Cabanossi joined #perl6
05:52 Herby_ any more examples or tutorials on Perl 6 classes and objects? outside of https://doc.perl6.org/language​/classtut#Consuming_our_class
05:52 Herby_ rather, any more recommended tutorials
05:58 ptolemarch joined #perl6
06:01 adu Herby_: I don't recommend tutorials, I recommend problems, problems that you may already know the solution to, maybe not in Perl6, but that's part of the fun
06:03 adu Herby_: and it doesn't have to be a hard problem, it could be really simple, like "count to 10" or "draw a box"
06:04 Herby_ yeah, I just need to try more problems
06:05 Hotkeys I made a pull request for a moar revision bump in perl6/nqp
06:05 adu one of the first things I do when learning a programming language (after HelloWorld) is implementing the "matrix determinant"
06:05 Hotkeys I wasn't sure entirely how the bump increments but it was more for increasing the commit than anything
06:07 Hotkeys in 2015.12-29-g8079ca5 what does the '29' indicate?
06:09 Mokok joined #perl6
06:12 Hotkeys http://adventofcode.com/ has some fun problems
06:12 Herby_ yesss, I was having some fun with that over the holidays
06:12 Hotkeys could try and do them in p6
06:12 Hotkeys if you haven't already
06:14 Herby_ the few I could figure out, I did in p6.  But I'm thinking I can look at other's solutions and see how I'd rewrite it in p6
06:23 Herby_ m: class Customer { has $!name; } my $c = Customer.new(name => 'Bob'); say $c.name;
06:23 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1Blxq8QLJU␤Strange text after block (missing semicolon or comma?)␤at /tmp/1Blxq8QLJU:1␤------> 3class Customer { has $!name; }7⏏5 my $c = Customer.new(name => 'Bob'); sa␤    expecting any of:␤  …»
06:24 Herby_ m: class Customer { has $!name } my $c = Customer.new(name => 'Bob'); say $c.name;
06:24 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/dSD5ru_tnr␤Strange text after block (missing semicolon or comma?)␤at /tmp/dSD5ru_tnr:1␤------> 3class Customer { has $!name }7⏏5 my $c = Customer.new(name => 'Bob'); sa␤    expecting any of:␤   …»
06:24 Herby_ m: class Customer { has $.name } my $c = Customer.new(name => 'Bob'); say $c.name;
06:24 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1UsgjtQCNe␤Strange text after block (missing semicolon or comma?)␤at /tmp/1UsgjtQCNe:1␤------> 3class Customer { has $.name }7⏏5 my $c = Customer.new(name => 'Bob'); sa␤    expecting any of:␤   …»
06:24 Herby_ I need to go to bed
06:25 Herby_ m: class Customer { has $.name }; my $c = Customer.new(name => 'Bob'); say $c.name;
06:25 camelia rakudo-moar fb0a13: OUTPUT«Bob␤»
06:44 CIAvash joined #perl6
06:56 moritz Good monring.
07:05 xtreak joined #perl6
07:07 hankache joined #perl6
07:07 hankache morning #perl6
07:14 laz78 joined #perl6
07:28 domidumont joined #perl6
07:33 domidumont joined #perl6
07:50 araujo__ joined #perl6
07:52 araujo__ joined #perl6
07:59 pierre-vigier joined #perl6
08:19 darutoko joined #perl6
08:24 [Tux] csv-ip5xs       17.999
08:24 [Tux] test            22.532
08:24 [Tux] test-t          12.193
08:24 [Tux] csv-parser      49.424
08:28 xinming joined #perl6
08:34 [Tux] Now that the dust on v6.c has settled and people start using perl6 (I hope), can I please draw your attention to the CRNL issue again, as it causes data loss
08:34 [Tux] https://gist.github.com/Tux/1542d23b568508160329
08:35 [Tux] I esp like to head jnthn's opinion on this
08:43 [Tux] or should I RT this?
08:46 perl6newbee joined #perl6
08:48 DrForr .seen niner
08:48 yoleaux I haven't seen niner around.
08:51 hankache [Tux] I thing jnthn knows most about it
08:51 [Tux] I know he knows, but I want to know if there will be a solution, and if what/how
08:52 [Tux] he also knows about core dumps in utf8-c8, but that has (for me) a lower priority
08:52 masak [Tux]: yes, please do RT it
08:54 masak [Tux]: I haven't studied the thing deeply, but it feels to me that part of the issue is that your data has both string nature (since you care about chars) and buffer nature (since you care about individual \r and \n bytes) at the same time
08:55 [Tux] I know, and Liz explained me a lot, but I think all we need is an option to leave NL/CR/CRNL unchanged as it had been up to the beginning of 2015-12
08:55 [Tux] but that might be a shortsighted opinion
08:55 hankache there is something weird happening with travis
08:55 masak hankache: we should have some kind of CI testing of travis :P
08:56 DrForr istravisdownorisitjustme.com.
08:57 hankache masak method foo (Int $var where 0 .. 360) doesn't work on travis and says cannot modify an immutable range
08:57 hankache although it works fine on local build
08:58 hankache if you replace it with method foo (Int $var) {if 0 < $var < 360 ...........} then it works on travis
08:58 masak m: class C { method foo(Int $var where 0..360) { say "OH HAI" } }; .foo(45), .foo(1080) given C.new
08:58 camelia rakudo-moar fb0a13: OUTPUT«OH HAI␤Constraint type check failed for parameter '$var'␤  in method foo at /tmp/XbnFXRbPEa line 1␤  in block <unit> at /tmp/XbnFXRbPEa line 1␤␤»
08:59 Hotkeys I think it might be a good idea [Tux]
08:59 masak hankache: sounds very fishy. if you can, please investigate more
08:59 rindolf joined #perl6
08:59 Hotkeys we already have the option to explicitly use nl/cr/crnl
08:59 masak today's autopun spotting: https://twitter.com/AndyKindl​er/status/690331997638516737
09:00 Hotkeys why not a leave-it-be option
09:00 hankache masak this ^^ in travis when you call foo(45) says #cannot modify immutable range
09:00 [Tux] that was what I was looking for
09:00 moritz it seems like Text::CSV wants to operate on Codepoints, not on Graphemes
09:00 [Tux] Hotkeys, *what* is that option?
09:01 [Tux] moritz, I plan to use utf8-c8 for that
09:01 Hotkeys oh
09:01 Hotkeys uh
09:01 Hotkeys use newline :lf
09:01 Hotkeys etc.
09:02 [Tux] err, wrong :) => that is global/lexical. I need it as a IO attribute to an existing handle
09:02 [Tux] and it should be alterable *after* the handle was opened
09:03 [Tux] so a proces can be passed an open file handle, temporarily set/reset that option, process, reset to what it was and return
09:04 Hotkeys That's the only option I know of
09:04 Hotkeys not sure if what you're looking for is currently availabe
09:04 [Tux] I was aware of that, but it won't fly
09:05 Hotkeys I agree
09:06 Hotkeys actually
09:06 Hotkeys if you know there is going to be only one type
09:06 Hotkeys there's http://docs.perl6.org/routine/open#Newline_options
09:07 masak hankache: what Rakudo is travis using, then? the above is fb0a13.
09:08 Hotkeys [Tux]: I keep trying to tab complete your name with "tu(tab)"
09:08 Hotkeys darn brackets
09:08 kmel joined #perl6
09:09 [Tux] [Tux] is PC at home, Tux and |Tux| are at work and Tux is already taken by someone else on freenode :(
09:09 Hotkeys ah
09:09 azawawi joined #perl6
09:09 azawawi good morning #perl6
09:10 [Tux] Hotkeys, the "problem" with the nl attribute is that I do not know what it is before I parse the (CSV) file(s)
09:10 Hotkeys right
09:11 [Tux] and Text::CSV also supports a mixture of line endings, as CSV does not require it to be consistent
09:11 kmel joined #perl6
09:11 [Tux] so «1,2,,4\r\n1,2,3,\r1,,3,4\n» is completely valid CSV for Text::CSV
09:13 masak [Tux]++ # bringing up a real problem with his code, sticking to his guns, being civil
09:15 masak Hotkeys: you need a better IRC client. irssi does tu<Tab> just fine
09:15 Hotkeys shh
09:16 hankache joined #perl6
09:16 hankache masak same on travis
09:16 Hotkeys I understand why having the logical newline thing is an alright idea, but there definitely needs to be the option to not translate them at all
09:16 Hotkeys [Tux]++
09:18 [Tux] https://rt.perl.org/Ticket/Display.html?id=127358
09:18 [Tux] I hope to have that one as explanatory as possible without leaving important details
09:20 azawawi [Tux]++
09:21 azawawi what's the best module for parsing HTML on Perl 6?
09:22 stmuk I've used HTML::Parser::XML
09:30 Hotkeys tomorrow I might actually start my work on contributing to the Lingua::* part of the ecosystem
09:30 Hotkeys like I've been saying I'd do for weeks
09:33 azawawi im scrapping http://www.imagemagick.org/api/magick-wand.php to get the C prototype + documentation to generate the POD and more nativecall methods for MagickWand :)
09:39 dalek nqp: 3656f4d | (John Spurr)++ | tools/build/MOAR_REVISION:
09:39 dalek nqp: Bump MOAR_REVISION to fix windows building
09:39 dalek nqp:
09:39 dalek nqp: There was a problem that stopped moar from working because it couldn't find
09:39 dalek nqp: msinttypes/inttypes.h, but that problem was fixed in this revision.
09:39 dalek nqp: review: https://github.com/perl6/nqp/commit/3656f4dc97
09:42 Hotkeys Woo
09:46 telex joined #perl6
09:48 nine_ DrForr: I'm here
09:48 Hotkeys nine_: are you niner
09:49 nine_ Hotkeys: yes. I go by "niner" when "nine" as user name is already taken.
09:49 Hotkeys Ah
09:49 Hotkeys Well ty for the pull and the git knowledge
09:51 azawawi joined #perl6
09:54 drrho joined #perl6
09:56 masak Hotkeys: ooc, what git knowledge?
10:00 drrho joined #perl6
10:00 Hotkeys masak: the moar and nqp revisions are made with git describe
10:01 masak ah, yes
10:11 SCHAAP137 joined #perl6
10:13 leont joined #perl6
10:16 lnrdo joined #perl6
10:17 hankache joined #perl6
10:23 pierre-vigier joined #perl6
10:24 RabidGravy joined #perl6
10:27 Mokok joined #perl6
10:27 Mokok Hello
10:28 ely-se joined #perl6
10:29 masak hi, Mokok
10:29 gfldex m: say "Hi Mokok!";
10:29 camelia rakudo-moar fb0a13: OUTPUT«Hi Mokok!␤»
10:31 masak m: say "Hi Mokok!".flip
10:31 camelia rakudo-moar fb0a13: OUTPUT«!kokoM iH␤»
10:32 Mokok m: say "Hi mask!".flip
10:32 camelia rakudo-moar fb0a13: OUTPUT«!ksam iH␤»
10:44 RabidGravy boom!
10:45 Hotkeys bang!?
10:45 ely-se ZoffixWin++
10:48 inwigilator joined #perl6
10:48 inwigilator hello
10:49 Hotkeys Hello inwigilator
10:51 inwigilator can I write something like next;?
10:52 araujo_ joined #perl6
10:53 RabidGravy yes
10:53 DrForr m: for ^2 -> $i { next }
10:53 camelia rakudo-moar fb0a13: ( no output )
10:55 inwigilator i need to replace smh like else { continue; }
10:58 DrForr Yes, as you can see, 'next' does indeed work.
10:58 inwigilator ok I got it
10:59 RabidGravy You may also want to see http://doc.perl6.org/language/phasers if you want to do things at different points of loop execution
11:02 RabidGravy also (and I'm not sure where this is documented)  if you want to do "next" to a label then the next is typically a method on the label
11:04 RabidGravy m: OUTEST: for <a b c d e> -> $a { INNEST: for ( 0 .. 4 ) -> $b {  say "$a - $b"; (Bool.pick ?? INNEST !! OUTEST).next;  }}
11:04 camelia rakudo-moar fb0a13: OUTPUT«a - 0␤a - 1␤a - 2␤a - 3␤b - 0␤b - 1␤b - 2␤c - 0␤c - 1␤c - 2␤d - 0␤e - 0␤e - 1␤e - 2␤e - 3␤e - 4␤»
11:05 RabidGravy which is quite cute (but useless)
11:05 RabidGravy note also you can't use OUTER or INNER as labels (maybe it should warn about that)
11:08 inwigilator Use of Nil in string context  in block <unit> at 1.1.46.pl6 line 9
11:10 RabidGravy "undefined"
11:10 inwigilator and line 9 is: loop (my $i=0; $i < @word_array.elems; $i++) {
11:10 inwigilator line 9: loop (my $i=0; $i < @word_array.elems; $i++) {
11:10 inwigilator line 9: loop (my $i=0; $i < @word_array.elems; $i++) {
11:12 inwigilator ok
11:12 inwigilator fixed :D
11:18 Relsak joined #perl6
11:19 inwigilator hey hey @arr = split("", "asd") first and last element is nil
11:22 ely-se m: my @xs = 1, 2, 3; my @ys = 1, 2, 3; @xs = @ys; say @xs === @ys; @xs := @ys; say @xs === @ys;
11:22 camelia rakudo-moar fb0a13: OUTPUT«False␤True␤»
11:24 inwigilator m: @arr = split("", "and"); say @arr[0];
11:24 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/wh38ctkt6u␤Variable '@arr' is not declared␤at /tmp/wh38ctkt6u:1␤------> 3<BOL>7⏏5@arr = split("", "and"); say @arr[0];␤»
11:24 inwigilator m: my @arr = split("", "and"); say @arr[0];
11:24 camelia rakudo-moar fb0a13: OUTPUT«␤»
11:25 inwigilator why NL?
11:25 ely-se newline
11:25 inwigilator I didn't put new line
11:25 ely-se you did
11:25 inwigilator how?
11:25 ely-se use print instead of say
11:26 inwigilator m: my @arr = split("", "and"); print @arr[0];
11:26 camelia rakudo-moar fb0a13: ( no output )
11:26 ely-se say appends a newline
11:26 inwigilator oh ok
11:26 inwigilator but tell me now why no output
11:26 inwigilator why it is nil?
11:26 inwigilator m: my @arr = split("", "and"); print @arr[1];
11:26 camelia rakudo-moar fb0a13: OUTPUT«a»
11:27 inwigilator split should give me [a, n, d] array
11:32 RabidGravy it doesn't
11:33 RabidGravy m: my @a = "and".comb(*);  say @a[0];
11:33 camelia rakudo-moar fb0a13: OUTPUT«Cannot call comb(Str: Whatever); none of these signatures match:␤    (Cool $: *%_)␤    (Cool $: Regex $matcher, $limit = { ... }, *%_)␤    (Cool $: Str $matcher, $limit = { ... }, *%_)␤    (Str:D $: *%_)␤    (Str:D $: Int:D $size, $limit = { ... …»
11:33 RabidGravy m: my @a = "and".comb();  say @a[0];
11:33 camelia rakudo-moar fb0a13: OUTPUT«a␤»
11:33 RabidGravy if you want to split into all the chars use comb
11:33 inwigilator ok thanks :)
11:34 inwigilator RabidGravy, I tried unpack but reading perl6 documentation of rme is a bit difficult
11:35 RabidGravy unpack is "experimental" in this release as it is proposed that it be replaced with something "more 6-ish"
11:35 CIAvash m: my @a = 'and'.split('', :skip-empty); say @a[0];
11:35 camelia rakudo-moar fb0a13: OUTPUT«a␤»
11:36 RabidGravy for the most part the pack/unpack is a subset of that in perl 5
11:38 leont Is there any way for me to (dynamically) give a closure method a name?
11:39 leont method ($arg) is named($name) { ... } or some such?
11:39 RabidGravy yeah
11:39 RabidGravy er
11:39 RabidGravy m: my &foo = { say "foo" };  &foo.^set_name("zub");  say &foo'
11:39 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/v7DBMq3mDj␤Two terms in a row␤at /tmp/v7DBMq3mDj:1␤------> 3oo" };  &foo.^set_name("zub");  say &foo7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        s…»
11:40 RabidGravy m: my &foo = -> { say "foo" };  &foo.^set_name("zub");  say &foo'
11:40 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bPugD_pz4g␤Two terms in a row␤at /tmp/bPugD_pz4g:1␤------> 3oo" };  &foo.^set_name("zub");  say &foo7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        s…»
11:40 RabidGravy m: my &foo = -> { say "foo" };  &foo.^set_name("zub");  say &foo
11:40 camelia rakudo-moar fb0a13: OUTPUT«->  { #`(zub|70733024) ... }␤»
11:41 RabidGravy (so used to typing in the shell)
11:42 RabidGravy but that's only so it "knows its own name", I'm not sure you can use it
11:43 leont It's mainly to make debugging nicer, really
11:43 leont And to make ^methods say something sensible
11:43 RabidGravy :)
11:46 leont Now lets see if I can make a trait out of this
11:46 pierre-vigier joined #perl6
11:53 musiKk joined #perl6
12:02 leont What are the AUTOGEN methods I'm seeing in my ^methods?
12:03 jnthn leont: iirc, auto-generated proto methods (when multis were written without a proto)...but I thought they usually were set_name'd
12:04 jnthn m: class A { multi m() { } }; say A.^methods
12:04 camelia rakudo-moar fb0a13: OUTPUT«()␤»
12:05 jnthn oh, duh
12:05 jnthn m: class A { multi method m() { } }; say A.^methodsoh
12:05 camelia rakudo-moar fb0a13: OUTPUT«Method 'methodsoh' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤  in block <unit> at /tmp/FVxvbjGocn line 1␤␤»
12:05 leont Yeah, it seems defining a proto gets rid of a AUTOGEN
12:05 jnthn m: class A { multi method m() { } }; say A.^methods
12:05 camelia rakudo-moar fb0a13: OUTPUT«(m)␤»
12:05 jnthn Yeah, but there the generated proto is called m
12:05 jnthn So I wonder what code-path you're taking that loses the renaming :)
12:06 leont m: class A { multi method m() { } multi method m(Int) {} }; say A.^methods
12:06 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tMI7PZ7QfL␤Strange text after block (missing semicolon or comma?)␤at /tmp/tMI7PZ7QfL:1␤------> 3class A { multi method m() { }7⏏5 multi method m(Int) {} }; say A.^method␤    expecting any of:␤  …»
12:06 leont m: class A { multi method m() { }; multi method m(Int) {} }; say A.^methods
12:06 camelia rakudo-moar fb0a13: OUTPUT«(m)␤»
12:06 leont Hmmmmm
12:06 jnthn That gets it right too
12:06 leont I do a compose at a later point, because I dynamically add some methods
12:06 leont Could it get lost there?
12:06 jnthn Do you add multi methods? Do they have a name?
12:07 leont Ah, yes. When I add the proto I suddenly see that multi in the list where I previously didn't
12:07 leont No I'm not adding multi methods dynamically
12:07 jnthn Hm
12:08 jnthn If you manage to boil it down to a smallish test case that reproduces the lack of renaming I'd be curious to see it.
12:08 jnthn Not that I'll have time to fix much for another week, but...
12:08 BenGoldberg joined #perl6
12:09 leont On it
12:10 xdoctor joined #perl6
12:12 RabidGravy I think I've seen it with ClassHOW methods
12:16 leont (it was on Path::Iterator, BTW)
12:28 Skarsnik joined #perl6
12:28 felher joined #perl6
12:37 ely-se joined #perl6
12:47 lokien_ joined #perl6
12:51 spider-mario joined #perl6
12:58 colomon joined #perl6
13:05 kid51 joined #perl6
13:07 FROGGS joined #perl6
13:07 FROGGS o/
13:11 leont I know I can do $object."$name"(|$capture), can I do the same but with a $method instead of a $name?
13:12 moritz leont: you can just invoke it
13:12 FROGGS leont: $method($invocant, ...)
13:12 moritz leont: $method($object, |$capture)
13:12 leont Ah, I see
13:12 FROGGS because it is ~~ Callable
13:12 RabidGravy thator $invocant.$method(...)
13:13 FROGGS are you sure?
13:13 RabidGravy I'm sure yes
13:13 FROGGS I was thinking this would not even parse right
13:13 leont I thought that gave an error, but apparently it didn't
13:14 jnthn yeah, $invocant.$method(...) works fine with $method is callable :)
13:14 Actualeyes joined #perl6
13:14 FROGGS aha
13:14 FROGGS so we do an istype check while we parse?
13:14 RabidGravy that's why you have to put the quotes round it when it's a string rather than a method object
13:15 FROGGS hmmm, can we actually do an istype check? probably not
13:15 RabidGravy or that's how I've rationalised it in my brain anyhow
13:15 FROGGS RabidGravy: you are right
13:15 jnthn It's a syntactic distinction.
13:15 RabidGravy I used that all over the place in some module
13:16 jnthn It's a runtime error is $method is not something that knows how to be invoked
13:18 RabidGravy ah, so you could add a CALL-ME to a string to make it do "something else" in that case, never occurred to me
13:20 leont Signature doesn't really expose named arguments. Guess I have to extract that out of the params…
13:21 RabidGravy m: class Foo {}; my $a = "foo" but role { method CALL-ME(*@args) { say @args } }; Foo.new.$a("zub")
13:21 camelia rakudo-moar fb0a13: OUTPUT«[Foo.new zub]␤»
13:21 RabidGravy hahahaha
13:21 FROGGS yes, that's where I love Perl 6 :o)
13:22 FROGGS things like routines are not hacks, they are based on real concepts that are properly implemented
13:22 FROGGS so many nice things fall out of basic rules
13:23 hankache joined #perl6
13:24 * FROGGS would love to work on Perl 6 full time... but then he's working for $dayjob on a Sunday -.-
13:26 * RabidGravy files it away in the "things I can't immediately think of a use for" category
13:30 maslan joined #perl6
13:36 _mg_ joined #perl6
13:36 nine jnthn: I guess having MoarVM unmap bytecode files more predictably is out of the question?
13:36 yoleaux 18 Jan 2016 15:29Z <orbus> nine: thanks - taking a look
13:38 RabidGravy The big problem with Perl 6 for me is that I keep getting distracted by "OooOooh I can do this really cool thing, I wonder what I could use it for" and spend twice as long doing everything
13:40 leont RabidGravy: I know! I just rewrote a part of my code to use reflection on signatures instead of hardcoding things, because may at some point in the future I might want to write extensions…
13:41 RabidGravy :)
13:41 leont nine: is that for that Windows problem?
13:41 nine yes
13:42 leont memory mapping with FILE_MAP_COPY (equivalent of MMAP_PRIVATE) might help too (just a guess)
13:42 nine I've now confirmed my initial suspicion. Though making MoarVM unmap earlier would probably be just a bad workaround for my inability to come up with a better system for outdating precomp files
13:43 leont No idea how smart Windows manages that though
13:43 RabidGravy leont, strangely I was just playing with a ClassHOW extension to do "find me all the methods with this signature" :)
13:43 ZoffixWin What is the Perl 6's idomatic way to count a character in a string? like Perl 5's =~ tr/a//;
13:44 nine .charws
13:44 Actualeyes joined #perl6
13:44 jantore joined #perl6
13:44 nine m: say "hello".chars
13:44 camelia rakudo-moar fb0a13: OUTPUT«5␤»
13:44 FROGGS a specific char I guess
13:44 ZoffixWin Yes, a specific char.
13:45 ZoffixWin say "foo" =~ tr/o//; in P5 returns 2
13:45 RabidGravy m: say "faarpo".comb.grep("a").elems
13:45 camelia rakudo-moar fb0a13: OUTPUT«2␤»
13:45 ZoffixWin :o grep?
13:46 ZoffixWin I didn't realize you could use grep with those arguments
13:46 RabidGravy m: "faarpo" ~~ /a/;  say $/.elems
13:46 camelia rakudo-moar fb0a13: OUTPUT«0␤»
13:46 RabidGravy m: "faarpo" ~~ /a/;  say $/
13:46 camelia rakudo-moar fb0a13: OUTPUT«「a」␤»
13:46 FROGGS m: say "faarpo".comb.Bag<a>
13:46 camelia rakudo-moar fb0a13: OUTPUT«2␤»
13:47 RabidGravy the default is just to smart match
13:48 nine m: say "foobarboo".comb("o").elems
13:48 camelia rakudo-moar fb0a13: OUTPUT«4␤»
13:48 nine http://doc.perl6.org/type/Str#routine_comb
13:48 nine Docs are great :)
13:48 RabidGravy :)
13:49 RabidGravy so basically there are a thousand and one ways to do it
13:49 ZoffixWin Well, the grep way was obvious, but it also has a problem of being uber slow. Perl 5 completed counting 200M characters in 0.3 seconds... The Perl 6 grep variant is still running
13:49 * ZoffixWin will try the comb("o") way when it completes
13:49 ZoffixWin has been over a minute already -_-
13:51 ZoffixWin I'm killin' it
13:51 ZoffixWin 3m35s (and I killed it; it didn't complete)
13:52 ZoffixWin .comb("o") is much better
13:52 FROGGS_ joined #perl6
13:52 ZoffixWin m: say "It's only {11.780/0.313} times slower than Perl 5's version"
13:52 camelia rakudo-moar fb0a13: OUTPUT«It's only 37.635783 times slower than Perl 5's version␤»
13:52 ZoffixWin nine++
13:53 RabidGravy while you're looking for the fastest, I suspect ""foooople" ~~ m:g/o/; say $/.elems" is probably slower still
13:53 leont Truth be told, tr in p5 is ridiculously well-optimized
13:53 jnthn nine: afaik, we unmap them when the GC can collect the MVMCompUnit. We can't really do it any sooner than that.
13:54 ZoffixWin leont, yeah, which is why I'm perfectly fine with the 37 times slower :P
13:54 leont It's one of those "C isn't going to do it faster" things
13:56 leont Possibly a :count on comb, to make it return a count instead of a list of matches is useful
13:56 AlexDaniel joined #perl6
13:56 leont I suspect this sort of thing is not uncommon
13:57 nine It's also something that should be very easy to detect for the optimizer
13:57 inwigilator joined #perl6
13:57 pierre-vigier joined #perl6
13:59 leont Wouldn't that require too much high-level knowledge? E.g. this comb and this elems will always refer to the stringy ones ones.
14:02 nine Oh yes, it would have to know that .comb is called on a Str. It could generate both code paths and a runtime type check to pick the right one. Or leave it to spesh for optimization. In both cases you're right that it's not as simple to optimize as it looked.
14:02 jnthn No need for an adverb, just need to write an Iterator for that case of comb that implements the count-only method
14:02 jnthn Then .comb("o").elems will use it
14:03 nine And that's what we already have :)
14:03 nine lizmat++ got there first :)
14:03 jnthn oh, that already is there
14:04 jnthn OK, so as our code-gen and general optimization gets better, so will that code :)
14:05 nine We could have guessed it actually. There's no way a naive high level implementation could have been only 37 times slower than Perl 5 at this.
14:05 jnthn True :)
14:07 AlexDaniel jnthn: by the way, have you looked at https://rt.perl.org/Public/​Bug/Display.html?id=127330 ? To me it sounds like compiling sub calls is just slow, not only in this particular case. Perhaps fixing this will make any code compile faster?
14:10 leont Seqs are awesome like that :-)
14:11 nine Yep. Their power lies in deferring the actual work so they have the chance to know more about the actual use case and can optimize for that.
14:16 kappa_ joined #perl6
14:18 kappa__ joined #perl6
14:18 kappa__ p6: my uint64 $n = 0xffffffffffffffff; say $n;
14:18 camelia rakudo-moar fb0a13: OUTPUT«-1␤»
14:19 kappa__ I am trying to get unsigned behaviour from uint but failing
14:21 kappa_ joined #perl6
14:22 AlexDaniel m: my uint64 $n = 0xafffffaffffafafa; say $n;
14:22 camelia rakudo-moar fb0a13: OUTPUT«-5764607866631947526␤»
14:22 leont p6: my uint64 $n = 0xffffffffffffffff; say Int($n);
14:22 camelia rakudo-moar fb0a13: OUTPUT«-1␤»
14:22 leont Hmmmm
14:22 AlexDaniel m: my uint64 $n = 0xaafffffaffffafafa; say $n;
14:22 camelia rakudo-moar fb0a13: OUTPUT«Cannot unbox 68 bit wide bigint into native integer␤  in block <unit> at /tmp/HFH3ziDQfq line 1␤␤»
14:25 kappa_ UInt works ok, but not the lowercase ones
14:25 FROGGS_ kappa_: it is ticketed since a while
14:25 FROGGS_ kappa_: jnthn was working on it lately iirc
14:28 _mg_ joined #perl6
14:28 RabidGravy to augment or apply a role that is the question
14:28 orbus hrm
14:28 orbus coming up with a gihub username is hard
14:29 orbus github*
14:29 kappa_ FROGGS_: ok, thanks, good to know
14:29 * orbus has been thinking about it for a couple weeks
14:29 AlexDaniel orbus: what about “orbus”?
14:29 orbus taken
14:29 ZoffixWin m: say Blob.new(<72 101 108 108 111 32 87 111 114 108 100 33>).decode: 'ASCII';
14:29 camelia rakudo-moar fb0a13: OUTPUT«Hello World!␤»
14:29 ZoffixWin Perl ++
14:29 orbus and not sure I want to use that anyway
14:29 AlexDaniel orbus: plorbus?
14:30 orbus heh
14:30 AlexDaniel or if that's taken, plorbus6
14:30 orbus maybe
14:30 orbus yeah, I guess there's nothing that says I can't make another one for non-p6 stuff
14:30 ZoffixWin orbus, what about andbus?
14:30 ZoffixWin X)
14:30 orbus lol
14:30 orbus xorbus
14:30 FROGGS_ hehe
14:30 FROGGS_ xorbus
14:30 AlexDaniel xorbus is also free
14:30 FROGGS_ heh
14:30 AlexDaniel nandbus should also work fine
14:30 orbus I was actually thinking about orbusx - but I like the joke better
14:31 RabidGravy m: say ('a' .. 'z').pick(8).join('')
14:31 camelia rakudo-moar fb0a13: OUTPUT«tixudchy␤»
14:31 AlexDaniel RabidGravy: what's that? A password generator?
14:31 orbus is pick cryptographically secure?
14:32 RabidGravy rarely creates something memorable to me
14:32 orbus that's why you use a password manager - if it's memorable, somebody can probably guess it
14:33 AlexDaniel m: ^10¹⁵ .pick.base(36).say
14:33 camelia rakudo-moar fb0a13: OUTPUT«36GMQMXUOI␤»
14:33 AlexDaniel m: ^10¹⁵ .pick.base(36).say
14:33 camelia rakudo-moar fb0a13: OUTPUT«2YJOIKVH3F␤»
14:33 AlexDaniel m: ^36¹⁵ .pick.base(36).say # better
14:33 camelia rakudo-moar fb0a13: OUTPUT«GY999220CFPR4IQ␤»
14:34 ZoffixWin https://xkcd.com/936/
14:34 AlexDaniel you can also control the length like this
14:35 AlexDaniel m: (36¹⁴..36¹⁵).pick.base(36).say
14:35 camelia rakudo-moar fb0a13: OUTPUT«OMI34UTHWKRKDEK␤»
14:36 AlexDaniel oops, off by one
14:36 AlexDaniel m: (36¹⁴..(36¹⁵-1)).pick.base(36).say # should be 15 chars
14:36 camelia rakudo-moar fb0a13: OUTPUT«XTRPSZUG3G293TO␤»
14:36 AlexDaniel or
14:36 AlexDaniel m: (36¹⁴..^36¹⁵).pick.base(36).say
14:36 camelia rakudo-moar fb0a13: OUTPUT«BWB3C5J7UJ9ROML␤»
14:36 ZoffixWin m: my $b = Blob.new(<72 101 108 108 111 32 87 111 114 108 100 33>); Blob[2] = 100; say $b.decode: 'ASCII';
14:36 camelia rakudo-moar fb0a13: OUTPUT«Cannot modify an immutable Blob[Int]␤  in block <unit> at /tmp/PpJXNgP9H2 line 1␤␤»
14:36 nine ZoffixWin: it's really telling when major advances in IT security don't come from scientific papers, but from online comics.
14:36 ZoffixWin dammit... Are there mutable blobs?
14:37 nine ZoffixWin: Bufs
14:37 ZoffixWin Thanks
14:42 orbus hmmm, well certainly the longer the better
14:42 orbus it still seems like using only common words, even in combination, would make dictionary-type attacks more likely
14:42 orbus probably your passwords should just all be 4096 bit random keys
14:42 nine Also ironic: Perl grew up to be the perfect tool for manipulating texts, yet in Perl 6 we have Hash as mutable Map, Array as mutable List, Buf as mutable blob with Str being the only non-primitive immutable type without a mutable companion.
14:44 orbus allocating a new string is more efficient than trying to do string manipulation?
14:44 * orbus doesn't know about the guts much
14:45 nine Well you can share immutable things between many users. That's very good for optimization
14:45 orbus sure
14:45 ZoffixWin m: subset Pos of Int where * > 0; my Pos $x = 1; say $x
14:46 camelia rakudo-moar fb0a13: OUTPUT«1␤»
14:46 ZoffixWin :o
14:46 ZoffixWin m: subset Pos of Int where * > 0; my Pos $x = 1; $x--
14:46 camelia rakudo-moar fb0a13: OUTPUT«Type check failed in assignment to $x; expected Pos but got Int␤  in block <unit> at /tmp/NPAtwS5ar_ line 1␤␤»
14:46 ZoffixWin m: subset Pos of Int where * < 0; my Pos $x = -1; $x++
14:46 camelia rakudo-moar fb0a13: OUTPUT«Type check failed in assignment to $x; expected Pos but got Int␤  in block <unit> at /tmp/wzaajldYKj line 1␤␤»
14:46 orbus I guess I'm thinking of c-style strings, where they're basically a contiguous block of memory
14:46 orbus doing manipulation on them is problematic
14:47 orbus unless you're just flipping case or something
14:47 orbus it's much easier to allocate a new chunk of memory and put the modified string there
14:47 orbus and then just deallocate the old one
14:48 orbus but I'm hardly a c guru - I can see strategies for working in those constraints, but all of them require more memory, more bookkeeping, or both
14:49 orbus but hey, if somebody wants to write StrBuf - go for it :)
14:50 orbus and I really have no clue how p6 strings are implemented under the hood
14:50 orbus I'm assuming it's already more complex
14:52 ZoffixWin m: grammar Counter { token TOP { [ <char> | . ] }; token char { o } }; Counter.parse: "foo", :actions((class { has $!counter = 0; method TOP ($) { say $!counter; }; method char ($) { $!counter++ };}).new);
14:52 camelia rakudo-moar fb0a13: OUTPUT«0␤»
14:52 ZoffixWin How come it's zero and not 2?
14:53 ZoffixWin m: grammar Counter { token TOP { [ <char> | . ] }; token char { o } }; Counter.parse: "foo", :actions((class { has $!counter = 0; method TOP ($) { say $!counter; }; method char ($) { $!counter++; say "Inside the char!" };}).new);
14:53 camelia rakudo-moar fb0a13: OUTPUT«0␤»
14:53 moritz ZoffixWin: first of all, you forgot to quantify the <char>
14:53 ZoffixWin Ah, right
14:54 ZoffixWin m: grammar Counter { token TOP { [ <char> | . ]* }; token char { o } }; Counter.parse: "foo", :actions((class { has $!counter = 0; method TOP ($) { say $!counter; }; method char ($) { $!counter++; say "Inside the char!" };}).new);
14:54 camelia rakudo-moar fb0a13: OUTPUT«Inside the char!␤Inside the char!␤2␤»
14:54 ZoffixWin moritz++
14:54 ZoffixWin Was there a second of all?
14:54 moritz ZoffixWin: also 'parse' implicitly anchors the match
14:54 moritz ah, but you do allow .
14:54 moritz never mind the point
14:54 moritz "second, nothing"
14:54 ZoffixWin I didn't know parse anchored, so thanks :D
14:55 RabidGravy "second, anything else I may not have thought of"
15:00 orbus Hey, is there a plan for when goto will be implemented?  I want to write some spaghetti code.
15:00 orbus :D
15:01 Actualeyes joined #perl6
15:02 orbus on the surface, goto seems like it might be difficult to implement in p6
15:03 ZoffixWin Hm... http://docs.perl6.org/language/io doesn't mention anything for how to read input from the user
15:03 ZoffixWin STDIN
15:03 ZoffixWin m: say $*IN
15:03 camelia rakudo-moar fb0a13: OUTPUT«IO::Handle<<STDIN>>(opened, at octet 0)␤»
15:06 ZoffixWin how do I go about reading a single char from $*IN? .getc seems to wait until I press ENTER
15:07 ZoffixWin Testing with perl6 -e 'loop { given $*IN.getc { when " " { exit; }; default { .print } } }'
15:08 leont That is terminal buffering
15:09 ZoffixWin hm.. how do I get rid of it?
15:10 ZoffixWin stdbuf -i0 perl6 ... doesn't seem to do it :/
15:11 leont Term-termios is probably your friend
15:12 leont You probably want raw modus
15:15 ely-se How can I create a class that implements an array of roles?
15:15 ZoffixWin I see panda now cares about Perl versions... "Term::termios requires Perl version 6.0.0. Cannot continue."
15:15 ely-se s/implements/does/
15:15 laz78 joined #perl6
15:16 moritz class Foo does Role1 does Role2 { }
15:17 ely-se m: role R { }; constant C := Metamodel::ClassHOW.new_type(name => 'C'); C.^add_role(R); C.^compose();
15:17 camelia rakudo-moar fb0a13: ( no output )
15:17 ely-se moritz: that's not an array :p
15:17 ZoffixWin leont++ Term::termios does what I want
15:17 moritz ely-se: right, it's a lsit
15:17 moritz *lsit
15:17 moritz ARGL
15:17 moritz *list
15:17 ZoffixWin :D
15:18 ely-se m: role R { method m() { say self } }; constant C := Metamodel::ClassHOW.new_type(name => 'C'); C.^add_role($_) for @[R]; C.^compose(); C.new.m;
15:18 camelia rakudo-moar fb0a13: OUTPUT«C.new␤»
15:18 ely-se nice
15:19 ely-se moritz: oh, hmm
15:19 ely-se m: role A { }; role B { }; constant Roles := A, B; class C does Roles { }
15:19 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/P5UDBkDqlG␤Cannot call trait_mod:<does>(C, List); none of these signatures match:␤    (Mu:U $doee, Mu:U $role)␤    (Variable:D $v, Mu:U $role)␤at /tmp/P5UDBkDqlG:1␤»
15:20 ely-se m: role A { }; role B { }; constant Roles := A, B; class C does |Roles { }
15:20 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/58sNGw_NG5␤Malformed trait␤at /tmp/58sNGw_NG5:1␤------> 3 }; constant Roles := A, B; class C does7⏏5 |Roles { }␤»
15:20 moritz ely-se: a list, not a List
15:21 CIAvash joined #perl6
15:23 ely-se :v
15:24 zakharyas joined #perl6
15:33 khw joined #perl6
15:34 xpen joined #perl6
15:38 jdv79 ZoffixWin: which "json spec" are you referring to?
15:38 pmurias joined #perl6
15:38 ZoffixWin context?
15:38 pmurias nine: re mutable strings, do we have much use cases for them?
15:38 jdv79 your last post on blogs.perl
15:39 ZoffixWin jdv79, RFC7159: http://rfc7159.net/rfc7159#rfc.section.2
15:40 ely-se for (1, 2, (3, 4), 5) { .perl.say }
15:41 pmurias nine: it seems to be once they become mutable rather we have to choose if we view them as an array of graphemes/code points/bytes rather than applying different view to them
15:41 ely-se m: for (1, 2, (3, 4), 5) { .perl.say }
15:41 camelia rakudo-moar fb0a13: OUTPUT«1␤2␤(3, 4)␤5␤»
15:44 xpen_ joined #perl6
15:44 ely-se m: ((1, 2, 3)>>.Str).WHAT.say
15:44 camelia rakudo-moar fb0a13: OUTPUT«(List)␤»
15:47 jdv79 huh.  i guess it was inevitable.
15:48 jdv79 though iirc part of the point of the json spec was that it would never change.
15:48 ZoffixWin hah
15:49 jdv79 wonder if that's its or will this be the beginning of the demise of json
15:49 ZoffixWin Not until we get something better :)
15:49 nine pmurias: to be clear: I don't think we're lacking mutable strings. It just sounds ironic that our types turned out that way and I love irony :)
15:58 ZoffixWin Is END { $!saved-term-settings.setattr(:DRAIN); } safe?
15:59 ZoffixWin As in, is the value of $!saved-term-settings guaranteed to exist at that time?
15:59 ZoffixWin Context: https://gist.github.com/zoffixznet/9​479d47c86fb3934f84f#file-foo-pm6-L16
16:02 ZoffixWin Or maybe I should use LEAVE phaser
16:02 ZoffixWin m: class Foo { has $!bar; submethod BUILD { $!bar = "Foo"; }; END { $!bar = 0; say "Tossing bar"; }; method x { say $!bar } }; Foo.new.x
16:02 camelia rakudo-moar fb0a13: OUTPUT«5===SORRY!5=== Error while compiling /tmp/8f3AOF9vS8␤Variable $!bar used where no 'self' is available␤at /tmp/8f3AOF9vS8:1␤------> 3od BUILD { $!bar = "Foo"; }; END { $!bar7⏏5 = 0; say "Tossing bar"; }; method x { s␤»
16:02 ZoffixWin I need a DESTROY or something
16:03 ZoffixWin m: class Foo { has $!bar; submethod BUILD { $!bar = "Foo"; }; submethod DESTROY { $!bar = 0; say "Tossing bar"; }; method x { say $!bar } }; Foo.new.x
16:03 camelia rakudo-moar fb0a13: OUTPUT«Foo␤»
16:06 ZoffixWin What's called during an object destructions?
16:09 ZoffixWin m: class Foo { has $!bar; submethod BUILD { $!bar = "Foo"; }; submethod DESTROY { $!bar = 0; say "Tossing bar"; }; method x { say $!bar } }; { my $x = Foo.new; $x.x }; say 42
16:09 camelia rakudo-moar fb0a13: OUTPUT«Foo␤42␤»
16:09 jdv79 nada implicitly, right?
16:10 ZoffixWin The spec mentions "DESTROY submethods" but it doesn't seem to be working: http://design.perl6.org/S12.html
16:10 ZoffixWin jdv79, what's "nada"?
16:10 jdv79 nothing
16:10 jdv79 destroy only fires if and when the gc gets around to it
16:11 jdv79 iirc scope guards are the closest you can get
16:11 jdv79 LEAVE basically
16:12 ZoffixWin Actually, I realize that, in my particular case, I can do the clean up in method TOP($/)  {...}
16:15 rindolf joined #perl6
16:20 sftf joined #perl6
16:21 jnthn AlexDaniel: I saw it; I think it'll be addressed with more general compiler performance improvemnets, and is unlikely anything special about that example.
16:22 jnthn orbus: fwiw, flipping case is also not always possible in-place since it can change the length of the string :)
16:22 nine jnthn: I rejected the ticket for that very reason
16:23 jnthn nine: Well, the other reason is that it has to observable. How fast is fast enough? :)
16:23 ely-se joined #perl6
16:25 nine Well obviously it's fast enough when it doesn't annoy me anymore. Though writing a test that checks my annoyance level might be a bit of a challenge...
16:27 araujo joined #perl6
16:27 araujo joined #perl6
16:28 jnthn Indeed :)
16:29 revhippie joined #perl6
16:30 nightfro` joined #perl6
16:36 * jnthn is a bit curious about 3c2fc66ab and what the use case for passing on --profile is :)
16:37 dalek rakudo/nom: d67cb03 | (Stefan Seifert)++ | src/core/CompUnit/PrecompilationRepository.pm:
16:37 dalek rakudo/nom: Remove obviously accidentally pasted line
16:37 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/d67cb03e0e
16:39 ely-se m: role R { }; constant g = Metamodel::ClassHOW.new_type; g.^add_parent(Grammar); g.^add_role(R); g.^compose;
16:39 camelia rakudo-moar fb0a13: ( no output )
16:39 ely-se I get an error on the g.^add_parent(Grammar); call that "Parents cannot be added to a class after it has been composed"
16:40 Praise joined #perl6
16:40 Praise joined #perl6
16:40 ely-se m: role R { }; constant g := Metamodel::ClassHOW.new_type; g.^add_parent(Grammar); g.^add_role(R); g.^compose;
16:40 camelia rakudo-moar fb0a13: ( no output )
16:41 musiKk joined #perl6
16:42 ely-se m: constant g = Metamodel::ClassHOW.new_type; g.^is_composed.say;
16:42 camelia rakudo-moar fb0a13: OUTPUT«Method 'say' not found for invocant of class 'NQPMu'␤  in block <unit> at /tmp/GopdQKmsCt line 1␤␤»
16:42 ely-se m: constant g = Metamodel::ClassHOW.new_type; say g.^is_composed;
16:42 camelia rakudo-moar fb0a13: OUTPUT«Method 'gist' not found for invocant of class 'NQPMu'␤  in block <unit> at /tmp/T1CuAmkKhv line 1␤␤»
16:42 ely-se m: constant g = Metamodel::ClassHOW.new_type; say g.^is_composed();
16:43 camelia rakudo-moar fb0a13: OUTPUT«Method 'gist' not found for invocant of class 'NQPMu'␤  in block <unit> at /tmp/8wVh4ceMhg line 1␤␤»
16:43 jnthn ely-se: Strange you get the error locally but not here...
16:44 jnthn I mean, it's right you can't add a parent after composition
16:44 jnthn But your example here clearly doesn't...
16:45 ely-se here's the full code: https://gist.github.com/rig​htfold/ed345900cf17fd90d646
16:45 ely-se I don't get the error either if I do it on a smaller code example.
16:45 ely-se (line 48 in the gist)
16:45 Actualeyes joined #perl6
16:46 jnthn uh, wait
16:46 jnthn constant = BEGIN time = evaluated once ever
16:47 jnthn So if you call that sub more than once, you'll be trying to add_parent to the same thing you did on the first call
16:47 ely-se aha :)
16:47 jnthn my \grammar = ... :)
16:47 jnthn Took me a couple of reads to spot :)
16:48 dalek rakudo/2016.01-preparation: 7741d58 | jnthn++ | src/core/Supply.pm:
16:48 dalek rakudo/2016.01-preparation: Fix scoping bug in Supply.grep.
16:48 dalek rakudo/2016.01-preparation: review: https://github.com/rakudo/rakudo/commit/7741d58bd5
16:48 dalek rakudo/2016.01-preparation: 8162bdf | (Tommy Stanton)++ | src/core/Exception.pm:
16:48 dalek rakudo/2016.01-preparation: Fix typo in X::Seq::Consumed exception
16:48 dalek rakudo/2016.01-preparation: review: https://github.com/rakudo/rakudo/commit/8162bdfffa
16:48 ely-se ah, seems to work with $ as well
16:48 ely-se I thought .^ maybe wanted to work on the container
16:48 ely-se thanks
16:55 ely-se this is also quite a nasty trap:
16:55 ely-se m: [[]].perl.say
16:55 camelia rakudo-moar d67cb0: OUTPUT«[]␤»
16:55 ely-se m: [[],].perl.say
16:55 camelia rakudo-moar d67cb0: OUTPUT«[[],]␤»
16:55 orbus alright
16:56 orbus time to look seriously at publishing my module
16:56 jnthn ely-se: Single arg rule, but yes, was a trade-off we knowingly made.
16:56 * orbus now needs to figure out how META.info works
16:56 ely-se IMO the whole treating of non-lists as single-element lists is going to do more bad than good
16:58 jnthn It's just part of the very general Perl design approach that operations tend not to be overloaded with multiple semantics, and so can coerce their arguments into something that fits the desired operation.
16:59 jnthn It's the same reasoning behind $a + $b always doing numeric addition, and $a ~ $b always doing string concat.
17:01 leont It is a bit confusing, but not an issue all that often
17:01 ZoffixWin orbus, you may find http://modules.perl6.org/repo/Test::META useful.
17:02 orbus appreciate the pointer
17:02 orbus have to setup github first
17:02 orbus and possibly write some more tests, although I have quite a few already
17:03 orbus guess you can never have too many
17:03 ely-se m: ((),).say
17:03 camelia rakudo-moar d67cb0: OUTPUT«(())␤»
17:03 orbus actually, here's a question - is there any standard way to provide optional tests?
17:03 ZoffixWin orbus, use skip
17:03 orbus hm
17:03 orbus okay
17:03 ZoffixWin orbus, I'm also working on Test::When
17:04 orbus okay cool
17:04 ZoffixWin (not ready for use yet, though... and I'm... vacationing :P)
17:04 orbus no worries
17:04 orbus my module is concurrency based and I wrote a couple multithreaded torture tests
17:04 orbus they take a while to run though
17:04 orbus probably better not to mess with them in a normal install
17:05 orbus oh, that reminds me
17:06 orbus jnthn: question, for you - if a thread is blocking waiting for a channel, does it not yield its slot in the thread scheduler?
17:06 orbus because I saw some behavior suggesting it may not
17:07 jnthn orbus: No, it doesn't
17:07 jnthn Channels are intended for situations where you want to block
17:08 jnthn We may well introduce a way to receive-async at some point
17:08 ely-se lol
17:08 ely-se m: sub array(*@xs) { @xs }; array(1, 2, 3).perl.say
17:08 camelia rakudo-moar d67cb0: OUTPUT«Cannot find method 'array'␤  in block <unit> at /tmp/Yut0cXKDKm line 1␤␤»
17:08 ely-se m: sub arrays(*@xs) { @xs }; arrays(1, 2, 3).perl.say
17:08 camelia rakudo-moar d67cb0: OUTPUT«[1, 2, 3]␤»
17:08 orbus right
17:08 jnthn So you can await that, and in conjunction with upcoming non-blocking away support it'll work out
17:08 orbus well I guess I just don't understand how the scheduler works :p
17:09 orbus I guess that's kind of where I'm going with this
17:09 orbus so I did like 20 concurrent receive promises
17:09 orbus @p = start {$c.receive} xx 20
17:09 orbus (this was for torture test)
17:09 ZoffixWin m: my Buf[int8] $x; $x.append: 0; say $x
17:09 camelia rakudo-moar d67cb0: OUTPUT«Cannot modify an immutable Buf[int8]␤  in any  at gen/moar/m-Metamodel.nqp line 1718␤  in block <unit> at /tmp/UV9pSKlT_M line 1␤␤»
17:09 orbus and then I tried to make a couple promises to send stuff to them
17:10 orbus but it seemed like the receive promises totally tied up the scheduler, so the sends never happened
17:10 orbus and it just blocked forever
17:10 ZoffixWin Can I use uint8 as Buf elements, so that, say, $buf[0]++ will become 0 if it's currently 255?
17:10 jnthn Yeah...you have to use .then for now to get non-blocking. It's on the todo list
17:10 jnthn OK, I need to go and cook dinner :) I'll be back later :)
17:10 orbus cool
17:10 orbus later
17:11 moritz m: my $b := Buf[int8].new(0); say ++$b[0]
17:11 camelia rakudo-moar d67cb0: OUTPUT«1␤»
17:11 spider-mario joined #perl6
17:11 moritz m: my $b := Buf[int8].new(255); say ++$b[0]
17:11 camelia rakudo-moar d67cb0: OUTPUT«0␤»
17:11 ZoffixWin Thanks
17:11 moritz ZoffixWin: seems to work as expected :-)
17:12 adu joined #perl6
17:12 ZoffixWin m: my $b = Buf[uint8].new(255); say ++$b[0]; $b.push: 0; say --$b[1]
17:12 camelia rakudo-moar d67cb0: OUTPUT«0␤255␤»
17:12 ZoffixWin How come you used the binding operator instead of simple assignment?
17:12 moritz just common paranoia, I think
17:12 ZoffixWin Ah
17:13 moritz comes from having deal with too much low-level stuff (like MOP)
17:13 moritz where you don't want to .^compose the Scalar container :-)
17:18 lsm-desktop joined #perl6
17:23 spider-mario joined #perl6
17:24 Zero_Dogg joined #perl6
17:24 Zero_Dogg joined #perl6
17:26 mr-foobar joined #perl6
17:31 nbrown joined #perl6
17:33 rickbike joined #perl6
17:34 ZoffixWin m: my \ꜜ = 42; say ꜜ
17:34 camelia rakudo-moar d67cb0: OUTPUT«42␤»
17:36 ZoffixWin huggable, unicode vars :is: Find fancy unicode chars that can be used as term names: m: (0 .. 0xFFFF).grep({.uniname ~~ /:i 'arrow'/ and .uniprop ~~ /^ L/})».chr.print
17:36 huggable ZoffixWin, Added unicode vars as Find fancy unicode chars that can be used as term names: m: (0 .. 0xFFFF).grep({.uniname ~~ /:i 'arrow'/ and .uniprop ~~ /^ L/})».chr.print
17:39 rurban joined #perl6
17:45 Peter_R joined #perl6
17:50 rickbike o/ #perl6
17:50 ZoffixWin Is there an easier way to write:    say "nope"; exit;
17:51 ZoffixWin Like adding "\n" to die() message in Perl 5: I want to print a message and exit, but I don't want to print the stack trace
17:52 moritz ZoffixWin: do you want it to be catchable, like in Perl 5?
17:52 ZoffixWin Yeah
17:52 moritz ZoffixWin: or always fatal, like with "exit"
17:53 ZoffixWin Hm... either, I guess. But catchable is good, if it's short and sweet :)
17:53 ZoffixWin Oh, fail!
17:54 ZoffixWin Well, still a stack trace.
17:54 ZoffixWin screw it... stack trace it is
17:55 ely-se Is there an API for parsing POD and just POD?
17:56 autarch I'm going to do a short presentation on p6 for my local perl mongers group - several people asked that I try to cover "differences between 5 and 6" - I was wondering if anyone had any suggestions for things to highligh
17:56 leont ely-se: you can access it by using the $= variables
17:56 leont E.g. $=pod[0]
17:56 orbus autarch: it's kind of a long list
17:56 autarch yeah, that was my feeling too
17:56 orbus maybe summarize http://doc.perl6.org/language/5to6-nutshell ?
17:57 ZoffixWin autarch, "it's completely different; like learning a new language"? :)
17:57 autarch heh, yeah
17:57 ely-se leont: no I have pod in a text file and I want to parse it
17:57 orbus well not totally completely different - it still ends up looking very perl-ish
17:57 ely-se it is not in Perl 6 source code
17:57 orbus and many things are just close enough to trip you up
17:57 leont Valid POD is valid Perl 6 ;-)
17:58 rickbike autoarch: include what is _not_ in Perl6 or ecosystem (yet), and what is planned
17:58 autarch rickbike: that seems like an even bigger topic!
17:59 rickbike autoarch: yes, but expectations need to be addressed
18:00 autarch rickbike: if you could be a little more specific that'd be helpful
18:01 masak hello #perl6 from a train \o/
18:01 rickbike autoarch: it's not installed by default is a big one, and the tools for installing, ide's, etc
18:02 * nine waves to masak
18:02 moritz ZoffixWin: the proper solution is to write your own exception class whose .gist method doesn't print a backtrace, and throw that
18:02 masak autarch: https://github.com/perl6/mu/blob/mas​ter/docs/Perl6/Perl5/Differences.pod
18:02 moritz ZoffixWin: and maybe write a shortcut for that
18:02 masak autarch: I don't make any guarantees about how up-to-date that document is
18:02 nine ZoffixWin: shouldn't it be actually your user's decision whether to show a backtrace or not?
18:02 autarch masak: that's fine, it's still helpful
18:03 moritz ZoffixWin: maybe we want a :!bt option in die() or so
18:03 rickbike What characters are allowed in flags (MAIN)
18:03 moritz rickbike: they are just identifiers
18:03 moritz ZoffixWin: but so far, there has been no consensus on that
18:04 ZoffixWin nine, pro'lly
18:04 ely-se leont: yeah, but I don't want to accidentally execute Perl 6 code
18:05 orbus java is the language I have the most experience with regarding exceptions - it only shows a backtrace for uncaught exceptions
18:05 orbus I haven't played with p6 exceptions that much yet
18:06 orbus in java if you catch the exception and then exit (gracefully or not), you don't see a backtrace
18:12 sjoshi joined #perl6
18:13 rurban joined #perl6
18:14 Peter_R joined #perl6
18:17 laz78 joined #perl6
18:20 masak orbus: same holds for Perl 6.
18:20 orbus that's kind of what I thought
18:20 masak orbus: if you `exit()`, you'll see no exception.
18:20 orbus maybe I didn't understand the question - working on several things at once :)
18:24 niceperl joined #perl6
18:34 lizmat joined #perl6
18:36 gfldex jnthn: is it reasonable to expect that type checks get a little faster with more work on the compiler? (i'm writing propagande right now, hence the question)
18:37 jnthn gfldex: I've never seen them show up in profiles much today anyway :)
18:37 jnthn gfldex: We optimize quite a lot of them out on hot paths already at specialization time. But yes, as our dynamic opt improves, more of them will be ripped out.
18:38 gfldex nice
18:38 jnthn Or multiple related ones lifted to a single one :)
18:41 leont Will explicit return types help at that too?
18:42 arnsholt I guess adding types will tend to help the optimizer, so generally the slight increase in cost on invocation will be won back in better code inside a body?
18:44 ely-se joined #perl6
18:47 jnthn leont: They're at their most useful on subs where we might benefit from static inlining some, or anywhere if they're native
18:47 laz78 joined #perl6
18:49 rickbike joined #perl6
18:51 inwigilator hey
18:52 inwigilator I want to you sdl6 lib on os x
18:52 inwigilator I copy sdl.framework
18:52 inwigilator to my libraries but still sdl6 cant see binaries
18:54 ZoffixWin inwigilator, what's the error message/
18:59 inwigilator w8 trying to install it via panda
19:01 ZoffixWin :/
19:01 masak m: sub pronounce { $^abbreviation.subst(/8/, "eight", :g) }; say pronounce "w8"
19:01 camelia rakudo-moar d67cb0: OUTPUT«weight␤»
19:02 masak :P
19:02 timotimo i'm one of the authors of SDL2::Raw; sadly, i have no OS X machine i can try stuff out with, inwigilator
19:02 inwigilator timotimo, yeah I am already trying this
19:02 * masak .oO( ...so if you could please send me one ASAP... )
19:02 Peter_R joined #perl6
19:02 inwigilator have you got some examples made in raw?
19:02 timotimo hahaha
19:02 ZoffixWin I believe they're actually tring to use https://github.com/PerlGameDev​/SDL6/blob/master/lib/SDL.pm6
19:03 timotimo yeah, in SDL2::Raw's repository there's an examples/ folder. both examples require Cairo to be installed, though
19:03 ZoffixWin inwigilator, yes, there's an examples dir. http://modules.perl6.org/repo/SDL2::Raw
19:03 ely-se m: module M { class C { } }; say M::C
19:03 camelia rakudo-moar d67cb0: OUTPUT«(C)␤»
19:03 ely-se m: module M { my class C { } }; say M::C
19:03 camelia rakudo-moar d67cb0: OUTPUT«Could not find symbol '&C'␤  in block <unit> at /tmp/sFtEeOSGEr line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/sFtEeOSGEr line 1␤␤»
19:07 inwigilator Cannot locate native library 'libSDL2.dylib': dlopen(libSDL2.dylib, 1): image not found
19:08 ZoffixWin inwigilator, I've never used OSX, but it has a package manager, right? Search it for SDL2 lib
19:08 ZoffixWin It's package libsdl2-2.0-0 on Bodhi Linux FWIW
19:09 timotimo i think that should be the right filename, no?
19:09 ZoffixWin I've successfully launched the snake example, so at least it works on Linux :)
19:10 hankache joined #perl6
19:12 AlexDaniel snake example? Where can I find that?
19:12 ZoffixWin AlexDaniel, https://github.com/timo/SDL2_raw-​p6/blob/master/examples/snake.pl
19:12 ZoffixWin AlexDaniel, https://twitter.com/zoffix​/status/690212830092644352
19:13 gfldex lolibogedalittle https://gfldex.wordpress.com/2016/01​/24/keep-your-types-safe-and-sound/
19:14 Peter_R joined #perl6
19:17 virtualsue joined #perl6
19:18 zengargoyle joined #perl6
19:20 nbrown joined #perl6
19:21 domidumont joined #perl6
19:22 cschwenz joined #perl6
19:24 ZoffixWin Curious... is there a way to rewrite this loop without having to declare $level outside the loop? https://gist.github.com/zoff​ixznet/1127bbede08f2e8368aa
19:25 geekosaur ZoffixWin, it doesn't have a native package manager, actually. which is why there are third party ones like macports, fink, homebrew, ...
19:26 ZoffixWin :(
19:26 geekosaur (also a port of gentoo portage, one of netbsd pkgsrc, ......)
19:27 AlexDaniel ZoffixWin: use state?
19:28 ZoffixWin AlexDaniel, oh, right :D
19:31 moritz ZoffixWin: loop (my $level; True; ) { ... }
19:32 caasih joined #perl6
19:32 ZoffixWin m: loop (my $i = 0; $i < 10; $i++ ) { $i.say }
19:32 camelia rakudo-moar d67cb0: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
19:32 ZoffixWin I didn't realize loop {} was a C-style loop
19:33 AlexDaniel ZoffixWin: RTFM? :)
19:33 ZoffixWin pfft
19:33 ZoffixWin Who does that
19:33 ZoffixWin :)
19:34 AlexDaniel ZoffixWin: but yeah, it would be weird to think that TIMTOWTDI-ish language does not have a C-style for loop
19:34 AlexDaniel what kinda bothers me though is this
19:34 AlexDaniel m: loop (my $i = 0; $i < 10; $i++ ) { }; say $i
19:34 camelia rakudo-moar d67cb0: OUTPUT«10␤»
19:35 AlexDaniel which means that the next time you write it in the same scope you can't use 「my $i」
19:35 ZoffixWin :o
19:36 revhippie is that intended or a bug?
19:36 AlexDaniel it was discussed and it seems like that's how it should be, but hey… I don't think that it dwims
19:36 araujo_ joined #perl6
19:37 AlexDaniel the reason was that it is tied to the surrounding { }
19:37 AlexDaniel m: { loop (my $i = 0; $i < 10; $i++ ) { }; }; say $i
19:37 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_4L8GryMky␤Variable '$i' is not declared␤at /tmp/_4L8GryMky:1␤------> 3(my $i = 0; $i < 10; $i++ ) { }; }; say 7⏏5$i␤»
19:37 AlexDaniel so yeah
19:38 gist_nb joined #perl6
19:38 araujo__ joined #perl6
19:39 ely-se joined #perl6
19:42 jnthn Yeah, it's intended; scope is determined by curlies, the only exception being signatures (which are of course associated with the curlies that follow them).
19:43 ggoebel14 joined #perl6
19:43 jnthn loop isn't that common anyway, so it'd not warrant a discontinuity. And `if my $x = foo() { }` is better written `if foo() -> $x { }`, and similar for unless/while/until
19:44 lokien_ joined #perl6
19:45 Amendil joined #perl6
19:46 musiKk joined #perl6
19:46 ZoffixWin m: say ^255 .»chr
19:46 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/d3Rcfo5Bmm␤Malformed postfix call (only alphabetic methods may be detached)␤at /tmp/d3Rcfo5Bmm:1␤------> 3say ^255 .7⏏5»chr␤»
19:46 ZoffixWin :/
19:46 araujo_ joined #perl6
19:49 AlexDaniel m: say (^255)\ ».chr
19:49 AlexDaniel ZoffixWin: ↑ if you really want to have a space there
19:52 inwigilator hey see this during perl6 sdl2 library
19:52 inwigilator NativeCall: Consider adding the api version of the library you want to use, sub foo is native(SDL2, v1)
19:52 araujo__ joined #perl6
19:52 pmurias_ joined #perl6
19:53 ZoffixWin inwigilator, yeah, that's just a warning and it's removed now. If you install latest and greatest, bleeding edge Rakudo, you won't see it
19:53 inwigilator ohh
19:53 inwigilator I install it from
19:53 dalek ecosystem: 3bad032 | (Zoffix Znet)++ | META.list:
19:53 dalek ecosystem: Add Inline::Brainfuck to the ecosystem
19:53 dalek ecosystem:
19:53 dalek ecosystem: Use Brainfuck language in your Perl 6 programs: https://github.com/zoffixz​net/perl6-Inline-Brainfuck
19:53 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/3bad032a87
19:53 inwigilator panda
19:54 ZoffixWin inwigilator, no, you didn't
19:54 inwigilator ZoffixWin, sure I did
19:54 ZoffixWin Wanna bet? :D
19:55 ZoffixWin inwigilator, panda is a Perl 6 program, so I can't see how you could install your Perl 6 compiler with it.
19:55 inwigilator so rakudo-star isn't in brew already
19:55 ZoffixWin Not the Christmas one, no
19:56 ZoffixWin You can get one using instructions on getperl6.com
19:56 ZoffixWin (Task::Star is just a package you can install with panda)
19:56 ZoffixWin And you can run "rakudobrew build moar" instead of "rakudobrew build moar 2015.12", to get the bleeding edge Perl 6
19:57 stmuk or wait a fortnight or so for 2016.01!
19:58 ZoffixWin :/ I sure hope it won't be named 2016.01
19:58 ZoffixWin 'cause it'll be Feb already
19:59 gtodd joined #perl6
20:00 colomon joined #perl6
20:01 atweiden joined #perl6
20:02 AlexDaniel yeah!!!
20:02 AlexDaniel snake example works great
20:02 ZoffixWin \o/
20:02 araujo_ joined #perl6
20:03 AlexDaniel shooter example kinda doesn't
20:03 atweiden i have a patch for YouCompleteMe to handle p6 identifiers: http://ix.io/nG4
20:03 AlexDaniel I mean, something works but it is very buggy
20:03 ZoffixWin Yeah, it didn't for me either
20:03 atweiden is there a BNF for p6 identifiers, or is http://doc.perl6.org/language/syntax the best link i can give?
20:04 ZoffixWin atweiden, Perl 6 Grammar is the best you can get methinks :)
20:04 atweiden thanks to the vim-perl team
20:04 domidumont joined #perl6
20:05 araujo_ joined #perl6
20:05 AlexDaniel there's a bug in the snake example
20:05 AlexDaniel you can make 180° turns
20:06 ZoffixWin atweiden, actually, you can probably find something useful in https://github.com/MadcapJake/language-pe​rl6fe/blob/master/grammars/p6-regexp.cson
20:06 AlexDaniel oh, and when you hit your tail it is just chopped off? Hmm
20:06 ZoffixWin atweiden, MadcapJake would know more about it
20:07 ZoffixWin m: my \Δ = 'Look ma, an identifier'; say Δ
20:07 camelia rakudo-moar d67cb0: OUTPUT«Look ma, an identifier␤»
20:08 ZoffixWin m: my \say = 'Look ma, an identifier'; say say
20:08 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ua8cIN9UE0␤Two terms in a row␤at /tmp/ua8cIN9UE0:1␤------> 3my \say = 'Look ma, an identifier'; say7⏏5 say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤ …»
20:08 ZoffixWin m: sub term:<say> {'Look ma, an identifier'}; say say
20:08 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0mCYlkLLXm␤Two terms in a row␤at /tmp/0mCYlkLLXm:1␤------> 3rm:<say> {'Look ma, an identifier'}; say7⏏5 say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤…»
20:09 ZoffixWin m: my \say = 'Look ma, an identifier'; say(say)
20:09 camelia rakudo-moar d67cb0: OUTPUT«Look ma, an identifier␤»
20:09 ZoffixWin :D
20:09 AlexDaniel m: sub term:<say> {'Look ma, an identifier'}; &say say
20:09 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/TAEYkyF1Cz␤Two terms in a row␤at /tmp/TAEYkyF1Cz:1␤------> 3m:<say> {'Look ma, an identifier'}; &say7⏏5 say␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤…»
20:09 AlexDaniel m: sub term:<say> {'Look ma, an identifier'}; &say: say
20:09 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/vEk9oDitdn␤Confused␤at /tmp/vEk9oDitdn:1␤------> 3:<say> {'Look ma, an identifier'}; &say:7⏏5 say␤    expecting any of:␤        colon pair␤»
20:09 AlexDaniel ok whatever
20:10 ZoffixWin m: my \x = 42; say x x x x x x x x x
20:10 camelia rakudo-moar d67cb0: OUTPUT«42424242424242424242424242424242424242​424242424242424242424242424242424242424242424​242424242424242424242424242424242424242424242​424242424242424242424242424242424242424242424​242424242424242424242424242424242424242424242​42424242424242424242424242424242424242…»
20:10 atweiden ZoffixWin MadcapJake/p6dx looks like it would be good to bundle with YouCompleteMe like they do for python/jedi rust/racerd
20:11 ely-se Sometimes I feel like I've come to the point where I understand so much about software development that there isn't anything interesting left to learn. :(
20:11 Hotkeys ZoffixWin: lol
20:11 araujo__ joined #perl6
20:11 ely-se In the past I'd learn about higher-order functions (exciting!) and inheritance (exciting!) and Perl (exciting!) but now I can't find anything new to learn that is slightly challenging anymmore
20:11 ZoffixWin ely-se, that's the time when you start learning AI and attempt to achieve singularity :)
20:13 araujo_ joined #perl6
20:14 moritz ely-se: well, you can move away from pure languages and language features: testing, architecture, DDD, deployment techniques, project management, reliability features, ...
20:14 moritz ely-se: or algorithms of course; there's a sheer infinite amount of wealth there
20:14 DrForr Reimplement the Y combinator from scratch.
20:15 moritz &?ROUTINE exists :-)
20:17 dalek rakudo/2016.01-preparation: 432ff2e | moritz++ | docs/announce/2016.01.md:
20:17 dalek rakudo/2016.01-preparation: Announcement: State the language version we implement
20:17 dalek rakudo/2016.01-preparation: review: https://github.com/rakudo/rakudo/commit/432ff2e315
20:17 AlexDaniel ely-se: have you tried prolog?
20:17 ely-se AlexDaniel: no, but I have tried Mercury which is also a logic programming language.
20:18 ZoffixWin moritz, "6v.c" looks off
20:18 * DrForr pricks up his ears at that mention.
20:18 AlexDaniel ely-se: I don't know… learn bash, lol :)
20:19 dalek rakudo/2016.01-preparation: 005ca63 | moritz++ | docs/announce/2016.01.md:
20:19 dalek rakudo/2016.01-preparation: Fix version number, ZoffixWin++
20:19 dalek rakudo/2016.01-preparation: review: https://github.com/rakudo/rakudo/commit/005ca639c0
20:19 ely-se I have been slightly interested in scientific computing but I have no use-cases for it
20:19 pmurias joined #perl6
20:21 lizmat moritz: s/6v.c/v6.c/
20:21 ZoffixWin lizmat, too slow :D
20:22 lizmat :-)   yeah
20:22 masak ely-se: I assume you've already looked into category theory?
20:22 ely-se yup
20:22 ely-se I don't know all the rules by heart but I have a general idea of what it's about
20:22 araujo__ joined #perl6
20:23 atweiden oh lawd, YouCompleteMe! "The regex is quite... opaque, so it is quite hard to review what it is doing. Could you update the PR description with an overview of the change and how you tested it?" :)
20:23 ZoffixWin lol
20:23 atweiden lol tests
20:24 masak ely-se: that's excellent. I'm still learning. I can fit Yoneda in my head, but each time I blink it falls out again.
20:24 atweiden i'll just patch it downstream in my PKGBUILDs
20:25 ZoffixWin atweiden, it kinda makes me think that regex should be a simple "\S"... not that I know wtf YoucompleteMe is
20:25 atweiden YCM is semantic code completer for vim and maybe other editors (?)
20:25 ZoffixWin m: sub term:<(╯°□°)╯︵┻━┻> { "Complete me" }; say "you" ~ (╯°□°)╯︵┻━┻
20:25 camelia rakudo-moar d67cb0: OUTPUT«youComplete me␤»
20:26 atweiden for anyone who can carry the torch https://github.com/Valloric/ycmd/pull/320
20:27 ely-se that regex is not very unreadable
20:27 ZoffixWin atweiden, what's \xC0-\xFF supposed to match?
20:28 ZoffixWin I'm more concerned with it being off (as in, it doesn't capture all possible Perl 6 identifiers)
20:28 ZoffixWin even if you exclude crazy cases like the last eval above
20:28 atweiden unicode?
20:28 atweiden i pulled it from https://github.com/vim-perl/vim-p​erl/blob/master/syntax/perl6.vim
20:28 inwigilator ZoffixWin, is there some bigger tutorials
20:28 inwigilator for sadly and perl6?
20:28 inwigilator or I should follow C
20:29 atweiden ZoffixWin: it doesn't
20:29 atweiden i don't think it works for when you have certain unicode chars
20:29 ZoffixWin atweiden, that doesn't look like unicode to me
20:29 ZoffixWin m: say (\xC0..\xFF)».chr
20:29 atweiden the main thing is it does kebab case
20:29 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/4D1Bhq0rhC␤Undeclared routines:␤    xC0 used at line 1␤    xFF used at line 1␤␤»
20:29 ZoffixWin m: say (0xC0..0xFF)».chr
20:29 camelia rakudo-moar d67cb0: OUTPUT«(À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ)␤»
20:30 ZoffixWin m: my $÷x = 42; say $÷x
20:30 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/H_LYDtnxrS␤Preceding context expects a term, but found infix = instead␤at /tmp/H_LYDtnxrS:1␤------> 3my $÷x =7⏏5 42; say $÷x␤»
20:30 ZoffixWin Reading your regex, it'd match the above
20:31 ZoffixWin inwigilator, for SDL, it'd be C. For Perl 6, try https://learnxinyminutes.com/docs/perl6/ and http://perl6intro.com/
20:31 atweiden m: my $var = 1; my $varי;
20:31 camelia rakudo-moar d67cb0: ( no output )
20:31 atweiden it doesn't support the $varי
20:31 ZoffixWin .u י
20:31 yoleaux U+05D9 HEBREW LETTER YOD [Lo] (י)
20:31 DrForr . o ( Kneel before Yod )
20:31 ZoffixWin Why is the above not a "undeclared" error?
20:32 ely-se masak: I'm thinking about trying some of the non-esoteric concatenative languages like Forth
20:32 ZoffixWin Oh, there are two mys
20:32 ely-se Or Factor
20:32 DrForr Try PostScript then, more practical.
20:34 masak ely-se: oh, I've always wanted to give Forth a closer look, too. it seems to hold worthwhile secrets about refactoring and code re-use.
20:34 ely-se refactoring in a concatenative language is literally cut–paste
20:34 masak ely-se: have you looked some at Joy?
20:34 ely-se Nein.
20:34 * leont knows someone who in college wrote a report about simulations in postscript, the document was the simulation…
20:35 ely-se Only concatenative languages that I have used were FALSE and Befunge.
20:35 masak "In Joy, the meaning function is a homomorphism from the syntactic monoid onto the semantic monoid." -- I didn't even know semantics had a monoid.
20:35 ely-se Well if you have an identitiy semantic and a closed associative operator on semantics then your semantics form a monoid :)
20:36 Hotkeys Concatenative langs are fun
20:36 Hotkeys I've only really tried factor though
20:38 masak ely-se: apparently the associative part is function composition -- that makes sense
20:38 ely-se well yes
20:38 Hotkeys Thinking with the stack is definitely interesting
20:39 ely-se most concatenative languages have a single blank operator which composes two functions that take and return stacks
20:39 moritz m: use IO::Socket::INET
20:39 camelia rakudo-moar d67cb0: OUTPUT«===SORRY!===␤IO::Socket::INET is a builtin type. You can use it without loading a module.␤»
20:39 alpha123 joined #perl6
20:40 TEttinger joined #perl6
20:40 niceperl joined #perl6
20:41 sortiz joined #perl6
20:42 sortiz \o #perl6
20:42 ZoffixWin o/
20:42 dalek rakudo/2016.01-preparation: ae29543 | moritz++ | docs/ChangeLog:
20:42 dalek rakudo/2016.01-preparation: Fill out ChangeLog a bit
20:42 dalek rakudo/2016.01-preparation: review: https://github.com/rakudo/rakudo/commit/ae295434a2
20:42 alpha123 joined #perl6
20:43 moritz [Coke]: if you have no better idea, I'd name the 2016.01 release "Kerman", just becase we never had a release name from Iran before
20:43 masak ely-se: I tried to produce a typed version of that once. I found Cat as prior art... but I didn't like it much. felt too contrived.
20:43 khisanth_ joined #perl6
20:43 masak ely-se: the central problem seems to be that some functions don't know statically how deep into the stack they dig. and so you end up trying to type the stack itself.
20:44 ely-se masak: I tried that too. I avoided that problem (and incidentally the problem of hideous unmaintainable programs) by not offering any operations that don't statically know how deep to dig.
20:45 masak I should try that.
20:46 ely-se I think the stack should be treated the same as classes are treated as opposed to hashes in Perl 6: you know at design-time what it looks like.
20:46 geraud joined #perl6
20:47 masak aye
20:47 masak it's not so much that I felt a need to type the stack myself; it's that I saw Cat had gone that route, and it kind of turned me off
20:47 ely-se masak: in my design functions had a type that described the top N elements on the stack before the call and the top M elements on the stack after the call, so the type of + would be (int int -> int)
20:48 ely-se variadics are naturally unsupported
20:49 masak *nod*
20:50 ely-se if only my PMs with vendethiel were archived :)
20:50 vendethiel I do archive all our PMs
20:51 ely-se D:
20:51 inwigilator hey, I don't get SDL bindings
20:51 inwigilator they don't return err codes or what?
20:52 ZoffixWin They should be very similar to just calling the C functions
20:52 dotness joined #perl6
20:53 inwigilator my $param = SDL_Init(VIDEO);
20:53 inwigilator SDL_Init(VIDEO)
20:53 inwigilator should return code
20:54 diana_olhovik_ joined #perl6
20:55 ZoffixWin inwigilator, yeah, doesn't look like the Perl 6 version is made to return it. timotimo would know more
20:55 ely-se .oO(insigilator)
20:56 araujo_ joined #perl6
20:56 inwigilator ely-se, ?
20:57 ely-se inwigilator, $ @ %
20:59 RabidGravy wooo got Sofa doing the basic CRUD stuff, more in three days than I had since April :)
21:00 raiph joined #perl6
21:01 RabidGravy (and only had to make a tiny change to HTTP::UserAgent to make all the PUT POST DELETE malarkey work :)
21:03 ZoffixWin sweet
21:03 ZoffixWin RabidGravy++
21:21 mprelude Is perl 6 'production-ready' yet?
21:21 AlexDaniel huggable: production
21:21 huggable AlexDaniel, nothing found
21:21 AlexDaniel awww
21:21 RabidGravy people use it in "production"
21:21 mprelude I am aware that it's a very flawed question.
21:21 AlexDaniel mprelude: yeah, there are different ways to answer that question depending on what you actually need
21:21 moritz mprelude: people are making money by using Rakudo
21:21 moritz mprelude: does that answer your question?
21:22 mprelude moritz: Yes :)
21:22 AlexDaniel I'd say no :)
21:22 AlexDaniel whatever… :)
21:22 mprelude It means if I implement something today, is the language likely to change and break it? :D
21:22 RabidGravy nope
21:22 masak mprelude: yes, but probably much less so than you might think
21:23 AlexDaniel mprelude: well, after christmas release it is not supposed to change much
21:23 masak mprelude: the breaking changes are much more controlled than they were 7 years ago
21:23 RabidGravy well, I'd say "not if you're carefule"
21:23 mprelude I've been using p5 for years, keep wanting to do something in 6.
21:23 AlexDaniel mprelude: whether it happens to be true or not, well, we will see
21:24 AlexDaniel mprelude: you missed so much! People have been using Perl 6 for years!
21:24 masak mprelude: cool! welcome aboard! write something and show it to us ;)
21:24 masak mprelude: pro tip: start small
21:24 sevvie joined #perl6
21:25 mprelude masak: Thanks, my usual start point is an implementation of the base IRC protocol :P
21:25 mprelude I've done that in about 15 languages now
21:25 alpha123 that's actually pretty smart
21:25 alpha123 i like that
21:25 alpha123 i might start doing that
21:25 sevvie hm. glad I joined when I did. I might start doing that too. XD
21:25 mprelude alpha123: It's a nice way to get a feel for a language, and you're working with a spec so can't get caught up in feature creep etc.
21:25 masak mprelude: sounds like fun!
21:26 mprelude It's also a really easy way to do TDD etc because it's a strict spec
21:26 masak mprelude: you might even enjoy combining that with Perl 6's concurrency features
21:26 AlexDaniel mprelude: perhaps you might want to look at existing implementations
21:26 mprelude masak: Will have to take a look.
21:26 alpha123 Perl6 would be a pretty swell language to implement an irc daemon or client in actually
21:26 masak mprelude: soo... let us know when you're writing to us on this channel using a Perl 6 IRC client, OK? :P
21:26 mprelude Are there any decent TDD (or better, BDD) modules yet?
21:26 masak mprelude: Test.pm is good for most things
21:27 masak mprelude: I usually layer something on top of that when I need to
21:27 mprelude masak: I'm a big fan of Cucumber for testing, but will look at Test.pm
21:28 masak oh, if you want to write tests Gherkin-style, I'm not sure what to recommend
21:28 masak probably easiest to yak-shave your own little thing for that
21:28 mprelude Might start with Test.pm, do some small stuff, then if I get to it, write a Gherkin-style testing lib
21:28 mprelude Lots to think about :)
21:29 sevvie gherkin, another good spec for experimenting in a language with. o.o
21:29 masak mprelude: if you've used Test::More in Perl 5, then Test.pm (which comes built-in with Rakudo) should feel familiar
21:34 abaugher joined #perl6
21:35 Cabanossi joined #perl6
21:39 inwigilator huh, where is destroyWindow method
21:41 inwigilator ZoffixWin, are you there?
21:42 masak inwigilator: please stand by while we locate ZoffixWin, who is not responding at the moment
21:42 mprelude Is there an equivelant to cpanfile for perl6 so I can one step initialize a project?
21:42 firstdayonthejob joined #perl6
21:45 orbus okay
21:45 orbus so
21:45 orbus I have a module
21:45 RabidGravy I think a couple of people have made something similar
21:45 orbus how do I get it onto modules.perl6.org?
21:46 AlexDaniel orbus: send a pull request
21:46 RabidGravy PR to https://github.com/perl6/ecosystem adding the META.info of your project to META.list
21:46 orbus I only signed up for github today
21:46 orbus still sort of figuring it out
21:46 ZoffixWin orbus, the README explains: https://github.com/perl6/ecosystem
21:46 ZoffixWin inwigilator, wat?
21:47 orbus I've only used git for solo development prior to this
21:47 anthk_ joined #perl6
21:47 orbus okay, will take a look
21:47 orbus thanks
21:47 inwigilator ZoffixWin, there are no DestroyWIndow method
21:47 ZoffixWin inwigilator, you can read the sauce and see everything it defines or not: https://github.com/timo/SDL2_raw​-p6/blob/master/lib/SDL2/Raw.pm
21:47 inwigilator only DestroyRender method exist
21:47 ZoffixWin ZoffixWin, then define it yourself.
21:47 ZoffixWin did... did I just talk to myself?
21:48 ZoffixWin inwigilator, sub destroyWindow is native('SDL_whatever') {...}. It should be easy enough
21:49 anthk_ hello, a program which ran with a sightly older version of perl6 now gives me a "Cannot unbox a type object" error
21:49 AlexDaniel huggable: new module :is: Fork ecosystem repo, add your module to META.list and send a pull request. See README here: https://github.com/perl6/ecosystem
21:49 huggable AlexDaniel, Added new module as Fork ecosystem repo, add your module to META.list and send a pull request. See README here: https://github.com/perl6/ecosystem
21:49 inwigilator ZoffixWin, I am not sure should I get this lib to my lib folder in project and then try to add new method yeah?
21:49 AlexDaniel anthk_: no line number?
21:49 AlexDaniel anthk_: if yes, then try with --ll-exception
21:50 AlexDaniel anthk_: also, what is exactly “slightly older”?
21:50 orbus okay
21:50 ZoffixWin inwigilator, you don't need it in your project... if SDL2::Raw already works. See http://docs.perl6.org/language/nativecall
21:50 * orbus will publish his module after he gets something to eat
21:51 orbus can't publish on an empty stomach
21:51 * ZoffixWin goes back to watching TV
21:51 inwigilator ZoffixWin, ey no :D
21:52 inwigilator I need to add a new method to my main file and if it is work I can post it to contribute or what?
21:53 ZoffixWin inwigilator, yeah, submit a PR to SDL2::Raw
21:55 inwigilator ZoffixWin, what is PR?
21:56 mprelude Pull request
21:56 inwigilator ok thanks :)
21:58 anthk_ joined #perl6
21:59 anthk_ AlexDaniel: wait
22:02 anthk_ AlexDaniel: http://pastebin.com/raw/geUb6cek
22:07 raiph joined #perl6
22:11 inwigilator I don't understand the meaning of *.type it is Whatevercode.new
22:11 inwigilator is it like an object or what
22:12 lizmat shouldn't https://github.com/jnthn/p6-stomp be in the ecosystem ?
22:12 BenGoldberg joined #perl6
22:13 orbus guess that depends if jnthn considers it release-worthy yet
22:14 orbus I saw the blog posts he was writing about it - didn't seem like he was done yet
22:16 skids inwigilator: "*.type" means "-> $thing { $thing.type }".  A WhateverCode is Code made by a Whatever ("*")
22:17 inwigilator skids, whats a difference between * and _? then
22:18 AlexDaniel anthk_: hmm runs fine here
22:18 skids inwigilator: _ is just a topic.  * makes code.
22:18 skids m: (*.say)(1)
22:19 camelia rakudo-moar d67cb0: OUTPUT«1␤»
22:19 espadrine joined #perl6
22:19 skids so *.say made a code object that says its argument, and then I called it with a 1.
22:19 AlexDaniel anthk_: can you change that so that it does not use a file?
22:20 AlexDaniel anthk_: i.e. just hardcode some buf or something
22:20 AlexDaniel anthk_: this way we can run it on camelia and see if it breaks here too
22:20 ely-se m: my &f = *.say; &f(42)
22:20 camelia rakudo-moar d67cb0: OUTPUT«42␤»
22:20 inwigilator ye I see
22:20 ely-se m: my &twice = * * 2; say &twice(3)
22:20 camelia rakudo-moar d67cb0: OUTPUT«6␤»
22:20 AlexDaniel m: say (* * *)(2, 10)
22:20 camelia rakudo-moar d67cb0: OUTPUT«20␤»
22:21 inwigilator m: say (*.type)(2)
22:21 camelia rakudo-moar d67cb0: OUTPUT«Method 'type' not found for invocant of class 'Int'␤  in block <unit> at /tmp/DoYw_lEAzn line 1␤␤»
22:22 AlexDaniel m: say (* × 2)(42)
22:22 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:22 AlexDaniel m: say {$_ × 2}(42)
22:22 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:22 AlexDaniel m: say {$^a × 2}(42)
22:22 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:22 AlexDaniel m: say -> $a {$a × 2}(42)
22:22 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:23 AlexDaniel jeez I love that
22:23 AlexDaniel and it keeps going like that forever
22:23 skids m: class A { method type { A } }; (*.type)(A.new).say; # .type is probably something the code where you saw *.type defined.
22:23 camelia rakudo-moar d67cb0: OUTPUT«(A)␤»
22:23 AlexDaniel m: say sub ($a) {$a × 2}(42)
22:23 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:24 AlexDaniel m: say anon sub double($a) {$a × 2}(42)
22:24 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:24 ely-se m: say { [+] 2 xx $_ }(42)
22:24 camelia rakudo-moar d67cb0: OUTPUT«84␤»
22:25 skids inwigilator: the actual builtins for find the type of something are .WHAT and .^name
22:25 Hotkeys whoa
22:25 Hotkeys perl 6 has '×'?
22:26 Hotkeys m: 3 × 4
22:26 camelia rakudo-moar d67cb0: OUTPUT«WARNINGS for /tmp/dLfKNLzG6N:␤Useless use of "×" in expression "3 × 4" in sink context (line 1)␤»
22:26 Hotkeys oh
22:26 skids inwigilator: But .WHAT is more of macro
22:26 Hotkeys what does it do
22:26 flussence and ÷
22:26 inwigilator m: 2.WHAT
22:26 camelia rakudo-moar d67cb0: ( no output )
22:26 Hotkeys m: say 3 × 4
22:26 camelia rakudo-moar d67cb0: OUTPUT«12␤»
22:26 skids m: 2.WHAT.say
22:26 camelia rakudo-moar d67cb0: OUTPUT«(Int)␤»
22:26 Hotkeys ah
22:26 Hotkeys forgot say
22:26 ely-se m: say 'a' x 3 × 4
22:26 camelia rakudo-moar d67cb0: OUTPUT«aaaaaaaaaaaa␤»
22:28 inwigilator skids, oh ok :)
22:28 AlexDaniel Hotkeys: how did you miss that?
22:28 flussence (and yes, we've already had the obligatory phase of forum FUD proclaiming how this one tiny addition will make the entire language unreadable...)
22:28 AlexDaniel Hotkeys: do you know about ∞? :)
22:29 AlexDaniel Hotkeys: or superscripts…
22:29 AlexDaniel Hotkeys: or smartquotes.
22:29 inwigilator Cannot look up attributes in a type object
22:30 skids inwigilator: that means you tried to call a method directly on a class instead of an object
22:31 inwigilator mm
22:32 skids (or, probably, tried to access class!attribute, or something you call did.)
22:32 inwigilator skids, http://pastebin.com/SHfxKFbn
22:32 inwigilator I am trying to access public attire
22:32 kjs_ joined #perl6
22:33 inwigilator but as I read in intro it is proper way to do it
22:33 inwigilator declared $.isRunning and I want to access it $!isRunning
22:33 inwigilator in direct mode
22:34 skids m: class A { has $!a; method new { $!a = 1 } }; A.new # there is no object yet in .new, is why.
22:34 camelia rakudo-moar d67cb0: OUTPUT«Cannot look up attributes in a type object␤  in method new at /tmp/R5h8gcEQy0 line 1␤  in block <unit> at /tmp/R5h8gcEQy0 line 1␤␤»
22:35 inwigilator skids, ?:D
22:35 skids In new you either have to call bless yourself, and do such things after bless, or you need to do it in a submethod BUILD.
22:35 skids (If you do not call bless in new it is automatically added at the end)
22:36 Hotkeys AlexDaniel: yeah I know about the other fun unicode
22:36 Hotkeys set ops etc
22:36 Hotkeys I just didn't know the multiplication one
22:36 skids m: class A { has $!a; submethod BUILD { $!a = 1 } }; A.new.perl.say;
22:36 camelia rakudo-moar d67cb0: OUTPUT«A.new␤»
22:37 AlexDaniel Hotkeys: https://doc.perl6.org/language/unicode_texas
22:38 Hotkeys what does o do
22:38 Hotkeys is that compose
22:39 inwigilator skids I need to learn more about it
22:40 Hotkeys m: &join ∘ &comb
22:40 camelia rakudo-moar d67cb0: ( no output )
22:40 inwigilator is it perl6 feature?
22:40 Hotkeys m: say &join ∘ &comb
22:40 camelia rakudo-moar d67cb0: OUTPUT«-> |args is raw { #`(Block|63053648) ... }␤»
22:40 Hotkeys hmm
22:40 AlexDaniel Hotkeys: ring operator… not documented
22:40 Hotkeys ah
22:40 AlexDaniel Hotkeys: https://p6weekly.wordpress.com/​2015/10/05/2015-41-a-new-face/
22:41 skids inwigilator: some other languages make a similar distinction but they don't call them "new" and "BUILD"
22:41 Hotkeys so it is compose
22:41 inwigilator skids, okay thanks :)
22:47 orbus the docs suggest that overriding new is considered poor practice
22:47 orbus but that seems to be the only way to get positional arguments for your constructor
22:48 orbus kind of annoying
22:48 AlexDaniel orbus: can't you do that with BUILD?
22:49 orbus I don't think so - as far as I know you can only do named arguments with BUILD
22:49 RabidGravy I don;t think so
22:49 skids orbus: Lots of people do it.  Just try to be aware that your new might be reused by subclasses.
22:49 orbus hm, yeah
22:49 AlexDaniel ehhh… Am I the only one who feels that OOP stuff in Perl 6 is a little bit weird sometimes?
22:50 orbus I think OOP stuff in general is a little weird
22:50 RabidGravy m: class F { submethod BUILD($a) { } }; F.new(1)'
22:50 camelia rakudo-moar d67cb0: OUTPUT«5===SORRY!5=== Error while compiling /tmp/epkO2lQldP␤Two terms in a row␤at /tmp/epkO2lQldP:1␤------> 3 F { submethod BUILD($a) { } }; F.new(1)7⏏5'␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤   …»
22:50 orbus but no, I wouln't say you're alone
22:51 orbus the BUILD/new thing still strikes me as odd, but maybe it just needs to be explained better
22:51 colomon joined #perl6
22:52 orbus the OO doc in general seems like it needs a refresh
22:52 orbus there's a number of things it doesn't cover
22:52 orbus or only covers briefly
22:52 dalek ecosystem: 72e4c1f | gotoexit++ | META.list:
22:52 dalek ecosystem: Add Concurrent::BoundedChannel to the ecosystem.
22:52 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/72e4c1ffef
22:52 dalek ecosystem: 4ee4f27 | RabidGravy++ | META.list:
22:52 dalek ecosystem: Merge pull request #135 from gotoexit/master
22:52 dalek ecosystem:
22:52 dalek ecosystem: Add Concurrent::BoundedChannel to the ecosystem.
22:52 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/4ee4f27042
22:53 masak orbus: the BUILD/new thing works fairly well in practice, I find
22:53 masak orbus: though of course it can be explained more or less well
22:54 masak orbus: and I agree with you -- I also think OO stuff in general is a little weird ;)
22:55 orbus I think part of the problem is I don't really understand it that well - the intent seems to be that new shouldn't be overridden because it'll call the BUILD methods all the way up the inheritance chain for you
22:55 orbus but then you have to override it to do common things like use positional parameters
22:56 orbus I don't know what would be a better solution, mind
22:57 orbus Java constructors are pretty weird too
22:57 skids orbus: no it's BUILDALL that calls all the BUILDS, and that is in turn called by bless.  Using your own new does not interfere with that.
22:57 orbus ah, I see
22:57 orbus so why do the docs advise against overriding new?
22:57 skids Which docs, BTW?
22:58 RabidGravy I think it may be over-stated
22:58 orbus http://doc.perl6.org/language/objects
22:58 orbus "However this is considered poor practice, because it makes correct initialization of objects from subclasses harder."
22:58 orbus so I guess I can see that
22:58 orbus if you have a bunch of positional parameters, it might make things difficult for subclass authros
22:58 orbus although it works well enough in java
22:59 orbus in practice
22:59 RabidGravy it's create a multi new rather than a non multi one and that does away
22:59 orbus docs don't say anything about multi new - so maybe my initial thought was correct, and the docs just need a refresh
23:01 skids "this is considered poor practice in some heavily OO oriented styles" maybe
23:02 orbus it'd probably be nice if it explained the potential pitfalls (and how to avoid them), rather than a vague warning implying disapproval
23:03 RabidGravy m: class F { has $.a; multi method new($a) { return self.bless(:$a) }}; class G is F { has $.b; has $.c; }; say G.new(a => 1, b => 2, c => 3); say G.new(1)
23:03 camelia rakudo-moar d67cb0: OUTPUT«G.new(b => 2, c => 3, a => 1)␤G.new(b => Any, c => Any, a => 1)␤»
23:04 orbus tmtowtdi
23:05 skids Yeah that would also be a good place to mention *%_ being there to bail you out.
23:06 RabidGravy I would go with "if you want to be polite to sub-classes then you should consider a "multi new" so the sub-class can still get the default behaviour"
23:08 masak 'night, #perl6
23:10 dalek doc: 6c977d8 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Callable.pod:
23:10 dalek doc: doc infix:<∘>
23:10 dalek doc: review: https://github.com/perl6/doc/commit/6c977d85af
23:10 dalek doc: ed6cb28 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Str.pod:
23:10 dalek doc: Merge branch 'master' of https://github.com/perl6/doc
23:10 dalek doc: review: https://github.com/perl6/doc/commit/ed6cb28964
23:14 anthk_ AlexDaniel:  the file is a ROM, where you just get opcodes. Instead of fetchig the opcode from a  file, just declare the opcode to a random one , like 0x7X01
23:15 BenGoldberg Hmm, I'd expect an ∘ operator to accept any two functions, provided the return signature of the rhs matched the parameter signature of the lhs.  Also, I'd hope for the resulting composed funtion to have the same paramature signature of the rhs, and return signature of the lhs.
23:16 Kcop joined #perl6
23:17 AlexDaniel anthk_: 0x7X01? X?
23:20 travis-ci joined #perl6
23:20 travis-ci Doc build failed. Wenzel P. P. Peppmeyer 'Merge branch 'master' of https://github.com/perl6/doc'
23:20 travis-ci https://travis-ci.org/perl6/doc/builds/104513954 https://github.com/perl6/doc/com​pare/6701bcfbcb4d...ed6cb28964a0
23:20 travis-ci left #perl6
23:20 laz78 joined #perl6
23:25 anthk_ AlexDaniel: 0x7201 sorry
23:27 raiph joined #perl6
23:29 AlexDaniel anthk_: can't replicate :(
23:29 AlexDaniel reproduce*
23:30 AlexDaniel well, I get an infinite loop with “unknown opcode” messages
23:30 anthk_ AlexDaniel:  that's enough :)
23:31 AlexDaniel oh that's enough?
23:31 AlexDaniel m: https://gitlab.com/snippets/14064
23:31 camelia rakudo-moar d67cb0: OUTPUT«0100␤unknown opcode␤»
23:32 AlexDaniel anthk_: ↑ so does it look right?
23:33 anthk_ in your case yes, in my case, I think there is a problem somewhere
23:33 sQuEE joined #perl6
23:34 anthk_ 2015.12-219-gd67cb03 my version of perl6
23:35 anthk_ perl6 -v This is Rakudo version 2015.12-219-gd67cb03 built on MoarVM version 2015.12-29-g8079ca5 implementing Perl 6.c.
23:54 pmqs__ joined #perl6
23:56 sortiz In the docs there are lots of methods documented as returning List:D when in fact they returns Seq:D, is this deliberate or just a pre-GLRism?
23:58 BenGoldberg AlexDaniel, The perl6 && operator is the same as in perl5.  What you want is +&
23:58 AlexDaniel BenGoldberg: oh, so time travel was finally invented?
23:59 AlexDaniel BenGoldberg: I remember that discussion… it was like two days ago or so? :)
23:59 sortiz Or simply a lack of formalism?

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

Perl 6 | Reference Documentation | Rakudo