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

There are *.t files (raku scripts) in the "t" location, and they're
intended to exercise the *.rakumod files located under the "lib"
location.   Unless you've got every "lib" in every project on your
system included in your PERL6LIB directory, you're going to need to Do
Something if you want the *.t files to be able to find the modules
under development.


That's what something like this does:

> use lib $*PROGRAM.parent.add('../lib');

"use lib" adds that path to the locations raku will search for modules.
Here the path is determined starting with the path to the currently
running script:

   $*PROGRAM.parent

>From there we go up one more level, then look down into the lib location.

I gather that many people would change directories into the "t"
directory before running the tests there, but myself I like to just
use full paths to the tests, so my current directory might be set to
any where.   So starting at the "." doesn't really work for me.


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

2021-07-12 Thread Clifton Wood
@ToddandMargo wrote:

Now I understand.  You are using Str as a
>  skip, skip, drop 2, skip, drop 4
> This is a sequential workaround.
> Also I was confused as I though Str was only
> a type declaration and could be used this way.
> What I would like to see is direct access, without the
> skips.
> In other words, the pre-salt equivalent of
> class AA { has Str @.I is rw };
> my $CC = AA.new;
> $CC.I[400]  = "four hundred"
> $CC.I[2000] = "two thousand"
> writing out 2000 skips is not practical.


I definitely agree with you, so let's use what we know of Raku to our
advantage. A hash structure would work well, here with the
Array-Indexes-to-Use as keys:

class AA {
  has @.I;

  submethod BUILD (:$data) {
 @!I[.key] = .value for $data[]
  }

  method new (*@data) {
self.bless( data => @data )
  }
}

You can now do the following:

AA.new(2 => 'b', 4 => 66, 9 => 'apples')

Which makes for a nice initializer!

- X


Re: Windows tutorial needed (Todd?)

2021-07-12 Thread ToddAndMargo via perl6-users

On 7/12/21 2:05 PM, Tom Browder wrote:

Did you ever get your Github account?


Not completely yet.

I don't mind if someone else takes my stuff
and formalized it somewhere else.  I am
not after fame (or infamy?).



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 (emphasis on YOU) should try to write a good draft we can comment
on, that means it would be best done on your own github account. Then you
can use the web interface and edit from any browser. Plus it's easy for
other users to peruse and comment on.

You have a reputation as the primo Raku Windows user (and Windows
professional expert), so you should run your draft up the old github flag
pole and we onlookers can suggest fine tuning edits.  ;-D

-Tom

P.S. And JJ can peek in once in awhile if he wants to.


Re: Windows tutorial needed (Todd?)

2021-07-12 Thread ToddAndMargo via perl6-users

On 7/12/21 7:28 AM, Tom Browder wrote:

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  issue #3913.

...

Would you be a little more specific.  Are you looking for
an install guide?  Or something else?


Todd, did you look at the issue in the corrected link submitted by
@yary? That pretty much describes (in order of most to least
importance) the main things I would like to see in the
tutorial/checklist.

If not, please look at:  .




obtaining the Windows MSI file

installing the MSI file

how to show "Hello, Word!" at the CLI

selecting and using a suitable free or inexpensive
begnning editor to use for simple programming in Raku


I should be able to help with a few of those.  Do I post
it back to the issue and have JJ formalize it?



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  issue #3913.
...
> Would you be a little more specific.  Are you looking for
> an install guide?  Or something else?

Todd, did you look at the issue in the corrected link submitted by
@yary? That pretty much describes (in order of most to least
importance) the main things I would like to see in the
tutorial/checklist.

If not, please look at:  .


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