Re: bash "."?

2020-05-15 Thread Tom Browder
On Fri, May 15, 2020 at 13:47 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > > >> On 15 May 2020, at 20:08, ToddAndMargo via perl6-users < > perl6-users@perl.org> wrote: > >> > >> On 2020-05-15 10:37, Elizabeth Mattijsen wrote: > >>> There will never be a Perl 6 version. > >> > >> >

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 2020-05-17 22:28, Paul Procacci wrote: ... > 'say if "test".IO.d', and > 'say "test".IO.d.Bool' Try: 'say so "test".IO.d'

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 2020-05-18 13:28, Tom Browder wrote: ... > > Try: > > > > 'say so "test".IO.d' Todd, you didn't try what I suggested. Once again, look a the line above^^ There is no "if" there. -Tom

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 17:51 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 2020-05-18 15:44, Tom Browder wrote: > > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users > > mailto:perl6-users@perl.org>> wrote: > > > >

Re: I need help with IO.e

2020-05-19 Thread Tom Browder
On Tue, May 19, 2020 at 03:44 Richard Hainsworth wrote: > The transcendental abundance of purple in Raku :) Ah, Richard, thanks for a trip down memory lane! In my youth I discovered the joys of science fiction a few years after that piece was published. -Tom

Re: bash "."?

2020-05-28 Thread Tom Browder
On Fri, May 15, 2020 at 20:38 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > On 2020-05-15 17:26, Tom Browder wrote: > > On Fri, May 15, 2020 at 13:47 ToddAndMargo via perl6-users > > mailto:perl6-users@perl.org>> wrote: Did you look at Raku modules

Re: I need a GTK pop up with time out

2020-06-03 Thread Tom Browder
On Wed, Jun 3, 2020 at 20:56 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: ... > Can anyone point me to > an example of a GTK information pop up with a time out > feature? Or similar? Have you looked at the examples in the GTK::Simple repo? Go to modules.raku.org, search on GTK,

Re: just curious to know

2020-06-14 Thread Tom Browder
On Sun, Jun 14, 2020 at 10:56 Richard Hainsworth wrote: > Hi Radhakrishnan, > > If 'spreading wings over the information technology field' were to mean > anything other than what is fashionable today, then C still reigns. Richard, excellently said! I would like to see that on our Raku.org site

Fwd: delimiters with more than one character? ...

2020-07-16 Thread Tom Browder
An opportunity for Raku golfers to show off Raku on the Debian users list. Best regards, -Tom -- Forwarded message - From: Albretch Mueller Date: Tue, Jul 14, 2020 at 07:52 Subject: delimiters with more than one character? ... To: Debian Users ML I have a string delimited by

Re: Baby steps to create a dataframe structure

2020-07-21 Thread Tom Browder
On Tue, Jul 21, 2020 at 20:00 Warren Pang wrote: > I have the same feeling. Perl5 has PDL which we have been using for data > analysis. While Raku seems to lack this. > I haven't looked into how it might work, but Raku does have the NativeCall interface as well as Inline::Perl5 which may help.

Re: Baby steps to create a dataframe structure

2020-07-22 Thread Tom Browder
On Wed, Jul 22, 2020 at 06:51 JJ Merelo wrote: > The Raku wrapper for GSL is ready, specifically all matrix operations, > check it out. It's extremely fast, and could be the foundation for these > data frames. > Depending on your use of the GSL, as I recall the license restricts commercial use.

Re: Any sign of a fix for the 10 second compile time?

2020-07-31 Thread Tom Browder
On Fri, Jul 31, 2020 at 14:55 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > >> On Fri, Jul 31, 2020, 04:45 ToddAndMargo via perl6-users > >> mailto:perl6-users@perl.org>> wrote: Todd, a couple of questions: 1. In your modules that change all the time, do have "use lib ...;" stat

Re: Any sign of a fix for the 10 second compile time?

2020-07-31 Thread Tom Browder
On Fri, Jul 31, 2020 at 5:38 PM ToddAndMargo via perl6-users wrote: > >> Todd, a couple of questions: > >> 1. In your modules that change all the time, do have "use lib ...;" > >> statements in any of them? > > > > No. If I do, they crash > > # use lib '/home/linuxutil/p6lib'; # may not be prec

Re: Any sign of a fix for the 10 second compile time?

2020-08-01 Thread Tom Browder
On Sat, Aug 1, 2020 at 12:30 Richard Hainsworth wrote: > What you are asking for is not a bug, but a part of the current stage of > design. It will probably get quicker. Richard, you should find an appropriate place in the docs and add a section on setting up your personal zef repo. Thanks. -

Re: Extended identifiers in named attributes

2020-08-26 Thread Tom Browder
On Wed, Aug 26, 2020 at 07:31 Marcel Timmerman wrote: I was experimenting with extended identifiers and found that it is > > not possible to use it in named attributes. E.g. > > > sub a (:$x:y) { say $x:y; } > > Are you sure that is supposed to work without some kind of () or <> like a module ide

Re: Raku User's Survey 2020 out now....

2020-08-28 Thread Tom Browder
On Thu, Aug 27, 2020 at 20:41 ToddAndMargo via perl6-users wrote: > On 2020-08-27 16:53, Daniel Long Sockwell wrote: > >> Very few of the other [methods are documented] this way. Todd, I have one more suggestion: Why don't you put your "keepers" on Github? Several advantages: 1. easy to change

Re: spurt and array question

2020-11-14 Thread Tom Browder
On Sat, Nov 14, 2020 at 01:59 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > Hi All, > > I am writing out an array of text lines to a file. > I just can't help but thinking I am doing it the > hard way. > > unlink( $Leafpadrc ); > for @LeafpadrcNew -> $Line { spurt( $Leafpa

Re: Help with bug

2020-12-29 Thread Tom Browder
On Tue, Dec 29, 2020 at 17:16 Elizabeth Mattijsen wrote: > Using an `await` inside a react, feels like a code smell to me. An > `await` will I suggest using 'note' for debugging instead of print or say so info is not delayed and goes straight to stderr. -Tom

Re: Module Documentation

2021-03-02 Thread Tom Browder
On Tue, Mar 2, 2021 at 08:42 Daniel Sockwell wrote: > Richard Hainsworth wrote: > > My suggestion is that some formal decision is made about documentation > for Raku modules, that some > > documentation good practices are put together and included in the > Modules page. > I agree that's a good

Re: Please create a Raku community channel

2021-03-13 Thread Tom Browder
On Sat, Mar 13, 2021 at 08:12 Joseph Brenner wrote: > Richard Hainsworth wrote: > > > I found out yesterday by the intervention of a regular participant in > > the community that a new documentation website is being worked on. > > I should say, I was surprised to hear about that project also. I

Re: Module Documentation

2021-03-16 Thread Tom Browder
On Tue, Mar 16, 2021 at 05:20 Elizabeth Mattijsen wrote: > > On 16 Mar 2021, at 04:22, Matthew Stuckwisch > wrote: > > I'm on board with this. I also use App::Mi6 after I saw from Elizabeth how much it helps with module development (and maintenance!). And from almost the beginning with mi6 I

Re: What's going on with "given (junction) {when (value)...}"

2021-06-01 Thread Tom Browder
On Tue, Jun 1, 2021 at 11:31 William Michels via perl6-users < perl6-users@perl.org> wrote: > Hi Bruce, > This is what I see with Rakudo 2020.10 (all code below performs > delightfully as expected): > This whole thread looks like good stuff for some probably missing roast tests. -Tom

Re: How do a pe-salt an array inside an object?

2021-07-06 Thread Tom Browder
On Tue, Jul 6, 2021 at 14:53 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: ... > writing out 2000 skips is not practical. Todd, why don't you tell us what you're really trying to do, i.e., what is your use case? Maybe the experts can suggest a better class design. -Tom

Windows tutorial needed (Todd?)

2021-07-11 Thread Tom Browder
See https://github.com/Raku/docs issue #3913. -Tom (tbrowder)

Re: Windows tutorial needed (Todd?)

2021-07-12 Thread Tom Browder
On Sun, Jul 11, 2021 at 14:27 yary wrote: > The link for that issue is https://github.com/Raku/doc/issues/3913 > ("doc" not "docs") > Thanks, @yary, for noticing my FF (finger fumble :-D)!

Re: Windows tutorial needed (Todd?)

2021-07-12 Thread Tom Browder
On Sun, Jul 11, 2021 at 17:12 ToddAndMargo via perl6-users wrote: > On 7/11/21 2:31 AM, Tom Browder wrote: > > See https://github.com/Raku/docs <https://github.com/Raku/docs> issue #3913. ... > Would you be a little more specific. Are you looking for > an install guide? Or

Re: Windows tutorial needed (Todd?)

2021-07-12 Thread Tom Browder
On Mon, Jul 12, 2021 at 15:44 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: I should be able to help with a few of those. Do I post > it back to the issue and have JJ formalize it? Do you know how to write in Markdown or Raku POD? Did you ever get your Github account? IMHO, you

Re: pod questions

2021-07-19 Thread Tom Browder
On Mon, Jul 19, 2021 at 06:57 Marcel Timmerman wrote: Reading a bit, I came across old documents (with a warning that these are > out of date) https://design.raku.org/S02.html#Multiline_Comments . It > states that any unrecognized format name should be treated as a comment > block, which the abov

Re: pod questions

2021-07-19 Thread Tom Browder
On Mon, Jul 19, 2021 at 09:20 Marcel Timmerman wrote: > On 7/19/21 2:29 PM, Tom Browder wrote: > > On Mon, Jul 19, 2021 at 06:57 Marcel Timmerman wrote: > > Reading a bit, I came across old documents (with a warning that these are >> out of date) https://des

Re: ftp client yet?

2021-10-26 Thread Tom Browder
On Tue, Oct 26, 2021 at 00:22 Ralph Mellor wrote: > > This is what the more complicated stuff I am doing. ... And if the code doesn't work because of a newly-found need of a go-between Perl5 and Raku, the author of Inline::Perl5 is very helpful in finding a fix and releasing a new version. Bes

Re: Windows tutorial needed (Todd?)

2021-11-06 Thread Tom Browder
On Sat, Nov 6, 2021 at 18:02 ToddAndMargo wrote: > On 7/11/21 02:31, Tom Browder wrote: > > See https://github.com/Raku/docs <https://github.com/Raku/docs> issue > #3913. > > > > -Tom (tbrowder) > > Hi Tom, > > I finally got around to writing your

Docs on docs.raku.org need automated build

2021-11-14 Thread Tom Browder
Doc site i see is several weeks old and missing my last merged contrib on example of programmatic use of ‘require’. Any hope of a rebuild this month? -Tom

Re: Docs on docs.raku.org need automated build

2021-11-15 Thread Tom Browder
On Mon, Nov 15, 2021 at 12:43 JJ Merelo wrote: > Done also for the official site, https://docs.raku.org > Check it out. > Thank you, JJ--it looks great! -Tom

Re: why not raku ?

2021-11-19 Thread Tom Browder
On Fri, Nov 19, 2021 at 07:48 Aureliano Guedes wrote: > I am still defending that we need a package for data > analysis/science/engineer (like the Perl5 PDL, Python Pandas or R > data.table) and an IDE for streaming programming like jupyter or rstudio. > Speaking for myself, I agree, and I think

Re: why not raku ?

2021-11-22 Thread Tom Browder
On Mon, Nov 22, 2021 at 12:13 PM Clifton Wood wrote: > Aureliano: > You are correct. That is an effective workaround, but it will be a > maintenance nightmare for large C++ libraries if you have to wrap every > method. > There has to be a better way. Not so easy to find in the docs, but here is

Re: file format extensions

2021-12-30 Thread Tom Browder
On Thu, Dec 30, 2021 at 06:26 Elizabeth Mattijsen wrote: > +1 from me. Shouldn't that be a .rakudoc file ? :-) Or .rakupod?

Re: Implementation of documented POD6 behaviour

2021-12-30 Thread Tom Browder
On Thu, Dec 30, 2021 at 07:17 Richard Hainsworth wrote: > I plan to use the POD6 metadata functionality a lot in a new module. It > would be far better to separate out the meta data into lines. > Richard, there are many pod things that haven’t been implemented yet. I have planned for a long time

Re: BEGIN {} question

2022-08-29 Thread Tom Browder
On Mon, Aug 29, 2022 at 10:29 AM ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: ... > Does the compiler make a full pass through > the code before firing off the BEGIN routine NO. And I think you may be surprised how much speedup you may get by using the precompiled-module "trick" fo

Re: BEGIN {} question

2022-08-29 Thread Tom Browder
On Mon, Aug 29, 2022 at 12:31 PM ToddAndMargo via perl6-users wrote: > On 8/29/22 08:41, Tom Browder wrote: ... > > And I think you may be surprised how much speedup you may get by using > > the precompiled-module "trick" for most of your 11,000-line program. ...

Re: Marketing / PR / Branding

2023-10-31 Thread Tom Browder
On Tue, Oct 31, 2023 at 08:41 Fernando Santagata wrote: > Hi Richard, > > Where is the Raku/Problem-solvers discussion about PR? > Ditto

Re: Test not working so well

2023-12-09 Thread Tom Browder
Try: say so $= On Sat, Dec 9, 2023 at 18:22 ToddAndMargo via perl6-users < perl6-users@perl.org> wrote: > Hi All, > > What am I doing wrong here? > > > my $x="abc2def"; say $x=/ ^ <[0..9]> ** 7 $ /; > / ^ <[0..9]> ** 7 $ / > > [0] > my $x="abc2def"; say $x=/ ^ <[l..z]> ** 7 $ /; > / ^ <[l..

Re: Help with macports port for zef

2023-12-31 Thread Tom Browder
On Mon, Nov 27, 2023 at 02:17 raf via perl6-users wrote: > Hi. I'm trying to create a macports portfile for zef so I'm not a Mac user, but I've been struggling with another Rakudo installation method for Linux and had similar problems. My solution has been to install the binary code for linux

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: Perl 6 script beginning lines: 'v6;' required?

2015-03-13 Thread Tom Browder
On Fri, Mar 13, 2015 at 8:01 AM, Brandon Allbery wrote: > On Fri, Mar 13, 2015 at 8:54 AM, Rob Hoelz wrote: ... Thanks Rob and Brandon. -Tom

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 fai

Re: Perl 6 Debugging

2015-03-14 Thread Tom Browder
On Sat, Mar 14, 2015 at 5:25 PM, Elizabeth Mattijsen wrote: >> On 14 Mar 2015, at 23:19, Tom Browder 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 > you to not

Re: Perl 6 Debugging

2015-03-14 Thread Tom Browder
On Mar 14, 2015 6:46 PM, "yary" 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 a single re

Re: Perl 6 Debugging

2015-03-15 Thread Tom Browder
On Mar 15, 2015 1:26 AM, "Moritz Lenz" 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⏏, %args ) = @_;

Re: Perl 6 Debugging

2015-03-15 Thread Tom Browder
On Sat, Mar 14, 2015 at 5:19 PM, Tom Browder 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 haven't yet

Re: Placeholder Variable (was: Perl 6 Debugging)

2015-03-15 Thread Tom Browder
On Sun, Mar 15, 2015 at 2:55 PM, Timo Paulssen 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

Carp and Croak

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

Re: Carp and Croak

2015-03-17 Thread Tom Browder
On Sun, Mar 15, 2015 at 8:32 PM, Tom Browder 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

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

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 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. Thanks, Moritz, I re

Re: Object Contruction

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

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" 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 yet. Do you

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

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 de

Re: Passing arrays to subroutines

2015-03-19 Thread Tom Browder
On Thu, Mar 19, 2015 at 10:15 AM, Moritz Lenz 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; I

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

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

2015-03-19 Thread Tom Browder
On Thu, Mar 19, 2015 at 5:58 PM, Tobias Leich 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 the function r

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 /usr/local/people/tbrowde/mydata/tbrowde-home-bzr/perl6/my-perl6-r

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

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

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

2015-03-19 Thread Tom Browder
On Mar 19, 2015 9:30 PM, "Brandon Allbery" wrote: > > On Thu, Mar 19, 2015 at 10:26 PM, Tom Browder wrote: >> >> On Mar 19, 2015 8:58 PM, "Brandon Allbery" wrote: >> > On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder wrote: >> >> >>

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

2015-03-19 Thread Tom Browder
On Mar 19, 2015 9:30 PM, "Brandon Allbery" 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-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

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 wrote: > On Mar 19, 2015 8:58 PM, "Brandon Allbery" wrote: >> On Thu, Mar 19, 2015 at 9:32 PM, Tom Browder >> wrote: >>> >>> if (self.$elem) { # <=== LINE 995 === LINE 995 >>

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

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-22 Thread Tom Browder
On Fri, Mar 20, 2015 at 2:02 PM, Tom Browder wrote: > On Mar 20, 2015 1:51 PM, "Tobias Leich" 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 6:22 PM, Henk van Oers wrote: > On Sun, 22 Mar 2015, Tom Browder wrote: >> On Fri, Mar 20, 2015 at 2:02 PM, Tom Browder >> wrote: >>> On Mar 20, 2015 1:51 PM, "Tobias Leich" wrote: >>>> if $obj.^can($method_name) {... >

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

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

Re: Object Introspection for Existence of Methods: How?

2015-03-23 Thread Tom Browder
On Mar 23, 2015 3:19 AM, "Moritz Lenz" 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 else's test suite (

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 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 Mon, Mar 23, 2015 at 10:41 AM, Elizabeth Mattijsen wrote: >> On 23 Mar 2015, at 14:11, Tom Browder wrote: >> Any recommendations for books on the subject? > > Perl Testing - A Developer’s notebook: Thanks, Liz--getting it! -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 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. Roger! Thanks, Bre

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 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 primer on testing in P

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

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 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 failed tests for LWP::

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

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

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 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 Bruce). Cheers! -Tom

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 wrote: > On Wed, Mar 25, 2015 at 8:29 AM, Moritz Lenz 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 as you said: self.&qu

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: 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" 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{$methodn

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 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 particular sit

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 ; my @t = foo(1, 2, 3); # in a shell $ perl6 doit.pl ===SORRY!=== Error while impor

Re: Example module and its use

2015-03-28 Thread Tom Browder
On Sat, Mar 28, 2015 at 5:01 AM, Tom Browder wrote: > On Fri, Mar 27, 2015 at 8:27 PM, Nathan Brown wrote: Okay, this works: use Bar :DEFAULT; but this does not: use Bar ; So is S11 in error!! 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 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. > http://design.perl6.org/S11.html#Dynamic_exportation states: > >

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" 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 p6 newbies

  1   2   3   >