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

Perl 6 Debugging

2015-03-14 Thread Tom Browder
I am trying to convert a fairly simple Perl 5 program and supporting modules to Perl 6 and making slow progress. Executing 'perl6 -v': This is perl6 version 2015.02-247-gab55cb7 built on MoarVM version 2015.02-25-g3d0404a I am trying to get something equivalent to Carp to show me the exact

Object Contruction

2015-03-18 Thread Tom Browder
My new object needs some methods run during construction. How can I do that without defining my own new method? I think something like this is supposed to work: class Geo::Ellipsoid; has $.ellipsoid is rw = 'WGS84'; # this needs more processing whether user-entered or default has $.units

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: Perl 6 Debugging

2015-03-15 Thread Tom Browder
On Mar 15, 2015 1:26 AM, Moritz Lenz mor...@faui2k3.org wrote: When I run your code with perl6-m (Rakudo with the MoarVM backend), I get ===SORRY!=== Error while compiling /home/moritz/Ellipsoid.pm6 Variable '$class' is not declared at /home/moritz/Ellipsoid.pm6:154 -- my( $class⏏,

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

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: 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

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

Re: Object Contruction

2015-03-18 Thread Tom Browder
On Mar 18, 2015 5:25 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote: YAPC::NC ?? You mean YAPC::NA? Yes, my fingers don't seem to work very well! I will be there, Good, meeting Perl 6 devs is the only reason I think I might attend. but haven’t had any inspiration for a presentation just

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-19 Thread Tom Browder
On Mar 19, 2015 9:30 PM, Brandon Allbery allber...@gmail.com wrote: Unless there is more that you didn't show, that function is not a method and has no `self`. [Please ignore last msg sent prematurely.] Why do you say that? The first line says it is a private method. -Tom

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

Function Signatures: Return Types (replace wantarray?)

2015-03-19 Thread Tom Browder
I need to replace the Perl 5 'wantarray' and think a multi method with differing return types should do it. So I've tried this: multi method foo($a, $b -- {Num,Num}) { #... } multi method foo($a, $b -- Num) { #... } and get errors like: Missing block at Ellipsoid.pm:672 -- ethod to($lat1,

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

Passing arrays to subroutines

2015-03-19 Thread Tom Browder
In Perl 5 I can do this: my @a = (1, 2); my @b = (3); foo(@a,@b); sub foo { my $n = @_; die Wrong num args: $n if ($n != 3);} In Perl 6 I think this is correct (or nearly so): sub foo(*@args) { die Wrong num args: { @args.elems } if @args.elems != 3;} Questions for Perl 6: foo is now

Object Introspection for Existence of Methods: How?

2015-03-20 Thread Tom Browder
I am trying to create a testing subroutine to detect if a class object has a certain method. I want it to look something like this: my $obj = Foo.new(); can_ok($obj, 'method1'); sub can_ok($obj, Str $method_name) { if $obj.{$method_name}:exists { say ok; return True; }

Re: Object Introspection for Existence of Methods: How?

2015-03-20 Thread Tom Browder
On Mar 20, 2015 1:50 PM, Will Coleda w...@coleda.com wrote: class bar { method foo () {}} my bar $a = bar.new(); say so $a.can(foo); Great! I'm not sure this warrants a new _ok method. How would you do it with an existing test? Thanks, Will. Cheers! -Tom

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

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

2015-03-13 Thread Tom Browder
I have seen the following beginning lines of Perl programs in some examples on the Perl 6 web site: #!/usr/bin/env perl6 v6; Isn't the 'v6' superflous given the first line? Best regards, -Tom

Re: rakudo Test module: expanding tests considered?

2015-03-24 Thread Tom Browder
On Mar 24, 2015 3:44 AM, Moritz Lenz mor...@faui2k3.org wrote: On Mon, Mar 23, 2015 at 5:53 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote: On 23 Mar 2015, at 23:50, Tom Browder tom.brow...@gmail.com wrote: Question: Would it be better to submit pull requests for some (or all

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: Re-installation of Perl 6 (Rakudo Star) via rakudobrew on Linux

2015-03-24 Thread Tom Browder
On Tue, Mar 24, 2015 at 10:44 AM, Steve Mynott steve.myn...@gmail.com wrote: The easiest thing is to delete everything and start again. Well, one reason to delete and start over is this time panda had changed paths so I was using the old panda. But now, even with the new panda, I still get the

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

2015-03-24 Thread Tom Browder
On Tue, Mar 24, 2015 at 12:10 PM, Tom Browder tom.brow...@gmail.com wrote: I guess a bug report is in order. Maybe I'll ask on #perl6. A bug report is in order because I didn't get that failure with the previous version. -Tom

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

2015-03-25 Thread Tom Browder
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. Fair enough--my fingers fumbled a few important things. I'll correct and recheck; Thanks, Moritz (and

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: Fancy sub arg handling: ability to expand error message?

2015-03-28 Thread Tom Browder
On Mar 28, 2015 8:54 AM, Moritz Lenz mor...@faui2k3.org wrote: On 28.03.2015 12:27, Tom Browder wrote: 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? You can always use

Please retract bug [perl #124169]

2015-03-30 Thread Tom Browder
That bug should have been filed with LWP::Simple, and I have just done so. Please close this bug as a mistake. Best, -Tom

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

2015-03-30 Thread Tom Browder
I would like an easy way to have a local search path for local Perl 6 modules (those not installed via Panda). I'm used to using the environment variable PERL5LIB for Perl 5 modules. Is there currently any equivalent way to do that for Perl 6? Thanks. -Tom

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

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: 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

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-22 Thread Tom Browder
On Sun, Mar 22, 2015 at 7:48 PM, Henk van Oers h...@signature.nl wrote: On Sun, 22 Mar 2015, Tom Browder wrote: Do Perl 6 modules not need tests? Yes they need tests. If so, which ones do they need? The public interface. and which can be left off? The private stuff. You can not test

Re: Object Introspection for Existence of Methods: How?

2015-03-22 Thread Tom Browder
On Sun, Mar 22, 2015 at 6:22 PM, Henk van Oers h...@signature.nl wrote: On Sun, 22 Mar 2015, Tom Browder wrote: 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

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: Example module and its use

2015-03-28 Thread Tom Browder
On Fri, Mar 27, 2015 at 8:27 PM, Nathan Brown nbrow...@gmail.com wrote: If you put the attribute is export on a sub, then it is part of the :DEFAULT and :ALL tagsets. That means you can import them by: use Bar :DEFAULT; Okay, I'll try that.

Re: Example module and its use

2015-03-28 Thread Tom Browder
On Sat, Mar 28, 2015 at 5:01 AM, Tom Browder tom.brow...@gmail.com wrote: On Fri, Mar 27, 2015 at 8:27 PM, Nathan Brown nbrow...@gmail.com wrote: Okay, this works: use Bar :DEFAULT; but this does not: use Bar foo; So is S11 in error!! 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 9:35 AM, Bruce Gray robertbrucegr...@gmail.com wrote: Any recommendations for books on the subject? http://shop.oreilly.com/product/9780596100926.do Perl Testing: A Developer's Notebook by Ian Langworth and Chromatic From 2005, but still a fantastic

rakudo Test module: expanding tests considered?

2015-03-23 Thread Tom Browder
I have some tests needed for a Perl 5 module I'm trying to translate from Perl 5 to Perl 6 that aren't available yet. Question: Would it be better to submit pull requests for some (or all) for the rakudo Test module or start creating a new Test::* module? Thanks. Best, -Tom

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

Re: rakudo Test module: expanding tests considered?

2015-03-23 Thread Tom Browder
On Mon, Mar 23, 2015 at 5:53 PM, Elizabeth Mattijsen l...@dijkmat.nl wrote: On 23 Mar 2015, at 23:50, Tom Browder tom.brow...@gmail.com wrote: Question: Would it be better to submit pull requests for some (or all) for the rakudo Test module or start creating a new Test::* module? Good

Re: Perl 6 Meetups in the Southeast US?

2015-05-08 Thread Tom Browder
On Thu, May 7, 2015 at 10:25 PM, Bruce Gray bruce.g...@acm.org wrote: ... Hi Tom! Atlanta.PM meets on the first Thursday of each month, at the topmost point of the I-285 perimeter. Thanks for the kind invitation, Bruce. I have been eyeballing the Atlanta PM as the closest active PM group to

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: Sub args: choose one of two?

2015-07-01 Thread Tom Browder
Perhaps you want that the named arguments are required rather than ... Thanks, Pm! Best, -Tom

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:21 AM, yary not@gmail.com wrote: On Fri, Jul 3, 2015 at 8:07 AM, Tom Browder tom.brow...@gmail.com wrote: ... I completely missed the other obvious attempt to use Perl 5ish semantics: if $idx = 0 { ... Which worked also (surprisingly given S32 and your comments

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

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:27 AM, Elizabeth Mattijsen l...@dijkmat.nl wrote: Hi Tom, ... Apart from what Carl and yary said, I would like to add that *if* you’re just interested in knowing whether a string starts with a certain substring, you can use .starts-with: ... Thanks, Liz, Perl 6

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

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: 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

Re: Sub args: choose one of two?

2015-06-27 Thread Tom Browder
On Jun 27, 2015 7:39 PM, yary not@gmail.com wrote: This sort of works, in that it does the right thing when you give one correct arg, and fails when you give neither arg or both args. The error message is good when you give both args, but LTA with no args. Thanks, Yary, Good use of multi

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 2:59 PM, Patrick R. Michaud pmich...@pobox.com wrote: On Thu, Jul 02, 2015 at 03:22:17PM -0400, Brandon Allbery wrote: On Thu, Jul 2, 2015 at 3:08 PM, Tom Browder tom.brow...@gmail.com wrote: 1. Write the 'main' program as another subroutine and call it from each

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

  1   2   3   >