Perl 6 - the future is here, just unevenly distributed

IRC log for #perl11, 2015-05-10

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

All times shown according to UTC.

Time Nick Message
03:29 travis-ci RPerl build passed. Will Braswell says 'Data Types, Perl Ops Perl Types, Implement type() & types() Part 2'
03:29 travis-ci http://travis-ci.org/wbraswell/rperl/builds/61935946 https://github.com/wbraswell/rperl/compare/12927693aeae...7a7cc256c073
04:31 willthechill yay
05:19 travis-ci RPerl build passed. Will Braswell says 'Data Types, Perl Ops Perl Types, Implement type() & types() Part 3'
05:19 travis-ci http://travis-ci.org/wbraswell/rperl/builds/61940607 https://github.com/wbraswell/rperl/compare/7a7cc256c073...b426aa706541
06:07 travis-ci RPerl build passed. Will Braswell says 'Data Types, Perl Ops Perl Types, Implement type() & types() Part 4'
06:07 travis-ci http://travis-ci.org/wbraswell/rperl/builds/61942859 https://github.com/wbraswell/rperl/compare/b426aa706541...76357bacc149
06:27 willthechill sweet
07:43 ToApolytoXaos joined #perl11
08:40 travis-ci RPerl build passed. Will Braswell says 'Grammar, Allow Literal & Variable Keys In HashReference'
08:40 travis-ci http://travis-ci.org/wbraswell/rperl/builds/61948988 https://github.com/wbraswell/rperl/compare/76357bacc149...5416ed03b9de
08:47 willthechill yay!
08:48 willthechill ToApolytoXaos: here is something fun for you to try, git fetch, build, install latest RPerl
08:48 willthechill then do this
08:48 willthechill use RPerl;  my $foo = SOMETHING; print type($foo);
08:48 willthechill also
08:48 willthechill use RPerl;  my $foo = SOMETHING; print types($foo);
08:48 willthechill type() and types() now exist, and are awesome
08:49 ToApolytoXaos where to use RPerl; ?
08:49 ToApolytoXaos in any empty file of mine?
08:49 willthechill sure those are 1-liners I just typed
08:49 willthechill the SOMETHING needs to be replaced with real data
08:49 willthechill like a hashref or arrayref
08:49 ToApolytoXaos ok
08:50 willthechill or an integer, number, or string
08:50 willthechill it is for you to play with and see how it works
08:50 ToApolytoXaos what to use for shebang? rperl?
08:50 willthechill no just normal perl shebang for now
08:50 ToApolytoXaos cool
08:50 willthechill rperl shebang is not stable yet
08:50 ToApolytoXaos OK, give me a second to test it
08:50 willthechill take your time
08:52 ToApolytoXaos one thing that does not make any sense in my stupid opinion (lol) is the "make test" warning messages
08:53 ToApolytoXaos since it's a testing, it *should* ignore any preinstalled rperl binary
08:53 ToApolytoXaos and use that in the generated "make test" command
08:54 willthechill I'll look into it
08:55 ToApolytoXaos vim testing.pl
08:55 ToApolytoXaos Undefined subroutine &main::types called at testing.pl line 11.
08:55 ToApolytoXaos shell returned 255
08:55 ToApolytoXaos Press ENTER or type command to continue
08:55 ToApolytoXaos Can't locate object method "say" via package "types" (perhaps you forgot to load "types"?) at testing.pl line 11.
08:55 ToApolytoXaos shell returned 255
08:56 willthechill say?
08:56 ToApolytoXaos i replaced say with print and get the same behavir
08:57 willthechill okay well since I can't see the contents of testing.pl, I can't help you!
08:57 ToApolytoXaos give me a second to pastebin it
08:57 willthechill in other words, paste contents of testing.pl here or in pastebin
08:57 willthechill okay yes thanks
08:58 ToApolytoXaos http://paste.debian.net/hidden/ac74f4a2/
09:00 willthechill that code is correct
09:00 ToApolytoXaos :/
09:01 willthechill rm -Rf ~/perl5
09:01 ToApolytoXaos ok
09:01 willthechill delete all old copies of RPerl
09:01 willthechill delete old git repo copies
09:01 willthechill pull latest git repo
09:01 ToApolytoXaos old git repos?
09:01 ToApolytoXaos meaning?
09:02 ToApolytoXaos you mean to delete rperl local copy from repository and re-fetch them from github?
09:03 willthechill yes
09:03 ToApolytoXaos ok
09:03 willthechill just delete everything
09:03 ToApolytoXaos i deleted it
09:03 willthechill it is easy to have 2, 3, 4 copies of RPerl in different places
09:03 ToApolytoXaos let me fetch it again
09:05 ToApolytoXaos remind me which steps to follow
09:05 ToApolytoXaos 1a?
09:07 ToApolytoXaos willthechill: are you there?
09:08 willthechill yes I'm here
09:08 ToApolytoXaos remind me the steps please :/
09:08 willthechill just a moment
09:09 willthechill 1a, 2b, 3
09:09 ToApolytoXaos brilliant!
09:09 ToApolytoXaos brb
09:15 rurban joined #perl11
09:18 willthechill brb
09:19 willthechill rurban: please fetch and build latest RPerl, then test out my new type() and types() routines!
09:28 ToApolytoXaos willthechill: everything works fine.
09:29 ToApolytoXaos perl testing.pl HASH(0x254c090)
09:29 ToApolytoXaos but my value was integer; why did it return HASH type?
09:35 willthechill no that is not correct
09:35 willthechill print type($foo);
09:35 willthechill not types()
09:35 willthechill for types() you need to use Dumper()
09:36 ToApolytoXaos yes, i saw this afterwards
09:36 willthechill print Dumper(types($foo));
09:36 ToApolytoXaos what type should i get for @array?
09:36 willthechill @array is forbidden in RPerl
09:36 willthechill only $arrayref
09:36 ToApolytoXaos oh!
09:36 willthechill likewise %hash is forbidden in RPerl
09:36 ToApolytoXaos that's why i got string for return lol
09:36 willthechill only $hashref
09:36 willthechill no you should not get string
09:37 willthechill please send me an example
09:37 ToApolytoXaos ok
09:37 willthechill rurban: in Makefile.PL I need to set an environmental variable RPERL_WARNINGS=0 to last throughout all `make; make test; make install;` steps
09:37 ToApolytoXaos http://paste.debian.net/hidden/7d7aa2e6/
09:37 willthechill rurban: I tried all of the following but none of it worked
09:38 willthechill BEGIN { use English; $ENV{RPERL_WARNINGS} = 0; `export RPERL_WARNINGS=0`; 1; }
09:38 willthechill (ignore the 'use English;', it was already there in the Makefile.PL)
09:38 willthechill ToApolytoXaos: okay I will check your pastebin now
09:38 ToApolytoXaos willthechill: also, you need to clarify to INSTALL to check whether 'source ~/perl5/perlbrew/etc/bashrc' is already appended in .bashrc
09:40 willthechill ToApolytoXaos: I see your new code in pastebin, now I realize why it gives you string as return value for type(@array), it is because type() is only receiving the first element of @array due to the fact that you are using forbidden pass-by-value and direct-@-access
09:40 willthechill so it is testing the value of the first element of @array, which is the string 'one'
09:41 ToApolytoXaos i see
09:41 willthechill so the return value of type('one) is 'string'
09:41 willthechill oops  type('one')
09:41 ToApolytoXaos so which types are allowed in RPerl?
09:41 willthechill integer number string arrayref hashref
09:41 willthechill also...
09:41 ToApolytoXaos ok, i got the first three correct lol
09:41 willthechill unknown
09:41 willthechill scalartype
09:42 willthechill *_method
09:42 ToApolytoXaos i need some examples for the rest from you
09:42 willthechill and *_hashref *_arrayref
09:42 willthechill string_hashref string_arrayref
09:42 willthechill also mixed_hashref mixed_arrayref
09:42 willthechill and all derivatives
09:42 willthechill the examples are given to you by type() and types()
09:42 willthechill that is the point of this exercise
09:42 ToApolytoXaos i'm not following :/
09:43 willthechill I created the type() and types() functions to show you what are the valid RPerl types
09:43 willthechill so you can ask the software instead of asking me
09:43 willthechill if you want to continue using forbidden @array, then just do this:    type(\@array)    types(\@array)
09:44 ToApolytoXaos ok
09:44 willthechill the backslash will pass a reference
09:46 ToApolytoXaos ok, i got the string_arrayref for \@array
09:46 ToApolytoXaos that's good
09:47 willthechill YES!
09:47 ToApolytoXaos now i need to get the rest types LOL!
09:47 willthechill now just try EVERYTHING
09:47 willthechill it can do any type ever
09:47 willthechill programmatically
09:47 willthechill so it will teach you about RPerl types!  :)
09:47 willthechill and it is NOT guessing at the types like some other Perl software
09:47 ToApolytoXaos coming from C-domain languages, i get stuck with other kind of types :s
09:48 ToApolytoXaos booleans?
09:48 willthechill it is going straight in through the real magic C functions which go into the Perl 5 core
09:48 ToApolytoXaos do they exist?
09:48 willthechill we have bool on the todo list
09:48 ToApolytoXaos that would be awesome
09:48 willthechill it is not important enough today to do it
09:48 ToApolytoXaos char?
09:48 willthechill nope no char either, same reason
09:48 ToApolytoXaos :/
09:48 ToApolytoXaos unsigned numbers?
09:48 willthechill like I said: integer, number, string
09:48 willthechill integer, number, string
09:49 ToApolytoXaos ok
09:49 ToApolytoXaos i got those three
09:49 willthechill you get those 3, plus arrayref and hashref
09:49 willthechill and mixed
09:49 willthechill and unknown
09:49 willthechill and method
09:49 willthechill and undef
09:49 willthechill infinitely combined
09:50 willthechill now try Dumper(types($foo));
09:50 ToApolytoXaos lol i suck so bad hahahaha
09:51 willthechill okay just type this into your command prompt
09:51 willthechill perl -e 'use RPerl; my integer $i = [[{g=>q{11}, h=>"2"}], [{m=>"23.3", n=>"1"}], [{a=>"23", b=>3}]]; print Dumper( types($i)) . "\n";'
09:51 ToApolytoXaos creating an empty function i get undef for both type / types
09:51 willthechill then do this
09:51 willthechill perl -e 'use RPerl; my integer $i = [[{g=>q{11}, h=>"2"}], [{m=>"23.3", n=>"1"}], [{a=>"23", b=>"3"}]]; print Dumper( types($i)) . "\n";'
09:51 willthechill then tell me how those 2 are different
09:51 willthechill GO!  :)
09:52 ToApolytoXaos wow...that output from the first one liner is too ugly
09:53 willthechill good lord just try to follow along here
09:53 willthechill the formatting is created by Dumper()
09:53 willthechill is is part of Perl 5 core
09:53 ToApolytoXaos your examples are the same
09:53 willthechill you can't complain about Dumper()
09:53 ToApolytoXaos but i guess you meant type / types
09:53 willthechill no the examples are NOT the same
09:53 willthechill no
09:53 willthechill copy and paste the 2
09:53 willthechill exactly as I put them
09:53 willthechill they are not the same
09:54 willthechill you are meant to see the difference
09:54 ToApolytoXaos ah, i just saw "3"
09:54 willthechill the point is for you to look at the output of those 2 in order to tell the difference in data structures
09:55 willthechill as reported via types()
09:55 ToApolytoXaos yeah, got it
09:55 willthechill type() just shows you the top level data type, types() shows you everything inside as well
09:55 willthechill so now you can see how to make any kind of complex data structures, then pass it to type() and types() for analysis
09:56 willthechill and the values returned are valid RPerl types
09:57 ToApolytoXaos yeah
09:57 ToApolytoXaos darn it, i feel so useless
09:57 ToApolytoXaos i guess it's because i have not previous experience with Perl
09:57 ToApolytoXaos it helps a bit
09:58 willthechill use type() and types() a lot
09:59 willthechill stop using @array = () and only use $arrayref = [];
09:59 willthechill stop using %hash = () and only use $hashref = {};
09:59 ToApolytoXaos ok
09:59 willthechill then build complex data structures and pass them to type() and types() for analysis
09:59 willthechill that will teach you all about RPerl data types
10:00 ToApolytoXaos i understand your points, but i need to continue with Perl
10:00 ToApolytoXaos i feel like a total moron
10:01 willthechill haha no problem, just start learning now!  :)
10:01 willthechill I'm getting tired, talk to you later!
10:01 ToApolytoXaos cheers mate
10:01 willthechill :)
10:20 willthechill ToApolytoXaos: one last gift before I fall asleep, I was able to suppress SOME of the warnings during `make test;`
10:21 willthechill the rest are more complicated to suppress, I will have to figure it out later, haha!  :)
10:21 willthechill okay goodnight my friend
10:22 basiliscos joined #perl11
10:38 travis-ci RPerl build passed. Will Braswell says 'Makefile & Tests, Suppress RPerl Warnings, Part 1'
10:38 travis-ci http://travis-ci.org/wbraswell/rperl/builds/61956105 https://github.com/wbraswell/rperl/compare/5416ed03b9de...96a72d822926
12:13 ToApolytoXaos perfect! goodnight willthechill
12:21 basiliscos joined #perl11
19:23 travis-ci RPerl build passed. Will Braswell says 'Makefile & Tests, Suppress RPerl Warnings, Part 2'
19:23 travis-ci http://travis-ci.org/wbraswell/rperl/builds/61995374 https://github.com/wbraswell/rperl/compare/96a72d822926...72871a45d889
19:25 willthechill yay

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