Re: use lib and locations in a variable

2021-07-13 Thread Elizabeth Mattijsen
> On 13 Jul 2021, at 19:07, Joseph Brenner wrote: > Bruce Gray points out "constant" works also: > > constant $lib_loc = $*PROGRAM.parent.add('../lib'); Yup. constant $foo = 42; is basically short for: BEGIN my $foo := 42

Re: use lib and locations in a variable

2021-07-13 Thread Joseph Brenner
Elizabeth Mattijsen wrote: >> Joseph Brenner wrote: >> I find that while this works: >> >>use lib $*PROGRAM.parent.add('../lib'); >> >> This doesn't work: >> >>my $lib_loc = $*PROGRAM.parent.add('../lib'); >>use lib "$lib_loc"; >> >> I get a compile time error >> >>Use of unini

Re: use lib and locations in a variable

2021-07-12 Thread Joseph Brenner
Just to clarify my use case a bit: Joseph Brenner wrote: > I want my test files to be able to find the modules they're testing > just using their relative locations, given the usual layout of "lib" > and "t" locations in parallel inside the project directory. That's like so: project

Re: use lib and locations in a variable

2021-07-12 Thread ToddAndMargo via perl6-users
On 7/11/21 11:46 PM, Elizabeth Mattijsen wrote: On 12 Jul 2021, at 00:54, ToddAndMargo via perl6-users wrote: I want the full stinkin' path, not a dot. ".".IO.full-stinkin-path; ah, no, that should be: ".".IO.absolute :-)

Re: use lib and locations in a variable

2021-07-11 Thread Elizabeth Mattijsen
> On 12 Jul 2021, at 00:54, ToddAndMargo via perl6-users > wrote: > I want the full stinkin' path, not a dot. ".".IO.full-stinkin-path; ah, no, that should be: ".".IO.absolute

Re: use lib and locations in a variable

2021-07-11 Thread ToddAndMargo via perl6-users
On 7/11/21 3:27 PM, Bruce Gray wrote: OUTPUT: ".".IO<-- again with the dot Hi Bruce, Back to the silly dot. I can hard code that myself. As far as I can tell, Raku, runs in the directory you start it in. And when I want the current directory, I want the full stinkin' path, not a dot. M

Re: use lib and locations in a variable

2021-07-11 Thread Bruce Gray
> On Jul 11, 2021, at 1:13 AM, ToddAndMargo via perl6-users > wrote: —snip-- > $*PROGRAM.parent is just a silly dot. —snip— Todd, That is true only when the program you are running happens to be in your current directory (as is very common, but not nearly universal, and not the case for

Re: use lib and locations in a variable

2021-07-11 Thread Elizabeth Mattijsen
> On 11 Jul 2021, at 01:11, Joseph Brenner wrote: > > I want my test files to be able to find the modules they're testing > just using their relative locations, given the usual layout of "lib" > and "t" locations in parallel inside the project directory. > > I find that while this works: > >

Re: use lib and locations in a variable

2021-07-10 Thread ToddAndMargo via perl6-users
On 7/10/21 4:11 PM, Joseph Brenner wrote: I want my test files to be able to find the modules they're testing just using their relative locations, given the usual layout of "lib" and "t" locations in parallel inside the project directory. I find that while this works: use lib $*PROGRAM.par

use lib and locations in a variable

2021-07-10 Thread Joseph Brenner
I want my test files to be able to find the modules they're testing just using their relative locations, given the usual layout of "lib" and "t" locations in parallel inside the project directory. I find that while this works: use lib $*PROGRAM.parent.add('../lib'); This doesn't work: m