Re: Perl 6 Debugging

2015-03-14 Thread Tom Browder
On Sat, Mar 14, 2015 at 5:25 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote: On 14 Mar 2015, at 23:19, Tom Browder tom.brow...@gmail.com wrote: ... Could you post the code of test_ellipsoid.pl for others to see (e.g. on gist.github.com)? That would help in tracing the problem (which is causing

Re: Perl 6 Debugging

2015-03-14 Thread Tom Browder
On Mar 14, 2015 6:46 PM, yary not@gmail.com wrote: For some reason your github link comes up as an empty page when I click on it. I was able to find it here: https://gist.github.com/search?q=test_ellipsoid.pl I've never used gist.github.com before and probably murfled it. There should be

Re: Object Contruction

2015-03-18 Thread Tom Browder
On Wed, Mar 18, 2015 at 7:22 AM, Moritz Lenz mor...@faui2k3.org wrote: ... http://doc.perl6.org/language/objects#Object_Construction lists at least two possible ways. Probably the most interesting one is BUILDALL with a callsame; see the last example (or example skeleton) in that section.

Re: Object Contruction

2015-03-18 Thread Tom Browder
On Wed, Mar 18, 2015 at 11:32 AM, Tom Browder tom.brow...@gmail.com wrote: On Wed, Mar 18, 2015 at 7:22 AM, Moritz Lenz mor...@faui2k3.org wrote: ... http://doc.perl6.org/language/objects#Object_Construction lists at least two possible ways. Probably the most interesting one is BUILDALL

Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Tom Browder
On Fri, Mar 20, 2015 at 2:02 PM, Tom Browder tom.brow...@gmail.com wrote: On Mar 20, 2015 1:51 PM, Tobias Leich em...@froggs.de wrote: if $obj.^can($method_name) {... That doesn't seem to work with private methods. Any trick to accomplish that? -Tom

Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Tom Browder
On Sun, Mar 22, 2015 at 7:13 PM, Henk van Oers h...@signature.nl wrote: On Sun, 22 Mar 2015, Tom Browder wrote: I'm trying to write a test. To test what? Your own typo's? The tests are for a public Perl 6 module translated from an existing Perl 5 module. Do Perl 6 modules not need tests

Re: Placeholder Variable (was: Perl 6 Debugging)

2015-03-15 Thread Tom Browder
On Sun, Mar 15, 2015 at 2:55 PM, Timo Paulssen t...@wakelift.de wrote: ... Thanks, Timo! Subroutine arg handling is an awkward but very exciting improvement for an old but non-expert Perl 5 user. Very briefly, how does one properly translate this to Perl 6: sub foo {my @a = @_; } Best, -Tom

Re: Perl 6 Debugging

2015-03-15 Thread Tom Browder
On Sat, Mar 14, 2015 at 5:19 PM, Tom Browder tom.brow...@gmail.com wrote: I am trying to convert a fairly simple Perl 5 program and supporting modules to Perl 6 and making slow progress. I have made much progress since Moritz showed me how to use perl6-m. Now I have come to a point where I

Carp and Croak

2015-03-15 Thread Tom Browder
How can I replace Carp and Croak in Perl 6? Thanks. Best, -Tom

Re: Trig Functions to-radians and from-radians

2015-03-17 Thread Tom Browder
On Tue, Mar 17, 2015 at 1:54 PM, Paul Cochrane p...@liekut.de wrote: Hi Tom, On Tue, Mar 17, 2015 at 12:52:42PM -0500, Tom Browder wrote: Those two functions are documented here: http://design.perl6.org/S32/Numeric.html#Trigonometric_functions but I have tried to use them with no luck

Trig Functions to-radians and from-radians

2015-03-17 Thread Tom Browder
Those two functions are documented here: http://design.perl6.org/S32/Numeric.html#Trigonometric_functions but I have tried to use them with no luck: say 10.to-radians(Degrees); Undeclared name: Degrees used at line 9 So how does one use the two functions? Best, -Tom

Re: Carp and Croak

2015-03-17 Thread Tom Browder
On Sun, Mar 15, 2015 at 8:32 PM, Tom Browder tom.brow...@gmail.com wrote: How can I replace Carp and Croak in Perl 6? According to TimToady on #perl6, to be honest, we haven't thought much about carp/croak yet. So I'm using die until something better comes along. -Tom

Re: Object Contruction

2015-03-18 Thread Tom Browder
You are correct, Liz, but I was trying those pieces to demonstrate to myself that all was available to me in the methods and all worked as I expected. It demos very roughly what I think I have to do to translate Geo::Ellipsoid to Perl 6. It's a WIP and I'm learning Perl 6 as I go. The prog is a

Can a class have an attribute and a method with the same name?

2015-03-18 Thread Tom Browder
I have a class with an attribute and a method with the same name and it looks so far like they clash. If that should be possible (which I suspect is true), I'll continue to debug. Thanks. -Tom

Re: Function Signatures: Return Types (replace wantarray?)

2015-03-19 Thread Tom Browder
On Thu, Mar 19, 2015 at 5:58 PM, Tobias Leich em...@froggs.de wrote: The multi dispatcher *only* chooses the multi candidate by matching arguments to parameters. The return type is not considered. Okay, I have now kind of found that in the synopses (which are a bit confusing for me considering

Re: Can a class have an attribute and a method with the same name?

2015-03-19 Thread Tom Browder
On Mar 19, 2015 3:02 AM, Moritz Lenz mor...@faui2k3.org wrote: On 03/19/2015 12:40 AM, Tom Browder wrote: So, you can have an attribute $!x and a method x, but if you write class A { has $.x; method x() {... } } then the method will prevent the automatic accessor from being

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Tom Browder
On Mar 19, 2015 9:30 PM, Brandon Allbery allber...@gmail.com wrote: On Thu, Mar 19, 2015 at 10:26 PM, Tom Browder tom.brow...@gmail.com wrote: On Mar 19, 2015 8:58 PM, Brandon Allbery allber...@gmail.com wrote: On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder tom.brow...@gmail.com wrote

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Tom Browder
Thanks for pointing out the error and the best practice comment. When I get the method to do what I really want I will post the solution. Best, -Tom

Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Tom Browder
The error message is: Cannot find method 'postcircumfix:( )' in method _normalize_output at /usr/local/people/tbrowde/mydata/tbrowde-home-bzr/perl6/my-perl6-repos/Geo-Ellipsoid/test/../lib/Geo/Ellipsoid.pm:995 in method to at

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-19 Thread Tom Browder
On Mar 19, 2015 8:58 PM, Brandon Allbery allber...@gmail.com wrote: On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder tom.brow...@gmail.com wrote: if (self.$elem) { # === LINE 995 === LINE 995 This is an indirect method call. Is that really what you intended? No, it's supposed

Re: Need help with: Cannot find method 'postcircumfix:( )'...

2015-03-20 Thread Tom Browder
On Thu, Mar 19, 2015 at 9:26 PM, Tom Browder tom.brow...@gmail.com wrote: On Mar 19, 2015 8:58 PM, Brandon Allbery allber...@gmail.com wrote: On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder tom.brow...@gmail.com wrote: if (self.$elem) { # === LINE 995 === LINE 995

Writing New Modules for Submission

2015-03-21 Thread Tom Browder
The guidance for the directory layout for a proposed module is very clear for mandatory items, and two other directories are also mentioned: bin and doc. What about other items such as a Makefile for developer use, development test scripts and modules, and miscellaneous files found in CPAN Perl 5

Re: Object Introspection for Existence of Methods: How?

2015-03-20 Thread Tom Browder
On Mar 20, 2015 1:51 PM, Tobias Leich em...@froggs.de wrote: if $obj.^can($method_name) {... Thanks, Tobias. Cheers! -Tom

Re: Object Introspection for Existence of Methods: How?

2015-03-20 Thread Tom Browder
On Mar 20, 2015 2:07 PM, Will Coleda w...@coleda.com wrote: use Test; class bar { method foo () {}} ok bar.can(foo), stuff; ok 1 - stuff Oops (I say as I slap my forehead)! Thanks, Will. -Tom

Re: Perl 6 script beginning lines: 'v6;' required?

2015-03-13 Thread Tom Browder
On Fri, Mar 13, 2015 at 8:01 AM, Brandon Allbery allber...@gmail.com wrote: On Fri, Mar 13, 2015 at 8:54 AM, Rob Hoelz r...@hoelz.ro wrote: ... Thanks Rob and Brandon. -Tom

Re-installation of Perl 6 (Rakudo Star) via rakudobrew on Linux

2015-03-24 Thread Tom Browder
I installed the 2015.02 version of Perl 6 (Rakudo Star) by following these instructions on the perl6.org site: quote To install Rakudo and Panda using rakudobrew: rakudobrew build moar rakudobrew build-panda Finally, install Task::Star. This will install all the modules that are shipped with

Re: How to get indirect access to a class attribute?

2015-03-25 Thread Tom Browder
On Wed, Mar 25, 2015 at 8:47 AM, Tom Browder tom.brow...@gmail.com wrote: On Wed, Mar 25, 2015 at 8:29 AM, Moritz Lenz mor...@faui2k3.org wrote: the indirect method call syntax is the right approach, you just got too many other details wrong to make it work. This syntax works in a method

How to get indirect access to a class attribute?

2015-03-25 Thread Tom Browder
Given a class like: our %attrs = (age=1,wgt=2); class foo { has $.age = rw;} method a { for %attrs.kv - $k, $v { my $aval = self.$k(); # supposed to work for a method name say attr { $k } has value '{ $aval }'; } } Question: 1. How can I indirectly refer to the attributes in a

Re: Is there an equivalent env var to PERL5LIB for Perl 6 module locations?

2015-03-31 Thread Tom Browder
On Mon, Mar 30, 2015 at 7:35 PM, Rob Hoelz r...@hoelz.ro wrote: Yup, PERL6LIB. =) And how did you find out about it, i.e., where is it documented? Thanks. -Tom

Re: Can a user cheat and call a class's private method?

2015-03-27 Thread Tom Browder
On Fri, Mar 27, 2015 at 6:36 AM, Carl Mäsak cma...@gmail.com wrote: This feels like the same conversation we had earlier this week about accessing private methods. :) But maybe there are still a few new points that can be made. ... Okay, Carl, I think I understand. But what about this for my

Re: Fancy sub arg handling: ability to expand error message?

2015-03-29 Thread Tom Browder
On Sat, Mar 28, 2015 at 5:43 PM, Tom Browder tom.brow...@gmail.com wrote: Agree--looks like we need some of Damien Conways wonderful CPAN modules That should be Damian Conway's -Tom

Re: Example module and its use

2015-03-28 Thread Tom Browder
On Mar 28, 2015 6:23 AM, Paul Cochrane p...@liekut.de wrote: BTW: please don't use the shortcut 'v6;': AFAIU it's been deprecated in favour of 'use v6;' Hope this helps a bit. It does, thanks! BTW, I think my fumbling in learning Perl 6 is giving me some ideas for the Coookbook, at least for

Fancy sub arg handling: ability to expand error message?

2015-03-28 Thread Tom Browder
I like the subroutine arg handling in Perl 6. Is there any simple way to attach a short error msg in place of or additive to the default for, say, a missing arg? Thanks. Best, -Tom

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Tom Browder
On Mon, Mar 23, 2015 at 7:04 AM, Tom Browder tom.brow...@gmail.com wrote: From your and Henk's comments, I think I need to learn a lot more about testing in general. Any recommendations for books on the subject? -Tom

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Tom Browder
On Mar 23, 2015 3:19 AM, Moritz Lenz mor...@faui2k3.org wrote: That said, I wonder why tests need introspection at all. I mean, you test by doing example calls and comparing to expected example return values. No argument from me. I am at the point of trying to replicate, in Perl 6, somene

Need Help with Perl 6 Module Test::Builder

2015-04-01 Thread Tom Browder
I need Perl 6 module Test::Builder to continue porting CPAN Perl 5 module Geo::Ellipdoid to Perl 6. Test::Builder currently is in the Task::Star module but it fails during the build process with Rakudo 2015.03 (it did NOT fail with Rakudo 2015.02). I have filed a bug report at the github source

Example module and its use

2015-03-27 Thread Tom Browder
I'm trying to get the basic syntax down on creating and using a module. I've tried this and get an error: # file 1: Bar.pm module Bar; sub foo($a, $b, $c) is export {} # file 2: doit.pl v6; use lib .; use Bar foo; my @t = foo(1, 2, 3); # in a shell $ perl6 doit.pl ===SORRY!=== Error while

Re: Can a user cheat and call a class's private method?

2015-03-26 Thread Tom Browder
On Mar 26, 2015 11:04 AM, Moritz Lenz mor...@faui2k3.org wrote: On 26.03.2015 16:55, Tom Browder wrote: I need to test some private routines, so is there a way to do that ... And then you can also do something like: my $private_method = $obj.^private_method_table{$methodname}; $obj

Re: Passing arrays to subroutines

2015-03-19 Thread Tom Browder
On Thu, Mar 19, 2015 at 10:15 AM, Moritz Lenz mor...@faui2k3.org wrote: On 03/19/2015 04:05 PM, Tom Browder wrote: In Perl 5 I can do this: ... 1. How can I combine arrays @a and @b into one array? generally with the comma operator: my @combined = @a, @b; It looks like I can also do

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Tom Browder
On Mon, Mar 23, 2015 at 10:41 AM, Elizabeth Mattijsen l...@dijkmat.nl wrote: On 23 Mar 2015, at 14:11, Tom Browder tom.brow...@gmail.com wrote: Any recommendations for books on the subject? Perl Testing - A Developer’s notebook: Thanks, Liz--getting it! -Tom

Can a user cheat and call a class's private method?

2015-03-26 Thread Tom Browder
I need to test some private routines, so is there a way to do that? Or will I have to copy code to a test script or? BTW, the tests are for input/output checks during development--not for the public user. Thanks. Best, -Tom

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Tom Browder
On Mon, Mar 23, 2015 at 11:28 AM, B. Estrade estr...@gmail.com wrote: As good as this book is, it's still Perl 5 specific. So watch out if you're coming from Perl 5 land and Heaven forbid you're looking to do traditional things, you might get scolded for asking a reasonable question. o_O.

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Tom Browder
On Mon, Mar 23, 2015 at 5:25 PM, Henk van Oers h...@signature.nl wrote: From 2005, but still a fantastic primer on testing in Perl. Sorry Tom. I think you must read a book about OO. I will go back and review OO, Henk. Thanks. Best, -Tom

Will Perl 6 save a compiled version of a source program like Python?

2015-05-18 Thread Tom Browder
I found some discussion of such a capability on the Perl Mongers' site but haven't found anything official yet in the Synopses. But I did find there an option that might do something related: --output-format (which is implementation defined). However, I do not see that option in Rakudo Perl 6.

Re: Will Perl 6 save a compiled version of a source program like Python?

2015-05-18 Thread Tom Browder
On Mon, May 18, 2015 at 7:47 AM, Elizabeth Mattijsen l...@dijkmat.nl wrote: On 18 May 2015, at 14:28, Tom Browder tom.brow...@gmail.com wrote: ... Can anyone point me to more info or say yes or no to possible support of a save-compilation feature? ... [good answer to my question...] Thanks

Perl 6 Meetups in the Southeast US?

2015-04-14 Thread Tom Browder
Unfortunately, I cannot attend the upcoming YAPC::NA in June. Does anyone know of any upcoming public tech meetings or conferences to be held in the southeast or mid-Atlantic US where there might be a Perl 6 dev presence? Thanks. -Tom

panda: Should it have an 'uninstall' option?

2015-04-07 Thread Tom Browder
Wouldn't an uninstall option be a good thing for panda? I don't know how insulated a Perl 6 package is from the rest of the installed packages, but I remember on more than one occasion wishing CPAN and Perl 5 packages had an uninstall option when an installation somehow got corrupted. Best

Fwd: Re: panda: Should it have an 'uninstall' option?

2015-04-07 Thread Tom Browder
-- Forwarded message -- From: Tom Browder tom.brow...@gmail.com Date: Apr 7, 2015 6:46 AM Subject: Re: panda: Should it have an 'uninstall' option? To: Tadeusz Sośnierz tadeusz.sosni...@onet.pl Cc: On Apr 7, 2015 6:34 AM, Tadeusz Sośnierz tadeusz.sosni...@onet.pl wrote

Re: Favorite (Xe|E)macs mode script for Perl 6?

2015-04-05 Thread Tom Browder
Thanks, Kamil! ~Tom

Favorite (Xe|E)macs mode script for Perl 6?

2015-04-04 Thread Tom Browder
I've found a couple of references to *emacs modes for Perl 6 on the net. I use Xemacs and would appreciate hearing from anyone on a recommended Perl 6 mode script for it. Thanks. Best, ~Tom

Re: Need Help with Perl 6 Module Test::Builder

2015-04-01 Thread Tom Browder
On Apr 1, 2015 4:57 PM, David Warring david.warr...@gmail.com wrote: I'm seeing the failure(s) as well. I've put in a PR that hopefully addresses this issue While we're waiting for the author, you can try checkout out, and building https://github.com/dwarring/p6-test-builder.git Thanks a

Re: Need Help with Perl 6 Module Test::Builder

2015-04-01 Thread Tom Browder
On Wed, Apr 1, 2015 at 5:22 PM, Tom Browder tom.brow...@gmail.com wrote: On Apr 1, 2015 4:57 PM, David Warring david.warr...@gmail.com wrote: I'm seeing the failure(s) as well. I've put in a PR that hopefully addresses this issue While we're waiting for the author, you can try checkout out

Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tom Browder
I finally found the Perl 6 version of Perl 5's $0 listed in: tablets.perl6.org/appendix-b-grouped.html#special-variables as '$*EXECUTABLE_NAME', and I expected it to act the same as $0 in Perl 6, but I have two problems with it: 1. When used it yields 'perl6' regardless of the script's name

Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tom Browder
On Sat, May 30, 2015 at 8:30 AM, Tobias Leich em...@froggs.de wrote: Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME. Tobias, I didn't find $*PROGRAM in the doc listed by Paul: http://doc.perl6.org/language/variables#Special_Variables Also, the following were not in:

Re: Perl 5's $0 vs. Perl 6's $*EXECUTABLE_NAME

2015-05-30 Thread Tom Browder
On Sat, May 30, 2015 at 9:03 AM, Tom Browder tom.brow...@gmail.com wrote: On Sat, May 30, 2015 at 8:30 AM, Tobias Leich em...@froggs.de wrote: Please also take a look at $*EXECUTABLE, $*PROGRAM and $*PROGRAM_NAME. Tobias, I didn't find $*PROGRAM in the doc listed by Paul: But it is the only

Re: Problem with string index for substrings a position zero (a bug?)

2015-07-03 Thread Tom Browder
On Fri, Jul 3, 2015 at 7:35 AM, Tom Browder tom.brow...@gmail.com wrote: On Fri, Jul 3, 2015 at 7:21 AM, yary not@gmail.com wrote: On Fri, Jul 3, 2015 at 8:07 AM, Tom Browder tom.brow...@gmail.com wrote: ... So, considering all the comments and S32 wording, I suspect that this would

Passing a hash to a subroutine: best method?

2015-07-03 Thread Tom Browder
While experimenting I've found the first two methods of passing a hash to a subroutine work: # method 1 my %hash1; foo1(%hash1); say %hash1.perl; sub foo1(%hash) { %hash{1} = 0; } # method 2 my %hash2; my $href2 = %hash2; foo2($href2); say %hash2.perl; sub foo2($href) { $href{1} = 0; } #

Re: Problem with string index for substrings a position zero (a bug?)

2015-07-03 Thread Tom Browder
On Fri, Jul 3, 2015 at 7:40 AM, yary not@gmail.com wrote: On Fri, Jul 3, 2015 at 8:35 AM, Tom Browder tom.brow...@gmail.com wrote: if $idx = 0 { ... Which worked also (surprisingly given S32 and your comments)! That doesn't work when the line has no comment in it, it gives an error

Re: Passing a hash to a subroutine: best method?

2015-07-03 Thread Tom Browder
On Jul 3, 2015 11:14 AM, Brandon Allbery allber...@gmail.com wrote: On Fri, Jul 3, 2015 at 11:26 AM, Tom Browder tom.brow...@gmail.com wrote: # method 1 ... foo1(%hash1); This is what I would naïvely expect to work in any language except Perl 5. That comment, along with Liz's, has convinced

Re: Passing a hash to a subroutine: best method?

2015-07-03 Thread Tom Browder
On Fri, Jul 3, 2015 at 10:26 AM, Tom Browder tom.brow...@gmail.com wrote: While experimenting I've found the first two methods of passing a hash to a subroutine work: # method 1 my %hash1; foo1(%hash1); say %hash1.perl; sub foo1(%hash) { %hash{1} = 0; } Another question on method 1

Re: Passing a hash to a subroutine: best method?

2015-07-03 Thread Tom Browder
On Fri, Jul 3, 2015 at 2:03 PM, Timo Paulssen t...@wakelift.de wrote: On 07/03/2015 07:20 PM, Tom Browder wrote: On Fri, Jul 3, 2015 at 10:26 AM, Tom Browder tom.brow...@gmail.com wrote: ... What is the proper type to use for the %hash for a more complete signature in function foo1? I've

Re: Sub args: choose one of two?

2015-06-27 Thread Tom Browder
On Jun 27, 2015 8:05 PM, Brent Laabs bsla...@gmail.com wrote: http://design.perl6.org/S99.html#LTA Ah, I almost guessed right! Best, -Tom

Sub args: choose one of two?

2015-06-27 Thread Tom Browder
I'm trying to take advantage of the MAIN suroutine to handle most all of my routine command line arg handling. One idiom I use a lot is for the user to choose only one of two args, but one must be chosen. Reading S06, I don't yet see a way to do that without dropping back to handling the @*ARGV

Re: Sub args: choose one of two?

2015-06-28 Thread Tom Browder
On Jun 28, 2015 5:24 AM, Moritz Lenz mor...@faui2k3.org wrote: user to choose only one of two args, but one must be chosen. So since it's not optional, you might consider not making it an option (prefixed with --), but rather a simple command: ... multi MAIN('open') {say Opening door;}

Problem with string index for substrings a position zero (a bug?)

2015-07-03 Thread Tom Browder
I originally had problems with the S32 description of string function index. S32 says that if the substring is not found then a bare Int is returned which evaluates to false, otherwise an Int with the position of the first substring match is returned. It goes on to say that one should not evaluate

Re: Sub args: choose one of two?

2015-07-02 Thread Tom Browder
On Tue, Jun 30, 2015 at 10:25 PM, Patrick R. Michaud pmich...@pobox.com wrote: On Sat, Jun 27, 2015 at 05:39:32PM -0500, Tom Browder wrote: ... multi sub MAIN(:$need!) { say need; } multi sub MAIN(:$hope!) { say hope; } I now have another problem, and I think I know the solution but I

Re: Sub args: choose one of two?

2015-07-02 Thread Tom Browder
On Thu, Jul 2, 2015 at 3:08 PM, yary not@gmail.com wrote: Here's a hackish way to implement #1: ... Ugh, my head hurts, yary, I think I'll save those methods for the future. Thanks! Best, -Tom

Re: .perl method: any plans for allowing output format changes?

2015-08-13 Thread Tom Browder
On Thu, Aug 13, 2015 at 3:51 AM, Steve Mynott steve.myn...@gmail.com wrote: The closest to Perl 5 Data::Dumper is Perl6 Data::Dump. Note also .perl will hang on many data structures. I find using YML dump also useful. Is that YAML dump? -Tom

Re: .perl method: any plans for allowing output format changes?

2015-08-13 Thread Tom Browder
On Thu, Aug 13, 2015 at 8:59 AM, Steve Mynott steve.myn...@gmail.com wrote: On Thu, Aug 13, 2015 at 3:51 AM, Steve Mynott steve.myn...@gmail.com wrote: On 13 August 2015 at 11:36, Tom Browder tom.brow...@gmail.com wrote: The closest to Perl 5 Data::Dumper is Perl6 Data::Dump. Note also .perl

What are Perl 6's killer advantages over Perl 5?

2015-08-11 Thread Tom Browder
I have seen several lists of new Perl 6 features (versus Perl 5) but they all seem to be lists that intermix features with varying degrees of value to ordinary Perl 5 users. If one wants to sell long-time Perl 5 users (already using the latest Perl 5, Moose, etc.) on the value of Perl 6, what

.perl method: any plans for allowing output format changes?

2015-08-11 Thread Tom Browder
I don't see any way to change the output format of the .perl method without a home-grown filter of some kind. Providing some way to duplicate the output of Data::Dumper would be handy for someone converting Perl 5 to Perl 6. Maybe we need a Perl 6 version of Data::Dumper. Best, -Tom

Re: String trim method

2015-08-06 Thread Tom Browder
On Thu, Aug 6, 2015 at 2:23 AM, Brent Laabs bsla...@gmail.com wrote: I think the optimal way would be: my $s = 'yada yada'; That way the program won't have to trim the whitespace off the string every time it is run. In the more general case, I might do it something like: my $s =

Re: Proposed new string methods: trim-rw, trim-leading-rw, trim-trailing-rw

2015-08-14 Thread Tom Browder
On Aug 14, 2015 8:46 AM, Brandon Allbery allber...@gmail.com wrote: On Fri, Aug 14, 2015 at 8:07 AM, Tom Browder tom.brow...@gmail.com wrote: ... now). Note that the same behavior applies to the 'substr' string method so that begs the question of why is the 'substr-rw' method justified

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Wed, Aug 12, 2015 at 2:00 AM, H.Merijn Brand h.m.br...@xs4all.nl wrote: On Tue, 11 Aug 2015 21:41:21 -0400, David H. Adler d...@pobox.com ... *THE* killer feature that will be seen by all beginning perl6 programmers is its awesome error messages. It is a shame that ... Thanks! -Tom

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Wed, Aug 12, 2015 at 4:02 AM, Kamil Kułaga teodoz...@gmail.com wrote: One thing that was not mentioned already is using Rat instead of standard floating point number. It prevents many silly mistakes especially when counting money. Thanks, Kamil. -Tom

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-12 Thread Tom Browder
On Tue, Aug 11, 2015 at 6:41 PM, Andrew Kirkpatrick uberm...@gmail.com wrote: Built-in facilities for the language to parse, transform and extend ... Thanks, Andrew. -Tom

String trim method

2015-08-05 Thread Tom Browder
I see that to trim white space from a strings's both ends I have to do this: my $s = ' yada yada '; $s = $s.trim; Is that the optimum way? Thanks. Best regards, -Tom

perl6/book fonts: why Adobe commercial fonts?

2015-07-22 Thread Tom Browder
Is there any reason to use Adobe commercial fonts for the book? As I read the instructions to copy fonts from Adobe Reader, I worry that that is prohibited by the license from Adobe. Building the book without the fonts results in an ugly book in some parts. (There are plenty of free and

Re: What are Perl 6's killer advantages over Perl 5?

2015-08-26 Thread Tom Browder
On Wed, Aug 26, 2015 at 3:26 AM, Moritz Lenz mor...@faui2k3.org wrote: Hi, On 11.08.2015 14:12, Tom Browder wrote: I have seen several lists of new Perl 6 features (versus Perl 5) but they all seem to be lists that intermix features with varying degrees of value to ordinary Perl 5 users

Re: Erratic timings

2016-01-04 Thread Tom Browder
On Mon, Jan 4, 2016 at 7:38 AM, Parrot Raiser <1parr...@gmail.com> wrote: >> Could the jumps to >1 seconds be explained by automatic pre-compilation >> taking place after >> you re-compiled rakudo ? > > Why would that happen occasionally, after a number of executions of > the same code? (If it

Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Tom Browder
Jonathan's intro course, in pdf, here: https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf is excellent, of course. But I really like the presentation theme and the slide formatting! Does anyone know what slide-making process he uses? So far the best I have found that

Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Tom Browder
On Thu, Dec 31, 2015 at 9:26 AM, Sitaram Chamarty <sitar...@gmail.com> wrote: > On 31/12/15 20:43, Tom Browder wrote: >> https://github.com/rakudo/star/raw/master/docs/2015-spw-perl6-course.pdf ... >> Does anyone know what slide-making process he uses? ... > Looks l

Re: Jonathan's "Perl 6 Introductory course"

2015-12-31 Thread Tom Browder
Thanks Sitaram and Moritz! -Tom

Perl6 build failure on Ubuntu 14.04, 32-bit

2015-12-23 Thread Tom Browder
I'm getting a "rakudobrew build moar" failure on Ubuntu 14.04 LTS, 32-bit, running as a guest host on VirtualBox 5.0.12 r104815 (running on Debian 7, 64-bit). Note that I have done some root cpanm Perl module installations as well as some Ubuntu package manager installations of Perl modules,

Re: Perl6 build failure on Ubuntu 14.04, 32-bit

2015-12-23 Thread Tom Browder
On Wed, Dec 23, 2015 at 10:38 AM, Steve Mynott wrote: > That looks like you don't have enough virtual memory (the physical > memory assigned to your VM and swap within it) should be at least 2GB > (maybe even more). Thanks, Steve--I wasn't very bright, was I! I have

Perl 6.c!!

2015-12-27 Thread Tom Browder
Thank you Perl 6 devs--what a great Christmas present! Now I'm looking forward to buying my first paper copy of a Perl 6.c book. Any rumours of who/what/when out there in Perl 6 land? Best, -Tom

Perl 6 Module and Program File Extension Conventions?

2016-01-12 Thread Tom Browder
In Perl 5 it seems the prevailing convention (in my experience) is to use ".pl" for Perl programs and ".pm" as file suffixes for Perl modules. In Perl 6 I have seen in the various repos, blogs, and doc both ".pl", ".p6", and ".pl6" for programs and both ".pm" and ".pm6" for modules. Is there any

Re: Workaround for Perl 5's __DATA__

2016-01-18 Thread Tom Browder
On Mon, Jan 18, 2016 at 6:47 AM, Kamil Kułaga wrote: > You may be happy with =finish block ... Thanks, Kamil! -Tom

'!' versus 'not' in boolean expression

2016-01-18 Thread Tom Browder
In creating some new Perl 6 programs I've run across several instances I'm confused about, to wit: Example 1 --- > my %h; say 'false' if !%h:exists; Unexpected named parameter 'exists' passed Example 2 --- > my %h; say 'false' if not %h:exists; false It looks like '!'

Re: Is there another way to define a regex?

2016-01-17 Thread Tom Browder
On Sun, Jan 17, 2016 at 1:55 PM, Bruce Gray <bruce.g...@acm.org> wrote: > On Jan 17, 2016, at 11:07 AM, Tom Browder <tom.brow...@gmail.com> wrote: > >> I'm trying to write all new Perl code in Perl 6. One thing I need is >> the equivalent of the Perl 5 qr// an

Re: Is there another way to define a regex?

2016-01-17 Thread Tom Browder
On Sun, Jan 17, 2016 at 3:03 PM, Moritz Lenz <mor...@faui2k3.org> wrote: > On 01/17/2016 06:07 PM, Tom Browder wrote: ... >> # regex of dirs to ignore >> my regex dirs { >> \/home\/user\/\.cpan | >> \/home\/tbrowde\/\.emacs >> } > > Better writ

Is there another way to define a regex?

2016-01-17 Thread Tom Browder
I'm trying to write all new Perl code in Perl 6. One thing I need is the equivalent of the Perl 5 qr// and, following Perl 6 docs, I've come to use something like this (I'm trying to ignore certain directories): # regex of dirs to ignore my regex dirs { \/home\/user\/\.cpan |

Re: '!' versus 'not' in boolean expression

2016-01-18 Thread Tom Browder
On Mon, Jan 18, 2016 at 1:37 PM, Elizabeth Mattijsen <l...@dijkmat.nl> wrote: >> On 18 Jan 2016, at 19:55, Tom Browder <tom.brow...@gmail.com> wrote: >> In creating some new Perl 6 programs I've run across several instances >> I'm confused

Re: Perl 6 advocacy needs a mailing list

2016-02-05 Thread Tom Browder
On Friday, February 5, 2016, Will Coleda wrote: > Please open a ticket for this request at > https://github.com/perl6/user-experience/issues so we don't lose it. > Thanks. I will, Will! Thanks. -Tom

Re: Google Summer of Code and Google Code In

2016-02-11 Thread Tom Browder
On Thursday, February 11, 2016, Bruce Gray <bruce.g...@acm.org> wrote: > > On Feb 11, 2016, at 5:19 PM, Tom Browder <tom.brow...@gmail.com > <javascript:;>> wrote: > > Has the Perl 6 organization participated in or are they planning to > > seek participat

Perl 6 advocacy needs a mailing list

2016-02-05 Thread Tom Browder
I would like to see such a list. It would help separate some of us bloviators, dreamers, and hand wavers from the others on the users list. -Tom

Re: Nice-to-have class methods

2016-01-28 Thread Tom Browder
On Wed, Jan 27, 2016 at 7:09 AM, Elizabeth Mattijsen <l...@dijkmat.nl> wrote: >> On 27 Jan 2016, at 14:00, Tom Browder <tom.brow...@gmail.com> wrote: >> >> Given so many handy methods for built-in classes, it would be nice to have a >> couple of more for some,

Re: Nice-to-have class methods

2016-01-27 Thread Tom Browder
On Wed, Jan 27, 2016 at 7:09 AM, Elizabeth Mattijsen <l...@dijkmat.nl> wrote: >> On 27 Jan 2016, at 14:00, Tom Browder <tom.brow...@gmail.com> wrote: >> >> Given so many handy methods for built-in classes, it would be nice to have a >> couple of more for some,

Re: A practical benchmark shows speed challenges for Perl 6

2016-02-03 Thread Tom Browder
On Wed, Feb 3, 2016 at 9:40 AM, Elizabeth Mattijsen wrote: > Is the code available somewhere? Would love to try some optimizations on it. Liz, code is in public pastes in Pastebin. Links are here: 1. The master Perl 6 script to run the tests: http://pastebin.com/MDmumWq0

A practical benchmark shows speed challenges for Perl 6

2016-02-03 Thread Tom Browder
I use Perl for heavy duty text processing. A question on Perl Monks about Perl 5's handling of a large input file got me wondering how the two Perls compare at the moment. I wrote a couple of simple programs, in both languages, to write and read a 10 Gb text file filled with identical

  1   2   3   >