Re: I need help with Config:INI

2020-05-30 Thread David Santiago
Hope this helps :-)

Basically the %hash variable contains another hash, and with spaces in
keys you cannot use them with "<>"


use Config;
use Config::INI;

my Str $IniFile = slurp "config.ini";
my %hash = Config::INI::parse($IniFile);

dd %hash;
print "\n";

for %hash.kv -> $section_name, %section_value  {

put "on $section_name we have: ";
for %section_value.kv -> $key, $value {
put "$key -> $value";
}

}

print "\n";

put %hash{'Backup paramters'};


ToddAndMargo via perl6-users  escreveu no dia
sábado, 30/05/2020 à(s) 00:02:
>
> Hi All,
>
> I an not figure out how to read the hash.
>
>
> ~~~ ini.test.pl6.ini ~
> # Raku: Confug::INI test INI
> # edit at your own risk
>
> [Backup paramters]
> target=B:\myDocsBackp\backup1
> partition=BACKUP
>
> [eMail]
> smtp=smtp.bozo.com
> address=b...@theclown.com
> port=587
> ~~~ /ini.test.pl6.ini ~
>
>
> ~~~ ini.test.pl6 ~
> #! /usr/bin/env raku
>
> #`{
>  # zef install Config
>  # zef install Config::INI
>
>
>
> https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
>  line 45 starts documtation
>
>  use Config::INI;
>  my %hash = Config::INI::parse_file('config.ini');
>  #or
>  %hash = Config::INI::parse($file_contents);
>  say %hash<_>;
>  say %hash;
>
>  This module provides 2 functions: parse() and parse_file(), both taking
>  one C argument, where parse_file is just parse(slurp $file).
>  Both return a hash which keys are either toplevel keys or a section
>  names. For example, the following config file:
>
>  foo=bar
>  [section]
>  another=thing
>
>  would result in the following hash:
> }
> #   { '_' => { foo => "bar" }, section => { another => "thing" } }
>
>
> use Config;
> use Config::INI;
>
> my Str $IniFile = slurp "ini.test.pl6.ini";
> my %hash = Config::INI::parse($IniFile);
>
> dd %hash;
> print "\n";
>
> for %hash.kv -> $key, $value  { print "   hash<$key> = [$value]\n\n"; }
> print "\n";
> ~~~ /ini.test.pl6 ~
>
> ~ run the test 
> $ ini.test.pl6
>
> Hash %hash = {"Backup paramters" => ${:partition("BACKUP"),
> :target("B:\\myDocsBackp\\backup1")},
> :eMail(${:address("bozo\@theclown.com"), :port("587"),
> :smtp("smtp.bozo.com")})}
>
> hash = [partition BACKUP
> target  B:\myDocsBackp\backup1]
>
> hash = [address  b...@theclown.com
> port587
> smtpsmtp.bozo.com]
> ~ /run the test 
>
>
> How do I read the hash so I get section
> `[eMail]` `smtp`?  (Or any of the other values
> as well.)
>
>
> Many thanks,
> -T


Re: I need help with Config:INI

2020-05-30 Thread Peter Pentchev
On Fri, May 29, 2020 at 05:02:15PM -0700, ToddAndMargo via perl6-users wrote:
> Hi All,
> 
> I an not figure out how to read the hash.
> 
> 
> ~~~ ini.test.pl6.ini ~
> # Raku: Confug::INI test INI
> # edit at your own risk
> 
> [Backup paramters]
> target=B:\myDocsBackp\backup1
> partition=BACKUP
> 
> [eMail]
> smtp=smtp.bozo.com
> address=b...@theclown.com
> port=587
> ~~~ /ini.test.pl6.ini ~
> 
> 
> ~~~ ini.test.pl6 ~
> #! /usr/bin/env raku
> 
> #`{
> # zef install Config
> # zef install Config::INI
> 
> 
> 
> https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
> line 45 starts documtation
> 
> use Config::INI;
> my %hash = Config::INI::parse_file('config.ini');
> #or
> %hash = Config::INI::parse($file_contents);
> say %hash<_>;
> say %hash;
> 
> This module provides 2 functions: parse() and parse_file(), both taking
> one C argument, where parse_file is just parse(slurp $file).
> Both return a hash which keys are either toplevel keys or a section
> names. For example, the following config file:
> 
> foo=bar
> [section]
> another=thing
> 
> would result in the following hash:
> }
> #   { '_' => { foo => "bar" }, section => { another => "thing" } }
> 
> 
> use Config;
> use Config::INI;
> 
> my Str $IniFile = slurp "ini.test.pl6.ini";
> my %hash = Config::INI::parse($IniFile);
> 
> dd %hash;
> print "\n";
> 
> for %hash.kv -> $key, $value  { print "   hash<$key> = [$value]\n\n"; }
> print "\n";
> ~~~ /ini.test.pl6 ~
> 
> ~ run the test 
> $ ini.test.pl6
> 
> Hash %hash = {"Backup paramters" => ${:partition("BACKUP"),
> :target("B:\\myDocsBackp\\backup1")},
> :eMail(${:address("bozo\@theclown.com"), :port("587"),
> :smtp("smtp.bozo.com")})}
> 
>hash = [partitionBACKUP
> targetB:\myDocsBackp\backup1]
> 
>hash = [address b...@theclown.com
> port  587
> smtp  smtp.bozo.com]
> ~ /run the test 
> 
> 
> How do I read the hash so I get section
> `[eMail]` `smtp`?  (Or any of the other values
> as well.)

If you want that specific value, dd %hash
If some of the keys are in variables, try this:

my $section = "eMail";
my $key = "smtp";
dd %hash{$section}{$key};

So %hash is a hash of hashes: the keys of %hash are the names of
the sections, the values are hashes containing the key/value contents of
the sections. The keys of %hash are the names of the variables
defined in the "eMail" section, the values of %hash are the,
well, values of the things in the "eMail" section.

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: I reproduced one of the errors!

2020-05-30 Thread Peter Pentchev
On Fri, May 29, 2020 at 04:36:41PM -0700, ToddAndMargo via perl6-users wrote:
> On 2020-05-28 06:39, Peter Pentchev wrote:
> > On Wed, May 27, 2020 at 03:12:01PM -0700, ToddAndMargo via perl6-users 
> > wrote:
> > > > On 2020-05-27 14:32, Andy Bach wrote:
> > > > > #!/usr/bin/env raku
> > > > > my Str $x;
> > > > > if $x.starts-with( "[" )  &&
> > > > > $x.contains( "]" )
> > > > > { say "Passed"; } else { say "Failed"; }
> > > > > 
> > > > > K:\Windows\NtUtil>raku Contains.Test.pl6
> > > > > Cannot resolve caller starts-with(Str:U: Str:D); none of these
> > > > > signatures match
> > > > > 
> > > > > (Cool:D: Cool:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_
> > > > > --> Bool)
> > > > > (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_ --> Bool)
> > > > > (Cool:D: Cool:D $needle, *%_ --> Bool)
> > > > > (Str:D: Str:D $needle, :i(:$ignorecase)!, :m(:$ignoremark), *%_ -->
> > > > > Bool)
> > > > > (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Bool)
> > > > > (Str:D: Str:D $needle, *%_ --> Bool)
> > > > > in block  at Contains.Test.pl6 line 3
> > > > > 
> > > > >   > The function should just complain that the variable is not 
> > > > > initialized.
> > > > > 
> > > 
> > > 
> > > > Well, it is:
> > > > Cannot resolve caller starts-with(Str:U: Str:D);
> > > > ...
> > > > in block  at Contains.Test.pl6 line 3
> > > > 
> > > > it says:
> > > > For line 3:
> > > > if $x.starts-with( "[" )
> > > > looking for a possible method 'starts-with' with a signature of 2
> > > > params; an undefined string ('Str:U:') and a defined one ('Str:D:')
> > > > failed - here's the list of the possible signatures raku currently has
> > > > ..."
> > > > 
> > > > I'd not be surprise if you could write your own "starts-with(Str:U:
> > > > Str:D); " method in raku and take care of this.  You could probably even
> > > > have it "say"
> > > > You have an undefined String var in this call, not going to be able to
> > > > do much useful matching against that.  Did you forget to initialize
> > > > something?
> > > 
> > > Hi Andy,
> > > 
> > > The function should just complain that you need to feed it an
> > > initialized value instead of sending you on a wild goose chase,
> > 
> > It does say that you are trying to call "starts-with()" as a method on
> > a value of type Str:U (undefined string), and it cannot find such
> > a method. It also tells you what methods it can find.
> > 
> > It gives the same error message no matter what types the function/method
> > can handle and no matter what type you are trying to call it on.
> >  From that point on Raku kind of expects you to know what Str:U means and
> > that the :U part means "undefined". It would give the same *type* of
> > message if you were trying to call a method that only works on undefined
> > strings and you were trying to call it on a defined string, only then it
> > would say that it can't find such a method for Str:D. In the eyes of
> > Raku, these errors are of the same kind, and it has provided you with
> > the types.
> 
> Hi Peter,
> 
> No doubt it is operating as designed.
> 
> It would be a lot more friendly if "Str:U" was
> changed to "Str:D". Oh please!   Oh Please!

Sorry, I don't really understand what you mean.  "Str:U" means
an undefined string - that's what you're calling .starts-with() on.
"Str:D" means a defined string - that's what .starts-with() wants to
operate on.  What do you mean "change Str:U to Str:D" - the error
message says "you invoked it on an undefined string, it wants to be
invoked on a defined string", what do you want to change?

Now, if you meant "change Str:U to 'an undefined string'", , what
I was trying to explain is that the error message is generic, it covers
any wrong calls of functions on any types... it does not really try to
get into what the types are (it cannot, in the general case for any
other type).

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.net r...@debian.org p...@storpool.com
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Accidentally closed an issue

2020-05-30 Thread Joseph Brenner
I was just trying to comment on an issue I opened the other day, and I
accidentally closed it.  I don't see any way for me to re-open it, so
I would guess I don't have permissions to do so.  Could someone
re-open this?

  https://github.com/rakudo/rakudo/issues/3728


Re: Accidentally closed an issue

2020-05-30 Thread JJ Merelo
Reopened

El sáb., 30 may. 2020 a las 19:26, Joseph Brenner ()
escribió:

> I was just trying to comment on an issue I opened the other day, and I
> accidentally closed it.  I don't see any way for me to re-open it, so
> I would guess I don't have permissions to do so.  Could someone
> re-open this?
>
>   https://github.com/rakudo/rakudo/issues/3728
>


-- 
JJ


Re: Accidentally closed an issue

2020-05-30 Thread Joseph Brenner
Thanks much.


On 5/30/20, JJ Merelo  wrote:
> Reopened
>
> El sáb., 30 may. 2020 a las 19:26, Joseph Brenner ()
> escribió:
>
>> I was just trying to comment on an issue I opened the other day, and I
>> accidentally closed it.  I don't see any way for me to re-open it, so
>> I would guess I don't have permissions to do so.  Could someone
>> re-open this?
>>
>>   https://github.com/rakudo/rakudo/issues/3728
>>
>
>
> --
> JJ
>


Re: I reproduced one of the errors!

2020-05-30 Thread ToddAndMargo via perl6-users

On 2020-05-30 04:19, Peter Pentchev wrote:

On Fri, May 29, 2020 at 04:36:41PM -0700, ToddAndMargo via perl6-users wrote:



Hi Peter,

No doubt it is operating as designed.

It would be a lot more friendly if "Str:U" was
changed to "Str:D". Oh please!   Oh Please!


Sorry, I don't really understand what you mean.  "Str:U" means
an undefined string - that's what you're calling .starts-with() on.
"Str:D" means a defined string - that's what .starts-with() wants to
operate on.  What do you mean "change Str:U to Str:D" - the error
message says "you invoked it on an undefined string, it wants to be
invoked on a defined string", what do you want to change?

Now, if you meant "change Str:U to 'an undefined string'", , what
I was trying to explain is that the error message is generic, it covers
any wrong calls of functions on any types... it does not really try to
get into what the types are (it cannot, in the general case for any
other type).

G'luck,
Peter




Hi Peter,

What a second.

https://docs.raku.org/routine/starts-with
multi method starts-with(Str:D: Str(Cool) $needle, :i(:$ignorecase), 
:m(:$ignoremark) --> Bool:D)


https://docs.raku.org/routine/contains
method contains(Cool:D: |c)

I had incorrectly presumed that since neither of
these two complained about `Str:D` not being defined
that it was specified as `Str:U`

So my beef is when you feed these guys an undefined
variable, that they needs to tell you it requires
a "defined" variable.  Not a bunch of useless rubbish.
For example (useless rubbish):

   Cannot resolve caller starts-with(Str:U: Str:D);
   none of these signatures match

   (Cool:D: Cool:D $needle, :i(:$ignorecase)!,
   :m(:$ignoremark), *%_ --> Bool)
   (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_
   --> Bool)
   (Cool:D: Cool:D $needle, *%_ --> Bool)
   (Str:D: Str:D $needle, :i(:$ignorecase)!,
   :m(:$ignoremark), *%_ --> Bool)
   (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Bool)
   (Str:D: Str:D $needle, *%_ --> Bool)
   in block  ...

And I know, I don't get a vote on the matter.
-T


question on pod comments

2020-05-30 Thread ToddAndMargo via perl6-users

Hi All,

I am somewhat confused about pod comments:

https://docs.raku.org/language/syntax#Pod_comments

Seems pretty straight forward.  But when I look at

https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm

starting line 45, I see

=begin pod
=head1 NAME
=head1 SYNOPSIS
=head1 DESCRIPTION
=end pod

I see no "=end xxx"

=end head1 NAME
=end head1 SYNOPSIS
=end head1 DESCRIPTION

What am I missing?

Many thanks,
-T


Re: I need help with Config:INI

2020-05-30 Thread ToddAndMargo via perl6-users

Follow up.

Special thanks to Peter and David!

I wrote a sample program to explain things in
my personal documentation:

-T


Raku: reading INI files:


Example:

~ini.test.pl6.ini ~~~
# Raku: Config::INI test INI
# edit at your own risk

IHave=NoSection

[Backup paramters]
target=B:\myDocsBackp\backup1
partition=BACKUP

[eMail]
smtp=smtp.bozo.com
address=b...@theclown.com
port=587
~/ini.test.pl6.ini ~~


~~~ini.test.pl6 ~
#! /usr/bin/env raku

=begin introduction

# zef install Config
# zef install Config::INI



https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
line 45 starts documtation

use Config::INI;
my %IniHash = Config::INI::parse_file('config.ini');

# Config::INI::parse return a hash of a hash
%IniHash = Config::INI::parse($file_contents);

# items before a [section] tag are given a [section] key value of '_'
print %hash<_> ~ "\n";

# Otherwise the key is the [section] tag
print  %hash ~ "\n";

   IHave=NoSection
   [eMail]
   address=b...@theclown.com

print "[_] IHave = " ~ %IniHash<_> ~ "\n";
print "[eMail] Address = " ~ %IniHash ~ "\n";

[_] IHave = NoSection
[eMail] Address = b...@theclown.com

=end introduction


use Config;
use Config::INI;

my Str $IniFile = slurp "ini.test.pl6.ini";
my %IniHash = Config::INI::parse($IniFile);  # %IniHash is a hash of a hash

print "The following INI file was read:\n";
for $IniFile.lines -> $Line { print "$Line\n"; }
print "\n";

print "The following sections where located:\n";
for %IniHash.kv -> $key, $value  { print "[" ~ $key ~ "]\n"; }
print "\n";

print "The following is a list of INI variables located in each section:\n";
for %IniHash.kv -> $section, $value  {
   print "[" ~ $section ~ "]\n";
   for $value.kv -> $SectionKey, $SectionValue  {
  print "   $SectionKey=$SectionValue\n";
   }
}
print "\n";

print "Direct addressing of values:\n";
print "[_] IHave = " ~ %IniHash<_> ~ "\n";
print "[eMail] Address = " ~ %IniHash ~ "\n";
print "\n";
~~~/ini.test.pl6 


$ ini.test.pl6
The following INI file was read:
# Raku: Config::INI test INI
# edit at your own risk

IHave=NoSection

[Backup paramters]
target=B:\myDocsBackp\backup1
partition=BACKUP

[eMail]
smtp=smtp.bozo.com
address=b...@theclown.com
port=587


The following sections where located:
[_]
[eMail]
[Backup paramters]

The following is a list of INI variables located in each section:
[_]
   IHave=NoSection
[eMail]
   port=587
   address=b...@theclown.com
   smtp=smtp.bozo.com
[Backup paramters]
   target=B:\myDocsBackp\backup1
   partition=BACKUP

Direct addressing of values:
[_] IHave = NoSection
[eMail] Address = b...@theclown.com


Re: question on pod comments

2020-05-30 Thread Kevin Pye
They're not Pod comments, they're Pod abbreviated blocks:

https://docs.raku.org/language/pod

Kevin.

On Sun, 31 May 2020 at 12:43, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> I am somewhat confused about pod comments:
>
> https://docs.raku.org/language/syntax#Pod_comments
>
> Seems pretty straight forward.  But when I look at
>
> https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
>
> starting line 45, I see
>
> =begin pod
> =head1 NAME
> =head1 SYNOPSIS
> =head1 DESCRIPTION
> =end pod
>
> I see no "=end xxx"
>
> =end head1 NAME
> =end head1 SYNOPSIS
> =end head1 DESCRIPTION
>
> What am I missing?
>
> Many thanks,
> -T
>


Re: I need help with Config:INI

2020-05-30 Thread ToddAndMargo via perl6-users

On 2020-05-30 20:08, ToddAndMargo via perl6-users wrote:

Follow up.


I just opened

An Example to consider adding to your documentation:
https://github.com/tadzik/perl6-Config-INI/issues/17


Re: question on pod comments

2020-05-30 Thread ToddAndMargo via perl6-users
On Sun, 31 May 2020 at 12:43, ToddAndMargo via perl6-users 
mailto:perl6-us...@perl.org>> wrote:


Hi All,

I am somewhat confused about pod comments:

https://docs.raku.org/language/syntax#Pod_comments

Seems pretty straight forward.  But when I look at

https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm

starting line 45, I see

=begin pod
=head1 NAME
=head1 SYNOPSIS
=head1 DESCRIPTION
=end pod

I see no "=end xxx"

=end head1 NAME
=end head1 SYNOPSIS
=end head1 DESCRIPTION

What am I missing?

Many thanks,
-T



On 2020-05-30 20:20, Kevin Pye wrote:

They're not Pod comments, they're Pod abbreviated blocks:

https://docs.raku.org/language/pod

Kevin.



I see that:

https://docs.raku.org/language/pod#Delimited_blocks
 =begin head1
 Top Level Heading
 =end head1

So back to my original question, where are the "=end " for
the other blocks?

I am confused.
-T


Re: question on pod comments

2020-05-30 Thread Kevin Pye
As I said, they're abbreviated blocks. Keep reading.

On Sun, 31 May 2020 at 13:30, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> >> On Sun, 31 May 2020 at 12:43, ToddAndMargo via perl6-users
> >> mailto:perl6-us...@perl.org>> wrote:
> >>
> >> Hi All,
> >>
> >> I am somewhat confused about pod comments:
> >>
> >> https://docs.raku.org/language/syntax#Pod_comments
> >>
> >> Seems pretty straight forward.  But when I look at
> >>
> >>
> https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
> >>
> >> starting line 45, I see
> >>
> >> =begin pod
> >> =head1 NAME
> >> =head1 SYNOPSIS
> >> =head1 DESCRIPTION
> >> =end pod
> >>
> >> I see no "=end xxx"
> >>
> >> =end head1 NAME
> >> =end head1 SYNOPSIS
> >> =end head1 DESCRIPTION
> >>
> >> What am I missing?
> >>
> >> Many thanks,
> >> -T
> >>
>
> On 2020-05-30 20:20, Kevin Pye wrote:
> > They're not Pod comments, they're Pod abbreviated blocks:
> >
> > https://docs.raku.org/language/pod
> >
> > Kevin.
> >
>
> I see that:
>
> https://docs.raku.org/language/pod#Delimited_blocks
>   =begin head1
>   Top Level Heading
>   =end head1
>
> So back to my original question, where are the "=end " for
> the other blocks?
>
> I am confused.
> -T
>


Re: question on pod comments

2020-05-30 Thread ToddAndMargo via perl6-users
On Sun, 31 May 2020 at 13:30, ToddAndMargo via perl6-users 
mailto:perl6-us...@perl.org>> wrote:


 >> On Sun, 31 May 2020 at 12:43, ToddAndMargo via perl6-users
 >> mailto:perl6-us...@perl.org>
>> wrote:
 >>
 >> Hi All,
 >>
 >> I am somewhat confused about pod comments:
 >>
 >> https://docs.raku.org/language/syntax#Pod_comments
 >>
 >> Seems pretty straight forward.  But when I look at
 >>
 >>
https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
 >>
 >> starting line 45, I see
 >>
 >> =begin pod
 >> =head1 NAME
 >> =head1 SYNOPSIS
 >> =head1 DESCRIPTION
 >> =end pod
 >>
 >> I see no "=end xxx"
 >>
 >> =end head1 NAME
 >> =end head1 SYNOPSIS
 >> =end head1 DESCRIPTION
 >>
 >> What am I missing?
 >>
 >> Many thanks,
 >> -T
 >>

On 2020-05-30 20:20, Kevin Pye wrote:
 > They're not Pod comments, they're Pod abbreviated blocks:
 >
 > https://docs.raku.org/language/pod
 >
 > Kevin.
 >

I see that:

https://docs.raku.org/language/pod#Delimited_blocks
   =begin head1
   Top Level Heading
   =end head1

So back to my original question, where are the "=end " for
the other blocks?

I am confused.
-T



On 2020-05-30 20:37, Kevin Pye wrote:

As I said, they're abbreviated blocks. Keep reading.




https://docs.raku.org/language/pod#Abbreviated_blocks
Abbreviated blocks

Abbreviated blocks begin by an '=' sign, which is followed immediately 
by the typename of the block. All following data are part of the 
contents of the block, thus configuration data cannot be specified for 
an abbreviated block. The block ends at the next Pod6 directive or the 
first blank line.


=head1 Top level heading


So basically, since they did not contain a "begin",
`=begin `, they do not use and `=end ` and
the terminate themselves after the first blank line.

Do I FINALLY have it down?

Also, in

https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm

since these Abbreviated Block were inside his

=begin pod
=end pod

He was just being fancy since they would have no
effect anyway as they were inside a comment already?

-T


Re: question on pod comments

2020-05-30 Thread Kevin Pye
While the original documentation you were referring to called them Pod
comments, that's not really accurate. The full documentation (to which I
referred you) calls them "Pod documents" which is much more descriptive.
The Pod document is parsed by Rakudo, and the contents can be used. Pod
documents are structured, and need to be consistent. Unless you do
something to explicitly refer to the pod, it is ignored by the running
program, and is a comment in that sense.

To further confuse you, Pod documents can contain comments in a couple of
ways.

Note that the documentation at docs.raku.org is written in Pod (in this
case in files containing no normal raku code).

On Sun, 31 May 2020 at 13:50, ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> >> On Sun, 31 May 2020 at 13:30, ToddAndMargo via perl6-users
> >> mailto:perl6-us...@perl.org>> wrote:
> >>
> >>  >> On Sun, 31 May 2020 at 12:43, ToddAndMargo via perl6-users
> >>  >> mailto:perl6-us...@perl.org>
> >> >> wrote:
> >>  >>
> >>  >> Hi All,
> >>  >>
> >>  >> I am somewhat confused about pod comments:
> >>  >>
> >>  >> https://docs.raku.org/language/syntax#Pod_comments
> >>  >>
> >>  >> Seems pretty straight forward.  But when I look at
> >>  >>
> >>  >>
> >>
> https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
> >>  >>
> >>  >> starting line 45, I see
> >>  >>
> >>  >> =begin pod
> >>  >> =head1 NAME
> >>  >> =head1 SYNOPSIS
> >>  >> =head1 DESCRIPTION
> >>  >> =end pod
> >>  >>
> >>  >> I see no "=end xxx"
> >>  >>
> >>  >> =end head1 NAME
> >>  >> =end head1 SYNOPSIS
> >>  >> =end head1 DESCRIPTION
> >>  >>
> >>  >> What am I missing?
> >>  >>
> >>  >> Many thanks,
> >>  >> -T
> >>  >>
> >>
> >> On 2020-05-30 20:20, Kevin Pye wrote:
> >>  > They're not Pod comments, they're Pod abbreviated blocks:
> >>  >
> >>  > https://docs.raku.org/language/pod
> >>  >
> >>  > Kevin.
> >>  >
> >>
> >> I see that:
> >>
> >> https://docs.raku.org/language/pod#Delimited_blocks
> >>=begin head1
> >>Top Level Heading
> >>=end head1
> >>
> >> So back to my original question, where are the "=end " for
> >> the other blocks?
> >>
> >> I am confused.
> >> -T
> >>
>
> On 2020-05-30 20:37, Kevin Pye wrote:
> > As I said, they're abbreviated blocks. Keep reading.
> >
>
>
> https://docs.raku.org/language/pod#Abbreviated_blocks
> Abbreviated blocks
>
> Abbreviated blocks begin by an '=' sign, which is followed immediately
> by the typename of the block. All following data are part of the
> contents of the block, thus configuration data cannot be specified for
> an abbreviated block. The block ends at the next Pod6 directive or the
> first blank line.
>
> =head1 Top level heading
>
>
> So basically, since they did not contain a "begin",
> `=begin `, they do not use and `=end ` and
> the terminate themselves after the first blank line.
>
> Do I FINALLY have it down?
>
> Also, in
>
> https://github.com/tadzik/perl6-Config-INI/blob/master/lib/Config/INI.pm
>
> since these Abbreviated Block were inside his
>
> =begin pod
> =end pod
>
> He was just being fancy since they would have no
> effect anyway as they were inside a comment already?
>
> -T
>


Re: question on pod comments

2020-05-30 Thread ToddAndMargo via perl6-users

On 2020-05-30 21:28, Kevin Pye wrote:
While the original documentation you were referring to called them Pod 
comments, that's not really accurate. The full documentation (to which I 
referred you) calls them "Pod documents" which is much more descriptive. 
The Pod document is parsed by Rakudo, and the contents can be used. Pod 
documents are structured, and need to be consistent. Unless you do 
something to explicitly refer to the pod, it is ignored by the running 
program, and is a comment in that sense.


Thank you for the help!



To further confuse you, Pod documents can contain comments in a couple 
of ways.


You get use to it.


Re: I reproduced one of the errors!

2020-05-30 Thread Veesh Goldman
読めないと分かりませんよ。


On Sun, May 31, 2020, 02:23 ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> On 2020-05-30 04:19, Peter Pentchev wrote:
> > On Fri, May 29, 2020 at 04:36:41PM -0700, ToddAndMargo via perl6-users
> wrote:
>
> >> Hi Peter,
> >>
> >> No doubt it is operating as designed.
> >>
> >> It would be a lot more friendly if "Str:U" was
> >> changed to "Str:D". Oh please!   Oh Please!
> >
> > Sorry, I don't really understand what you mean.  "Str:U" means
> > an undefined string - that's what you're calling .starts-with() on.
> > "Str:D" means a defined string - that's what .starts-with() wants to
> > operate on.  What do you mean "change Str:U to Str:D" - the error
> > message says "you invoked it on an undefined string, it wants to be
> > invoked on a defined string", what do you want to change?
> >
> > Now, if you meant "change Str:U to 'an undefined string'", , what
> > I was trying to explain is that the error message is generic, it covers
> > any wrong calls of functions on any types... it does not really try to
> > get into what the types are (it cannot, in the general case for any
> > other type).
> >
> > G'luck,
> > Peter
> >
>
>
> Hi Peter,
>
> What a second.
>
> https://docs.raku.org/routine/starts-with
> multi method starts-with(Str:D: Str(Cool) $needle, :i(:$ignorecase),
> :m(:$ignoremark) --> Bool:D)
>
> https://docs.raku.org/routine/contains
> method contains(Cool:D: |c)
>
> I had incorrectly presumed that since neither of
> these two complained about `Str:D` not being defined
> that it was specified as `Str:U`
>
> So my beef is when you feed these guys an undefined
> variable, that they needs to tell you it requires
> a "defined" variable.  Not a bunch of useless rubbish.
> For example (useless rubbish):
>
> Cannot resolve caller starts-with(Str:U: Str:D);
> none of these signatures match
>
> (Cool:D: Cool:D $needle, :i(:$ignorecase)!,
> :m(:$ignoremark), *%_ --> Bool)
> (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_
> --> Bool)
> (Cool:D: Cool:D $needle, *%_ --> Bool)
> (Str:D: Str:D $needle, :i(:$ignorecase)!,
> :m(:$ignoremark), *%_ --> Bool)
> (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Bool)
> (Str:D: Str:D $needle, *%_ --> Bool)
> in block  ...
>
> And I know, I don't get a vote on the matter.
> -T
>


Re: I reproduced one of the errors!

2020-05-30 Thread Veesh Goldman
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.

On Sun, May 31, 2020, 09:05 Veesh Goldman  wrote:

> 読めないと分かりませんよ。
>
>
> On Sun, May 31, 2020, 02:23 ToddAndMargo via perl6-users <
> perl6-us...@perl.org> wrote:
>
>> On 2020-05-30 04:19, Peter Pentchev wrote:
>> > On Fri, May 29, 2020 at 04:36:41PM -0700, ToddAndMargo via perl6-users
>> wrote:
>>
>> >> Hi Peter,
>> >>
>> >> No doubt it is operating as designed.
>> >>
>> >> It would be a lot more friendly if "Str:U" was
>> >> changed to "Str:D". Oh please!   Oh Please!
>> >
>> > Sorry, I don't really understand what you mean.  "Str:U" means
>> > an undefined string - that's what you're calling .starts-with() on.
>> > "Str:D" means a defined string - that's what .starts-with() wants to
>> > operate on.  What do you mean "change Str:U to Str:D" - the error
>> > message says "you invoked it on an undefined string, it wants to be
>> > invoked on a defined string", what do you want to change?
>> >
>> > Now, if you meant "change Str:U to 'an undefined string'", , what
>> > I was trying to explain is that the error message is generic, it covers
>> > any wrong calls of functions on any types... it does not really try to
>> > get into what the types are (it cannot, in the general case for any
>> > other type).
>> >
>> > G'luck,
>> > Peter
>> >
>>
>>
>> Hi Peter,
>>
>> What a second.
>>
>> https://docs.raku.org/routine/starts-with
>> multi method starts-with(Str:D: Str(Cool) $needle, :i(:$ignorecase),
>> :m(:$ignoremark) --> Bool:D)
>>
>> https://docs.raku.org/routine/contains
>> method contains(Cool:D: |c)
>>
>> I had incorrectly presumed that since neither of
>> these two complained about `Str:D` not being defined
>> that it was specified as `Str:U`
>>
>> So my beef is when you feed these guys an undefined
>> variable, that they needs to tell you it requires
>> a "defined" variable.  Not a bunch of useless rubbish.
>> For example (useless rubbish):
>>
>> Cannot resolve caller starts-with(Str:U: Str:D);
>> none of these signatures match
>>
>> (Cool:D: Cool:D $needle, :i(:$ignorecase)!,
>> :m(:$ignoremark), *%_ --> Bool)
>> (Cool:D: Cool:D $needle, :m(:$ignoremark)!, *%_
>> --> Bool)
>> (Cool:D: Cool:D $needle, *%_ --> Bool)
>> (Str:D: Str:D $needle, :i(:$ignorecase)!,
>> :m(:$ignoremark), *%_ --> Bool)
>> (Str:D: Str:D $needle, :m(:$ignoremark)!, *%_ --> Bool)
>> (Str:D: Str:D $needle, *%_ --> Bool)
>> in block  ...
>>
>> And I know, I don't get a vote on the matter.
>> -T
>>
>