implementing every(N)

2010-07-30 Thread Ted Zlatanov
I have a Perl 5 module called Every which provides, simply, every(5); # true on invocation 5, 10, etc. every(seconds => 5); # true at 5, 10, etc. seconds It's really nice in endless loops, logging, etc. I'd like to translate it to Perl 6 (using Rakudo specifically). Its current implementation r

Re: implementing every(N)

2010-07-30 Thread Ted Zlatanov
On Fri, 30 Jul 2010 12:19:16 -0500 "Patrick R. Michaud" wrote: PRM> On Fri, Jul 30, 2010 at 09:17:30AM -0500, Ted Zlatanov wrote: >> I have a Perl 5 module called Every which provides, simply, >> >> every(5); # true on invocation 5, 10, etc. >> every(seconds => 5); # true at 5, 10, etc. second

Re: implementing every(N)

2010-07-30 Thread Patrick R. Michaud
On Fri, Jul 30, 2010 at 09:17:30AM -0500, Ted Zlatanov wrote: > I have a Perl 5 module called Every which provides, simply, > > every(5); # true on invocation 5, 10, etc. > every(seconds => 5); # true at 5, 10, etc. seconds > > It's really nice in endless loops, logging, etc. I'd like to transla

Re: implementing every(N)

2010-08-01 Thread Moritz Lenz
Hi, Ted Zlatanov wrote: > I have a Perl 5 module called Every which provides, simply, > > every(5); # true on invocation 5, 10, etc. > every(seconds => 5); # true at 5, 10, etc. seconds > > It's really nice in endless loops, logging, etc. I'd like to translate > it to Perl 6 (using Rakudo speci

Re: implementing every(N)

2013-01-07 Thread Ted Zlatanov
On Fri, 30 Jul 2010 12:56:37 -0500 Ted Zlatanov wrote: TZ> On Fri, 30 Jul 2010 12:19:16 -0500 "Patrick R. Michaud" wrote: PRM> I suspect something like CALLER::<$?FILE> and CALLER::<$?LINE> might PRM> eventually do what you want -- they would at least get to a unique PRM> line within the ca

Re: implementing every(N)

2013-01-07 Thread Carl Mäsak
Ted (>): > Are state variables available now, or is the every(N) functionality > possible in some other way now? Why not try it by writing a small program? :) Rakudo is available at a discount right now -- download it before it's too late! -- and the syntax for state variables is the same as it's

Re: implementing every(N)

2013-01-08 Thread Ted Zlatanov
On Mon, 7 Jan 2013 17:51:52 +0100 Carl Mäsak wrote: CM> Ted (>): >> Are state variables available now, or is the every(N) functionality >> possible in some other way now? CM> Why not try it by writing a small program? :) CM> Rakudo is available at a discount right now -- download it before it'

Re: implementing every(N)

2013-01-08 Thread Patrick R. Michaud
On Tue, Jan 08, 2013 at 12:14:22PM -0500, Ted Zlatanov wrote: > On Mon, 7 Jan 2013 17:51:52 +0100 Carl Mäsak wrote: > > CM> Ted (>): > >> Are state variables available now, or is the every(N) functionality > >> possible in some other way now? > > CM> Why not try it by writing a small program? :

Re: implementing every(N)

2013-01-09 Thread Ted Zlatanov
On Tue, 8 Jan 2013 11:29:47 -0600 "Patrick R. Michaud" wrote: PRM> On Tue, Jan 08, 2013 at 12:14:22PM -0500, Ted Zlatanov wrote: >> >> Since I'm writing a module, I didn't think a one-liner was sufficient >> proof that state variables are reliable. Sorry I didn't make that >> clear. [...] P