annoucements page on website

2024-05-13 Thread Richard Hainsworth

Hi all,

We've added a new announcements page to the Raku documentation website.

As soon as the changes propage through the tool chain - probably after 
about 10.30am UTC - whenever you open the website after a new 
announcement has been made that you have not read, you will get a popup 
of the announcement.


Once cancelled, that message should not normally appear again.

You will only see a new announcement when one is added to the top of the 
announcements page.


All announcements can be seen by looking at the new announcement page 
(link can be found in Introduction/Beginning)


You can suppress all announcement popups using a toggle that can be 
found in the navigation's More dropdown.


Richard

aka finanalyst



EBook of documentation

2024-05-09 Thread Richard Hainsworth

Hi to everyone.

We have reformatted all the documentation into an EBook! It is now 
available from the docs.raku.org website.


Click on More, then EBook, read the popup and download the book.

THIS IS A FIRST DRAFT, so there's things wrong and help is needed to get 
it right.


Why have EBook? Its an offline form of the documentation, and is smaller.

The EPUB 3 specification is targetted, but most ebook readers seem to 
require some EPUB 2 components (see below).


On a desktop, the Calibre reader and editor read the book correctly. 
Callibre is cross platform.


On an Android I have tried a couple of readers, but nothing stands out 
yet. Moon+works but doesnt like the Table of Contents (see below), One 
reader wouldnt load the book.


Problems needing help.

1. EPUB 3 differs from EPUB 2 by the Table of contents. Epub 3 requires 
and xhtml format (provided), but Epub 2 requires a ncx format (not 
provided). So first task for someone is to look at how the xhtml toc 
file is created and create a ncx one.


Most Ebook readers assume that the ncx file is available, even though 
for Epub 3 it is not required.


On doc-website, the relevant plugin is EBook/plugins/ebook-embedd.

Once the file is generated, some experimenting will be needed to work 
out how best to incorporate it into the ebook.


2. The CSS could be improved.

- the code snippets are fixed format and highlighted. Some TLC is needed 
here


3. A cover image is needed.

Regards,

Richard Hainsworth

aka finanalyst



Re: run on regex line?

2024-01-20 Thread Richard Hainsworth

Todd,

You could use Elizabeth Mattijsen's App-rak. It's a Raku utility that 
does grep, sed, awk.


Richard

On 20/01/2024 10:53, ToddAndMargo via perl6-users wrote:

On 1/20/24 01:42, William Michels via perl6-users wrote:


On Jan 19, 2024, at 23:49, ToddAndMargo via perl6-users 
 wrote:


Hi All,

Can I do a run on line with a regex like I
just did with sed?

$ zbarimg Screenshot.png | sed -e 's/.*?secret=//' -e 's/&.*//'

Usually I just do two lines in Raku.

Many thanks,
-T



Hi Todd,

Not that I am aware. The naive way is just to pipe them:

~$ echo 'roses are red' | raku -pe 's/roses/lilacs/' | raku -pe 
's/red/blue/'

lilacs are blue


The Raku way would be combining those two statements into one Raku call:

~$ echo 'roses are red' | raku -pe 's/roses/lilacs/; s/red/blue/'
lilacs are blue



I like this one! It is easy to figure out at a glance.



#OR ("big-S" notation below)

~$ echo 'roses are red' | raku -ne 'S/roses/lilacs/ andthen 
S/red/blue/.put'

lilacs are blue


The `andthen` call reloads the `$_` topic variable. For more 
examples, see:


https://stackoverflow.com/questions/65066358/concatenating-s-in-raku 



HTH, Bill


It does.  Thank you!

Raku's regex's spoil me.  sed has to be
the editor from ...

Then again, I still use vi at times.


Re: Marketing / PR / Branding

2023-10-31 Thread Richard Hainsworth

Thanks Marton for the clearer explanation and link!

Sorry to everyone else for not including the link

On 31/10/2023 13:48, Polgár Márton wrote:


There is a thematic page on Github for a while called Discussions. In 
the case of the Raku/problem-solving repository, it's second next to 
Issues, and next to Pull requests. The direct link to this particular 
discussion is https://github.com/Raku/problem-solving/discussions/395.


On 2023. 10. 31. 14:46, Tom Browder wrote:
On Tue, Oct 31, 2023 at 08:41 Fernando Santagata 
 wrote:


Hi Richard,

Where is the Raku/Problem-solvers discussion about PR?


Ditto

Marketing / PR / Branding

2023-10-31 Thread Richard Hainsworth

Hi,

I just posted a new discussion in the Raku/Problem-solvers discussion 
about the subject.


The idea is to brain storm about where to go with Raku marketing / PR / 
branding. So if you have some ideas / point of view, please contribute.


Regards,

Richard, aka finanalyst



New search for Raku documentation page

2023-09-15 Thread Richard Hainsworth

Hi everyone,

A new search facility has been developed for the Raku documentation 
site. It would be useful to get some feedback.


The new search can be tested at 'https://new-raku.finanalyst.org'. Try 
clicking on the 'i' button next to the search panel for information.


The search interface is as close as possible to the previous interface 
(which is still in use on docs.raku.org and docs-dev.raku.org).


Please comment in the issue opened on github.com/Raku/doc-website

Several shortcuts  have been added, and feedback on which shortcuts to 
have  as defaults would be helpful. Ditto for the default values of some 
options.


Regards,

Richard Hainsworth, aka finanalyst



Reminder about RakuDoc

2023-08-19 Thread Richard Hainsworth
A quick reminder to this list that comments are open for the RakuDoc 
revision.


The document can be see at https://github.com/Raku/RakuDoc-GAMMA

Other information about the process can be found in the README

Richard

aka finanalyst



Re: A question on AND

2023-06-30 Thread Richard Hainsworth

I tried this and it worked without any problem.

Here's the whole program:

use v6.d;
say @*ARGS.raku;
if @*ARGS.elems > 0 && "@*ARGS[0]".lc eq "debug" {
say 'got' }
and at the terminal:

$ raku todd-test.raku debug --debug=50
["debug", "--debug=50"]
got


FWIW
why are you quoting ARGS? The .lc coerces to string anyway.
why are you using && and not 'and'
why are you not using a sub MAIN with an optional --debug
eg. sub MAIN( @args, Bool :$debug=False) {
#stuff
if $debug { ... }


On 30/06/2023 06:06, ToddAndMargo via perl6-users wrote:

if @*ARGS.elems > 0  &&  "@*ARGS[0]".lc eq "debug"  {...}

Re: Need regex in the middle wildcard help

2023-06-19 Thread Richard Hainsworth

HI Todd,

Some more clean up:

On 19/06/2023 12:41, ToddAndMargo via perl6-users wrote:



This is my test program:


#!/bin/raku

print "\n";
my Str $x = Q[href="wike-2.0.1-1.fc38.noarch.rpm">wike-2.0.1-1.fc38.noarch.rpm 
27-Apr-2023 01:53  143K] ~
 Q[href="wine-8.6-1.fc38.i686.rpm">wine-8.6-1.fc38.i686.rpm 
19-Apr-2023 21:48  11K] ~
 Q[href="wine-8.6-1.fc38.x86_64.rpm">wine-8.6-1.fc38.x86_64.rpm 
 19-Apr-2023 21:48 11K] ~
 Q[href="wine-alsa-8.6-1.fc38.i686.rpm">wine-alsa-8.6-1.fc38.i686.rpm 
  19-Apr-2023 21:48  223K];


$x~~m:i/  .*? ("wine")  (.*?)  $(Q[">] )  .*?  $( Q[a href="] )  
(.*?) ( $(Q[">] ) )  /;


print "0 = <$0>\n1 = <$1>\n2 = <$2>\n\n";

my Str $y = $0 ~ $1 ~ " " ~ $2;
print "$y\n\n";



$ RegexTest.pl6

0 = 
1 = <-8.6-1.fc38.i686.rpm>
2 = 

wine-8.6-1.fc38.i686.rpm wine-8.6-1.fc38.x86_64.rpm



After Joseph's help:
  $SysRev  = $WebPage;
  $SysRev~~m:i/  .*? ("wine")  (.*?)  $(Q[">] )  .*?  $( Q[a 
href="] )  (.*?)  ( $(Q[">] ) )  /;

  $SysRev = $0 ~ $1 ~ "   " ~ $2;



maybe the following would be a bit more Raku-ish

[in file called todd-test.raku]

$=finish ~~ /:i ['href="' ~ \" $ = ( 'wine-' \d .+? ) .*? ]+ $ /;
say $/.join(' ');

=finish wike-2.0.1-1.fc38.noarch.rpm 
27-Apr-2023 01:53  143K
wine-8.6-1.fc38.i686.rpm 19-Apr-2023 
21:48  11K
wine-8.6-1.fc38.x86_64.rpm 
19-Apr-2023 21:48 11K
wine-alsa-8.6-1.fc38.i686.rpm  
19-Apr-2023 21:48  223K

[end of todd-test.raku]
Test it in a terminal:

$ raku todd-test.raku
wine-8.6-1.fc38.i686.rpm wine-8.6-1.fc38.x86_64.rpm

Some comments.
1) `=finish` is an undocumented part of the POD6 specification (I only 
discovered it recently). It will be documented soon.
Anything after `=finish` is put in string that can be pulled into a Raku 
program with `$=finish` (also undocumented)
`=finish` was introduced instead of Perl's `__DATA__`.
It is useful, because if you have alot of text to be experimented on, just 
attach the text to the bottom of the program after a =finish
2) `~~` does not need a `m` (you only need 'm' if you want to associated a 
regex with the topic, eg. $_)
3) the /  'begin' ~ 'end' 'regex'  / syntax means match the regex between 
'begin' and 'end'.
4) The final output has a 'wine' in it, so why search for it separately? Just 
include it in the search.
5) You seem to be looking for a 'wine-' followed by a digit, so as to eliminate 
the 'wine-alsa-' line, so look for that
6) '$=' places the match into $/ of the whole match. Multiple matches 
create an array.
7) `$/.join` takes an array and joins it with a separator.
8) In the original code, all the $() and Q[] add noise without any 
disambiguation.

But then we want to pull out interesting bits and we are not interested in the 
rest. So `comb` is better.

[start of test-2.raku]

$=finish.comb(/ 'wine-' \d .+?  /).join(' ').say;

=finish wike-2.0.1-1.fc38.noarch.rpm 
27-Apr-2023 01:53  143K
wine-8.6-1.fc38.i686.rpm 19-Apr-2023 
21:48  11K
wine-8.6-1.fc38.x86_64.rpm 
19-Apr-2023 21:48 11K
wine-alsa-8.6-1.fc38.i686.rpm  
19-Apr-2023 21:48  223K

[end of test-2.raku]


Same output.

Notes:
1) comb looks for all matches in a string, so no need for the repeat and end of 
line in the regex
2) We are looking for something 'after' a 「"」 and 'before' a second 「"」, and so we can use 
the  and  zero-width matchers.

Richard, aka finanalyst








Re: Upcoming documentation meetings

2023-02-06 Thread Richard Hainsworth

I thought it was for 2nd Saturday, which is the 11-th

On 04/02/2023 23:13, Ralph Mellor wrote:

That's super short notice but if you mean EST, so 5pm UK time,
it would work for me.

On Fri, Feb 3, 2023 at 7:07 PM Will Coleda  wrote:

I can do a test tomorrow at noon if there's interest.

On Fri, Feb 3, 2023 at 10:27 AM Parrot Raiser <1parr...@gmail.com> wrote:

I think I had problems finding the audio options on Jitsi, and wasted
a couple of meetings doing so. I'd suggest a "test" setup meeting,
where the whole agenda is ensuring that everyone has all the settings
right. Maybe set up a static video shot with background music to give
feedback?

On 2/2/23, Elizabeth Mattijsen  wrote:

On 2 Feb 2023, at 21:11, Ralph Mellor  wrote:
My internet is flakey when humidity is around 80%+ and the weather
forecast suggests it may be but with luck I'll be "there" 5pm UK time
(noon EST, 9am US west coast time) Saturday Feb 11.

If you switch off your camera, you will reduce the needed bandwidth
significantly.  But I guess I don't need to tell you that  :-)


Liz


Re: How in Raku can a symlink be edited to a new target, if the target is a directory.

2022-11-07 Thread Richard Hainsworth

Ignore this message.

It turns out I had set up my file structure incorrectly, so the 
description below is wrong and the problem is elsewhere. Raku handles a 
symlink to a directory correctly.


On 07/11/2022 9:55 am, Richard Hainsworth wrote:
I want - in a Raku program - update a symlink from 'plug-v1' to 
'plug-v2', where both plug-v1 and plug-v2 are sub-directories of 
'src'. The symlink is 'plug'.


I am using Ubuntu.

First time I create symlink with

'src/plug-v1'.IO.symlink( 'plug' );

If now I want to change the link, then the following

'src/plug-v2'.IO.symlink( 'plug' );

causes the error:

Failed to symlink file: file already exists

This is understandable.

So then I tried

'plug'.IO.unlink if 'plug'.IO ~~ :e;

'src/plug-v2'.IO.symlink( 'plug' );

This seems to work in a test file in which I create the directories 
then symlink and unlink.


However, when I try this sequence in a Raku script on a symlink that 
exists before the program runs, I get the error


Failed to delete file: illegal operation on a directory in block 
 at test.raku line 18


where line 18 corresponds to the " 'plug'.IO.unlink " statement.

Looking at the documentation for "*nix", I see that in some flavours 
of Unix, 'unlink' deletes a directory, rather than removing a symlink. 
I can see therefore that since 'plug' is a symlink to a directory, 
Raku is forbidding the operation.


There are some options to unlink that seem to get round this problem, 
but those options do not seem to exist (or are not documented) in Raku.


How do I achieve programatically in Raku an edit of a symlink to a new 
target, if the target is a directory.




How in Raku can a symlink be edited to a new target, if the target is a directory.

2022-11-07 Thread Richard Hainsworth
I want - in a Raku program - update a symlink from 'plug-v1' to 
'plug-v2', where both plug-v1 and plug-v2 are sub-directories of 'src'. 
The symlink is 'plug'.


I am using Ubuntu.

First time I create symlink with

'src/plug-v1'.IO.symlink( 'plug' );

If now I want to change the link, then the following

'src/plug-v2'.IO.symlink( 'plug' );

causes the error:

Failed to symlink file: file already exists

This is understandable.

So then I tried

'plug'.IO.unlink if 'plug'.IO ~~ :e;

'src/plug-v2'.IO.symlink( 'plug' );

This seems to work in a test file in which I create the directories then 
symlink and unlink.


However, when I try this sequence in a Raku script on a symlink that 
exists before the program runs, I get the error


Failed to delete file: illegal operation on a directory in block  
at test.raku line 18


where line 18 corresponds to the " 'plug'.IO.unlink " statement.

Looking at the documentation for "*nix", I see that in some flavours of 
Unix, 'unlink' deletes a directory, rather than removing a symlink. I 
can see therefore that since 'plug' is a symlink to a directory, Raku is 
forbidding the operation.


There are some options to unlink that seem to get round this problem, 
but those options do not seem to exist (or are not documented) in Raku.


How do I achieve programatically in Raku an edit of a symlink to a new 
target, if the target is a directory.




Re: BEGIN {} question

2022-09-01 Thread Richard Hainsworth
On Wed, 31 Aug 2022, 00:59 ToddAndMargo via perl6-users, <
perl6-users@perl.org> wrote:

> On 8/30/22 13:34, Richard Hainsworth wrote:
> > Hi Todd,
> >
> 
> > Since you continue for ever to complain about 'compile' time issues,
>
> "Stage parce" is specifically what I am whining about
>
> > rather than startup times, I wonder whether the programs you write are
> > massive monolithic lines of code with thousands of lines, much like most
> > standard software when FORTRAN or COBOL were the high level languages,
> > or whether you design things to make each section more manageable.
>
>
> $ raku -c --stagestats GetUpdates.pl6
> Stage start : 0.000
> Stage parse : 17.851
> Stage syntaxcheck: Syntax OK
>
> Perl 5 does it over 300 times faster on the code I ported
>
Raku and Perl are two different languages in the same family. They evolved
with different targets, perl to react quickly to internet requests, Raku to
be a better programming language. This may not be the take the actual
developers have, but it's what I think happened.

So the thing you designed for Perl will be faster because it fits the
pattern. But it's not the best way for Raku. Even though stage parse will
get significantly faster over time because Raku was designed to be
optimisable, I think Perl will always be faster.

Having said that Raku is still better because it separates out things that
should be separate. So you may need to change the way you handle your task.
Work with Raku rather than expect it to be the same as Perl.

>
> >
> > If the programs you write to be run from the command line are thousands
> > of lines long, then yes!! you will suffer!!! from long startup times

Think about the difference between start up and parsing. Move as much stuff
away from parsing as possible.

> > because the program is re-compiled EVERY time. However, if you redesign
> 
>
> Hi Richard,
>
> Long time no talk to you either.  Don't be a stranger.
> (If you like, I can always "whine" about compile times
> to get your attention, if you like.  Chuckle.)
>
> Thank you.  That letter took a lot of work!
>
> How does this sound?
>
No. I think you are missing the explicit difference being made in Raku,
which differs from all other languages I know (explicit since one could
argue C preprocessing  does the Sam)  between compile time and run time.
Raku explicitly allows you to specify compile time actions in the program
itself. By saying above / below, this indicates a linear view of code at
the same time.
This distinction will become even greater when the new Macros are
incorporated. That's the next version of Raku.

>
>   BEGIN is a special block of code called a "phaser"
>   that runs at compile time.  It will see any code
>   above it, such as variables and  imported modules,
>   but not below it.
>
> Snip
>
> Can you show me an example of FIRST and LAST
>
> There are some in the documentation
>


>
> Where .precomp does not work for me is my software
> updates program.  This is a behemoth program (imports
> six of my custom modules too) that goes out and checks
> for software updates that I support at my customer
> sites.  it is about 70 programs.
>
Change the way you do this to be more compliant with the realities of Raku.
You may find in the refactoring process that your old way is probably
subject to bit rot.

>
> To do this open the web site with firefox.  Then I
> use their developer's tools to examine the page's
> source code.  I find the fragment I am looking
> for and regex them to extract them.
>
> In the process, I goof the regex/s "A LOT".  Not
> to mention  having to chase down hidden character
> that do not appear in Firefox's page source.
> And download that are different on a web browser
> than with curl.
>
> I do have a function that allows me to only run that
> one web site's extraction, so I do not have to go
> through all 70 of them.
>
> So, I have to recompile the code maybe up to 20 times
> depending on the difficulty of the web site.  The
> L-O-N-G delays drives me nuts.
>
Treat the regexes as data for a program. Compile the program once. Run the
regexes as often as you need.

>
> Snip.
>
> Speaking of BEGIN, is this Raku's "parallel
> processing" method?  Does Raku have a way to
> spawn parallel processes and have them talk to
> each other?
>
> -T
>
> Concurrency is a major change that Raku does differently. But it bursts my
> head. Because concurrency is hard!
>


>
>
>
>
>
>
>


Re: BEGIN {} question

2022-08-30 Thread Richard Hainsworth

Hi Todd,

Long time no see.

Re your 'keeper'. There is a reason why things are called the way they 
are in Raku (aka Perl6). BEGIN is NOT a special subroutine.


BEGIN is a phaser. And it introduces a block. Blocks are not subroutines 
(subs). Even though blocks and subs (and methods and callables) are code 
related things, a sub can take a signature, but a block cannot. You can 
pass arguments to a block using pointy syntax, eg -> $x, %y {  ... }, 
which is why it is possible to do things like 'for %some-hash.kv -> 
$key, $value {  }'. The 'for' takes a block, which can be pointy. 
'for' does not take a special subroutine.


But a sub can have a parameter list, eg., 'sub (Int $b where *>= 10) { 
say %b }; ' The 'where' bit means that the compiler will put in checks 
that $b is always greater-equal to 10. So subs are far far more than blocks.


Also you cannot return from a block, but you can return from a sub.

So, by putting in your keeper that BEGIN is a special subroutine, you 
are ignoring a whole world of Raku goodness, as well as making it 
difficult for yourself to understand other phasers.


And talking of phasers, there are some really useful ones, like FIRST 
and LAST, that are in loops. So if you want something to happen first 
time in a loop, put it in FIRST { }.


Also I see you are on the compile time whine again. When perl6 first 
became available as 'pugs', it did take FOREVER. Then as more of perl6 
became implemented as rakudo, startup times became slower.


Things changed when modules were precompiled. I really do not understand 
what you are talking about when you say you don't think precompile is 
useful everywhere.


For example, when I write something that is called from the command line 
(for example in my raku-collection-raku-documentation distribution), I 
have a one-liner raku program 'RakuDoc' that just says 'use 
Collection::RakuDoc'.


EVERYTHING else is in the module Collection::RakuDoc, all the MAIN 
subroutines, and stuff. That then only gets compiled once. So, the first 
time RakuDoc is called from the command line, there is a startup delay 
because the whole module is compiled. Every other time RakuDoc is 
called, its really so fast I don't notice a problem. Only the *one* line 
is compiled each time the program is called. All the rest is in 
precompiled form.


Same with my Extractor program, which is in the raku-extraction module. 
This is a GUI program that takes the rakudoc (aka POD6) files and 
converts them into markdown. For example, I write the README's for my 
github repos as README.rakudoc, then use Extractor to turn it into a 
README.md. The result is far better because the rakudoc renderer I use 
(from my pod-render distribution) automatically collects all the headers 
and puts them into a Table of Contents. If you've tried to do a TOC in 
markdown, you know what a hassle it is.


But Extractor is a GTK::Simple program. And GTK::Simple takes forever to 
precompile. But once done, I don't notice any startup time.


And I change my software quite a lot, so every time I change something, 
yes, startup is slow the first time, but not the next time. Surely, you 
use a piece of software more than once.


Compared to the OLD days, rakudo programs react like lightning. Design 
your software properly, and you wont - as a human - notice much of a delay.


I think the startup complaint (not the compile time for something) has 
been effectively relegated to the days when rakudo was young. So whilst 
in the past I truly sympathised with your rants about compile times, I 
am now quite confused and I find sympathy hard to come by.


Since you continue for ever to complain about 'compile' time issues, 
rather than startup times, I wonder whether the programs you write are 
massive monolithic lines of code with thousands of lines, much like most 
standard software when FORTRAN or COBOL were the high level languages, 
or whether you design things to make each section more manageable.


If the programs you write to be run from the command line are thousands 
of lines long, then yes!! you will suffer!!! from long startup times 
because the program is re-compiled EVERY time. However, if you redesign 
the code, putting things into classes, roles, subroutines, and Raku-y 
goody things, you can push stuff into modules, and reduce your calling 
program to a single line.


When you change your software, do you change every part of it every 
time? Or do you change some client related interface part? Put the 
interface part into one module, and the other more stable functionality 
into other modules. Then when you change the interface part, you dont 
change the other modules. They have already been compiled. So the first 
time you start up your program, only the section you have changed gets 
recompiled, not the entire monolith.


By the way, I assume that you understand the Raku meaning of 'module', 
as opposed to a 'distribution'. When I write a large piece of software, 
I 

Rakudoc - make the naming consistent

2022-07-19 Thread Richard Hainsworth
With the change from Perl 6 to Raku, there were a number of naming 
changes, particularly of file formats, eg pl6 -> raku, pm6 -> rakumod.


One of the changes was `.pod6` to `.rakudoc` for files that are 
primarily documentation files.


However, we continue to refer to POD6 (also known as Pod6) as the name 
of the markup language for Raku documentation. POD6 comes from Perl's 
markup language and comes from Plain Old Documentation, together with 
the 6 version.


My recommendation is to rename the markup language as `Rakudoc`. This is 
consistent with the file format name.


This is a minor change and will not affect many people at all. It will 
not affect the operation of any program constructs.


However, without a consensus, references to the markup language as 
Rakudoc instead of POD6 might cause confusion.





Re: Using fez

2022-07-11 Thread Richard Hainsworth

Vadim and Liz,

Thank you for this clue.

I seem to be behind on this. I do not use App::Mi6

I try to keep to the documentation on Modules.pod6, and I have updated 
Modules.pod6 every time I learn something more.


It seems to me that there should be some more explanation in 
Modules.pod6 for sharing a module, including some ideas about how to use 
App::Mi6


I looked at module development utilities (modules-extra.pod6), but it is 
so minimalist that it is meaningless to me.


Richard

On 10/07/2022 8:41 pm, Vadim Belman wrote:

Hi,

Liz has probably missed the point of your question. Yes, you must do fez upload 
for each new release. It means each time you'd need to do some pre-release 
preparations to create an archive, etc... The fastest way is to switch to 
App::Mi6 for building distributions. My approach is a makefile plus helper 
scripts I include as a submodule for nearly each project I develop because mi6 
doesn't cover my needs.

Best regards,
Vadim Belman


On Jul 10, 2022, at 11:38 AM, Richard Hainsworth  wrote:

I have begun uploading modules to fez.

Suppose a module is in active development. And I have v0.7.1, then v0.7.2 etc. 
Do I need to upload each version, or will fez automatically provide the most 
updated module?

When p6c was the main ecosystem, the reference was to github. So, the latest 
version on github was used, and zef would use whatever was on github.




Re: Is this zef or me: Inconsistent Ecosystem response

2022-06-29 Thread Richard Hainsworth
The problem is cured by uploading the latest version of the dependent 
module to fez.


A `zef search Raku::Pod::Render` should list v3.7.6

On 29/06/2022 3:11 pm, Fernando Santagata wrote:

Hi Richard,
I tried 'zef search Raku::Pod::Render' and I can only see versions 
from v2.1 through v3.7.3.

If your last version is v3.7.5 there's something missing for sure.

On Wed, Jun 29, 2022 at 2:50 PM Richard Hainsworth 
 wrote:


Hi,

zef appears to be giving inconsistent results.

I have updated several of my modules. But when I try the github
actions to test an update a module that depends on one updated, it
does not recognise the most recent module, only a version I
changed some time ago.

I have a module called Raku::Pod::Render the latest version is v3.7.5

When I use `zef info "Raku::Pod::Render" ` on my local machine, I get

zef info "Raku::Pod::Render"

===> Updating fez mirror:http://360.zef.pm/
===> Updated fez mirror:http://360.zef.pm/
===> Updating p6c 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updating cpan 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
===> Updated p6c 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updated cpan 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
- Info for: Raku::Pod::Render
- Identity: Raku::Pod::Render:ver<3.7.5>:auth
- Recommended By: Zef::Repository::Ecosystems
- Installed: Yes
Description:     A generic Pod6 Renderer with custom Pod::Blocks, 
FormatCodes for one or more files using templates, provides HTML and MarkDown.
License:     Artistic-2.0
Source-url:     git://github.com/finanalyst/raku-pod-render.git  
<http://github.com/finanalyst/raku-pod-render.git>
Provides: 12 modules
Support:
#   bugtracker:https://github.com/finanalyst/raku-pod-render/issues
#   source:https://github.com/finanalyst/raku-pod-render.git
#   email:richard@hainsworth.wales
Depends: 14 items

I have another module called Raku-Pod-Extraction, which "depends
on" Raku::Pod::Render:v<3.7.5+>

My github workflow file is

name: "Raku"
on: [ push, pull_request ]
jobs:
   raku:
     strategy:
   matrix:
     os:
   - ubuntu-latest
     raku-version:
   - 'latest'
     runs-on: ${{ matrix.os }}
     steps:
   - name: Checkout
     uses: actions/checkout@v2
   - uses: Raku/setup-raku@v1
     with:
   raku-version: ${{ matrix.raku-version }}
   - name: Check zef info
     run: zef info "Raku::Pod::Render"
   - name: Install Dependencies
     run: zef install --/test --test-depends --deps-only .
   - name: Install App::Prove6
     run: zef install --/test App::Prove6
   - name: Run Tests
     run: prove6 -I. t

As you can see, I run the zef info line for Raku::Pod::Render. I
am getting the following response (this happens after I used
exactly the same command locally)

Run zef info "Raku::Pod::Render"
===> Updating fez mirror:https://360.zef.pm/
- Info for: Raku::Pod::Render
- Identity: Raku::Pod::Render:ver<3.7.3>:auth
- Recommended By: Zef::Repository::Ecosystems
- Installed: No
===> Updated fez mirror:https://360.zef.pm/
Description:     A generic Pod6 Renderer with custom Pod::Blocks, 
FormatCodes for one or more files using templates, provides HTML and MarkDown.
===> Updating rea 
mirror:https://raw.githubusercontent.com/Raku/REA/main/META.json
License:     Artistic-2.0
===> Updated rea 
mirror:https://raw.githubusercontent.com/Raku/REA/main/META.json

Source-url:https://raw.githubusercontent.com/raku/REA/main/archive/R/Raku%3A%3APod%3A%3ARender/Raku%3A%3APod%3A%3ARender%3Aver%3C3.7.3%3E%3Aauth%3Cgithub%3Afinanalyst%3E.tar.gz
Provides: 12 modules
Support:
#   source:https://github.com/finanalyst/raku-pod-render.git
#   bugtracker:https://github.com/finanalyst/raku-pod-render/issues
#   email:richard@hainsworth.wales
Depends: 14 items

Furthermore, another user raised an issue in the github repo of
Raku::Pod::Render and seems to have had the same problem
installing Raku::Pod::Render

The Raku::Pod::Render:ver<3.7.3> has an error in it, which I
fixed. But now the Ecosystem appears to be acting inconsistently.



--
Fernando Santagata

Is this zef or me: Inconsistent Ecosystem response

2022-06-29 Thread Richard Hainsworth

Hi,

zef appears to be giving inconsistent results.

I have updated several of my modules. But when I try the github actions 
to test an update a module that depends on one updated, it does not 
recognise the most recent module, only a version I changed some time ago.


I have a module called Raku::Pod::Render the latest version is v3.7.5

When I use `zef info "Raku::Pod::Render" ` on my local machine, I get

zef info "Raku::Pod::Render"

===> Updating fez mirror:http://360.zef.pm/
===> Updated fez mirror:http://360.zef.pm/
===> Updating p6c 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updating cpan 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
===> Updated p6c 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/p6c1.json
===> Updated cpan 
mirror:https://raw.githubusercontent.com/ugexe/Perl6-ecosystems/master/cpan1.json
- Info for: Raku::Pod::Render
- Identity: Raku::Pod::Render:ver<3.7.5>:auth
- Recommended By: Zef::Repository::Ecosystems
- Installed: Yes
Description:     A generic Pod6 Renderer with custom Pod::Blocks, FormatCodes 
for one or more files using templates, provides HTML and MarkDown.
License:     Artistic-2.0
Source-url:     git://github.com/finanalyst/raku-pod-render.git
Provides: 12 modules
Support:
#   bugtracker:https://github.com/finanalyst/raku-pod-render/issues
#   source:https://github.com/finanalyst/raku-pod-render.git
#   email:richard@hainsworth.wales
Depends: 14 items

I have another module called Raku-Pod-Extraction, which "depends on" 
Raku::Pod::Render:v<3.7.5+>


My github workflow file is

name: "Raku"
on: [ push, pull_request ]
jobs:
  raku:
    strategy:
  matrix:
    os:
  - ubuntu-latest
    raku-version:
  - 'latest'
    runs-on: ${{ matrix.os }}
    steps:
  - name: Checkout
    uses: actions/checkout@v2
  - uses: Raku/setup-raku@v1
    with:
  raku-version: ${{ matrix.raku-version }}
  - name: Check zef info
    run: zef info "Raku::Pod::Render"
  - name: Install Dependencies
    run: zef install --/test --test-depends --deps-only .
  - name: Install App::Prove6
    run: zef install --/test App::Prove6
  - name: Run Tests
    run: prove6 -I. t

As you can see, I run the zef info line for Raku::Pod::Render. I am 
getting the following response (this happens after I used exactly the 
same command locally)


Run zef info "Raku::Pod::Render"
===> Updating fez mirror:https://360.zef.pm/
- Info for: Raku::Pod::Render
- Identity: Raku::Pod::Render:ver<3.7.3>:auth
- Recommended By: Zef::Repository::Ecosystems
- Installed: No
===> Updated fez mirror:https://360.zef.pm/
Description:     A generic Pod6 Renderer with custom Pod::Blocks, FormatCodes 
for one or more files using templates, provides HTML and MarkDown.
===> Updating rea 
mirror:https://raw.githubusercontent.com/Raku/REA/main/META.json
License:     Artistic-2.0
===> Updated rea 
mirror:https://raw.githubusercontent.com/Raku/REA/main/META.json
Source-url:https://raw.githubusercontent.com/raku/REA/main/archive/R/Raku%3A%3APod%3A%3ARender/Raku%3A%3APod%3A%3ARender%3Aver%3C3.7.3%3E%3Aauth%3Cgithub%3Afinanalyst%3E.tar.gz
Provides: 12 modules
Support:
#   source:https://github.com/finanalyst/raku-pod-render.git
#   bugtracker:https://github.com/finanalyst/raku-pod-render/issues
#   email:richard@hainsworth.wales
Depends: 14 items

Furthermore, another user raised an issue in the github repo of 
Raku::Pod::Render and seems to have had the same problem installing 
Raku::Pod::Render


The Raku::Pod::Render:ver<3.7.3> has an error in it, which I fixed. But 
now the Ecosystem appears to be acting inconsistently.


how to handle too many threads?

2022-03-08 Thread Richard Hainsworth

Briefly

I have lots of tests that individually run with no fails, but when run 
together I get a really strange run-time error:


MoarVM oops: insert conflict, java is 437938227, 9 != 17

I think too many threads are being used.

I'm not asking someone else to solve this problem, but for assistance so 
that I can.


I would like some help on a strategy to find what/where the problem is, 
and how to prevent the error.


More detail:

I have over 15 test files, xt/000-meta-file.t to 
xt/100-html/015-css-addition.t.


When I run each test file individually, especially 
xt/100-html/015-css-addition.t, they pass all tests.


When I run the test files together, they fail at 
xt/100-html/015-css-addition.t


I have the same behaviour when using prove6 and prove as the test runner.

Sometimes the failure is shown as a specific failed test within the test 
file [xt/100-html/015-css-addition.t] (again, the test itself passes).


However, I also got output (see below), which indicates (I think) that 
too many threads have been requested.


Towards the bottom of the messages is 
`Cro::WebApp::Template::Repository::Build`, which is a module of mine 
built on top of `Cro::WebApp::Template::Repository`. So the problem 
would seem to be there, although it uses Monitors. 
'xt/100-html/015-css-addition.t' is not the first test file in which the 
functionality of `Cro::WebApp::Template::Repository::Build`is used.


Output of run is:

xt/000-meta-file.t ... ok

xt/005-templates.t ... ok

xt/006-detect-templater.t  ok

xt/010-templates-mustache.t .. ok

xt/015-templates-file.t .. ok

xt/020-custom-container-templates.t .. ok

xt/025-Placement.t ... ok

xt/030-page-components.t . ok

xt/035-pod-meta-data.t ... ok

xt/040-filewrap.t  ok

xt/050-plugin.t .. ok

xt/060-custom-formatting-codes.t . ok

xt/070-gist.t  ok

xt/100-html/010-basic.t .. ok

xt/100-html/015-css-addition.t ...1/13MoarVM oops: insert conflict, java is 
437938227, 9 != 17

   at :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:numish)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:number:sym)

 from gen/moar/stage2/QRegex.nqp:1685  
(/opt/rakudo-pkg/bin/../share/nqp/lib/QRegex.moarvm:!protoregex)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:number)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:value:sym)

 from gen/moar/stage2/QRegex.nqp:1685  
(/opt/rakudo-pkg/bin/../share/nqp/lib/QRegex.moarvm:!protoregex)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:value)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:type_constraint)

 from gen/moar/Grammar.nqp:2677  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:parameter)

 from gen/moar/Grammar.nqp:2657  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:signature)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:multisig)

 from gen/moar/Grammar.nqp:2435  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:routine_def)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:routine_declarator:sym)

 from gen/moar/stage2/QRegex.nqp:1685  
(/opt/rakudo-pkg/bin/../share/nqp/lib/QRegex.moarvm:!protoregex)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:routine_declarator)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:term:sym)

 from gen/moar/stage2/QRegex.nqp:1685  
(/opt/rakudo-pkg/bin/../share/nqp/lib/QRegex.moarvm:!protoregex)

 from :1  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:term)

 from gen/moar/Grammar.nqp:3711  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:termish)

 from gen/moar/stage2/NQPHLL.nqp:1249  
(/opt/rakudo-pkg/bin/../share/nqp/lib/NQPHLL.moarvm:EXPR)

 from gen/moar/Grammar.nqp:3754  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:EXPR)

 from gen/moar/Grammar.nqp:962  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:statement)

 from gen/moar/Grammar.nqp:890  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:statementlist)

 from gen/moar/stage2/NQPHLL.nqp:1471  
(/opt/rakudo-pkg/bin/../share/nqp/lib/NQPHLL.moarvm:LANG)

 from gen/moar/Grammar.nqp:1342  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:FOREIGN_LANG)

 from gen/moar/Grammar.nqp:838  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:comp_unit)

 from gen/moar/Grammar.nqp:553  
(/opt/rakudo-pkg/bin/../share/perl6/lib/Perl6/Grammar.moarvm:TOP)

 from gen/moar/stage2/QRegex.nqp:2267  
(/opt/rakudo-pkg/bin/../share/nqp/lib/QRegex.moarvm:parse)

 from gen/moar/stage2/NQPHLL.nqp:2301  
(/opt/rakudo-pkg/bin/../share/nqp/lib/NQPHLL.moarvm:parse)

 from 

Re: Removing ' characters

2022-01-10 Thread Richard Hainsworth

Aha. Thanks

On 10/01/2022 15:59, Gianni Ceccarelli wrote:

On Mon, 10 Jan 2022 15:41:04 +
Richard Hainsworth  wrote:


Using REPL I got

  > my $s = '\'\''
''
  > $s.subst( / \' ~ \' (.+) /, $0)
Use of Nil in string context
    in block  at  line 1

That error message (which is a bit LTA) refers to the `$0`. As
https://docs.raku.org/routine/subst#Callable shows, you need to write:

 $s.subst( / \' ~ \' (.+) /, { $0 })


  > my $t = '{}'
{}
  > $t.subst( / \{ ~ \} (.+) /, $0)


This only appear to work because you're running it in the same REPL
session; the previous `subst` had the side-effect of setting `$0`
(well, it sets `$/`, but `$0` is an alias for `$/[0]`…)



Removing ' characters

2022-01-10 Thread Richard Hainsworth
If a string is enclosed in ' characters, and I want to remove the 
bracketing ', how do I do it?


Seems like ' is not a normal character, or is it because its not a 
bracketing character?


Using REPL I got

> my $s = '\'\''
''
> $s.subst( / \' ~ \' (.+) /, $0)
Use of Nil in string context
  in block  at  line 1

> my $t = '{}'
{}
> $t.subst( / \{ ~ \} (.+) /, $0)



For clarity

raku -v

Welcome to Rakudo™ v2021.12.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2021.12.




Re: update: meta data in Pod Block

2022-01-03 Thread Richard Hainsworth

Rakudo v2031.03 

Have I been asleep for a decade?

My Rakudo is v2021.12.

I'm not sure what context you are using, so why you are getting errors. 
POD6 commands do not work with REPL.


Here is the contents of a test file, which can be run with 'prove6 -v 
t/config.t' assuming the following are in 't/config.t'


The first three tests are in the Roast test suite and have been passing 
for years. I'm not aware they fail with any version of Rakudo.


The =defn test is related to my earlier email and shows that Definition 
lists cannot contain embedded POD6.



use Test;
plan 8;
my $p = 0;
my $r;

=begin pod =for DESCRIPTION :title = :authorBrown> :pubdate(2011) =end pod $r = $=pod[$p++].contents[0];

is $r.config, 'presentation template';
is $r.config, 'John Brown';
is $r.config, 2011;

=begin pod =for head1 :attr('key') :battr This is a working header 
=for head1 = :attr('key') :battr
This is what is being tested =defn Bad boy When you Bto include 
formating. Outside a definition list Bis treated differently. 
=end pod $r = $=pod[$p++];


is $r.contents[0].config, 'key', "'attr' is found in first header config";
is $r.contents[1].config, 'key', "'attr' is found in second header 
config";
isa-ok $r.contents[2], Pod::Defn, 'third item is a definition list';
isa-ok $r.contents[3].contents[1], Pod::FormattingCode, 'Ordinary paragraph 
contents has a Formatting Code';
todo 1;
isa-ok $r.contents[2].contents[1], Pod::FormattingCode, 'Definition contents 
has a Formatting Code';

done-testing;

Regards

Richard

On 02/01/2022 23:00, Ralph Mellor wrote:

On Sun, Jan 2, 2022 at 8:00 PM Richard Hainsworth
 wrote:

What does not work (in that 'newkey' is not found in the 'config' part
of the Pod::Block returned by $=pod

=head1 :key

= :newkey

I just tried that with Rakudo v2031.03 and got a compile
time error for this line:

= :newkey

Preceding context expects a term, but found infix = instead.
Did you make a mistake in Pod syntax?


But this does work, and it is a passing test in the Roast suite

=head1 :key

=   :newkey

For me I got the same error as above. This was so for anywhere from
zero to 10 spaces between the `=` and `:newkey`.


However, the intent of S26, as stated in the raku documentation, is for
the first variant above to work, and also for the following case

(this being what is intended as a virtual margin):

   =head1 :newkey

   = :newkey

For me I got the same error (for the `  = :newkey` line).


But this does works (and it seems to be two virtual margins)

   =head1 :key

   =   :newkey

Same error.

My results vs yours suggest someone has changed this behavior
between v2021.3 and your version.

Having looked at commits to Grammar.nqp since 2021.03 I don't
understand how that can be if you're using a later version.


I have looked at the grammar for this situation, which I think is at

https://github.com/finanalyst/rakudo/blob/ae2bf80dae74986c75f9a610f7a25cc1f6cdbb36/src/Perl6/Grammar.nqp#L5093

Blame suggests that code was.last affected (merely moved) 3 years ago:

https://github.com/finanalyst/rakudo/blame/ae2bf80dae74986c75f9a610f7a25cc1f6cdbb36/src/Perl6/Grammar.nqp#L5093


but I cannot see why the actual behaviour occurs, but the documented
(apparently intended) behaviour does not.

The behaviour change and blame suggests it's not due to that line.



Alternatively I am utterly confused.

Either way, happy new year. :)

--
love, ralph


update: meta data in Pod Block

2022-01-02 Thread Richard Hainsworth

tl;dr

Found a workaround. Raku documentation about meta / config data is 
subtly wrong. I'm writing a PR to modify documentation.


Long version:

As per my previous email, the documentation in docs.raku.org about POD6 
says that configuration data provided on lines after a POD6 declaration 
has not been implemented.


This is wrong in some way, either the implementation is incorrect, or 
the documentation is incorrect. But config data CAN be supplied on 
succeeding lines.


What does not work (in that 'newkey' is not found in the 'config' part 
of the Pod::Block returned by $=pod


=head1 :key

= :newkey

But this does work, and it is a passing test in the Roast suite

=head1 :key

=   :newkey

However, the intent of S26, as stated in the raku documentation, is for 
the first variant above to work, and also for the following case


(this being what is intended as a virtual margin):

 =head1 :newkey

 = :newkey

But this does works (and it seems to be two virtual margins)

 =head1 :key

 =   :newkey

I have looked at the grammar for this situation, which I think is at

https://github.com/finanalyst/rakudo/blob/ae2bf80dae74986c75f9a610f7a25cc1f6cdbb36/src/Perl6/Grammar.nqp#L5093

but I cannot see why the actual behaviour occurs, but the documented 
(apparently intended) behaviour does not.





Raku name change

2022-01-01 Thread Richard Hainsworth
Just noticed when creating new module on GitHub, the dropdown for the 
.gitignore template has an entry for 'perl6' but not for raku.




Re: continuous testing

2022-01-01 Thread Richard Hainsworth

JJ
Thanks. That is very useful. One interesting question.

I notice from this setup that you chart the COMMITS, and the raku 
program uses 'say' to output the results.


But how do you access these charted results?

Regards,

Richard

On 01/01/2022 10:14, JJ Merelo wrote:
Try the new GitHub actions with the recently renovated Docker image. 
See it in action, for instance, here:


https://github.com/JJ/p6-pod-load/blob/master/.github/workflows/test.yaml 
<https://github.com/JJ/p6-pod-load/blob/master/.github/workflows/test.yaml>


El vie, 31 dic 2021 a las 19:57, Richard Hainsworth 
(mailto:rnhainswo...@gmail.com>>) escribió:


Thanks

On 31/12/2021 18:27, Fernando Santagata wrote:

Hi Richard,
this is a link to the GitHub official documentation:

https://docs.github.com/en/actions
<https://docs.github.com/en/actions>

You can also copy a configuration from another project and adapt
it to your needs. For example this one installs some C libraries,
some module dependencies and runs the tests:


https://github.com/frithnanth/raku-Math-Libgsl-Interpolation/blob/master/.github/workflows/test.yml

<https://github.com/frithnanth/raku-Math-Libgsl-Interpolation/blob/master/.github/workflows/test.yml>

On Fri, Dec 31, 2021 at 5:56 PM Richard Hainsworth
mailto:rnhainswo...@gmail.com>> wrote:

Fernando,

Thanks.

Any link / blog / article about how to set up GitHub action
up for Raku?

Regards,

Richard

On 31/12/2021 16:52, Fernando Santagata wrote:

Hi Richard,
apparently Travis CI has discontinued its free open source plan.
I switched to GitHub actions; don't know what's available on
other platforms.

On Fri, Dec 31, 2021 at 5:43 PM Richard Hainsworth
mailto:rnhainswo...@gmail.com>> wrote:

I noticed that the .travis files have been removed from
some distributions.

Also a .circleci file exists in the Raku Docs repo.

Is there a preferred / recommended / list of continuous
testing
environments?

Is there a preferred / rapid way to handle Raku modules?

Regards,

Richard



-- 
Fernando Santagata




-- 
Fernando Santagata




--
JJ


Re: Should I start learning Perl?

2022-01-01 Thread Richard Hainsworth

Mr. Turritopsis Dohrnii Teo En Ming,

Happy New Year from Wales.

You asked:

May I know if Perl is still in vogue?
Should I start learning Perl?

There is Perl and what used to be called Perl6, which is now called 
Raku. This is an email list for Raku, aka Perl 6.


Lets start with 'vogue-ness'.

When I was a student, FORTRAN was the main language for science, and 
COBOL was for finance. When I first set up an intranet for KPMG in their 
Moscow office, Perl 5 had just appeared and it was THE internet 
language. Since then many languages have come into fashion, and Python, 
JAVA, and Go seem to me to be widespread, whilst C remains incredibly 
important. You can find listings of popular languages on the internet.


However, consider that once a piece of software has been written in a 
language, transferring it 100% to another language is very difficult. 
Transferring about 95% is easy, but it is the rare cases that are 
difficult to get right. So companies with huge investments in software 
systems written in COBOL, Fortran, and Perl do not want to change the 
language, and they look for programmers who can maintain these software 
systems. Even though most programmers hate COBOL as a language (it is 
now old, but in its day was ground-breaking), COBOL programmers get high 
salaries from big companies with large software investments.


The same is even more true of Perl. Perl continues to be a good 
language, with VERY many modules and new ones being written, with VERY 
many companies relying on existing software systems based on Perl.


So does 'in vogue' mean what is fashionable today, but discarded 
tomorrow, or does it mean something for which there is a massive and 
continuing demand? Note that here I am trying to distinguish between 
volatile 'fashion' and what is in demand, which is an aspect of being 
'in vogue'.


It might easily be true that programmers are paid more if they have 
skills in languages with large installed bases, but which are out of 
fashion! The reason is that languages 'in fashion' attract many young 
people, who are taught these languages in schools and colleges. So the 
population of junior programmers with 'in fashion' skills is large. 
Programmers with older language skills are rarer, so they get paid more.


So if you are looking for a language to serve you in a career, then do 
not look at 'fashion', but look at the installed base. In which case 
Perl is a very good choice.


More important for a good programmer, though, is to learn the "Way" or 
"Art" of programming because various techniques for writing good 
software are applied in any different languages. Essential to good 
programming is testing, and particularly unit testing. I only started to 
use unit tests as part of the way I develop software quite late in my 
career. It is so easy to dismiss it as extra admin, rather than an 
essential way of thinking about the results generated by software. Also, 
things like program structure, naming variables and code elements in a 
self-documenting manner, differentiating between inheritance and code 
re-use, and so on are vital for good progamming.


Raku (previously known as Perl 6) is an excellent choice of language to 
learn because it has been designed to make good programming techniques 
easy. Once you have mastered important software techniques in Raku, you 
can then employ them in other settings.


At one time, I had to write in Java (for Android apps) and C (embedded 
systems), but for all my own tasks I used Raku. At the time Raku was 
very slow to compile (that is getting much better), but the ease with 
which I could write a small script to do a complex thing in a way that 
is easy to understand and debug is unmatched (I think) by any other 
language.


Raku is still at the forefront of language design, with its ability to 
handle Unicode (eg., you can name your variables in simplified or 
traditional Chinese script), grammars, concurrent programming, and 
several other areas. Why is Raku not more widespread? Probably because 
it does not have a big company sponsoring its development, and 
advertising it.


So short responses to your questions:

Is Perl 'in vogue' in the meaning of is it fashionable? Is that a good 
question to be asking? The answer is 'Perl is not as fashionable as it 
once was'. But are you asking because you only want to follow fashion, 
or are you asking to see how best to develop yourself in your career, or 
as a programmer. Is Perl in vogue because it is widely used, then yes 
Perl is in vogue.


Is Raku fashionable? If you look at the quality of the people in the 
Raku community, and their experience with other languages, and when you 
consider the types of things that interest computer scientists and being 
implemented in Raku, then 'yes, Raku is fashionable'. But if by 
fashionable, you mean what is being hyped by influencers, or companies 
with money trying to get you locked into their products, then 'no, Raku 
is not fashionable'.



Re: continuous testing

2021-12-31 Thread Richard Hainsworth

Thanks

On 31/12/2021 18:27, Fernando Santagata wrote:

Hi Richard,
this is a link to the GitHub official documentation:

https://docs.github.com/en/actions <https://docs.github.com/en/actions>

You can also copy a configuration from another project and adapt it to 
your needs. For example this one installs some C libraries, some 
module dependencies and runs the tests:


https://github.com/frithnanth/raku-Math-Libgsl-Interpolation/blob/master/.github/workflows/test.yml 
<https://github.com/frithnanth/raku-Math-Libgsl-Interpolation/blob/master/.github/workflows/test.yml>


On Fri, Dec 31, 2021 at 5:56 PM Richard Hainsworth 
mailto:rnhainswo...@gmail.com>> wrote:


Fernando,

Thanks.

Any link / blog / article about how to set up GitHub action up for
Raku?

Regards,

Richard

On 31/12/2021 16:52, Fernando Santagata wrote:

Hi Richard,
apparently Travis CI has discontinued its free open source plan.
I switched to GitHub actions; don't know what's available on
other platforms.

On Fri, Dec 31, 2021 at 5:43 PM Richard Hainsworth
mailto:rnhainswo...@gmail.com>> wrote:

I noticed that the .travis files have been removed from some
distributions.

Also a .circleci file exists in the Raku Docs repo.

Is there a preferred / recommended / list of continuous testing
environments?

Is there a preferred / rapid way to handle Raku modules?

Regards,

Richard



-- 
Fernando Santagata




--
Fernando Santagata


Re: continuous testing

2021-12-31 Thread Richard Hainsworth

Fernando,

Thanks.

Any link / blog / article about how to set up GitHub action up for Raku?

Regards,

Richard

On 31/12/2021 16:52, Fernando Santagata wrote:

Hi Richard,
apparently Travis CI has discontinued its free open source plan.
I switched to GitHub actions; don't know what's available on other 
platforms.


On Fri, Dec 31, 2021 at 5:43 PM Richard Hainsworth 
mailto:rnhainswo...@gmail.com>> wrote:


I noticed that the .travis files have been removed from some
distributions.

Also a .circleci file exists in the Raku Docs repo.

Is there a preferred / recommended / list of continuous testing
environments?

Is there a preferred / rapid way to handle Raku modules?

Regards,

Richard



--
Fernando Santagata


continuous testing

2021-12-31 Thread Richard Hainsworth

I noticed that the .travis files have been removed from some distributions.

Also a .circleci file exists in the Raku Docs repo.

Is there a preferred / recommended / list of continuous testing 
environments?


Is there a preferred / rapid way to handle Raku modules?

Regards,

Richard



Implementation of documented POD6 behaviour

2021-12-30 Thread Richard Hainsworth
I plan to use the POD6 metadata functionality a lot in a new module. It 
would be far better to separate out the meta data into lines.


In https://docs.raku.org/language/pod I find

"In the future, the configuration section may be extended over 
subsequent lines by starting those lines with an |=| in the first 
(virtual) column followed by a whitespace character."


with a footnote that it is not implemented.

Is there some indication when it will be implemented?

I am willing to look at the the Rakudo code and create a PR to implement 
this functionality. Is there any reason not to do this, eg., planned 
changes such as changing to RakuAST.


Similar to the above, there are implied POD6 behaviours that do not 
work, in particular embedded POD6.


Two examples:

- Pod6 tables. A cell of a POD6 table may not contain a POD6 table. Thus 
a table of tables is not possible.


Note that there is a test in the Pod::To::HTML test suite that tests for 
this behaviour. It is TODO'd because it does not work, but it is 
expected it should work.


The current behaviour is to treat the embedded table as an unknown block 
type.


- Definition lists.

It is not possible to include embedded POD6 in the contents part of a 
definition.


More detail on these.

The following program:

=begin pod

=for head1 :attr('key') :battr
This is a working header

=for head1
= attr('key) :battr
This is what is being tested

=defn Bad boy
When you Bto include formating.

Outside a definition list Bis treated differently.

=end pod
say $=pod;

Produces the following output:

[Pod::Block::Named{:name("pod")}
  Pod::Heading{:config("\$\{:attr(\"key\"), :battr(\"key2\")}"), :level("1")}
Pod::Block::Para
  This is a working header
  Pod::Heading{:level("1")}
Pod::Block::Para
  = attr('key) :battr This is what is being tested
  Pod::Defn{:term("Bad boy")}
Pod::Block::Para
  When you B to include formating.
  Pod::Block::Para
Outside a definition list
Pod::FormattingCode{:type("B")}
  formating
 is treated differently.
]

From the above, it can be seen that
(1) the config part of the second header does not contain extra key/value pairs.
This is consistent with the footnote in the documentation.
(2) the contents part (which is shown by say as being indented from the 
Pod:Block line) of a Pod::Defn
is treated differently from the contents part of a Pod::Block::Para. This is 
not documented and is unexpected.

I have not shown the POD6 table behaviour, but its similar to the Pod::Defn 
behaviour.



file format extensions

2021-12-30 Thread Richard Hainsworth
I'm revising how I name files that are included in my modules. With the 
name change to Raku, the file extensions also changed for script and 
module files.


In addition Jonathan has defined some format extensions for Cro files, 
and I am sure there would be other developers who would like to claim 
unique extension names for files.


This is not a post intended to start a war about file extensions, that 
is whether they should exist in a modern file system. For whatever 
reason they came into being, a significant number of users, such as 
myself, find them useful, if only as a mnemonic for their files' 
probable contents.


It seems to me a short page in the docs.raku.org would be useful with 
the various file extensions, and so if a developer wanted for a custom 
file extension to be primarily applied to some new module, the way to do 
would be to create a PR on the documentation file.


If this post gets some positive responses, then I'll write the POD6 file 
for inclusion in docs.raku.org and create a PR for inclusion.


[Another naming question would be the name of the markup language - as 
distinct from the file extension - for documentation. For Perl it is 
POD, for Perl6 it was natural to use POD6. POD stands for Plain Old 
Documentation, but I think that POD6 is neither Plain, nor Old. How 
about RDM for Raku documentation markup? ]


There is a wrinkle in that Raku best practice has evolved in line with 
the evolution of perl6 into Raku. So it seems reasonable to have 
previous file formats listed as well.


The following are what I think are the current best practices. Since I 
have been out of circulation for a while, the list is likely not 
exhaustive and may be wrong. I am certain there are other file types I 
have not included.


For each file type, extensions on the left are earlier, and the 
extension of the far right (after the TAB) is considered best practice


Perl6 / Raku script: .pl, .pl6,  .raku

Perl6 / Raku Module: .pm, .pm6,  .rakumod

Perl6 / Raku Standalone Documentation (POD6 can be included in a script 
or module file): .pm, .pm6, .pod, .pod6,  .rakudoc


NQP file:  .nqp

Cro template:  .crotmp








Re: gather take eager syntax

2021-04-20 Thread Richard Hainsworth
The 'take' is creating a Pair, which is one thing, whilst when creating 
a hash, you need two things: the key and the value.


The gather adds extra complexity by creating a list, which is also one 
thing. But you could flatten the list into the list of things by using |.


So `my %h = gather { take eager "foo"=>1}` has only the `foo=>1` as the 
first thing, which is the key, but nothing for the key to point to.


Your `my %h = gather { take eager "foo"=>1; take "bar"=>2;}` has two 
things. The `foo=>1` is the key, and the `bar=>2` is the value. That's 
what was being shown in the output, but with the implied parentheses it 
is not easy to see at first. You got `{foo 1 => bar => 2}`, which is { 
(foo=>1) => (bar=>2) }


(Note the before => the key is auto-quoted, so no need to use "foo"=>1.

Hope this helps.

On 20/04/2021 06:39, Norman Gaywood wrote:

Hi, I can't figure out why the last line here is failing.
Version 2020.07

$ raku
To exit type 'exit' or '^D'
> my %h = gather { take "foo"=>1; take "bar"=>2;}
{bar => 2, foo => 1}
> my %h = gather { take "foo"=>1}
{foo => 1}
> my %h = gather { take eager "foo"=>1; take "bar"=>2;}
{foo 1 => bar => 2}
> my %h = gather { take eager "foo"=>1}
Odd number of elements found where hash initializer expected:
Only saw: $(:foo(1),)
  in block  at  line 1

--
Norman Gaywood, Computer Systems Officer
School of Science and Technology
University of New England
Armidale NSW 2351, Australia

ngayw...@une.edu.au  
http://turing.une.edu.au/~ngaywood 

Phone: +61 (0)2 6773 2412  Mobile: +61 (0)4 7862 0062

Please avoid sending me Word or Power Point attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html 



Re: too many file handles

2021-03-17 Thread Richard Hainsworth
After working at this, I finally found where it was happening, and a 
work-around.


I was checking all 517 http/s links in the documentation to see whether 
they are all live (not 404 and host found). For this I was using 
LibCurl::Easy.


The relevant bits of code was something like

for @links -> $link { # @links.elems = 517

    my $http = LibCurl::HTTP.new;

    try { $rv = $http.HEAD($link).perform.response-code }

    if $! { $rv = $http.error }

}

I had assumed that as soon as the $http went out of scope, it would be 
collected.


When I rewrote as

my $http = LibCurl::HTTP.new;

for @links -> link { ... }

then the program ran to completion without failing with 'too many file 
handles.



Now my question is this: Is this a problem with the LibCurl::Easy 
module, where I can raise an issue.


Or is this a more general Raku problem with objects not being garbage 
collected?


Richard


On 17/03/2021 17:55, Elizabeth Mattijsen wrote:

On 17 Mar 2021, at 18:45, Richard Hainsworth  wrote:

I have been running into this error: "Too many open files"

Sorry for the lack of detail. The problem is that the error comes up in odd 
places, so I have found it difficult to golf down into Raku program that always 
fails with this error.

When I separate out the code that leads to the error, and create another 
program, Raku handles it without difficulty. It seems to occur when there are a 
lot of moving parts, so to speak.

I am not explicitly opening file handles, but the software I have written is 
using the idiom

"some-filename.html".IO.spurt( $an-accumulated-string );

Obviously, filehandles are being opened under the hood. Having written a file, 
there is no need to reference it again, so I could close the filehandle.

I have been told that because of the way garbage handling is implemented, there 
is a problem with file handles.

That's should only happen if you specifically open a file to obtain an 
IO::Handle: if you don't close it yourself (e.g. via a LEAVE block like: LEAVE 
.close with $handle), *then* you run this risk, as the IO::Handle.DESTROY 
method *will* close the handle, but you cannot be sure as to when 
IO::Handle.DESTROY gets called.



If so, what is a safer idiom to use in place of and IO on a string, so that the 
handle can be closed immediately after use?

The "filelame".IO.spurt($string)" is the exact idiom to ensure that file 
handles are getting closed for you automatically.  And I've just checked the code: the OS file 
handle *is* specifically getting closed with an nqp::closefh($!PIO).  Specifically, the 
sequence is:

 my $PIO := nqp::open($path,$mode);
 nqp::writefh($PIO,nqp::decont(data));
 nqp::closefh($PIO);

Now, you can't get more succinct than that: it doesn't even open an IO::Handle 
at all!

The only thing I can think of at this moment, is that somehow nqp::closefh() is 
leaking?  Perhaps creating an issue for this, is in order!


Liz



too many file handles

2021-03-17 Thread Richard Hainsworth

I have been running into this error: "Too many open files"

Sorry for the lack of detail. The problem is that the error comes up in 
odd places, so I have found it difficult to golf down into Raku program 
that always fails with this error.


When I separate out the code that leads to the error, and create another 
program, Raku handles it without difficulty. It seems to occur when 
there are a lot of moving parts, so to speak.


I am not explicitly opening file handles, but the software I have 
written is using the idiom


"some-filename.html".IO.spurt( $an-accumulated-string );

Obviously, filehandles are being opened under the hood. Having written a 
file, there is no need to reference it again, so I could close the 
filehandle.


I have been told that because of the way garbage handling is 
implemented, there is a problem with file handles. If so, what is a 
safer idiom to use in place of and IO on a string, so that the handle 
can be closed immediately after use?


Appreciate some help on this.

Richard



Re: Please create a Raku community channel

2021-03-15 Thread Richard Hainsworth

Thanks to everyone that responded.

It seems to me that the establishment of a common communication channel 
by the RSC (Raku Steering Council) would in itself define the Raku 
Community. Those who want to be a part of the community would track 
(follow, read, contribute etc) the channel. I don't think it is 
something that needs to be over-thought. Every channel has its 
advantages and disadvantages, and there's going to be someone who does 
not like the result.


But the current situation of multiple channels of communicating is 
obviously going to create confusion. It would be like having multiple 
places for defining the same set of constants for a software project, or 
some other analogy of duplicating code that should be kept in one place 
and referred to, not written and maintained in multiple places.


Also, if like-minded people have a way to share and cooperate, a 
community will build. Facilitating the growth of a community will have 
an impact on the acceptance of Raku as a language.


Having multiple differing approaches to the same problem can be good - 
not arguing with that. But if there's no common way to share information 
about the multiple approaches, how can the different approaches be 
compared? If they can't be compared, then the advantages of multiple 
approaches are lost. And no one can be certain that their efforts are 
being considered.


It turns out - from comments of JJ and Vadim - that Altai-man's 
initiative is a personal one. Had it not been late at night (for me) and 
had there been an established channel where  plans for community 
resources are shared, I would have realised that straight-away. Instead, 
I got annoyed and lost sleep (silly and unreasonable, but I am human).


Daniel, I look forward to hearing from you. Altai-man, please send me a 
link that I can catch up with what you are planning (I'm not so good at 
tracking multiple github repos).


One of the things I would like to do is to set up a way of doing 
documentation that will allow for multiple languages to be possible, 
which means that it should be possible to show the same documentation 
file side-by-side in two languages, with text for each language kept in 
a separate file, but for equivalent places in the documentation to be 
synchronised. It would also be good to have revisionning history 
visible, so that updates in the main text can be tracked so as to update 
in a target language text.


Regards,

Richard

On 14/03/2021 21:16, Daniel Sockwell wrote:

I agree with the points Vadim and JJ made: There's a good chance that having a 
more official
communication channel would _not_ have prevented surprise here, since the 
amount of progress
on the a potential docs redesign seems to have taken many people (including 
me!) by surprise.
I guess that's what happens when our community has "forgiveness >> permission" 
as a core value!

That said, I also agree with Vadim that we should have a better way to 
communicate things like
this,
even if it wouldn't have been relevant in this particular case. In fact, we 
theoretically do: our
website lists the perl6-announce list, which is supposed to be "low traffic (a 
few emails a
month)".
https://raku.org/community

Looking at the archive for that list, it has been **very** low traffic indeed: 
the last message was

sent in 2015. So we clearly haven't been using it, and starting now (when we're 
about to finally
move on to raku-* mailing lists) probably doesn't make much sense. But, once we 
do, making an
effort
to actually use the raku-announce list seems like a good way to address this 
issue.

Finally, Richard, in the interest of not taking you by surprise again on the 
same topic, I wanted to
mention that, inspired by the proposed doc site redesign and your comments 
about the broader topic,
I'm now working on a proof of concept along the same lines (because I have a 
slightly different vision
of what a redesigned website might look like, but don't think I can communicate 
it without a POC).  I
hope to be able to share more details in the coming days.

Best,
Daniel / codesections


Please create a Raku community channel

2021-03-12 Thread Richard Hainsworth
This is a request to the Raku Coordinating Council that was elected at 
the end of last year.


Please name a channel where community wide plans or announcements are 
made. Or may be establish one.


I found out yesterday by the intervention of a regular participant in 
the community that a new documentation website is being worked on.


I joined a conversation on the raku-dev IRC and discovered that the 
plans are quite far established. Since I have been working full-time for 
three months on a project that could (not should!!) serve as the 
infra-structure of a new site, I was really quite surprised and I am 
sure many of you will understand it was jarring.


I follow all the conversations on this email list. I have found it very 
difficult (due to my own technical incompetence relating to github) to 
set up my github preferences to get regular notification about issues. I 
have also found that the IRC chats are streams of consciousness that are 
difficult for me to manage.


It seems however, that it is my fault that I was taken by surprise  by 
the news of a different documentation website and that I should have 
been following all the issues on the documentation repo or the problem 
solving repo.


It *IS* reasonable for Raku developers and community organisers to make 
it the responsibility of a participant to follow conversations, but I 
would suggest that the current scattering of conversations, on the IRC 
chat, various github repositories, this email list, is not *optimal* for 
the development of a coherent Raku community. It is also - I would 
suggest - a waste of human resources if the same objectives are pursued 
by multiple enthusiasts without any coordination or communication.


If the Raku Council were to designate some channel, whether its an email 
list, an IRC chat, or a github repo, or maybe a discord or slack or 
other channel as the main community resource, then I would make sure I 
could read all the messages there and stay in touch with what is happening.


Hence my request to the Raku council to consider improving communication 
between developers and the wider Raku community.


Regards

Richard Hainsworth

aka finanalyst




Re: [sf-perl] The SF Perl Raku Study Group, 03/14 at 1pm PDT

2021-03-12 Thread Richard Hainsworth

Jo,

I think you are something! Existentially and exemplary!

The quotations you find are very interesting.

TJ, I wonder whether there is some misunderstanding?

Richard

On 12/03/2021 19:09, yary wrote:

Or is that a Zen critique ... I think therefore i am not...?

On Fri, Mar 12, 2021, 11:21 AM Joseph Brenner > wrote:


You'll need to expand on that a bit, I don't get the complaint.

Do pretentious quotations bug you?


On 3/12/21, Tiejun Li mailto:tie...@yahoo.com>>
wrote:
>  Joseph,
> You think you are something. You are not. You are nothing.
> TJ
>
>     On Friday, March 12, 2021, 3:17:03 AM GMT+8, Joseph Brenner
> mailto:doom...@gmail.com>> wrote:
>
>  Donald Knuth, "Computer programming as an art", CACM, December
1974:
>
> "In this connection it is most important for us all
> to remember that there is no one 'best' style; everybody
> has his own preferences, and it is a mistake to try to force
> people into an unnatural mold.  ...  The important thing is
> that you really *like* the style you are using; it should be
> the best way you prefer to express yourself."
>
> The Raku Study Group
>
> March 14th, 2021  1pm in California, 9pm in the UK
>
> Zoom meeting link:
>
>
https://us02web.zoom.us/j/88493580999?pwd=Zmt3bUE0SFZLYU9MRnFDSXY5eDJLQT09

>
> Passcode: 4RakuRoll
>
> RSVPs are useful, though not needed:
> https://www.meetup.com/San-Francisco-Perl/events/276873465/

> ___
> SanFrancisco-pm mailing list
> sanfrancisco...@pm.org 
> https://mail.pm.org/mailman/listinfo/sanfrancisco-pm

>



Re: A problem case for the site documentation search: the "^methods" method.

2021-03-11 Thread Richard Hainsworth

Jo,

For what its worth, the search page on http://raku.finanalyst.org now 
takes you to ^methods


Previously, a search on '^methods' found the reference, but hide the 
location, so the link could not be clicked. That is fixed now.


Regards,

Richard

On 10/03/2021 15:42, Joseph Brenner wrote:

JJ Merelo  wrote:

This is a bug in Documentable. Generated an issue there
https://github.com/Raku/Documentable/issues/149 Thanks for the report.

And thanks for opening the issue.


Re: Find Packages with prefix ...

2021-03-07 Thread Richard Hainsworth

Interesting question.

I would like to know a good way of doing this. But just to refine the 
question, so that we don't discuss which directory modules are in 
(doesn't matter whether its lib/ or bin/), or whether we use classes and 
inheritance, the interesting (for me) question is: how to find other 
packages that have been installed?


Assume that we have three distributions, Parent, Brother, Sister. Parent 
'provides' 'Top.rakumod', while brother and sister provide 
'Top::Son.rakumod' and 'Top::daughter.rakumod', respectively. Brother 
and Sister have a 'depends': 'Top' in their META6.json.


Each distribution is in its own git repo. And each are installed by zef.

Suppose Top is set up as a class with an interface method 'multi method 
on-starting { ... }', which each sub-class has to implement, and which 
when run, provides the caller with information about the sub-class.


So, now we run an instance of Top (as defined in Parent). It needs to 
look for installed modules that match 'Top::*'. The place to start (I 
think) is '$*REPO', which is a linked list of repositories containing 
the modules that are installed. $*REPO also does the 
|CompUnit::Repository| role, which in turn has a 'need' method.


What I don't understand is how to manipulate $*REPO to get a list of all 
the candidate modules that match 'Top::*', along the whole of the linked 
list.


Once I have the list of candidates, I can use '^can' to check it has a 
'on-starting' method, and then call that method.


If someone could provide a bit of boiler plate code, I would really 
appreciate it.


Richard

On 07/03/2021 02:36, Paul Procacci wrote:

Hey Gents,

I was toying with an idea of writing a program (shocker!) and in the 
design of said program I wanted to give the ability to other module 
writers to extend functionality of the base program.


The main program would live in bin/ as per normal and claim a 
namespace of its own.  Call it: SuperDuperProgram


Within this namespace, I would ideally designate 
SuperDuperProgram::Modules to be the namespace that modules would live 
under.  These modules would have their own git repos and depend on 
SuperDuperProgram being installed.


Given this, I'd like the main program to perform a prefix search of 
installed modules with that namespace as a prefix, load said modules 
it finds, perform callbacks that I would designate as being required 
to successfully load the module, etc.


I've read various resources which include the zef source code, the 
raku docs, etc., yet am still unable to wrap my head around this.


Any pointers in the right direction as welcomed.

A mock up of what I had in mind:

./bin/SuperDuperProgram
###
#!/usr/bin/env raku

my @modules_with_prefix = 
search_installed_modules_with_prefix('SuperDuperProgram::Modules');


for @modules_with_prefix {
  # require module
  # perform init callbacks - new() for example
  # whatever else
}

--
__

:(){ :|:& };:


Module Documentation

2021-03-02 Thread Richard Hainsworth
Hi, I want to create a system that will show documentation about Raku 
Modules that I have installed.


There does not seem to be a Documentation standard, or best practice, 
for Raku modules.


Hence the following post.

In the Modules documentation in the Language section of the Raku 
documentation, there is a single mention of README.md, but only that it 
is needed by github. There is no indication about what should be in 
README.md


As a user of Raku, this does not matter much to me in practice, as when 
I need to understand something, I look at the code on the repository. 
But it can be a hassle going to Modules.raku.org, finding the module, 
going to the repo, finding where the information is, etc. I do NOT try 
and find the information that has been installed by zef because the 
location names are not human friendly. I understand the reasoning there, 
and do not suggest any change. But it is not easy to find documentation 
on locally installed modules, even though the information is there.


Even the "zef --open browse  source" command opens a browser to 
the internet repo, not to the local installation. There is no "zef 
documentation entity" or "zef README entity" command. I am NOT 
complaining about zef because the problem is not with zef, per se, but 
with the absence of a documentation standard (I think).


I wanted to incorporate a page with documentation of modules in the 
Collection-Raku-Documentation system I have just released.


But I do not see how to do this.

Most Raku modules have a README.md, which is required because of github 
requirements. Although the README's of some modules leave a great deal 
to be desired.


Many modules have extensive POD6 inside the main 'lib/module.pm6' file 
(where 'module' obviously is a placeholder for this email).


There is an issue on the GTK::Simple repo, which I am now the maintainer 
of, for more documentation. Actually, I learnt how to use GTK::Simple by 
looking at the examples in the repo, which have lots of explanation. But 
the README.md is appalling. However, an unanswered question is where 
would I put a documentation file when I write it, so that it is useful 
for users wanting to understand more.


In the modules I am now developing, I have a README.pod6 file, which I 
convert to the README.md file for github using a GUI tool in 
Raku::Extraction. The advantage of this is that the README.pod6 can have 
links to other pod6 files.


My suggestion is that some formal decision is made about documentation 
for Raku modules, that some documentation good practices are put 
together and included in the Modules page. My suggestion is that 
documentation should be in one of the following:


- the main module, defined (perhaps) as the pm6 file with the same name 
as the Distribution name


- a README.pod6 in the root

- a POD6 file pointed to by META6.json, eg a META6.json key that looks 
like: "documentation": "/lib/MyModule.pm6" or something.






Alternative view of Raku Documentation

2021-03-02 Thread Richard Hainsworth
I've just passed a milestone in the development of a suite of modules 
for rendering a collection of POD6 content files.


Please take a look at http://raku.finanalyst.org and especially 
http://raku.finanalyst.org/search.html


Please let me know whether you find the search interface easier than the 
one on the official site.


(I will be updating based on feedback. Eg., I will be showing links and 
visited links more clearly, but not with blue/purple of standard HTML)


Both search functions (the official one, and mine) rely on the same 
underlying information, but it is presented in a different way. I wanted 
(a) more context when searching, (b) I want previous searches to be 
retained in case the place I went to does not have the information  was 
looking for.


Please also bear in mind that this is a system still being developed. So 
there are some wrinkles:


1: There are numerous places in the official Raku docs where links 
target 'virtual' files. These virtual files do not exist in the 
Raku/docs directory, but are generated by the software developed to 
render the POD6 files, namely Documentable. Personally, I think having 
links to virtual files is fragile, and it does make the development of 
an alternative system of viewing the docs more difficult.


2: The inheritance diagrams in the standard documentation system are not 
cited in the official Raku docs, but are "sewn in" by Documentable based 
on a single text file that describes relationships.


The reasons I developed this new system?

- I want to create a Blog site, a site for translations from English to 
Welsh, and a site for my business that rely mostly on Raku, not php.


- The underlying content of most CMS suites seems to be MarkDown. But 
MarkDown does not allow for any meta data to be attached to text. POD6 
is both simple to write, but it also allows for meta data to be attached 
to paragraphs, headers, blocks. You can see some of this potential by 
clicking on the Collection button at raku.finanalyst.org


- I'm not entirely happy with the Documentable/Pod::To::HTML modules 
that are used to render Raku Documentation, and I hate it when people 
criticise things without providing some systematic alternative. So 
here's an alternative.


I have more to say about Module documentation, but that involves another 
topic.




Strange behaviour in REPL

2021-01-11 Thread Richard Hainsworth
I want to test for a key being defined in one hash, and if it is, then 
it should be a hash, and I need the value of that second key.


So I was testing my syntax with raku and got the following:

raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.12.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2020.12.

To exit type 'exit' or '^D'
> my %h =  Z=> 1..*
{one => 1, three => 3, two => 2}
> %h = %( this-key  => 'something' )
{this-key => something}
> my $x
(Any)
> with %h { do with . { $x = $_ } }
something
> with %h { do with . { $x = $_ } }
===SORRY!===
Word 'with' interpreted as a listop; please use 'do with' to introduce 
the statement control word

at line 4
--> $ = with⏏ %h { do with . { $x = $
Unexpected block in infix position (two terms in a row)
at line 4
--> $ = with %h⏏ { do with . { $x = $_ } };

Note the lines begining with 'with'. Exactly the same line, executed 
twice, produces two significantly different answers.


I think this shouldn't happen.



Re: LTA documentation page

2021-01-06 Thread Richard Hainsworth
We have a Google Summer of Code project to work on rakudoc, and the 
latest version of rakudoc points to "noisgul" 's repo.


But ... rakudo aka p6doc was intended to work in the same way as perldoc.

At the time the p6doc project was started, there was actually very 
little documentation, so most of the energy of people interested in 
documentation was on getting Perl 6 / Raku documented. As projects 
evolved, the best way to access the documentation turned out to be via 
the website.


Work on rakudoc languished because for most people, looking on line was 
easier and quicker than looking for installed modules.


There REMAINS a need for a tool to look at the documentation associated 
with installed modules. That documentation exists if it is contained in 
the distribution that zef installs. As Vadim said Raku can robustly keep 
multiple versions of the same Module differing by version number and 
author fork. So in principle, if the Module is there, so is the 
documentation. But rakudoc does not access that information.


So rakudoc does not do what you might think it should.

On 05/01/2021 17:41, JJ Merelo wrote:
Yep, there are a couple of (known) issues here: 
https://github.com/Raku/problem-solving/issues/252 
 which request to 
remove it from the ecosystem (and I'll probably do it when I finish 
this email), and this one https://github.com/Raku/doc/issues/2896 
 Build.pm does not really 
work now, to it should probably be removed. And if it is, there's 
actually nothing to "install" so it should be removed.
Maybe we should work first on releasing rakudoc. Let me see if we can 
do that soon-ish or it requires a lot of work. And in any case we will 
probably encourage people to use the online version of the 
documentation (or to build it themselves via Documentable)


Thanks anyways for the checks, cheers

El mar, 5 ene 2021 a las 18:02, Gianni Ceccarelli 
(mailto:dak...@thenautilus.net>>) escribió:


On 2021-01-05 William Michels via perl6-users
mailto:perl6-users@perl.org>>
wrote:
> Raiph's suggestion works for me (on rakudo-2020.10). I mean, p6doc
> installs

Oh, that points to new, different, problems.

https://modules.raku.org/search/?q=p6doc
 links to
https://github.com/Raku/doc  which
does not contain a ``p6doc`` script,
which means that what I get with ``zef install p6doc`` is not the same
thing (this is a general problem with pointing at repositories instead
of distribution artifacts, it's not specific to p6doc)

Then, ``zef install p6doc`` fails here, because::

  Failed to create directory '/usr/share/perl6/site/doc' with mode
  '0o777': Failed to mkdir: Permission denied

AIUI, distributions should install to the CompUnit::Repository in my
home directory, not into the system-wide one.

-- 
        Dakkar - 

        GPG public key fingerprint = A071 E618 DD2C 5901 9574
                                     6FE2 40EA 9883 7519 3F88
                            key id = 0x75193F88



--
JJ


Re: Extra . needed

2021-01-04 Thread Richard Hainsworth

Mea culpa. Super embarrassing.

Comes from having to do something else for a year.

Thanks Brad


On 03/01/2021 18:59, Brad Gilbert wrote:

You've already asked a similar question.

https://stackoverflow.com/questions/54033524/perl6-correctly-passing-a-routine-into-an-object-variable 
<https://stackoverflow.com/questions/54033524/perl6-correctly-passing-a-routine-into-an-object-variable>


When you call $a.f() you are getting the value in &!f which is a function.

When you call $a.f().() you are getting the value in &!f, and then 
also calling that function.


You don't need the parens on a method call if they are empty.

So $a.f() is the same as $a.f
and $a.f().() is the same as $a.f.()

On Sun, Jan 3, 2021 at 12:30 PM Richard Hainsworth 
mailto:rnhainswo...@gmail.com>> wrote:


I was playing with classes and adding a closure to an attribute.

I discovered that to call a closure on object I need `.()` rather
than just `()`. See REPL below.

raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.12.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2020.12.

To exit type 'exit' or '^D'
> class A { has &.f = -> { 'xyz' }}
(A)
> my A $a .=new
A.new(f => ->  { #`(Block|94272504746848) ... })
> say $a.f()
->  { #`(Block|94272504749656) ... }
> say $a.f.()
xyz
>


I was wondering whether it was intended for `()` to return
something other than `.()`?

My first thought would be that `.()` would have the same syntactic
sugar as `.[]` on an Array object.

I looked in the Documentation and in Classes found

&!callback();
inside class Task.

So I think there may be something a bit wrong. Or is this an
artifact of REPL?



Extra . needed

2021-01-03 Thread Richard Hainsworth

I was playing with classes and adding a closure to an attribute.

I discovered that to call a closure on object I need `.()` rather than 
just `()`. See REPL below.


raku
Welcome to 퐑퐚퐤퐮퐝퐨™ v2020.12.
Implementing the 퐑퐚퐤퐮™ programming language v6.d.
Built on MoarVM version 2020.12.

To exit type 'exit' or '^D'
> class A { has &.f = -> { 'xyz' }}
(A)
> my A $a .=new
A.new(f => ->  { #`(Block|94272504746848) ... })
> say $a.f()
->  { #`(Block|94272504749656) ... }
> say $a.f.()
xyz
>


I was wondering whether it was intended for `()` to return something 
other than `.()`?


My first thought would be that `.()` would have the same syntactic sugar 
as `.[]` on an Array object.


I looked in the Documentation and in Classes found

&!callback();
inside class Task.

So I think there may be something a bit wrong. Or is this an artifact of 
REPL?


Re: Is the cosine page wrong?

2020-12-29 Thread Richard Hainsworth
See inline below
On Tue, Dec 29, 2020, 09:54 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 12/29/20 1:12 AM, Richard Hainsworth wrote:
> > Hi Richard,
> >
> > When deciding to write a technical article, the
> > VERY FIRST thing you have to do is determine
> > your TARGET AUDIENCE.
> >
> > In a single sentence, please state for me what
> > you believe the TARGET AUDIENCE is for the
> > documentation.
> >
> > Would that it were that simple! But since you have some definite ideas
> > about what's wrong, why don't you have a go?
> > What the target audience?
>
> Hi Richard,
>
> What it is would be what you stated previously:
>
>   "Reference is written for a person who already
>   knows how to program and who uses Raku"
>
This is taken out of context. I said the Raku community has come to a
consensus that DOCUMENTATION should contain both *tutorial* and
*reference*.

> What I would like it to be is:
>
>   for both new and advanced users
>
> Standard technical writing: define terms (links work),
> start small and work up to advanced.  And no showing off.
>
But Raku documentation could not be 'standard technical writing', if such a
thing exists. Raku documentation should be compared to documentation about
another newish language, such as Rust or Go, or Haskell. I think it
compares well.


> > It's clear that you are a member, but what about others?
>
> "member".  That must be a British term.  By context, I
> presume you mean I am program in Raku.
>
I meant 'member of an audience'. Does USA English have another term for an
individual in an audience? I think not. Brevity by ellipsis is an literary
style that assumes an intelligent reader will supply the missing
information from the context. You correctly assumed what I implied. Raku
documentation uses a similar technique.

>
> > I use the
> > documentation every time I program in Raku (or C or php)
>
> I always have the documentation pages open when I am
> programming too.
>
> By the way, your statement
>  "who already knows how to program and who
>   uses Raku"
>
> would definitely apply to me and the docs drive me
> around the bend (sometimes the actual source code
> is easier for me to understand and I have starting
> looking at that too), so I would posit that you
> should change your statement to
>
>   "Reference is written for a person who already
>   has an advanced knowledge of and programs in Raku"
>
> Oh and it does not help that a google search of
> raku this and that turns up 1001 hits on pottery.
>
Actually if I want an answer to a programming question, I would turn to
StackOverflow, and Raku there does not give any ceramic references.

>
> Richard


Re: Is the cosine page wrong?

2020-12-29 Thread Richard Hainsworth
On Tue, Dec 29, 2020, 06:57 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> On 12/28/20 4:54 AM, Richard Hainsworth wrote:
> > So please take what I say now as a plea for you to adapt a little,
>


> >
> > No set of documentation standards will please everyone - that's life.
> > Even so, there ARE STILL areas of the Raku documentation that are
> > lacking (just look at the issues on the Documentation repository, any of
> > them raised by our indefatigable JJ).
>
>
> Hi Richard,
>
> When deciding to write a technical article, the
> VERY FIRST thing you have to do is determine
> your TARGET AUDIENCE.
>
> In a single sentence, please state for me what
> you believe the TARGET AUDIENCE is for the
> documentation.
>
Would that it were that simple! But since you have some definite ideas
about what's wrong, why don't you have a go?
What the target audience?
It's clear that you are a member, but what about others? I use the
documentation every time I program in Raku (or C or php)

>
> Many thanks,
> -T
>
>


Re: Is the cosine page wrong?

2020-12-28 Thread Richard Hainsworth

This seems to have been fixed already.

The speed this problem was noted and fixed demonstrates (a) the 
importance given to documentation, and (b) the diligence of JJ.


Kudos to JJ and those who helped fix the problem.

Richard

On 28/12/2020 15:35, Elizabeth Mattijsen wrote:

https://github.com/Raku/doc/issues/3753


On 28 Dec 2020, at 16:23, Parrot Raiser <1parr...@gmail.com> wrote:

I just went to the page at docs.raku.org on multi-line comments, to
suggest a couple of clarifying edits. The pencil icon invoked a 404
from GitHub.

When one goes to make a fix, and the fixer is broken, it's a bit
recursive. Can anyone cure problem #1, so I can get to step #2? :-)*

On 12/28/20, Elizabeth Mattijsen  wrote:

❤️


On 28 Dec 2020, at 13:54, Richard Hainsworth 
wrote:

Todd,

Some of what you have said in this email list over the years has been very
valuable. You ask questions that get some very illuminating answers. I
wrote a Module just for you (although I' still trying to get it to work on
Windows) and it inspired me to look much more deeply at GTK::Simple, which
I have just become the maintainer for.

So please take what I say now as a plea for you to adapt a little, not to
get pissed off with us even though you do seem to have pissed some of us
off.

You have very definite ideas about what the documentation should and
shouldn't be. You have stated them over and over again. The Raku community
at large - based on replies from multiple individuals over the years -
disagrees with you.

The Raku community has come to the concensus that there is a distinction
between Tutorials and Reference, and that the Documentation site should
contain both. Tutorials define how to use some aspect of Raku, with
example text and explanation. Reference tries to cover as much of the
language as possible, covering all the methods/subs/names/types etc as
possible. Reference is written for a person who already knows how to
program and who uses Raku. The assumption is that if a person reading a
reference does not understand some term, then s/he will search in the
documentation on that term to understand it.

No set of documentation standards will please everyone - that's life. Even
so, there ARE STILL areas of the Raku documentation that are lacking (just
look at the issues on the Documentation repository, any of them raised by
our indefatigable JJ).

However, the balances between prolixity and brevity, examples and
assumption of knowledge, exhibited in the Raku Documentation do by and
large reflect a community consensus.

It is polite in a community of rational human beings to accept what seems
to be the general consensus, even if you do not agree with it. By
continuing to demand your views about documentation should be accepted
without any support from anyone else, is quite irritating. So please try
to find a different way to express ways to improve the documentation that
will not piss people off.

You have suggested in this email list a variety of 'keepers', which seem
to be the way you document your use of Raku. However, these 'keeper' texts
are full of spelling mistakes, indicating you do not use a spell-checker,
and also are ambiguous or technically wrong. Personally, I have not found
your keepers to have been any use at all. But they may be useful to
someone. Even worse, it is not possible for me to find a collection of
your keepers because they are in posts to this email list, and I am not
going to search through thousands of emails for your keepers on something
whose keywords I would need to guess at. So the form you have made the
keepers available is not easily accessible.

In addition, the way the Raku community has evolved to work is to make
changes to Documentation, whether Tutorials or Reference, by actually
suggesting changes. If you look on the upper right of any primary document
(the docs.raku.org site displays pages that are both automatically
generated from primary documents, and the primary documents themselves -
basically the documents referenced from the home page), you will see a
Pencil icon. Click on that, and you will be taken to the github site and
you can directly edit the document. The change is then submitted as a Pull
Request, and it will be reviewed. If the change is seen to be reasonable,
it is included.

In this way, every single member of the Raku Community has the ability to
make or suggest a contribution.

However, a word of caution about human nature. If you go and try to
completely change all the documentation to the way you want it, trashing
everything that has already been contributed, it is extremely unlikely
that your amendments will ever be accepted. Further, you run the risk that
contributions with your name will never be considered by the Core
Developers because they have rejected PRs you made before.

Contribute in a way that enhances the Documentation, and your work will be
praised.

I hope whatever end of year, mid-winter or religious festival you
celebrated was festive, even 

Re: Is the cosine page wrong?

2020-12-28 Thread Richard Hainsworth

Todd,

Some of what you have said in this email list over the years has been 
very valuable. You ask questions that get some very illuminating 
answers. I wrote a Module just for you (although I' still trying to get 
it to work on Windows) and it inspired me to look much more deeply at 
GTK::Simple, which I have just become the maintainer for.


So please take what I say now as a plea for you to adapt a little, not 
to get pissed off with us even though you do seem to have pissed some of 
us off.


You have very definite ideas about what the documentation should and 
shouldn't be. You have stated them over and over again. The Raku 
community at large - based on replies from multiple individuals over the 
years - disagrees with you.


The Raku community has come to the concensus that there is a distinction 
between Tutorials and Reference, and that the Documentation site should 
contain both. Tutorials define how to use some aspect of Raku, with 
example text and explanation. Reference tries to cover as much of the 
language as possible, covering all the methods/subs/names/types etc as 
possible. Reference is written for a person who already knows how to 
program and who uses Raku. The assumption is that if a person reading a 
reference does not understand some term, then s/he will search in the 
documentation on that term to understand it.


No set of documentation standards will please everyone - that's life. 
Even so, there ARE STILL areas of the Raku documentation that are 
lacking (just look at the issues on the Documentation repository, any of 
them raised by our indefatigable JJ).


However, the balances between prolixity and brevity, examples and 
assumption of knowledge, exhibited in the Raku Documentation do by and 
large reflect a community consensus.


It is polite in a community of rational human beings to accept what 
seems to be the general consensus, even if you do not agree with it. By 
continuing to demand your views about documentation should be accepted 
without any support from anyone else, is quite irritating. So please try 
to find a different way to express ways to improve the documentation 
that will not piss people off.


You have suggested in this email list a variety of 'keepers', which seem 
to be the way you document your use of Raku. However, these 'keeper' 
texts are full of spelling mistakes, indicating you do not use a 
spell-checker, and also are ambiguous or technically wrong. Personally, 
I have not found your keepers to have been any use at all. But they may 
be useful to someone. Even worse, it is not possible for me to find a 
collection of your keepers because they are in posts to this email list, 
and I am not going to search through thousands of emails for your 
keepers on something whose keywords I would need to guess at. So the 
form you have made the keepers available is not easily accessible.


In addition, the way the Raku community has evolved to work is to make 
changes to Documentation, whether Tutorials or Reference, by actually 
suggesting changes. If you look on the upper right of any primary 
document (the docs.raku.org site displays pages that are both 
automatically generated from primary documents, and the primary 
documents themselves - basically the documents referenced from the home 
page), you will see a Pencil icon. Click on that, and you will be taken 
to the github site and you can directly edit the document. The change is 
then submitted as a Pull Request, and it will be reviewed. If the change 
is seen to be reasonable, it is included.


In this way, every single member of the Raku Community has the ability 
to make or suggest a contribution.


However, a word of caution about human nature. If you go and try to 
completely change all the documentation to the way you want it, trashing 
everything that has already been contributed, it is extremely unlikely 
that your amendments will ever be accepted. Further, you run the risk 
that contributions with your name will never be considered by the Core 
Developers because they have rejected PRs you made before.


Contribute in a way that enhances the Documentation, and your work will 
be praised.


I hope whatever end of year, mid-winter or religious festival you 
celebrated was festive, even in our pandemic afflicted world, and I wish 
you a safe and productive CE 2021.


Regards,

Richard

On 28/12/2020 11:55, ToddAndMargo via perl6-users wrote:

On 12/25/20 8:10 AM, Ralph Mellor wrote:

On 12/23/20 4:28 PM, Ralph Mellor wrote:
  > If a method does not explicitly specify its invocant type, it is 
set

  > to the type of the enclosing class.

But it does not specify an invocant.  It just leaves it blank


This is how it works in Raku source code. If there's no signature at 
all,
or if the invocant is blank, or if the invocant's type is not 
specified, its

type is the type of the class which encloses or composes the method
(or `Mu` for a mainline `my` method).





Hi Ralph,

What is used in the 

Continuous testing

2020-12-23 Thread Richard Hainsworth

Hi to everyone.

Hope you all have a happy holiday time at the end of the year - 
different countries different celebrations, but good will to all.


Hope 2021 is properous for you all too.

About continuous testing. I have recently taken on the maintenance of 
GTK::Simple.


The Travis-CI setup was constructed a while ago and tested both OSX and 
Linux, but not Windows.


It was failing for OSX and for one of the Linux environments.

So I have changed it to the minimal docker image provided by JJ - kudos 
that man!!!


However, that required a removal of OSX - bad.

In addition, GTK::Simple is difficult to install on Windows, so I'll 
need help there, but I would like to know how test a module for Windows 
anyway.


For clarity, I last used a Mac in the naughties, and stopped using 
Windows as soon as I could get what I needed from Linux. So basically, I 
have minimal recent knowledge of these environments.


I have two questions:

a) Could any one provide me with a CI scheme that would cover Linux / 
OSX / Windows?


Not necessarily on the same server environment.

There is an issue in GTK::Simple to the effect that it would be better 
to use github Actions instead of Travis-CI et al. A comment on this 
theme would help.


b) Is there a reasonable link to a blog/tutorial on CI ?

I think that there should be some basic information on CI in the Raku 
documentation on Modules. If anyone answers q1 for me, then I'll write 
up the scheme I adopt for the Modules documentation together with a link 
to better information.


When I have asked this question before, I haven't had much response. 
Either I have had answers that assume everyone know about CI, or most 
often I get a response that the answerer just copies/pastes 
configurations from other modules.


Whilst CI is not a part of Raku, a basic CI scheme that could be adopted 
by all Module writers would enhance the robustness of the Raku module 
community.




Re: pod6 and markdown

2020-09-02 Thread Richard Hainsworth
The raku compiler allows for what you want. It is the Pod render module 
that has to do this work. SO


I've just re-written Pod::To::HTML. It's in Raku::Pod::Render (Note the 
Raku at the beginning, I also wrote another module with almost the same 
name that doesn't do this).


The legacy Pod::To::HTML (which is Pod::To::HTML:auth ) 
does all of the HTML rendering hardcoded. Essentially, I took out all 
the output-specific and put it into templates.


So, now you can put something like '=Figure' (or '=MyWonderfulBlock') 
into your pod6 file, and define a template as 'figure' (or 
'mywonderfulblock') with custom output formating, eg. 'width="100px">') and it will work.


Also, you can create your own Format Codes, so F could 
be made to embed font-awesome icons into pod6 files.


Also, the Raku::Pod::Render distribution has a GUI tool called 
Extractor.raku that will take any pm6 file and extract the Pod6 and 
format it into README.md or .html files.


Sorry for shameless ad

On 02/09/2020 03:02, Vadim Belman wrote:

Unfortunately, neither rendered constraints nor image insertions are 
implemented yet. Or it is so up to my knowledge, at least. I miss these 
features too sometimes.

Best regards,
Vadim Belman


On Aug 31, 2020, at 6:56 AM, Fernando Santagata  
wrote:

Hello *,

I was wondering whether there's a way to tell that a section of pod6 should be 
rendered only by a specific renderer.

My problem is that I want to show a figure in a README.md and I'm using 
App::MI6, which builds the README.md file from the pod6 documentation in the 
module file.

As far as I can tell, there's no specific pod6 formatter for a figure; so far I 've 
beeninserting raw markdown lines in the pod6 documentation, such as 
"![description](file.svg)", but it's ugly and it would show when other 
renderers will be used on the same pod6 file.

Is there a way to restrict some text to just one renderer, or to insert a 
figure or picture in a pod6 file?

--
Fernando Santagata


Re: lines :$nl-in question

2020-09-01 Thread Richard Hainsworth

Some comments on the linguist contribution.

While 'invocant' and 'invoker' may be 'functionally equivalent', it 
seems to me that in fact 'invocant' is correct.


'Invocant' indicates a thing that invokes, and does not imply 
necessarily an intent. By analogy, we have 'defendant' in normal usage, 
someone for whom a defense is being made.


Since everything in Raku is an object, then being an object means that 
there are methods which can be called on the object. When a method is 
called on an object, as in '$some-string.IO.lines()', the method 'lines' 
is given the object '$some-string.IO' on which it has been called. It is 
the invocant.


Some form of intent would be needed for 'invoker'. By analogy, 
'defender' is used when an defenser is being made on behalf of someone 
else - the defendant.  So, in Raku, suppose we have some 'sub 
outputting' as in


sub ouputting ( $string,  )

and  = IO::lines();

Then it would seem to me that if '($string)' inside 'outputting' 
would make 'outputting' the invoker, and '$string' the invocant for 
'lines()'.


Regarding the difference between 'employer/employee' 'payer/payee': the 
relationship is one where the action is carried out by one entity - the 
subject - directly with respect to another - usually called the object. 
One person hires - the employer, who is doing it with an intent, and the 
other is being hired.


The relationship between 'defender/defendant' indicates the direction of 
the action is not from the defender to the defendant, but to something 
else, usually the court.


Naturally, there are bound to be exceptions, but the subtle distinctions 
between the suffixes '-er', '-ant', and '-ee', are worth preserving. 
Raku was specified by a linguist, and it is very much apparent.


On 30/08/2020 22:08, Stuckwisch, Matthew wrote:
So I guess I got included on this as the resident language professor 
:-) (although I probably should subscribe to p6 users at some point) I 
didn't see the whole thread in the e-mail I got copied in on, so 
apologizes if I repeat much.


I'll spare everyone all the linguistic details, but suffice it to say, 
invocant and invoker are functionally equivalent.  The former is a 
nominalized adjective, and the latter a noun proper.  They mean "the 
one that invokes (calls)".   We can use either, but I'd recommend we 
be very consistent.  Invocant seems to be the preferred, so let's use 
it exclusively. On the other side, we have invoked and invokee, which 
in English share a similar distinction (although nominalizing the 
former often sounds odd, and adjectifying the latter would probably be 
read as missing a genitive 's).


Summed up, we should avoid using invocant to refer to a method that's 
being called.  Generally, just calling it a "method" is sufficient, 
but if need be, I'd go with "the invoked method".  We probably can 
write documentation to avoid the formalisms altogether, though, by 
saying something to the effect of


> Opens the file [represented by the [calling] object] and returns its 
lines.


That's fairly simple and clear.  In an article about signatures, 
however, I think using the term is absolutely appropriate, and 
warrants defining it parenthetically inline as "the object that 
calls/invokes the associated method".  I get that using the word 
"call" muddies the water (the formal distinction that tchrist was 
getting at is that a sub has no invocant except perhaps a calling 
context, ie the "caller" — which a method also has), but we already 
did that by having methods use CALL-ME instead of INVOKE-ME :-) *


MSS


* Of course, the reason was to harmonize calls of all code, and the 
fluid nature of allowing transitive methods be used as subs and 
viceversa (method $invocant: @args and $invocant.) means that one 
term had to rule them all.



*From:* William Michels >

*Sent:* Sunday, August 30, 2020 2:44:55 PM
*To:* yary mailto:not@gmail.com>>
*Cc:* perl6-users >; ToddAndMargo >; Brad Gilbert >

*Subject:* Re: lines :$nl-in question
Do you agree with that definition, Yary? Brad? Here it is:

"Invocant"

"Caller, the one who calls or invokes. The invocant of a method would
be the object on which that method is being called, or, in some cases,
the class itself. Invocant is used instead of caller because the
latter refers to the scope."

https://docs.raku.org/language/glossary#Invocant

At first blush, the definition at
https://docs.raku.org/language/glossary#Invocant contradicts the
definition given to us by Brad. English speaker will typically use the
following word pairs to denote 1. an actor and 2. a recipient of some
action. So we have the following:

Payer vs. Payee
Lessor vs. Lessee
Employer vs. Employee

So going with the typical English usage above, the pattern would
continue with "Caller" vs "Callee" and 

Re: lines :$nl-in question

2020-08-30 Thread Richard Hainsworth

Todd,

While your logical transitions move you down some interesting rabbit 
holes, if you are going to say stuff, at least check first.


On 30/08/2020 00:39, ToddAndMargo via perl6-users wrote:

On 2020-08-28 23:51, Tobias Boege wrote:




You do realize "invocant" is not even in the dictionary


Not true, Todd. Took me 5 seconds to find:

https://www.merriam-webster.com/dictionary/invocant


   Definition of /invocant/

*: *one that invokes


(esoteric or requiring special knowledge)?


And whilst we there:


   Definition of /funny/

 (Entry 1 of 2)

1a *: *affording light mirth and laughter *: *amusing 
 His account of the 
war came in bits and pieces, sometimes bloody, sometimes funny.— Robert 
Penn Warren
b *: *seeking or intended to amuse *: *facetious 
 Don't take him so 
seriously; he was just being funny.
2 *: *differing from the ordinary in a suspicious, perplexing, quaint, 
or eccentric way *: *peculiar 
 My car has been 
making a funny noise. —often used as a sentence modifierFunny, things 
didn't turn out the way we planned.
3 *: *involving trickery or deception told his prisoner not to try 
anything funny


Which is not the same as 'esoteric'

So operators are a 'funny' sort of function, is an apt use of the word 
'funny'. But "operators are an 'esoteric' sort of function" does not work.


 “Anyone who can only think of one way to spell a
 word obviously lacks imagination.”
    -- Mark Twain

I do have to look at it twice when I see it, but I do figure
it out.  So is okay with me.


which returns
 an IO::Handle,




Re: Any sign of a fix for the 10 second compile time?

2020-08-01 Thread Richard Hainsworth

Tom,

I was not clear. I didn't intend to say/mean a different **zef** repo, 
but a different Precompilation Cache.


I have done this with Pod::From::Cache. If you think this is worth 
discussing in the docs, let me know.


On the other hand, I recompiled raku to make a change, and it needed 
access to the existing zef repo, so I symlinked the ../site directory to 
the one that zef uses. So ... I suppose it might be possible to hack 
something simply by changing symlinks. Not sure it would be a neat way 
of doing things.


Besides, zef and raku have environment variables that should handle 
this. I haven't looked at how to do this neatly yet.


Richard

On 01/08/2020 19:33, Tom Browder wrote:
On Sat, Aug 1, 2020 at 12:30 Richard Hainsworth 
mailto:rnhainswo...@gmail.com>> wrote:


What you are asking for is not a bug, but a part of the current
stage of
design. It will probably get quicker.


Richard, you should find an appropriate place in the docs and add a 
section on setting up your personal zef repo.


Thanks.

-Tom


Re: Any sign of a fix for the 10 second compile time?

2020-08-01 Thread Richard Hainsworth

Todd

What you are asking for is not a bug, but a part of the current stage of 
design. It will probably get quicker.


However, the biggest part of the timing is the compilation - as you have 
noticed.


When you precompile a module, it stores the byte code. Then it runs 
quite well.


Now it IS possible to set up a precomp store of your own, but isn't 
worth the hassle.


zef does all of that for you. So the best thing is to find a way to get 
zef to install your modules.


Naturally if you change anything in them, you will need to bump the 
version number in the META6.json file and then reinstall.


Failure problems with zef, so long as your module compiles, involves 
good housekeeping. zef will look for tests and run them. I cannot 
program anything now without tests, they are SOOO useful.


Then the structure of the module directory has to be right. But once you 
have got things working once, it becomes much easier.


I have a directory called .perl and inside it is just a META.json which 
lists in the depends field all  my favourite modules. Then I use zef to 
install deps.


On 01/08/2020 01:08, ToddAndMargo via perl6-users wrote:

On 2020-07-31 16:40, Tom Browder wrote:

On Fri, Jul 31, 2020 at 5:38 PM ToddAndMargo via perl6-users
 wrote:

Todd, a couple of questions:
1. In your modules that change all the time, do have "use lib ...;"
statements in any of them?


No.  If I do, they crash


# use lib '/home/linuxutil/p6lib';   # may not be precompiled; calling
program must take care of this



Just for "-O fun", set up your modules as if they were to be public,
i.e., add a META6.jso for the module collection.
The collection being "/path/to/MyModules" and in MyModules create:

  META6.json # create it and add all your modules in it just like
you were going to publish the whole mess.
  ./lib/
 # my modules as moved or duped from "/home/linuxutil/p6lib"
  t/
 00-meta-test.t # some basic test to check your META6.json file

Then, in dir "/path/to/MyModules" try:

 $ zef install .  # <== that's a DOT/PERIOD, i.e., the current 
directory


If that works, then you should be able to "use" them from your program.

-Tom





Hi Tom,

I am really after is what I originally asked.  Is this
issue any closer to being solved?  And is there
a bug I can get myself Cc'ed on to.

When I get a chance at it again, I will
will look into the workaround.  Thank you.

What compiles in 1/2 seconds on Perl 5 should not
take 18 seconds on Perl 6.

It is the "parse" stage this is the issue.

$ time raku --stagestats -c GetUpdates.pl6
Stage start  :   0.000
Stage parse  :  18.405
Stage syntaxcheck: Syntax OK

real    0m18.449s
user    0m20.673s
sys    0m0.223s


Re: Any sign of a fix for the 10 second compile time?

2020-07-31 Thread Richard Hainsworth

Todd,

Strangely after all the correspondence we have had, but I am unable to 
read your mind, and so understand your question.


Perhaps you could have pity on me and give me a bit more information about

a) which bug has appeared

b) what is it that you are compiling

c) a short snippet of code with the timing data (you can get that by 
setting an option in the rakudo command line)


yours non-telepathically

Richar

On 31/07/2020 02:45, ToddAndMargo via perl6-users wrote:

Hi All,

Any sign of a fix for the 10 second compile time?

Do you know if a bug has been opened on it so I can
sign up for the CC?

Many thanks,
-T


Re: Pod6 examples

2020-07-21 Thread Richard Hainsworth

How about:

https://github.com/Raku/doc/tree/master/doc/Language/pod.pod6

which is the pod source of https://docs.raku.org/language/pod

Also try the other sources under the 
https://github.com/Raku/doc/tree/master/doc directory.


Richard

On 21/07/2020 15:40, Parrot Raiser wrote:

Can anyone point me at examples of pod6 in use? I'm trying to relate
the syntax shown in https://docs.raku.org/language/pod to actual
results. Concise would be nice, tutorial even better.


BUILD and TWEAK

2020-07-21 Thread Richard Hainsworth

Trying to update the documentation on submethod TWEAK - there is nothing.

But the documentation should be accurate and not confusing. So some 
questions:


In a loop or program, things like BUILD or LEAVE or FIRST are called 
'phasers'.


By analogy, during the 'build' process of instantiating an object from a 
class, two 'submethod's can be called, viz.


submethod BUILD and submethod TWEAK.

1) Should these submethods be considered 'phasers' to be consistent with 
other BUILD, LEAVE etc usages?


2) What actually calls these submethods?

The documentation says 'bless' indirectly calls submethod BUILD. But the 
documentation seems to indicate that 'bless' is not needed to create an 
object.


So what calls the submethods?

3) Is it correct to say that TWEAK can access all the attributes of the 
object?


4) How to describe the way the TWEAK of a subclass accesses attributes 
in the parent?


eg

class A { has $.thing }

class B is A { submethod TWEAK { #do something to $.thing in A } }


Re: perl streaming framework

2020-07-14 Thread Richard Hainsworth
There was a talk by Steven Lembark about using the lazy gathers and 
concurrency constructs in Raku at the last Perl conference that might be 
of interest.


Steven (if I remember correctly) was using these tools to analyse vast 
quantities of data.


The language constructs exist in Raku, and the actual processing is as 
fast as any other language. But the ease of writing, and thus 
maintaining the code, is much much simpler.


On 14/07/2020 09:54, Warren Pang wrote:

Hello

We are already using perl PDL and something similar.
The streaming framework is mainly used for real time data analysis.
Tyler from Apache Beam project has wrote a great book about streaming 
system:

http://streamingsystems.net/
So I have interest to know if there is the perl implementation for that.

Thank you.



On Tue, Jul 14, 2020 at 3:39 PM Shlomi Fish > wrote:


Hi Warren!

Please reply to list.

On Tue, 14 Jul 2020 10:34:57 +0800
Warren Pang mailto:war...@gmail.com>> wrote:

> Hi
>
> Does perl have a stream computing framework?
> I know Java/python have many, such as spark, flink, beam etc.
> But I am looking for a perl alternative, since most of our team
members
> have been using perl for data analysis.
>

1. Do you want one for Raku which was formerly known as "Perl 6" (see
https://en.wikipedia.org/wiki/Raku_(programming_language) ) or for
"perl 5"?

2. What do you mean by "stream computing framework"? Is there a
wikipedia/etc.
page for them?

3. Can you link to some examples?

4. Do you mean something like http://pdl.perl.org/ (or numpy for
python)?


> Thank you.



-- 


Shlomi Fish https://www.shlomifish.org/
Why I Love Perl - https://shlom.in/joy-of-perl

The reason the Messiah has not come yet, is because Chuck Norris
keeps finding
faults in God’s plan for his coming.
    — https://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post -
https://shlom.in/reply .



NativeLibs not loading on Module testing

2020-07-14 Thread Richard Hainsworth

I'm adding a Module to the ecosystem, and the Build system failed, see

https://travis-ci.com/github/Raku/ecosystem/builds/175326153

It doesn't seem that it is my Module that's failing, but NativeLibs.

see line 165.

As for my Module (raku-pod-render) it passes all tests, including 
Test-Meta locally, so I don't think its my module.


Richard aka finanalyst


Re: root cubic

2020-07-09 Thread Richard Hainsworth
Did you mean the square root of 9 to give 3. Maybe you were wanting cube 
root of 27?


Using REPL, I got

> say 27**(1/3)
3
>

On 09/07/2020 16:26, Aureliano Guedes wrote:

Hi all,

A quick question.

This is expected?

raku -e 'say 9 ** (1/3)'
2.080083823051904


Why do I'm asking this?
I know about the computational floating problem and I also know that 
the Raku deal with rational whenever it is possible and store numbers 
as expressions (actually I don't know if there are more details). 
That's why 0.2 + 0.1 == 0.3 in Raku returns True whilst in other 
languages like Python, Perl5, and Ruby return False.


Then, I was just playing around and I'd like to check if it is expected.

Thanks


--
Aureliano Guedes
skype: aureliano.guedes
contato:  (11) 94292-6110
whatsapp +5511942926110


Re: proto and multi

2020-06-29 Thread Richard Hainsworth

@Gianni - thank you.

That works.

The problem in my original code - after removing the whitespace in { * } 
- was to have 'Positional @s' instead of 'Positional $s'. Either '@s' or 
'Positional $s' work.


Thanks for the rapid feedback.

Richard

On 29/06/2020 19:31, Gianni Ceccarelli wrote:

On 2020-06-29 Richard Hainsworth  wrote:

a) I don't understand why the white space matters, but clearly it
does. So the token is '{*}' and not braces around a Whatever-star.

Yep. Weird, but it's a special token.


Not sure why the List:D is not being matched to Positional. Is the
List:D refering to the |c signature capture ??

Your method wants a `Positional @s`, which is an array/list/seq
containing only objects that do the `Positional` role. You're passing
it a list of strings. Either write `@s` (the @ implies you want a
positional thing) or `Positional $s` (a scalar containing a positional
object)


c) Writing out all the code in each method is what I already have.
But I'm looking for ways to factor out common code.

This works::

   class NewClass {
   has $.debug is rw = False;
   has $.value is rw = 'Initial value';

   proto method handle( |c ) {
 note "before value is $.value" if $.debug;
 {*}
 note "after value is $.value" if $.debug;
   }
   multi method handle(Str $s) {
   $.value = $s;
   say 'in string'
   }
   multi method handle(@s) {
   $.value = @s[0];
   say 'in positional'
   }
   }

   my NewClass $x .= new(:debug);

   $x.handle('hello world');
   $x.handle();

and prints::

   before value is Initial value
   in string
   after value is hello world
   before value is hello world
   in positional
   after value is hello



Re: proto and multi

2020-06-29 Thread Richard Hainsworth
a) I don't understand why the white space matters, but clearly it does. 
So the token is '{*}' and not braces around a Whatever-star.


b) Removing the space yields the following response.
in string
Cannot resolve caller handle(NewClass:D: List:D); none of these 
signatures match:

    (NewClass: Str $s, *%_)
    (NewClass: Positional @s, *%_)
  in method handle at test.raku line 15
  in block  at test.raku line 30

Not sure why the List:D is not being matched to Positional. Is the 
List:D refering to the |c signature capture ??


Since 'in string' was printed, one of the methods was reached. Confused.

c) Writing out all the code in each method is what I already have. But 
I'm looking for ways to factor out common code.


Regards

On 29/06/2020 18:44, Fernando Santagata wrote:

After deleting the spaces as suggested, there's a "Positional" too many.
I guess you can rewrite that method declaration as

multi method handle(@s)

or

multi method handle(Positional $s)

and adjust the method's body.

On Mon, Jun 29, 2020 at 7:37 PM yary <mailto:not@gmail.com>> wrote:


It looks like you have spaces in the token { * } can you try it
without, using this {*} instead?

On Mon, Jun 29, 2020, 1:29 PM Richard Hainsworth
mailto:rnhainswo...@gmail.com>> wrote:

I have several multi methods.

All of them have the same first statement, then differ
depending on the signature.

proto seems to be a way to factor out the common statement,
and there is a phrase in the Documentation that * can affect
the dispatch, viz:

"You can give the |proto| a function body, and place the |{*}|
where you want the dispatch to be done. This can be useful
when you have a "hole" in your routine that gives it different
behavior depending on the arguments given:"

The docs give and example proto, but unfortunately, not how
this works with other multi's.

So  I tried this:

class NewClass {
 has $.debug is rw = False;
 has $.value is rw = 'Initial value';

 proto method handle(|c ) {
 note "value is $.value" if $.debug;
 { * } }
 multi method handle(Str $s) {
 $.value = $s;
 say 'in string' }
 multi method handle(Positional @s) {
 $.value = @s[0];
 say 'in positional' }
}

my NewClass $x .= new;

$x.handle('hello world');
$x.handle();
$x.debug = True;
$x.handle('hello world');
$x.handle();

#raku test.raku
#value is Initial value
#value is Initial value

I am wondering how to use proto and {*}



--
Fernando Santagata


proto and multi

2020-06-29 Thread Richard Hainsworth

I have several multi methods.

All of them have the same first statement, then differ depending on the 
signature.


proto seems to be a way to factor out the common statement, and there is 
a phrase in the Documentation that * can affect the dispatch, viz:


"You can give the |proto| a function body, and place the |{*}| where you 
want the dispatch to be done. This can be useful when you have a "hole" 
in your routine that gives it different behavior depending on the 
arguments given:"


The docs give and example proto, but unfortunately, not how this works 
with other multi's.


So  I tried this:

class NewClass {
has $.debug is rw = False;
has $.value is rw = 'Initial value';

proto method handle(|c ) {
note "value is $.value" if $.debug;
{ * } }
multi method handle(Str $s) {
$.value = $s;
say 'in string' }
multi method handle(Positional @s) {
$.value = @s[0];
say 'in positional' }
}

my NewClass $x .= new;

$x.handle('hello world');
$x.handle();
$x.debug = True;
$x.handle('hello world');
$x.handle();

#raku test.raku
#value is Initial value
#value is Initial value

I am wondering how to use proto and {*}



Re: just curious to know

2020-06-14 Thread Richard Hainsworth

Hi Radhakrishnan,

If 'spreading wings over the information technology field' were to mean 
anything other than what is fashionable today, then C still reigns.


And if anything, COBOL still is so important in big financial 
institutions that COBOL programmers earn more than Java programmers - if 
some articles are to be believed.


But fashion or pride **is** important, not technical or intellectual 
superiority - there are examples where a technically inferior technology 
became more widely used. Just in the IT field, MS Windows is more 
widespread than Linux. Is this because Windows is 'better technically', 
'better funded', 'better advertised'? or whatever. Please don't answer 
because I'm only asking hypothetical questions that don't have binary 
answers. My aim is to show you that the question you ask has underlying 
assumptions that may not be true.


What matters to me (because it affects what I do, and I am unable to 
affect what other people do in their blind herd instinct) are the following:


a) Can I write  elegant programs in a language, without excessive words? 
I'm looking askance at Java, which is still one of the most popular 
languages around. By elegance, I mean take a complex problem and write a 
program so that I can come back to it two years later and quickly work 
out how it runs.


b) Can I write programs that can be easily tested - for me the following 
programming paradigm leads to good code: writing a test, writing the 
documentation, writing the code (iterating the cycle), and not the other 
way around.


c) Can I write a one line piece of code to test something, or do 
something quickly on a terminal? Can I use the same language to write a 
complex piece of software?


d) Does the language deal clearly with subtle problems, eg., Is there a 
distinction between code reuse, and extensions of existing objects.


e) Does the language do things I can't do easily in other languages?

So for me, the answer to (a)-(d) is unambiguously yes. And there are a 
number of things I can list for Raku / Perl 6 for (e)


- Unicode. You can use any human language you want for your identifiers 
and numbers. You could create aliases in any language for any of the 
functions in Raku. You can create your own functions using any character.


- Perl regular expressions (regexes) are copied (badly??) by every !!! 
other language. But Raku takes them much further, and more flexibilty. 
After getting used to Raku regexes, I tear my hair out when I go to 
another language.


- Regexes are extended into Grammars and Actions. This in my view is 
where Raku will be most used.


- I think most of all is that I can write a program that is a bit like a 
conversation. Flow statements like 'when', 'if', 'unless', 'for', 
'with', 'without' just make it so much easier to write understandably.


- There is an explicit difference between Truthiness and Definedness. 
Eg. 'if' is about truthiness, but 'with' is about definedness. And '0' 
can be made to be 'True' if you need it to be.


I have used many languages, but I find myself coming back to Raku.

This is a quick response, and I'm sure I missed something out - oh yes: 
concurrency ...


Regards

Richard

On 14/06/2020 16:04, Radhakrishnan Venkataraman wrote:

Hi,
I had been a perl 5.0 user in the past.  Ever since perl 6.0 was 
announced, I waited, like many, indefinitely.  At last perl 6.0 has 
just started from its starting block and is also in the race.  I am 
happy about that.


Perl 5.0 was generally termed to be good at CGI scripting, system 
administration, web scraping, strong regex, processing text files etc.,


I want to know what perl 6 is so special in.  When perl 5.0 was there, 
there did not exist any other language to do the same things easily as 
perl 5.0 did. Similarly, in which areas perl 6 is special?  I am 
unable to know it from google search, as much information is 
not available.


Further, if concurrency and parallelism are the special things in perl 
6, then Rust and Go (so special in both concurrency and parallelism) 
are already spreading its wings over the information technology 
field.  Both are statically typed and compiled languages and there 
would be more "welcome gesture" for these languages in the field.


To put my question simply, where is the space for perl 6 in today's 
technology?

Please enlighten me (any body from user group) on this.

Thank you,

Regards,
Radhakrishnan


Re: regex interpolation of array

2020-06-13 Thread Richard Hainsworth

Understood. Thankyou.

The " quotes is what I missed. So $ = "@W[3]" worked as I would expect.

The other two variations, eg. $ =<{ @W[3] }>, gave Nil responses, 
indicating match failure.


On 13/06/2020 14:41, Brad Gilbert wrote:

Inside of a regex `{…}` will just run some regular Raku code.
Code inside of it will most likely have no effect on what the regex 
matches.


What you should have written was:

    $ = "@W[3]"

The thing you were thinking of was:

    $ = <{ @W[3] }>

Which could have been written as:

    

---

To have the result of regular Raku code have an effect on the match, 
it has to have <…> around it


    'TrueFalse' ~~ / <{ Bool.pick }> /

I think it is better if you use "…" if you are just interpolating a 
variable, because that is something you might do outside of a regex as 
well.


---

The reason your code matched is that an empty regex always matches.

    'abc' ~~ / "" /
    'abc' ~~ / {} /
    'abc' ~~ / {'def'} / # still an empty regex as far as the regex 
engine is concerned


On Sat, Jun 13, 2020 at 5:35 AM Richard Hainsworth 
mailto:rnhainswo...@gmail.com>> wrote:


I was playing with a regex and array interpolation.

From the documentation I thought the following comparisons would
be the same, but they are not.

What am I missing?

my @W = ;
my $S = 'perlchallengeextrathingswithweeklysome' ; #randomly concatenate 
the words without spaces say 'yes' if $S ~~ /
$=( {@W[3] }) /;
say $;
my $sol = @W[3]; # with
say 'yes' if $S ~~ / $=( $sol ) /;
say $;


yes
「」
yes
「with」





regex interpolation of array

2020-06-13 Thread Richard Hainsworth

I was playing with a regex and array interpolation.

From the documentation I thought the following comparisons would be the 
same, but they are not.


What am I missing?

my @W = ;
my $S = 'perlchallengeextrathingswithweeklysome' ; #randomly concatenate the words 
without spaces say 'yes' if $S ~~ / $=( {@W[3] }) /;
say $;
my $sol = @W[3]; # with
say 'yes' if $S ~~ / $=( $sol ) /;
say $;


yes
「」
yes
「with」





Re: perl6 with Rakudobrew

2020-06-12 Thread Richard Hainsworth
I have tried two different strategies on appveyor. (I also run a travis 
test for the same Module that passes without a problem).


a) Copying from OpenSSL, which uses rakudo.git (see script below)

b) Copying from GTK::Simple, which uses Rakudobrew (see below)

Both failed for reasons I can't work out. (The final lines are below)

Could someone suggest an install stanza that would use the latest 
`rakudo-star-***.msi` installation package?


It would be good to have some samples in the raku documentation.

I can provide my travis script (I use JJ's docker image).

[Rakudobrew]

os: Visual Studio 2017

platform: x64

install:
  -'"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' - appveyor-retry choco install strawberryperl --allow-empty-checksums

  - SET 
PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
  - git clone https://github.com/tadzik/rakudobrew %USERPROFILE%\rakudobrew
  - SET PATH=%USERPROFILE%\rakudobrew\bin;%PATH%
  - rakudobrew build moar %TEST_MOAR%
  - rakudobrew build zef
  - cd %APPVEYOR_BUILD_FOLDER%
  - echo "installing SSL so we can download the dll files"
  - zef install IO::Socket::SSL
  - zef --depsonly install .
  - zef build .

build: off

test_script:
  - prove -v -e "raku -Ilib" t/
  - zef --debug install .

shallow_clone: true
[ response from appveyor fail - last lines]
...
Generating code
Finished generating code
Microsoft (R) Program Maintenance Utility Version 14.16.27035.0
Copyright (C) Microsoft Corporation.  All rights reserved.
+++ Checking for moar NQP version
+++ Creating installation directories
+++ Removing old files
+++ Installing files
+++ Preparing installation
Installed 13 core modules in 24.63815875 seconds!
+++ MOAR BACKEND INSTALLED
+++ Installing MOAR launchers
+++ Creating Raku executable alias
+++ Rakudo installed succesfully!
Rakudo has been built and installed.
Updating shims
Done, moar-2020.05.1 built
rakudobrew build zef
Cloning into 'zef'...
Your branch is up to date with 'origin/master'.
rakudobrew: perl6: command not found
Command exited with code 1

[Rakudo.git]
os: Visual Studio 2017

platform: x64

install:
  -'"C:\Program Files (x86)\Microsoft Visual 
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"' - appveyor-retry choco install strawberryperl --allow-empty-checksums

  - SET 
PATH=C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin;%PATH%
  - appveyor-retry git clone https://github.com/rakudo/rakudo.git 
%APPVEYOR_BUILD_FOLDER%\..\rakudo
  - cd %APPVEYOR_BUILD_FOLDER%\..\rakudo
  - perl Configure.pl --gen-moar --gen-nqp --backends=moar
  - nmake install
  - SET PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\bin;%PATH%
  - SET 
PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\share\perl6\site\bin;%PATH%
  - cd %APPVEYOR_BUILD_FOLDER%
  - echo "installing SSL so we can download the dll files"
  - zef install IO::Socket::SSL
  - zef --depsonly install .
  - zef build .

build: off

test_script:
  - prove -v -e "raku -Ilib" t/
  - zef --debug install .

shallow_clone: true
[rakudo.git - avveyor failure. last lines]

+++ MOAR BACKEND INSTALLED
+++ Installing MOAR launchers
+++ Creating Raku executable alias
+++ Rakudo installed succesfully!
SET PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\bin;%PATH%
SET 
PATH=%APPVEYOR_BUILD_FOLDER%\..\rakudo\install\share\perl6\site\bin;%PATH%

cd %APPVEYOR_BUILD_FOLDER%
echo "installing SSL so we can download the dll files"
"installing SSL so we can download the dll files"
zef install IO::Socket::SSL
'zef' is not recognized as an internal or external command,
operable program or batch file.
Command exited with code 1

[end]

On 12/06/2020 20:15, Vadim Belman wrote:

I'm still using rakudobrew for myself, it is not a problem. Besides, we still 
install perl6.

What I'd look for is if correct PATH is setup; and check if rakudobrew is been 
used properly. Note that different modes (env or shim) would need different 
handling. To my understanding, in a container shims are preferable over env.

Best regards,
Vadim Belman


On Jun 12, 2020, at 2:40 PM, Elizabeth Mattijsen  wrote:

It is my understanding that rakudobrew has been renamed to rakubrew: 
https://rakubrew.org  Could the be the issue?


On 12 Jun 2020, at 14:59, Richard Hainsworth  wrote:

I ran into this error using Rakudobrew on appveyor (see after )

I'm new at using appveyor, so maybe my script is wrong. But I wonder whether 
its because of a name change to raku without a backward alias to perl6.



Rakudo has been built and installed.

Updating shims
Done, moar-2020.05.1 built
rakudobrew build zef
Cloning into 'zef'...
Your branch is up to date with 'origin/master'.
rakudobrew: perl6: command not found
Command exited with code 1


perl6 with Rakudobrew

2020-06-12 Thread Richard Hainsworth

I ran into this error using Rakudobrew on appveyor (see after )

I'm new at using appveyor, so maybe my script is wrong. But I wonder 
whether its because of a name change to raku without a backward alias to 
perl6.




Rakudo has been built and installed.

Updating shims
Done, moar-2020.05.1 built
rakudobrew build zef
Cloning into 'zef'...
Your branch is up to date with 'origin/master'.
rakudobrew: perl6: command not found
Command exited with code 1


Re: Issues with "zef install Informative" under Windows

2020-06-08 Thread Richard Hainsworth

Todd,

I wrote Informative a while ago. So as to make it self-contained, I 
copied code from GTK::Simple (as stated in the comments).


The reason for this is that GTK::Simple itself is quite large with a lot 
of boilerplate for many functions.


So, does GTK::Simple install on Windows 10?

If so, I will edit the Informative to the newest version of GTK::Simple.

Regards,

Richard


On 08/06/2020 22:55, ToddAndMargo via perl6-users wrote:

Hi All,

Window 10-2005
Rakudo version 2020.05.1 built on MoarVM version 2020.05

Informative installs perfectly in Fedora (Linux), but
not Windows 10.  "--force-build" does not work either

Anyone know how to fix this?

Many thanks,
-T


K:\Windows\NtUtil>Issues with "zef install Informative"

===> Searching for: Informative
===> Building: Inform:ver<1.2>:auth
[Inform] At line:1 char:192
[Inform] + ... ystem.io.file]::openread((resolve-path $file 
-replace \"-\",\"\"  ...

[Inform] +    ~
[Inform] You must provide a value expression following the '-' operator.
[Inform] At line:1 char:192
[Inform] + ... -replace \"-\",\"\" } get-sha256 
C:\Users\tony\.zef\store\p6-inform.g ...

[Inform] + ~
[Inform] Unexpected token '\",\"\" } get-sha256 
C:\Users\tony\.zef\store\p6-inform.git\7dd537445b8a20956fc4ab438941718415871999\
[Inform] resources\blib\lib\GTK\libatk-1.0-0.dll"' in expression or 
statement.
[Inform] + CategoryInfo  : ParserError: (:) [], 
ParentContainsErrorRecordException

[Inform] + FullyQualifiedErrorId : ExpectedValueExpression
[Inform]
[Inform] Effective index out of range. Is: -1, should be in 0..^Inf
[Inform]   in block  at 
C:\Users\tony\.zef\store\p6-inform.git\7dd537445b8a20956fc4ab438941718415871999\Build.pm 
line 53
[Inform]   in method build at 
C:\Users\tony\.zef\store\p6-inform.git\7dd537445b8a20956fc4ab438941718415871999\Build.pm 
line 47

[Inform]   in block  at -e line 1
[Inform] Actually thrown at:
[Inform]   in block  at 
C:\Users\tony\.zef\store\p6-inform.git\7dd537445b8a20956fc4ab438941718415871999\Build.pm 
line 90
[Inform]   in method build at 
C:\Users\tony\.zef\store\p6-inform.git\7dd537445b8a20956fc4ab438941718415871999\Build.pm 
line 47

[Inform]   in block  at -e line 1
===> Building [FAIL]: Inform:ver<1.2>:auth
Aborting due to build failure: Inform:ver<1.2>:auth 
(use --force-build to override)


Re: I need help finding a class for a method

2020-06-08 Thread Richard Hainsworth

Todd,

The 'unit' in line 3 means something like 'this whole file is the 
Module' so there are no Begins/Ends/brackets.


The opening bracket for class Informing is on (or about) line 10 and the 
closing in at about line 630, with a comment 'end of Informing class'


Richard

On 08/06/2020 21:47, ToddAndMargo via perl6-users wrote:

On 2020-06-08 05:35, Fernando Santagata wrote:
On Mon, Jun 8, 2020 at 2:11 PM ToddAndMargo via perl6-users 
mailto:perl6-users@perl.org>> wrote:


    On 2020-06-08 04:32, Fernando Santagata wrote:
 > On Mon, Jun 8, 2020 at 1:20 PM ToddAndMargo via perl6-users
 > mailto:perl6-users@perl.org>
    >> wrote:
 >
 >     On 2020-06-08 03:38, Fernando Santagata wrote:
 >       > …and line 3:
 >       >
 >       > unit module Informative;
 >
 >     3: unit module Informative;
 >
 >     Does not look like a class to me.  What am I missing?
 >
 > It's a namespace declaration, see:
 >
 >
https://docs.raku.org/language/syntax#index-entry-declarator_unit-declarator_module-declarator_package-Package,_Module,_Class,_Role,_and_Grammar_declaration
 >
 > That's the reason why the class name is Informative::Informing
    and not
 > just Informing.

    Hi Fernando,

    I see:

     Several packages may be declared in a single file.
     However, you can declare a unit package at the start
     of the file (preceded only by comments or use
     statements), and the rest of the file will be taken
     as being the body of the package. In this case, the
     curly braces are not required.

     unit module M;
     # ... stuff goes here instead of in {}'s

    I thought methods had to be part of classes?  Or
    how the above relates to the methods in the module.

    I am confused.


Methods are just subroutines which take an implicit first argument: 
the object they are operating on.


All the methods in the module you mentioned are methods of the 
Informative::Informing class. You can check it by matching the '{' at 
the beginning of the class declaration with the corresponding '}'; 
method show() is inside the class.


OTOH there's a "sub inform" in the "Informative" namespace which is 
not inside a class and is indeed a simple sub, even if it has been 
localized in that namespace. You can call that sub without prepending 
its namespace, since it has been declared as "is export."


--
Fernando Santagata



Hi Fernando,

I get all that and well written.  Thank you!

Here is my problem.  I am using Geany as it works well
over "ssh-X11" and I have to do a lot of work remotely.
And it is beautifully cross platform (I support Linux,
Windows, and Mac).

In Geany, the beginning "{" and ending "}" brackets color
blue (red if you forget one).  I CAN'T FIND THE ENDING
BRACKET!   I also can't find the "Informative::Informing
class" declaration.

This is me being blind, not misunderstanding.

Since you have found them, would you mind giving me
the line number for the "Informative::Informing class" declaration and 
the line numbers for the beginning

and ending curly brackets?

Many thanks,
-T


Re: What is the zef command to update a module?

2020-06-08 Thread Richard Hainsworth

Todd, Hi. Its

zef upgrade Informative

zef upgrade

will upgrade all the modules you have downloaded.

FYI

zef is now pulling v.1.0 of Informative, which has red countdown numbers 
as default.


Richard

On 08/06/2020 12:14, ToddAndMargo via perl6-users wrote:


# zef update Informative
A plugin name was provided that does not exist or does not support 
'update'


What am I doing wrong, this time?


Re: I need help finding a class for a method

2020-06-08 Thread Richard Hainsworth

Look at line 10

class Informing {

On 08/06/2020 11:31, ToddAndMargo via perl6-users wrote:

Hi All,

Over on

https://github.com/finanalyst/p6-inform/blob/master/lib/Informative.pm6

Line 144:

    method show(
    Str $str?,
    Int :$timer,
    Bool :$show-countdown
    ) {

where is the class that is linked to that method?

Many thanks,
-T


Re: I need a GTK pop up with time out

2020-06-08 Thread Richard Hainsworth

Todd,

I'm answering in the list again because I can't help you.

The problem shown in the screenshot seems to be a problem with GTK on 
Windows.


I don't have the same output on Ubuntu - as you can see from the images 
on my computer


https://ibb.co/C0x5P30

Since I don't know anything about Windows since the time Ubuntu started, 
I can't help you.


On 08/06/2020 04:34, ToddAndMargo via perl6-users wrote:

On 2020-06-07 19:47, ToddAndMargo via perl6-users wrote:

Hi Richard,

How do I stretch the box out so it will show
the entire title?

-T


Only one letter in the title shows
https://ibb.co/X3sVxBV


Re: I need a GTK pop up with time out

2020-06-08 Thread Richard Hainsworth

Todd,

Please see below. I'm leaving this in the list because you raise 
questions of style.


On 08/06/2020 03:45, ToddAndMargo via perl6-users wrote:

On 2020-06-07 08:45, Richard Hainsworth wrote:

By directions, I mean the (English) definition of
what each variable does. What do the following do:

:buttons,
:Response,
:timer,
:title,
:show-countdown,
data.response = <$data.response>;
etc.

They may be somewhere there, but I need a link
to them


In the example I gave in my README file (which I copied to a separate 
file and it runs as expected), I gave a way in which each argument is 
used. Also the names of the arguments are intended to be self-explanatory.


So buttons is about 'buttons', title is about the title, etc.

When I download a new module, I want to see how to use it, I don't find 
long word explanations to be much use.






print "data response is = < { $popup.response } >";


That has got me into trouble before.  I switched to
 print( "data = <" ~ $popup ~ ">\n" );
This will give you information about the object, as I explained in some 
detail before.

print( "data.response = <" ~ $data.response ~ ">\n" );

This is the same as putting {} into a "-enclosed string.


 data = >
So here you get the contents of data, which is an object, and this is 
the short way Raku tells you about objects.

data.response =    # or OK


And here you get the data you want. When the box came up, you clicked on 
the 'Cancel' button. The Cancel button was associated with the


string 'Cancel'. Try some of the other buttons and you get other 
strings. That's why I put various forms of nonsense in the example, to 
induce the reader to try to get the strings.



Also note that you have not defined $data.


oops.

What is with the weird
    data = >

$data holds an object of type Informing.




2) why do I have to have more than one button?
`:buttons( OK=>'OK Maybe' )` errors with

  Type check failed in binding to parameter
  '@buttons'; expected Positional but got Pair
  (:OK("OK Maybe"))


More than one button, possible!

But look at the error message. You have specified `OK => 'string'` 
which is the definition of a Pair, as the error message says.


But what is wanted is a Positional, as the error message says. An 
example of a Positional is an Array. So try this


`:buttons( [ :OK("OK Maybe") ] )

The [ ] creates an Array, which is a Positional.




In my example, I gave three Pairs separated by commas. That is 
interpreted by raku as a Sequence, which is also a Positional.


You could have written

:buttons(:OK("OK Maybe) , ) # note the trailing comma, which is 
essential here.


So it was the comma.  H
To be honest, I find Sequences, Arrays, Slip et al the MOST frustrating 
part of Raku. There is a whole tutorial in the Documentation about them. 
Its worth reading several times. But I can see that the reason for the 
very fine differentiation in Raku between Sequences and Array gives the 
language much more flexibility.


There is no reason why an Array can only have one item. But in order 
to make things generic, there needs to be a way to have more than one.


I have array's all the tme with only one element.  Then add t them 
latter.  Raku does not seem to care.  So I am confused


So am I. What does 'Then add t them latter' mean in English? Do you mean 
'Then add t to them later'? Why would you add 't'? Where would you add 't'?





how do I turn it into something useful to me?



5) What is popup suppose to show?

Say what?


$popup.show(


It 'show's $popup again. I thought this was being intuitive. Do I really 
need to say " $popup.show() shows popup again."


I know that is what JAVA does all the time, and I get really irritated 
saying "Something something is something". But the paradigm of Raku is 
to be intuitive in the way programs are written.






6) why is it not dismissing after 5 seconds?
I don't understand this. I am not prescient - I cannot see what is 
happening on your screen with your setup. It works fine on my computer.


It just sits there on my screen.  You example works though.

You gave me a screenshot,

https://ibb.co/X3sVxBV

Do you see the 20 in white in the lower right of the box? That is a 
countdown number. When it goes to zero, the box disappears.


The box sits there for 20 seconds with the counter going down. If you 
can't see the counter, 


I thought I was being clever in making the screen shot only just 
visible. If you didn't notice the countdown clock, then I was being too 
clever. I'll change it to red by default.


Here's an example.

https://ibb.co/C0x5P30

Note the responses in the terminal panel, eg. we have b2.

By the way, this is CommaIDE which is written by  Jonathan. It can be 
used on Windows.


https://ibb.co/b54K2Yn
https://ibb.co/vhFmT9L

This probably means I'll need to add a c

Re: question about the multi in method

2020-06-08 Thread Richard Hainsworth

Ok Todd, let me have a go at this issue.

From what I understand, you see 'multi' and think 'there are more than 
one', which leads to the question 'where are they?'


My understanding of 'multi' is 'there COULD be more than one', which 
leads to the question 'are there any?'


This is actually a very powerful aspect of Raku.

There are (as has been stated in this thread) four types of which  multi 
= 'could be more than one' and only = 'only one' .


If the developer wrote 'only sub' then, no one else could write a sub 
with that name. For a developer of a program or a module, that might be 
OK, because it's unlikely anyone else would need/want to use that name. 
But for a compiler, the probability is reversed. Someone will want to 
use it. That is why in many other languages there are 'reserved words' 
which you are not allowed to use.


In Raku, if you develop a new type, for example say a quodion, and you 
want to 'add' quodions, then you CAN use + because it can be overloaded. 
It is defined as a multi.


Or in your most overused example 'needle' can be rewritten to take a 
quodion, which may yield a spectrum of results because that's what 
quodions are for.


Since needle is defined as a 'multi', if you write a 'needle' method for 
quodions, the needle for strings STILL exists, and Raku will correctly 
call the method you wrote for quodions if a quodion is implied, but call 
the default needle if a string (or any other type) is used.


Since you have developed the quodion method entirely for your paid 
subscribers, the module is NOT available to the public, so you wont tell 
anyone about it. So it doesn't have to be in the documentation.


Is this making any sense to you?

Richard

On 08/06/2020 09:25, Peter Pentchev wrote:

On Mon, Jun 08, 2020 at 12:12:07AM -0700, ToddAndMargo via perl6-users wrote:

On 2020-06-07 22:39, Peter Pentchev wrote:

I thought I explained that. The Rakudo developers are*never*  finished
with the development of some methods. Somebody*will*  want to extend
them in their own module. The Rakudo developers*want*  to declare some
methods as "multi" to allow the Rakudo users to write Raku programs that
extend some existing classes to make them do interesting things.

You did and I understood it.  Your explanation was well
though out/

What you missed was my point that the developers have a
process for checking in new code.  Part of that process
is updating the documentation.  That is the proper
time for documentation to be updated.  The purpose of
the documentation is not to keep places open for unicorns.

Now you are absolutely correct that the software is NEVER finished.  But
Raku is not a "daily" release to the public.
They exist, but are not released to the general public.
Raku has releases.  When the new release his, the
documentation need to match the release.  It is
all part of the check in process.

Nothing. Needs. To be. Updated.

For the last time. The methods are "multi" for two reasons:
- to allow other parts of Rakudo to use them *internally*
- to allow *module authors* and *application writers* like you and me
   to extend them in our own classes

Both of these are very valid reasons to declare some methods as "multi".

Nothing needs to change in the documentation.


What did you learn from going to Github? That you may call
.starts-with() without the :i or :m parameters? Was that not written in
the documentation? Or that you may call .starts-with() with a $needle
being Cool and not Str? Again, was that not written in the
documentation? So what did you learn from going to Github that was not
in the documentation?

Nothing I remember.  But that was not my point.

What is your point then? What *exactly* is lacking in the documetation
of the Str.starts-with() method, *and why*? Examples, please.
And no, *don't* say "the internal method without the :i and :m" without
explaining *why* you want it to be "documented".

G'luck,
Peter



Re: I need a GTK pop up with time out

2020-06-07 Thread Richard Hainsworth

Mea culpa

:!show-countdown === :show-countdown(False)

:show-countdown === :show-coundown(True)

But skewer-names, not snake.

Thanks Peter for the correction.

Richard

On 07/06/2020 17:18, Peter Pentchev wrote:

On Sun, Jun 07, 2020 at 04:45:16PM +0100, Richard Hainsworth wrote:

Todd

I'm answering this question in the main list to explain some shortcuts.

Just to make sure it all works (if Windows will accept GTK), copy the
program from the Readme to a script file and run it with raku.

Playing around with it should make things clear.

On 07/06/2020 07:16, ToddAndMargo via perl6-users wrote:

[snip]

7) why is there no "show-countdown"?

There is! `:show-countdown` is named parameter to the method 'show', and an
example is shown.

By default `:show-countdown` is True, so there is no need to set it if you
want a countdown. If you dont want a count-down shown, then you need to set
`:!show-countdown` , which in itself is a shortcut for
`show-countdown(True)` . This was one of the examples.

Just a minor point: ITYM "a shortcut for show_countdown(False)" :)


Those shortcuts are becoming fairly common raku idioms. I didn't think it
would be necessary to document them.

G'luck,
Peter



Re: I need a GTK pop up with time out

2020-06-07 Thread Richard Hainsworth

Todd

I'm answering this question in the main list to explain some shortcuts.

Just to make sure it all works (if Windows will accept GTK), copy the 
program from the Readme to a script file and run it with raku.


Playing around with it should make things clear.

On 07/06/2020 07:16, ToddAndMargo via perl6-users wrote:

On 2020-06-04 04:35, Richard Hainsworth wrote:

Todd,

I wrote you one a very long time ago, after a question from you.

The module is called "Inform". Its on the modules site.

Since it was a long time ago, there may be some bit-rot. Let me know 
if there is .


The module should show how to use GTK, and there is a time-out function.

Richard, aka finanalyst

On 04/06/2020 02:55, ToddAndMargo via perl6-users wrote:

Hi All,

Okay, now I know I am pushing it.  Can anyone point me to
an example of a GTK information pop up with a time out
feature?  Or similar?

Many thanks,
-T


Hi Richard,

Some follow questions:

1) where are the directions? 
I don't understand this question. Which directions? I tried to make the 
example as full of explanation as possible.

where are the
variable definitions?

I don't understand this. The variables are all defined.


in the following:

# my first attempt:


first you will need a 'my'. In the example, I put:

my $popup = inform  etc

As I said, but I expanded in the comments, 'inform' is a subroutine that 
returns and 'Informing' object.


Actually, this is also a pointer in answer to something you asked 
elsewhere. This is a way of creating something to which methods are 
attached.



$popup = inform( 'Something cleaver here',
 # :buttons(Dismiss => 'Dismiss Test', 
:Response('Dismissed'))

 # :buttons(Dismiss => 'Dismiss Test'),
 # :buttons( OK=>'OK',b2=>'Not on your life', 
'Cancel'=> "I don't want to")

 :buttons( OK=>'OK Maybe', b2=>'Not on your life' ),
 :timer(5),
 :title("5 second Countdown test"),
 :show-countdown );
print( "popup = <$popup>\n" );
print( "data.response = <$data.response>\n" );


The first print should give you something about the Informing object

Note that in the second print, you have invoked the `.response` method 
on the object. This is used to extract the information from the dialog 
box. However, you have used '<' which is used inside a "" string for 
other things. Better to use


print "data response is = < { $popup.response } >";

Also note that you have not defined $data.



2) why do I have to have more than one button?
`:buttons( OK=>'OK Maybe' )` errors with

  Type check failed in binding to parameter
  '@buttons'; expected Positional but got Pair
  (:OK("OK Maybe"))


More than one button, possible!

But look at the error message. You have specified `OK => 'string'` which 
is the definition of a Pair, as the error message says.


But what is wanted is a Positional, as the error message says. An 
example of a Positional is an Array. So try this


`:buttons( [ :OK("OK Maybe") ] )

The [ ] creates an Array, which is a Positional.

In my example, I gave three Pairs separated by commas. That is 
interpreted by raku as a Sequence, which is also a Positional.


You could have written

:buttons(:OK("OK Maybe) , ) # note the trailing comma, which is 
essential here.


There is no reason why an Array can only have one item. But in order to 
make things generic, there needs to be a way to have more than one.




3) what is the difference between "buttons" and "response"?
Both of these give two buttons:
  :buttons(Dismiss => 'Dismiss Test', :Response('Dismissed'))
This is simply raku. There are two ways to define a pair (a) String => 
SomeObject, (b) :String(SomeObject)

When you use => the key is autoquoted to make it a string.

4) why am I getting a weird response:
 popup = >


Not at all weird, but highly informative :) . This is telling you that 
popup is an Informing Object instance from the Informative Module.


If you look at the text (which you can find in github - my p6/raku 
repositories are public), you will see how Informative is defined.



data.response = .response>

5) What is popup suppose to show?

Say what?


6) why is it not dismissing after 5 seconds?
I don't understand this. I am not prescient - I cannot see what is 
happening on your screen with your setup. It works fine on my computer.


7) why is there no "show-countdown"?


There is! `:show-countdown` is named parameter to the method 'show', and 
an example is shown.


By default `:show-countdown` is True, so there is no need to set it if 
you want a countdown. If you dont want a count-down shown, then you need 
to set `:!show-countdown` , which in itself is a shortcut for 
`show-countdown(True)` . This was one of the examples.


Those shortcuts are becoming fairly common raku idioms. I didn't think 
it would be necessary to document them.





Many thanks,
-T

Hope the Module could be of some use.


Re: changing name of module

2020-06-07 Thread Richard Hainsworth
Why nanoseconds slower? (I won't notice them, but why would a name 
change slow things?)


If alignment is not a concern, then p6 and raku are equivalent?

On 07/06/2020 13:31, Parrot Raiser wrote:

Create an updated version, perhaps with an "rk" prefix, (preserving
any text alignment, since "p6" and "rk" are the same length), then
change the "pk" version simply to invoke the "rk"?

Existing code should continue to work, albeit nanoseconds slower,
while new code can be culturally consistent.


changing name of module

2020-06-07 Thread Richard Hainsworth

Hi,

I've written some modules and released them into the Ecosystem. (I don't 
use cpan for raku)


In the past, I have named my modules 'p6-xxx'. So references for zef 
would be git - finanalyst - p6-xxx (loosely speaking).


Now I am considering whether to rename the module to `raku-xxx`

There are three alternatives:

a) leave the module name as before - historical roots.

b) change the name in my github repo, and change the source reference in 
the public ecosystem file 
(https://github.com/Raku/ecosystem/blob/master/META.list).


I don't know what would happen if someone has installed the module using 
zef, and the source changes.


c) leave the old versions of the module with one source, create a new 
repo and bump the version number in the META.json file


Any comments about what might be best practice?

Regards,

Richard


Re: I need a GTK pop up with time out

2020-06-04 Thread Richard Hainsworth

Todd,

I wrote you one a very long time ago, after a question from you.

The module is called "Inform". Its on the modules site.

Since it was a long time ago, there may be some bit-rot. Let me know if 
there is .


The module should show how to use GTK, and there is a time-out function.

Richard, aka finanalyst

On 04/06/2020 02:55, ToddAndMargo via perl6-users wrote:

Hi All,

Okay, now I know I am pushing it.  Can anyone point me to
an example of a GTK information pop up with a time out
feature?  Or similar?

Many thanks,
-T


Re: I reproduced one of the errors!

2020-06-03 Thread Richard Hainsworth




Is there a way to write a methods as I would write
a sub and avoiding the class thing?

-T
I suppose if a sensei were to ask what blue and yellow make - after 
explaining colour mixing in great detail - then get the answer red, 
would the sensei hit her head upon a wall? ... if the aspirant is blind???


Re: I reproduced one of the errors!

2020-06-03 Thread Richard Hainsworth

This is so good as a reply!!!

Makes the tedium of questioning worth paying attention to.

On 02/06/2020 16:41, Parrot Raiser wrote:

I suspect that "methods" were originally distinguished from
"subroutines" because it made the rain-dance about the new cure for
all civilisation's ills and the heartbreak of psoriasis,
Object-Oriented Programming,  look more impressive. After one has seen
a few programming religions launched, the similarities blur the
differences.  Profundity through obscurity always helps the marketing,
because it slows the recognition.

Subroutines are blocks of code that can be used anywhere within a
scope that may be global or local. Methods are a subset of subroutines
that can only be used within a particular scope on particular kinds of
things.


Re: I reproduced one of the errors!

2020-06-01 Thread Richard Hainsworth

Todd,

You said you asked if you could create your own methods, and that you 
were told 'no'. That was a surprising statement, so I asked about some 
context about who would say such a stupid(?!) thing. Seems like this was 
a half-remembered 'no' somewhere in a cloud . Lets leave it there.


You often ask questions that get interesting answers. But rather than 
guessing what you're thinking, perhaps you might explain how you see a 
'subroutine' differing from a 'method'. If you look at the Raku 
documentation, which I know for you, is like shoving your head in a 
barrel of cold water, you will find quite a few examples of methods, 
subs, blocks, and pointies, together with things called signatures. 
Repeating any of this material won't help you. So what is a method to 
you? How do you think it might be used?


Richard

On 01/06/2020 22:06, ToddAndMargo via perl6-users wrote:

On 2020-06-01 13:46, Richard Hainsworth wrote:

Todd,

I'd be interested to see where someone said 'no' to creating your own 
methods.


Methods are integral to the whole idea of a class.

It's also clear throughout the Raku documentation that there are methods. 



But for a method, you need a class. Peter put the method in a class.

Do you want a method 'outside' a class? If so, what exactly do you 
think a method outside a class would do?


No idea what you are getting at.  I would just like
to create and run them as I do with subroutines.



Richard



Hi Richard,

I checked my sent bin and I had deleted it back a
years, so it did not show up.   I also checked

https://www.mail-archive.com/perl6-language@perl.org/

And if it is there is is drowned out by so many
other hits.

And I checked my own internal documentation, and
it says a lot about what they are, but not about
creating them (it will now).

So, Rats.  Maybe someone else reading this will
remember.

Do you have a favorite primer on creating methods
you could send me a link to?

I am delighted I can do my own methods.  Raku,
now 1002 ways of doing everything!  I do adore Raku!

-T


Re: I reproduced one of the errors!

2020-06-01 Thread Richard Hainsworth

Todd,

I'd be interested to see where someone said 'no' to creating your own 
methods.


Methods are integral to the whole idea of a class.

It's also clear throughout the Raku documentation that there are methods.

But for a method, you need a class. Peter put the method in a class.

Do you want a method 'outside' a class? If so, what exactly do you think 
a method outside a class would do?


Richard

On 01/06/2020 21:38, ToddAndMargo via perl6-users wrote:

On 2020-06-01 02:21, Peter Pentchev wrote:

class Thing {
multi method do-things(Int:D $value) {
    say "A thing can do things with an integer: $value";
}

multi method do-things(Rational:D $value) {
    say "A thing can do things with a rational number: $value";
}
}



Hi Peter,

I have asked this question before.  Is it possible for
me to create my own methods.  The answer came back as
"no".

Did you just demonstrate for me how to create my own
methods?

-T


Re: I reproduced one of the errors!

2020-05-31 Thread Richard Hainsworth

Probably more like: I won't understand if I don't read.

On 31/05/2020 18:43, ToddAndMargo via perl6-users wrote:
On Sun, May 31, 2020, 09:05 Veesh Goldman > wrote:


    読めないと分かりませんよ。


On 2020-05-30 23:15, Veesh Goldman wrote:

Sorry, my Japanese is mediocre.
Meant to say that you can't complain about not understanding 
something if you haven't learned how to read it.




Google Translate: "I can't understand if I can't read"


Re: I need help with IO.e

2020-05-19 Thread Richard Hainsworth

Peter,

What a genius answer!

The transcendental abundance of purple in Raku :)

On 18/05/2020 22:26, Peter Pentchev wrote:
It's the internal representation of the program you told Raku to 
parse

and execute; the truth is that, just like in a sci-fi story about
a machine that is supposed to answer any question, but only comes back
with "the question has not been asked correctly", ...

In case anybody is curious,
http://www.gutenberg.org/cache/epub/33854/pg33854.txt

G'luck,
Peter



Re: subst :g and captures in the replacement

2020-04-19 Thread Richard Hainsworth

Yary,

I tried your examples out in REPL after reading Tobias and Timo's 
responses.


After the second example, I tried outputting the  result of '$/' which 
contains the  whole capture from the last regex match. My result was


> 'fosdffgg'.subst(/(f+)/,'( ' ~ $0 ~ ' )',:g)
( f )osd( f )gg
> $/
(「f」
 0 => 「f」 「ff」
 0 => 「ff」)
>
In addition, I recall that $0 is syntactic sugar for $/[0].

On 19/04/2020 22:53, yary wrote:

Question from today's Raku meetup. This works in a way I expect

> 'fosdffgg'.subst(/f+/,"( "~ * ~" )", :g);
( f )osd( ff )gg

This one, $0 gets the single f each time

> 'fosdffgg'.subst(/(f+)/,"( $0 )", :g);

( f )osd( f )gg

Bug or misunderstanding on my part?

-y


Re: tip: Windows, Git, and those nice Linux utilities

2020-04-10 Thread Richard Hainsworth
Whether or not git is "required" (for some definition of required) for 
zef is somewhat irrelevant.


A computer is required for zef, so is an operating system. Not 
everything can be included in a distribution.


The real question is therefore which things (modules/tools/etc) should 
be included in a distribution that someone in the target audience may 
not have, and which may it be assumed that someone in the target 
audience will already have or can find. It seems fairly obvious to me 
that git is something a developer should have or can easily obtain.


But that is a matter of judgement. Leaving git out is not 'a mistake', 
not was it 'forgotten'. It was a judgement.


It is also a matter of judgement as to whom the target audience is. But 
that is entirely another topic.


On 10/04/2020 01:37, ToddAndMargo via perl6-users wrote:

On 2020-04-09 09:39, Richard Hainsworth wrote:

Am I missing something here?

It would seem obvious to me that Git and Raku are not linked in any 
way, except of course for developers who only use Git with Raku, or 
who only have a dependency on Git through zef.


It would therefore seem to me that a Raku / Zef distribution should 
NOT bundle Git. Consequently, 'Git' is not "forgotten" and that is 
*should* be installed independently.


Git is required for Zef to operate.  So Git is a dependency
of Zef.  Therefor Zef should either include Git or warn
the user that he needs to download it himself


Re: tip: Windows, Git, and those nice Linux utilities

2020-04-09 Thread Richard Hainsworth

Am I missing something here?

It would seem obvious to me that Git and Raku are not linked in any way, 
except of course for developers who only use Git with Raku, or who only 
have a dependency on Git through zef.


It would therefore seem to me that a Raku / Zef distribution should NOT 
bundle Git. Consequently, 'Git' is not "forgotten" and that is *should* 
be installed independently.


In fact, since Github is now owned by Microsoft, it seems a little 
strange to require 'zef' to include it in an installation.


Regards,

Richard

On 09/04/2020 11:47, ToddAndMargo via perl6-users wrote:

Hi All,

Since the Raku Windows Installer forgets to install Git along
with Zef:

    https://github.com/rakudo/star/issues/145

You have to install Git yourself:

    https://git-for-windows.github.io/

Now here is a sweet feature of having Git installed.
It comes with all kind of nice Linux utilities, like ls,
tar, more, etc..

To get access to them:

-->  sysdm.cpl
  --> Advanced (tab at the top)
   --> Environmental Variables (button, lower right)
    --> Path, Edit, add to the end
  ;C:\Program Files\Git\usr\bin

I don't know about you guys, but every time I
want a directory listing in Windows, I type
`ls` and have to go back and change it to `dir`.
No longer!

:-)

-T


Rational numbers... was Re: irrational nubmer?

2020-02-20 Thread Richard Hainsworth
Hi Todd,

This is going to be hard for an intuitive guy like you, but it can be
proven that 100% of all numbers are irrational (see
https://math.stackexchange.com/questions/1556670/100-of-the-real-numbers-between-0-and-1-are-irrational
).

Except the ones that a computer can do operations on, which are by
definition Rational, as others in the list have already said.

The apparent paradox between these statements arises because of the logic
of infinities.

However, my question to you is: when would you come across an irrational
number in a computer? How would you express it? Suppose I gave you a
function  sub irrational( $x ) which returns true for an irrational number.
What would you put in for $x? Bear in mind that anything like pi or sqrt(2)
is either going to be infinitely long or a rational approximation.

So I could argue that raku already has a function irrational. It is called
False.

Regards,
Richard

On Thu, Feb 20, 2020, 02:58 ToddAndMargo via perl6-users <
perl6-users@perl.org> wrote:

> Hi All,
>
> This is a complete trivia question.
>
> Is there a test to see if a number is irrational,
> such as the square root of two?
>
> And how does Int handle a irrational number?  Is
> there a limit to magic Larry powder?
>
> Many thanks,
> -T
>


Re: I need syntax to sub declare return a hash and an array

2020-01-21 Thread Richard Hainsworth

sub x( --> Hash) { my %h = A => 'a' }

1) '-->' in the signature is the best way to provide information to the 
compiler about what the subroutine should return


2) 'returns' in the declaration (not the part in the block) used to be 
used, but for some arcane reason that I never really understood, it is 
deprecated.


3) 'Hash' or 'Associative'. These all refer to roles that a hash will 'do'.

4) A block (that is the { ... } bit) will always 'return' the last 
expression evaluated. So there is no need for the 'return %h' in your 
code. 'return ...' is only needed if you  have some logic where the 
block can exit in several places, not just the last expression.


5) To specify an 'array', you can use 'sub x( --> Array) { my @a = 1..* }'

6) HOWEVER, you really do need to read the documentation about 
Sequences, lists and arrays.


Richard

On 21/01/2020 04:09, ToddAndMargo via perl6-users wrote:

On 2020-01-20 19:55, ToddAndMargo via perl6-users wrote:

Hi All,

What is the proper way to state that I am returning a
hash from a sub?   `sub x() returns % {}`

And an array?  `sub x() returns @ {}`

Many thanks,
-T



I think this is it:

> sub x() returns Associative { my %h= A=>"a"; return %h}

> x
{A => a}


> sub y() returns Array { my @a=(1,2,3,2,1) ; return @a}

> y
[1 2 3 2 1]


Am I too high up the food chain with Associative and Array?

-T


Re: Circular loading?

2020-01-16 Thread Richard Hainsworth

What is in WinReg?

Bear in mind that the top level Raku program is compiled into memory and 
run. But the default for any Module is that it is compiled first, and 
the compiled version is stored. (You can prevent precompilation by using 
the statement "no precompilation;" which can be useful if you want to 
have trace statements. But don't forget to take out the 'no 
precompilation' once development has finished.)


So the Raku compiler finds all the 'use' statements, and looks for an 
already compiled version of some module (lets call it Module) - the 
'precompilation'. (Have you noticed any .precomp/ directories in the 
directory you run the program from?) There is a reason for this, but 
it's a bit long to explain here.


If a precompiled version cannot be found by Raku, then it will compile 
the first source of Module and store it in an appropriate place (a local 
.precomp/ directory if you are developing Module and you haven't 
installed it). That is why when you run a Raku program for the first 
time with a big module it takes for ever, but the next time it goes 
quite  fast.


If there is a 'use' statement in the Module, then Raku will do the same 
for that module.


What often happened to me was that I developed a module and I had a "use 
lib 'lib';" statement in it. When the module was the top program (so to 
speak), no errors arise, but when you try to pre-compile that Module, 
you get an error.


The way around this is to delete the 'use lib ...' pragma. And instead, 
compile with 'raku -Ilib ...' (or 'perl6 -Ilib'). Note that the option 
is Capital I not lower l (the font in my email agent doesn't make it 
easy to see the difference).


This option implies that there is a directory 'lib' local to the 
directory where the raku compiler is being invoked, and that your module 
WinReg.pm6 is in 'lib'. Raku then looks FIRST at 'lib' for Module. If it 
finds a source there, it compiles it and stores it. It then does not 
look any further for WinReg.pm. For other modules, Raku will then look 
along the default linked list of directories until it finds a source it 
can use.


Hope this helps a bit.

Richard

On 16/01/2020 20:15, ToddAndMargo via perl6-users wrote:

On 2020-01-16 11:45, ToddAndMargo via perl6-users wrote:

Hi All,

How do you troubleshoot:

  raku -I. -c WinMessageBox.pm6

  Circular module loading detected trying to
  precompile /home/CDs/Windows/NtUtil/WinReg.pm6

I have traced it down to this:


 use WinReg :to-UTF16-c-str;
or just
 use WinReg;


Comment it out and it checks fine.  I am not calling
any modules imported from WinReg.pm6 at this point.

What is going on?

Yours in confusion,
-T


Does this help?

$ raku -I. --stagestats -c WinMessageBox.pm6
Stage start  :   0.000
Stage parse  : ===SORRY!===
Circular module loading detected trying to precompile 
/home/CDs/Windows/NtUtil/WinReg.pm6


Re: Once again - You say one thing and do another Re: Bug to report: cardinal called an integer

2020-01-15 Thread Richard Hainsworth

Todd,

You just did exactly what Liz said you would do by writing 'Richard has 
not liked me for a long time'.


Do you not even re-read your own posts or have the self-awareness to 
recognise it? Really?


Does it matter whether or not 'I like you'? This list is not some place 
for social media types where the most important thing is whether 'she 
liked me' or not.


As to profuse thanks: it's can be very irritating to scroll to the end 
of long long long post only to find you have written 'thanks'. Try '+1' 
at the beginning.


You write below "That is a good character trait on your part.  I will 
wear you down eventually."


Sounds to me that you think we are idiots for helping you. And if you do 
'wear us down eventually', what does that mean? That will we stop 
replyng to you? or completely ignore you? or remove you from the email list?


Are any of those alternatively particularly attractive to you?

This hopefully will be the last time I respond to this thread.

I have replied to the other thread about cardinals because you raised a 
particularly interesting topic with some deep roots in mathematics and 
semiotics (though you may not have realised it). As I said below, you 
have a unique ability to ask questions. Perhaps what can be annoying is 
that you don't always listen to the answer.


Regards,

Richard

On 15/01/2020 22:39, ToddAndMargo via perl6-users wrote:

On 2020-01-15 14:18, Elizabeth Mattijsen wrote:

Thank you Richard for this long and thoughtful answer.

I have already given up on Todd, I'm glad to see others haven't 
(yet).  What will follow is probably a response that is either: a. 
everybody is against me, b. the Raku community won't listen, c. the 
various variations on those themes.  I sincerely hope that I'm wrong.


Liz


Hi Liz,

Richard has not liked me for a long time.  There
is really not anything I can do about it but
maybe wait him out.  I can say the sky is a lovely
shade of blue and he would find something offensive
in the remark.

 "a. everybody is against me, b. the Raku
 community won't listen, c. the various variations
 on those themes"

U.  I complain about the documentation and the
difficulty in try to get it fixed.  The rest of Raku,
I absolute adore and have said so, so many times
that I fear I am being tiresome.

And the "everybody is against me" remark is in your
head.  I have NEVER said anything like this.  Complaining
about the state of the documentation is not complaining
that everyone is against me.

And to add, I really like the folks on this group
as well as thank them profusely when they help me.
I am also starting to be able to return the favor and
help others.

And I even like you too.  You help me with things
and you don't even like me.  That is a good character
trait on your part.  I will wear you down eventually.

Raku and the members of this group are awesome.

-T


Once again - You say one thing and do another Re: Bug to report: cardinal called an integer

2020-01-15 Thread Richard Hainsworth

Todd,

Once again I find myself writing to you directly in response to a post 
of yours and asking again that you be respectful to others in this 
community. Striving for respect for everyone from everyone directly 
benefits us all.


And disrespect harms you: your long emails defending your points of view 
have no persuasive power because you refuse to listen or to change.


Further the self-aggrandising tone and disrespect to others are - to be 
quite blunt - also consistent with the word and phrases one might 
consider to be indicative of the intellectually challenged. It might be 
wise therefore to re-parse your responses before sending lest the 
readers of this list find their perceptions harden into belief.


You have asked in response to a previous thread that if you are 
disrespectful, that it be pointed out. So here goes.


On 15/01/2020 18:13, ToddAndMargo via perl6-users wrote:

On 2020-01-14 01:13, JJ Merelo wrote:


Never miss a good chance to bash documentation...


Guilty as charged?


No one has ever called the documentation perfect, but there is only one 
person who goes beyond the reasonable to vilify both the documentation 
and its volunteer creators.


Guilty as charged! (An indication of humility as well as humour on your 
part would have been to replace the '?' with ':)' or some such emoji)






    By the way, "C String" REQUIRES a nul at the end:
    an error in the NativeCall documentation.


No, it does not. And even if it did, it should better go to the C, 
not Raku, documentation


Your original complaint was that you had encountered a problem with '\0' 
on strings and you wanted that problem to be included in the Raku 
documentation.


a) Irrespective of whether null-ended strings are a part of C or an 
implementation detail, it is not a Raku problem. So of the two 
assertions that JJ made, one might be debatable within the context of a 
C-language based list, not a Raku list, and the second is True about 
reference materials in Raku,  but arguably the tutorial materials could 
be enhanced.


b) The way in which you present your point of view is 
counter-productive. I would agree with you that for irregular users of C 
working with some libraries, strings without '\0' terminations could 
trigger unexpected responses. It would be useful, therefore, if at an 
appropriate point in the NativeCall POD file, a comment is included to 
this effect.


c) You could provide a useful service to the Raku community by offering 
a PR (Github Pull Request) with a patch.


d) Within the NativeCall POD there is a fairly extended tutorial about 
interfacing to an Internet function in a C library. I wrote that part of 
the document, having myself worked hard to get the function to work. I 
documented my work, created a patch and offered it to the Perl 6 
community. I think it was my first patch. It was accepted. The 
documentation can be changed by newcomers. So long as the contributor is 
willing to LISTEN to requests for changes, as in grammar and spelling. 
Or in placing. By way of another example, I wrote a fairly long document 
about CompUnits, submitted a PR, which was not accepted. So be it. I 
understood the rationale for the rejection.




Oh Great And Mighty Gatekeeper of the Documentation!
This is plain disrespect. Calling JJ a dog was also disrespectful. 
Reversing a derogatory term for hyperbole is no less disrespectful.


You are in error.  The problem is the mistake in the
documentation
Several people have pointed out to you that they do not consider your 
interpretation of C to be definitive. Nor does it matter. What I could 
agree on (as said above) is that there are peculiarities of some 
versions of C that can trip the unwary, and that the TUTORIALS about an 
interface system, such as NativeCall, could include mention of the trap.

you won't fix


It is not JJ's job to FIX the documentation. He has provided substantial 
and significant contributions to the documentation system as a whole. I 
am profoundly grateful to JJ for his efforts.


You could also contribute to the community generated documentation by 
providing a PR.


And please do not refer to your own reference notes. If you do in this 
thread, I will not refrain, as I have done so far, in subjecting them to 
the sort of searing review they deserve.



and your misunderstand of
the C programming language.


Once again this is disrespectful. (In case English is your second 
language, I will not point out the grammatical error.) Since you were 
obviously not given any lessons in etiquette during your long life, 
perhaps a little pointer would be in order here. Rather than directly 
accusing someone of being in error, or of misunderstanding something, 
and thereby diminishing that person in a public forum, a less aggressive 
approach would be to say "I don't think I agree with you" and then state 
the facts as you see them. In this way, if the person you are 
communicating with changes his/her mind to acknowledge you 

Re: My Windows Modules

2020-01-01 Thread Richard Hainsworth

Todd!

Of what use are these module printouts?

For someone who complains immediately if you are disrespected by having 
your grammar corrected, you are remarkably disrespectful to everyone else.


The work you have done getting these modules to work on Windows is 
great. Given the dominance of Windows in computing, your modules will 
almost certainly be useful to someone.


But you send them to an email list. Only those who regularly read the 
list will see them. Someone coming later will not.


Where do regular Raku programmers (not just 'developers') put modules? 
Into the ecosystem, so that everyone! can search for a module they need, 
and can then simply install it with zef.


Second, your plain text versions of modules have no tests, there is no 
dependency list, there is no one to go to if the module does not work, 
eg. because Microsoft changed something at random, as they do.


If you expect someone else to do that work, think again. Most people on 
this list probably have more projects in their TODO list than you do, 
and it seems to me that the majority of them have moved away from an OS 
that you yourself have described pejoratively.


There are many reasons for creating the modules as described in the 
documentation and placing them in the ecosystem.


If you don't like doing this, that's OK, but it's a shame that the 
results of your time and energy can't be used by others.


Flooding this email list with plain text programs is just blatantly 
saying "I don't care about your conventions, I'll do this my way". And 
that is disrespectful of the community.


Todd, you ask many many questions on this list, questions about things 
that provide value to you and for which you say you get paid for. You 
receive free help in a patient and friendly manner, even when you are 
contemptuous of the people who help you. The very least you could do is 
to abide by the norms that this community has set up.


If you have modules you want to share, share them in a way that people 
can use. If you find issues, then raise them in the places where issues 
are handled. If you have a personal rule about doing some things 
differently, fine, but please be respectful of others in the community 
and the 'rules' they abide by.


Have a prosperous New Year, and may your programming bring you joy.

Richard

On 01/01/2020 07:12, ToddAndMargo via perl6-users wrote:


Hi All,

My latest three modules.  two more in the works that use these:

WinReg.pm6
WinMessageBox
NativeConstants.pm6

WinReg.pm6 about killed me!

-T



# unit module WinReg;
# WinReg.pm6

#`{

   Utilities to operate on the Windows registry

   perl6 -I. -c WinReg.pm6

   Test one liner:
  perl6 -I. -e "use WinMount :GetLUA; say GetLUA();"
  perl6 -I. -e "use NativeConstants; use WinReg :WinReadRegKey; 
say WinReadRegKey( HKEY_LOCAL_MACHINE, 
Q[SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system], 
Q[EnableLUA], REG_DWORD, True ).base(16);"
  perl6 -I. -e "use NativeConstants; use WinReg :WinReadRegKey; 
say WinReadRegKey( HKEY_LOCAL_MACHINE, Q[SOFTWARE\Microsoft\Windows 
NT\CurrentVersion], Q[ProductName], REG_SZ,True );"


   References:

https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499- 



https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regopenkeyexw 



https://docs.microsoft.com/en-us/windows/win32/sysinfo/registry-key-security-and-access-rights 



https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regqueryvalueexw 



https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regclosekey 



https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regclosekey 



}

use NativeCall;
use NativeConstants;
use WinMessageBox :WinMsg;


sub to-c-str( Str $str ) returns CArray[WCHAR]  {
   my @str := CArray[WCHAR].new;
   for ( $str.comb ).kv -> $i, $char { @str[$i] = $char.ord; }
   @str[ $str.chars ] = 0;
   @str;
}


sub OpenKey( WinRegHives $Hive, Str $SubKey, $Debug ) {

#`{
    Open the key:

https://docs.microsoft.com/en-us/windows/win32/api/winreg/nf-winreg-regopenkeyexw 



https://docs.microsoft.com/en-us/windows/win32/sysinfo/registry-key-security-and-access-rights 


    C++
    LSTATUS RegOpenKeyExW(
   HKEY    hKey,  # Hive name (HKEY_LOCAL_MACHINE)
   LPCWSTR lpSubKey,  # path to the 
key(/SOFTWARE/Microsoft/Windows/CurrentVersion/Policies/System/EnableLUA)

   DWORD   ulOptions, # 0
   REGSAM  samDesired,    # KEY_READ (0x20019), KEY_SET_VALUE 
(0x0002)
   PHKEY   phkResult  # A pointer to a variable that receives 
a handle to the opened key

    );
}

   my Str $SubName = &?ROUTINE.name;

   my int32 $Handle;
   my int32 $RtnCode = 0;

   my $lpSubKey  = to-c-str( $SubKey );

   my int32 $ulOptions  = 0;
   my int32 $lpData = 0;
   my int32 $lpcbData   = 1024;  # In:  the maximum amount of bytes 
allowed in the return variable

 # Out: the value of the key
 

USE'ing a symlinked module causes a MOAR error

2019-12-20 Thread Richard Hainsworth
I have a MOARV error when USE'ing a module that is symlinked to a local 
`lib` directory.


So I have the following in my directory tree:

raku-A/lib/

                A.pm6

raku-B/lib/

                B.pm6

                (symlink to A.pm6)

raku-B/t/

            01-basic.t


In B.pm6 , I have

```

use A;

# more code

```

In 01-basic.t:

```

use B;

...

```

Running the following from `raku-B/`

```

prove -ve 'raku -Ilib'

```

causes the error:

t/01-basic.t .. Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to 
something meaningful.
  in any statement_control at 
/opt/rakudo-pkg/share/perl6/lib/Perl6/Grammar.moarvm line 1

Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to 
something meaningful.
  in any statement_control at 
/opt/rakudo-pkg/share/perl6/lib/Perl6/Grammar.moarvm line 1

===SORRY!===
Cannot resolve caller new(IO::Path:U: Any:U, :CWD(Str)); none of these 
signatures match:



However, if instead of using a symlink, I copy the contents of A.pm6 
into Raku-B/lib, then the moarvm error disappears.


Is this a bug? Or is it a part of the raku design, (I think I remember 
reading somewhere that cross-directory access is constrained).


If it is a part of the design, how can I work around it other than by 
copying the contents of the module?


Regards,

Richard


Re: OAuth2

2019-12-16 Thread Richard Hainsworth

Try https://modules.raku.org/search/?q=auth

There's one there for what you want.

If you never looked at the modules page (it's a copy of the 
modules.perl6.org page), you might find a lot of things.


The repository also holds a module I wrote in answer to a question you 
raised over a year ago.


On 16/12/2019 19:55, ToddAndMargo via perl6-users wrote:

Hi All,

This from G-Suite (g-mail):

    Starting February 15, 2021, G Suite accounts will only
    allow access to apps using OAuth[2]. Password-based
    access will no longer be supported.

I have several customers who get backup reports, RAID
controller reports, etc. eMailed to me though curl.
Curl has no plans to support OAuth2.

Is there any sign of a Raku module that supporting OAuth2
in our future?

Many thanks,
-T


compunit classes

2019-11-16 Thread Richard Hainsworth

Hi,

I'm sending an email rather than IRC to catch more feedback.

There are several CompUnit::Repository classes, viz.

AbsolutePath

FileSystem

Installable

Installation

Locally

NQP

Perl5

Spec

Unknown


Would it be possible for someone to provide a line or two as to the 
purpose/use/use-case for each class. I'm trying to document these classes.


Regards,

Richard


Refactoring of the documentation system.

2019-08-26 Thread Richard Hainsworth

General notification!

The community members working on the documentation system are deploying 
a new refactored system. Hopefully, no one will notice a difference on 
the docs.perl6.org page. When the next Rakudo Star is released p6doc 
will be working.


However, murphy rules! So some warning ...

The Perl 6 documentation system has developed incrementally over several 
years. Problems developed, the most obvious being that p6doc stopped 
working.


Two GSoC projects have refactored the system and p6doc works in a much 
more intuitive manner.


A number of modules are all in a single repository, and these need to be 
split, so that the base Pod6 sources containing documentation about the 
language are in one repo, p6doc is in another repo, and support modules 
are in other repos.


The main aim of the new work has been

- retain the user-facing interface

- specify the documentation system so that changes to the documentation 
software can be tested


- unit tests on software and the documentation

- increased robustness of the documentation system

All of this development work and the rational behind it can be found in 
the wiki at the github repo for the docs.


The refactoring has been tested separately, but it will be implemented 
for the Perl 6 system in the near future.


Some patience is requested.

In order for Perl 6 to be more widely accepted, it must have a good and 
evolving documentation system. As new functionality becomes common in 
the software world, the documentation system needs to adapt.


By separating out content sources from the software rendering the 
sources, we can allow for new systems to develop.


Not everyone agrees about what is 'good' documentation. So for the 
future, flexibility is needed to allow for different possibilities to be 
developed based on a single set of source POD6 files, and for software 
to be specified and tested before deployment.


Regards,

Richard Hainsworth,

aka finanalyst


  1   2   3   >