Re: How to call a super class method?

2015-10-28 Thread Lloyd Fournier
I just re-read your question and saw your emphasis on "non-static" context. I'm not 100% sure what you are looking for, but take a look at *BUILD:* http://docs.perl6.org/language/objects#Submethods LL On Wed, Oct 28, 2015 at 2:31 PM, TS xx wrote: > Hello fellow perl

Re: How to call a super class method?

2015-10-28 Thread Lloyd Fournier
Hi Emiliano, You could do this: class Person { has $.name; method new($name) { # do some things self.bless(:$name); } } class Employee is Person { my $counter = 1; method new () { # Employees don't have individual identities so we give them a name :(

Re: Need help with Nil values

2016-02-23 Thread Lloyd Fournier
You could just do: method new (Str $value?) { ... } # makes value optional and then not pass anything to .new. On Tue, Feb 23, 2016 at 1:27 PM TS xx wrote: > Thanks Brandon, > > > That was what I was looking for. > > I'm trying it already. > > > Regards, > > Emiliano >

Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
I'd do the follwiing: 1. make a sub named shell to overwrite the existing one that calls .shell on Proc. 2. make a class that inherits from Proc: class MyProc is Proc { } 3. Look at https://github.com/rakudo/rakudo/blob/nom/src/core/Proc.pm and decide what methods you need to override to get the

Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
I was thinking just do: 'sub shell(...) is export { }'. And then 'use MyCrazyShell;' in module.pm. Do you mean without modifying module.pm? LL On Tue, Feb 28, 2017 at 1:46 AM Brian Duggan <bdugg...@gmail.com> wrote: > On Monday, February 27, Lloyd Fournier wrote: > > I'd d

Re: Simple windows code example needed

2017-01-11 Thread Lloyd Fournier
say "hello world"; or on the command line: perl6 -e 'say "hello world"' There are no headers :) LL On Thu, Jan 12, 2017 at 2:28 PM ToddAndMargo wrote: Hi All, Please forgive me being a mooch here. Would some kind person please write me a simple Windows perl 6 script

Re: Fwd: Re: Variables in modules

2017-03-15 Thread Lloyd Fournier
Since $?FILE in modules is being discussed I'll just leave this RT here: https://rt.perl.org/Public/Bug/Display.html?id=128442 On Thu, Mar 16, 2017 at 4:50 AM JuhiMarcel LangbroekTimmerman < mt195...@gmail.com> wrote: > In the perl doc of IO, IO::Path etc. The type is $?File.IO.WHAT to search >

Re: mocking Proc

2017-02-27 Thread Lloyd Fournier
Ah nice. Wrapping makes more sense than augmenting Proc anyway. LL On Tue, Feb 28, 2017 at 4:22 AM Brian Duggan wrote: > On Monday, February 27, Brian Duggan wrote: > > I tried numerous variants with multis and signatures that match the > > existing signatures, but

Re: Version of a Module

2017-07-04 Thread Lloyd Fournier
It is a bug. It's because of the way require is implemented at the moment is a little rough. The first one is asking for the .^ver of a stub package require has inserted. ::("Bailador").ver should work. LL On Wed, Jul 5, 2017 at 4:46 AM Martin Barth wrote: > Hi there, > > is

Re: not enough memory

2017-06-29 Thread Lloyd Fournier
I'm not sure if it's related but I've been getting a few weird memory related issues with HEAD and zef. e.g my travis build just segfaulted: https://travis-ci.org/spitsh/spitsh/builds/248242106#L1355 And a day or so ago I got: "MoarVM panic: Heap corruption detected: pointer 0x7f0fe9a16410 to

Re: Version of a Module

2017-06-27 Thread Lloyd Fournier
Hi Martin, AFAIK you can only do this with hacks atm. It's different if the module is installed or if you are in the source directory doing pelr6 -Ilib. I do this in my own module here: https://github.com/spitsh/spitsh/blob/master/lib/Spit/Util.pm6#L61 LL On Wed, Jun 28, 2017 at 7:14 AM

Re: Parse a string into a regex?

2017-05-12 Thread Lloyd Fournier
Patrick's answer of <$regex-interpolation> is the one I'd use. Although it checks a few possibly malicious things it doesn't catch everything: https://rt.perl.org/Public/Bug/Display.html?id=131079 On Fri, May 12, 2017 at 5:11 PM Andreas Mueller < andreas.muel...@biologie.uni-osnabrueck.de>

Re: Absolute path to directory of the current perl program

2017-05-27 Thread Lloyd Fournier
I'd use $*PROGRAM.absolute.IO.dirname I'm not sure why .absolute doesn't return an IO::Path object. Maybe that's being addressed as part of Zoffix++'s IO work. On Sat, May 27, 2017 at 10:07 PM Gabor Szabo wrote: > I came up with this: > > say

Re: Absolute path to directory of the current perl program

2017-05-28 Thread Lloyd Fournier
After thinking about what Zoffix said, probably what you're meant to do is: $*PROGRAM.parent.absolute Which leaves the stringification (.absolute) until last. On Sun, May 28, 2017 at 4:04 PM Lloyd Fournier <lloyd.fo...@gmail.com> wrote: > FYI: > > 15:57 < llfourn> Zoff

Re: Absolute path to directory of the current perl program

2017-05-28 Thread Lloyd Fournier
ame does not return and IO::Path object either. > > Gabor > > > On Sat, May 27, 2017 at 6:48 PM, Lloyd Fournier <lloyd.fo...@gmail.com> > wrote: > > I'd use > > > > $*PROGRAM.absolute.IO.dirname > > > > I'm not sure why .absolute doesn't return an IO::

Re: ding!

2017-05-31 Thread Lloyd Fournier
perl6 -e 'say "\a"' Will print the alarm character which causes an annoying sound on my mac. Other than that, you'll have to investigate the module ecosystem or shell out to something. LL On Thu, Jun 1, 2017 at 1:24 PM ToddAndMargo wrote: > Hi All, > > Does Perl 6 have