Re: Example module and its use

2015-03-28 Thread Moritz Lenz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 28.03.2015 11:05, Tom Browder wrote: > 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 i

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

Re: Example module and its use

2015-03-28 Thread Paul Cochrane
Hi Tom, > use Bar :DEFAULT; > > but this does not: > > use Bar ; > > So is S11 in error!! That might not necessarily be the case (however S11 certainly isn't clear about exactly how to import selected routines while `use`-ing a module). All subs/methods that are marked with `is export` are

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

Re: Example module and its use

2015-03-27 Thread Nathan Brown
Hi Tom, 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; http://design.perl6.org/S11.html#Dynamic_exportation states: The default EXPORTALL handles symbol exports by removing recognized export ite

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