Re: boo-boo in run docs?

2025-11-18 Thread ToddAndMargo via perl6-users


On Mon, Nov 17, 2025 at 11:44 PM ToddAndMargo via perl6-users [email protected] > wrote:


On 11/17/25 8:25 PM, ToddAndMargo wrote:
 > And start simple again.
 > No showing off until AFTER all the basics have
 > been discussed.

Don't expect those reading the docs to understand
every other aspect of Raku.



On 11/18/25 7:35 AM, Will Coleda wrote:

https://docs.raku.org/ 

shows different types of documentation available, including:

* Type reference
* Language reference
* Tutorials

Sounds like you'd like a tutorial: looking through the tutorial section, 
I find a tutorial already exists covering run, Proc, Proc::Async: 
https://docs.raku.org/language/ipc  
- Inter-process communication / Programs running other programs and 
communicating with them.


Whereas the type reference pages like https://docs.raku.org/type/Proc 
 are going to be an overview of the 
object along with the laundry list of methods available.


Cheers

Hi Will,

I actually wrote my own tutorial (keeper) on "run".
And just discovered a boo-boo of my own in it that
I will have to fix.

I was trying to encourage Richard to write up his
methods explanations as he is a talented technical
writer.

-T


Re: boo-boo in run docs?

2025-11-18 Thread Will Coleda
https://docs.raku.org/

shows different types of documentation available, including:

* Type reference
* Language reference
* Tutorials

Sounds like you'd like a tutorial: looking through the tutorial section, I
find a tutorial already exists covering run, Proc, Proc::Async:
https://docs.raku.org/language/ipc - Inter-process communication / Programs
running other programs and communicating with them.

Whereas the type reference pages like https://docs.raku.org/type/Proc are
going to be an overview of the object along with the laundry list of
methods available.

Cheers

On Mon, Nov 17, 2025 at 11:44 PM ToddAndMargo via perl6-users <
[email protected]> wrote:

> On 11/17/25 8:25 PM, ToddAndMargo wrote:
> > And start simple again.
> > No showing off until AFTER all the basics have
> > been discussed.
>
> Don't expect those reading the docs to understand
> every other aspect of Raku.
>


Re: boo-boo in run docs?

2025-11-17 Thread ToddAndMargo via perl6-users

On 11/17/25 8:25 PM, ToddAndMargo wrote:

And start simple again.
No showing off until AFTER all the basics have
been discussed.


Don't expect those reading the docs to understand
every other aspect of Raku.


Re: boo-boo in run docs?

2025-11-17 Thread ToddAndMargo via perl6-users

On 11/12/25 2:52 AM, Richard Hainsworth wrote:



On Sun, 9 Nov 2025, 04:27 ToddAndMargo via perl6-users, [email protected] > wrote:


On 11/8/25 11:59 AM, Richard Hainsworth wrote:
 > Hi Todd,
 >
 > Long time since I responded to one of your questions.

Snip


Hi Richard,

I under stand why it is done that way.  I just
do not like how it is done.

We all have our likes and dislikes.
I know you document things with your keepers. But to be honest the ones 
you have published contain errors because they gloss over important topics.


For example in your next sentence:


"run" return its results in the OOP class "Proc".

There is an error! 'run' does NOT return it's results in the OOP class 
Proc!!!


'run' returns an object of type Proc. This is important because you can 
have many objects but there is still only one class. And the difference 
between type and class arises because (in Raku but not in many other 
languages) you can add roles to an object which means it will do more 
than just the methods of class Proc.


And that is precisely what methods are documented by class and not by 
the routines which return objects of that class.


The whole point of the secondary files is to aid in finding relevant 
information.


But that is also the reason for the functionality in the search button.

  I think everyone agrees that search and the website could be improved.

If you could find a way to suggest a systematic way of showing you how 
to get the information you need in a more intuitive way, please let me know.


I'm writing a new version of the docs website. Take a look at https:// 
new-raku.finanayst.org 


It looks a bit like the old one, but it works better on mobiles and tablets.

There are bugs in it still.

Currently I'm working on an upgrade to the RakuDoc Renderer, so the bugs 
will be there for a bit.


However I really would like to have a better search function.

I wish the documentation would define what is
put into your Proc variable when "run" exits.
Not divide it up all over the place.

Snip

And, I should not have to find the source code
more readable and explanatory than the documents.
And that should tell you something!

Thank you for the well written letter.
I appreciate it.

-T





Hi Richard,

After a lot of though, I think the best way to put this
so something is usable for both novices and experts
is to start as simple as you can get and then work up
to the advanced stuff.  Perl5's perdocs are an
excellent example.

For instance, the "run" command.  What is the novice
user looking for?

First a one sentence discretion about what it is doing.

Second, what do I feed it?  Keep it really simple.
Don't do into any of the fancy features such as
colon pairs.  Save all that stuff for later.

Third, what does it give me back.  Just the basics.
What is most important in order of sequence is

First, exitcode.  The program called's feedback is
useless if the call failed.  Resist the urge to
explain about how it value got populated.

Second, the STDSTR.

Third, the STDERR.

Then stop there and send them directly to a
discussion of Proc.  And start simple again.
No showing off until AFTER all the basics have
been discussed.

And that should be the end "run".   If you start
giving examples, they won't know to go to Proc.

About your explanation of methods and other stuff
in your letters to me.  They are wonderful.  And I can
see why it is important to you.  Raku's implementation
of OOPS is absolutely elegant.  I can see where you
would want to shout from the roof tops about it.
The developers not only knocked it out of the ball park,
they knocked it out of the state into another ball park's
stands!


But you need to resist where you are going to find
novices.  Someone just wanting to know how to operate
"run" does not need or want to know it came from a
method that eventually down the food chain made a
system call to the kernel.  You just confuse them.

That being said, have you though of incorporating the
OOP (class) stuff you wrote me into a training document/
instruction manual?

You have a wonderful technical writing talent and Raku's
OOPs need to be shouted from the roof tops.  It is beyond
imagination useful!  Make sure you start by explaining
what OOP is, then advancing to Raku's class in an
implementation of it.

If you need any dumbed down examples to start with, you
know where to find me!

-T


Re: boo-boo in run docs?

2025-11-15 Thread ToddAndMargo via perl6-users

On 11/12/25 2:52 AM, Richard Hainsworth wrote:



On Sun, 9 Nov 2025, 04:27 ToddAndMargo via perl6-users, [email protected] > wrote:


On 11/8/25 11:59 AM, Richard Hainsworth wrote:
 > Hi Todd,
 >
 > Long time since I responded to one of your questions.

Snip


Hi Richard,

I under stand why it is done that way.  I just
do not like how it is done.

We all have our likes and dislikes.
I know you document things with your keepers. But to be honest the ones 
you have published contain errors because they gloss over important topics.


For example in your next sentence:


"run" return its results in the OOP class "Proc".

There is an error! 'run' does NOT return it's results in the OOP class 
Proc!!!


'run' returns an object of type Proc. This is important because you can 
have many objects but there is still only one class. And the difference 
between type and class arises because (in Raku but not in many other 
languages) you can add roles to an object which means it will do more 
than just the methods of class Proc.


And that is precisely what methods are documented by class and not by 
the routines which return objects of that class.


The whole point of the secondary files is to aid in finding relevant 
information.


But that is also the reason for the functionality in the search button.

  I think everyone agrees that search and the website could be improved.

If you could find a way to suggest a systematic way of showing you how 
to get the information you need in a more intuitive way, please let me know.


I'm writing a new version of the docs website. Take a look at https:// 
new-raku.finanayst.org 


It looks a bit like the old one, but it works better on mobiles and tablets.

There are bugs in it still.

Currently I'm working on an upgrade to the RakuDoc Renderer, so the bugs 
will be there for a bit.


However I really would like to have a better search function.

I wish the documentation would define what is
put into your Proc variable when "run" exits.
Not divide it up all over the place.

Snip

And, I should not have to find the source code
more readable and explanatory than the documents.
And that should tell you something!

Thank you for the well written letter.
I appreciate it.

-T





Hi Richard,

I am thinking.  I will definitely get back to you in a few days.

-T


Re: boo-boo in run docs?

2025-11-12 Thread Richard Hainsworth
On Sun, 9 Nov 2025, 04:27 ToddAndMargo via perl6-users, <
[email protected]> wrote:

> On 11/8/25 11:59 AM, Richard Hainsworth wrote:
> > Hi Todd,
> >
> > Long time since I responded to one of your questions.
>
Snip

>
> Hi Richard,
>
> I under stand why it is done that way.  I just
> do not like how it is done.
>
We all have our likes and dislikes.
I know you document things with your keepers. But to be honest the ones you
have published contain errors because they gloss over important topics.

For example in your next sentence:

>
> "run" return its results in the OOP class "Proc".
>
There is an error! 'run' does NOT return it's results in the OOP class
Proc!!!

'run' returns an object of type Proc. This is important because you can
have many objects but there is still only one class. And the difference
between type and class arises because (in Raku but not in many other
languages) you can add roles to an object which means it will do more than
just the methods of class Proc.

And that is precisely what methods are documented by class and not by the
routines which return objects of that class.

The whole point of the secondary files is to aid in finding relevant
information.

But that is also the reason for the functionality in the search button.

 I think everyone agrees that search and the website could be improved.

If you could find a way to suggest a systematic way of showing you how to
get the information you need in a more intuitive way, please let me know.

I'm writing a new version of the docs website. Take a look at
https://new-raku.finanayst.org

It looks a bit like the old one, but it works better on mobiles and tablets.

There are bugs in it still.

Currently I'm working on an upgrade to the RakuDoc Renderer, so the bugs
will be there for a bit.

However I really would like to have a better search function.

> I wish the documentation would define what is
> put into your Proc variable when "run" exits.
> Not divide it up all over the place.
>
> Snip
>
> And, I should not have to find the source code
> more readable and explanatory than the documents.
> And that should tell you something!
>
> Thank you for the well written letter.
> I appreciate it.
>
> -T
>
>
>


Re: boo-boo in run docs?

2025-11-11 Thread ToddAndMargo via perl6-users

On 11/11/25 6:22 AM, Peter Pentchev wrote:

The "exitcode" method, on the other hand, is what Raku creates
automatically when the source code says "has $.exitcode". It will
read the value of the internal "$.exitcode" field and it will return

To be a bit more precise, for methods of that class that will have
access to the internal field, the field itself is called "$!exitcode".

G'luck,
Peter



Hi Peter,

Maybe this will help with my issue with the documentation.
You want to use run and before.  You get to the run page
and what do you find?  It looks like a summary of a
specification sheet.  It is not at all helpful.

I am reminded of University calculus.   Supposedly the hardest
coarse was the one that was taught by a teacher that explained
the mechanics of a process first, sent us home to work on
problems, then the next lesson explained the theory.  I loved
the course and got a perfect A in it.  Then the next calculus
course was taught by a teacher that taught the theory, then
sent us home to solve problems.  The next lesson, he repeated
it.  The course about killed me.  I got a C in it.  It was
my worse grade in Uni.

In my own paper on run, the first two to lines are a quick
introduction as to what run does:

Run allows Raku to call and external program outside
the “shell”. Results are given back in OOP format using
the Proc class.

Simple and direct.  The next section is my table of contents.

The third section shows links to my references.

The fourth section is the simplest example I could think of.
No showing off or bragging.

Quick “run” example:

#!/usr/bin/raku

# Note: use "shell" with wild cards ("*", "?")

my @args = "ls", "-al", Q[RunTest.raku];
my Proc $p = run( "ls", "-al", Q[RunTest.raku], :err, :out );

my int  $x = $p.exitcode;  #  `$?` in bash
my Str  $y = $p.err.slurp(:close);
my Str  $z = $p.out.slurp(:close);

print "\$x (exitcode) = <$x>\n";
print "\$z (out)  = $z\n";
print "\$y (err)  = $y\n";


Result:
$x (exitcode) = <0>
$z (out)  = -rwxrwxrwx. 1 tony root 858 Nov  2 22:40 
RunTest.raku

$y (err)  =

I work up to more complicated from there.


Now from my own coding:

   ( $ReturnStr, $CurlStatus ) = CurlImpersonate $ClickHere, 
$NewFileName,  $SubName ;

   if $CurlStatus eq True  {
   ...
   } else {
   ...
   }


Notice how the FIRST thing I check is the exit code?
That is the most import part.  Did the call work or not.

And who cared how it got there. Method or anything other
way.  Is it zero on not is all the is important.  If
it is not zero, I do not care what is in $ReturnStr.

The document on run is absolutely accurate and pretty
much useless.

-T



Re: boo-boo in run docs?

2025-11-11 Thread ToddAndMargo via perl6-users

On 11/11/25 5:55 AM, Peter Pentchev wrote:

On Tue, Nov 11, 2025 at 04:44:42AM -0800, ToddAndMargo via perl6-users wrote:

On 11/6/25 3:58 PM, Peter Pentchev wrote:

exitcode
should have been included in the examples in run's documentation.
And exit code should have been included in the definition of
Proc, not buried at the end of the document,



It is in the definition. It is listed as one of the methods, because
that is what it is. "The end of the document" is the section that
lists all of the methods that you can call.


.exitcode in not a method.  The value is an integer.


No, "$.exitcode" is an internal field that you do not have
direct access to. The only reason you know about that field right now is
that you looked at the source code of the class; programs that use
objects of the Proc class cannot access it directly.

The "exitcode" method, on the other hand, is what Raku creates
automatically when the source code says "has $.exitcode". It will
read the value of the internal "$.exitcode" field and it will return
that value to you. If you have a variable called $proc and it is
a Proc object, then you can call that method in two main ways:

   say $proc.exitcode()  # see, it's a method with no arguments

   say $proc.exitcode  # Raku allows you to omit the parentheses

That second way is the standard Raku way to let programs access
the fields of an object that they are allowed to: the class
says "has $.field" and Raku automatically generates a method
called "field" that you can call with or without the parentheses.
The internal variable that is called $.exitcode is not really
visible to your program; the only way for you to get that exit code
is to invoke the method that is called "exitcode"...

...and that is described in "Methods" section of the Proc documentation.
  

So what your are saying, correct me if I misinterpret you,
is that

   .exitcode,
   .signal
   .pid
   @.command

Should all go at the end becasue somewhere in the run command,
methods are used to populate them?


Not exactly. The $.exitcode, $.signal, $.pid, and @.command
INTERNAL variables are not documented on purpose - your program
does not have any way to access them directly.

However, the way they are defined in the source code means that
Raku has automatically generated the "exitcode", "signal", "pid",
and "command" methods for you to call to get those values...

...and those methods are all described in the "Methods" section
of the https://docs.raku.org/type/Proc page :)

And they are described in the "Methods" section of the "Proc" page
because that's where they belong - because they are methods of
the "Proc" class. A function that returns an object of the type
"Proc" does not need to document anything you can do with that
object, just as a function that returns an object of the type "Int"
does not need to document anything you can do with that object.

I mean, the Str class has a method called "chars" that you call to
figure out how many characters there are in a string. Now do you
think that the documentation of the string class should tell you
stuff like "oh, and once you call chars, you can then do several
things with that value, like you can call is-prime to figure out
whether that is a prime number, or you can call sign to figure out
whether this is a positive or a negative number, or you can
call sqrt to get the square root of that number"? No, none of
that belongs in the Str class, because it has nothing to do
with strings; however, it is documented in the Int class, the Real
class, the Numeric class and so on.

So just as the documentation of Str does not tell you that you can
do $name.chars.sqrt, so the documentation of run() does not tell you
that you can do run().exitcode. The documentation of Str says
that "chars" returns an Int; the documentation of "run" says
that it returns a Proc.
  
G'luck,

Peter



Hi Peter,

No objection here.

I am also marveling at your technical writing.  You stated
the information very clearly.   I have a hard time with
technical writing and you really impressed me with yours.

-T

Now I will go wash my mouth out with soap!  :-)


Re: boo-boo in run docs?

2025-11-11 Thread Peter Pentchev
On Tue, Nov 11, 2025 at 03:55:11PM +0200, Peter Pentchev wrote:
> On Tue, Nov 11, 2025 at 04:44:42AM -0800, ToddAndMargo via perl6-users wrote:
> > On 11/6/25 3:58 PM, Peter Pentchev wrote:
> > > > exitcode
> > > > should have been included in the examples in run's documentation.
> > > > And exit code should have been included in the definition of
> > > > Proc, not buried at the end of the document,
> > 
> > > It is in the definition. It is listed as one of the methods, because
> > > that is what it is. "The end of the document" is the section that
> > > lists all of the methods that you can call.
> > 
> > .exitcode in not a method.  The value is an integer.
> 
> No, "$.exitcode" is an internal field that you do not have
> direct access to. The only reason you know about that field right now is
> that you looked at the source code of the class; programs that use
> objects of the Proc class cannot access it directly.
> 
> The "exitcode" method, on the other hand, is what Raku creates
> automatically when the source code says "has $.exitcode". It will
> read the value of the internal "$.exitcode" field and it will return

To be a bit more precise, for methods of that class that will have
access to the internal field, the field itself is called "$!exitcode".

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-11 Thread Peter Pentchev
On Tue, Nov 11, 2025 at 04:44:42AM -0800, ToddAndMargo via perl6-users wrote:
> On 11/6/25 3:58 PM, Peter Pentchev wrote:
> > > exitcode
> > > should have been included in the examples in run's documentation.
> > > And exit code should have been included in the definition of
> > > Proc, not buried at the end of the document,
> 
> > It is in the definition. It is listed as one of the methods, because
> > that is what it is. "The end of the document" is the section that
> > lists all of the methods that you can call.
> 
> .exitcode in not a method.  The value is an integer.

No, "$.exitcode" is an internal field that you do not have
direct access to. The only reason you know about that field right now is
that you looked at the source code of the class; programs that use
objects of the Proc class cannot access it directly.

The "exitcode" method, on the other hand, is what Raku creates
automatically when the source code says "has $.exitcode". It will
read the value of the internal "$.exitcode" field and it will return
that value to you. If you have a variable called $proc and it is
a Proc object, then you can call that method in two main ways:

  say $proc.exitcode()  # see, it's a method with no arguments

  say $proc.exitcode  # Raku allows you to omit the parentheses

That second way is the standard Raku way to let programs access
the fields of an object that they are allowed to: the class
says "has $.field" and Raku automatically generates a method
called "field" that you can call with or without the parentheses.
The internal variable that is called $.exitcode is not really
visible to your program; the only way for you to get that exit code
is to invoke the method that is called "exitcode"...

...and that is described in "Methods" section of the Proc documentation.
 
> So what your are saying, correct me if I misinterpret you,
> is that
> 
>   .exitcode,
>   .signal
>   .pid
>   @.command
> 
> Should all go at the end becasue somewhere in the run command,
> methods are used to populate them?

Not exactly. The $.exitcode, $.signal, $.pid, and @.command
INTERNAL variables are not documented on purpose - your program
does not have any way to access them directly.

However, the way they are defined in the source code means that
Raku has automatically generated the "exitcode", "signal", "pid",
and "command" methods for you to call to get those values...

...and those methods are all described in the "Methods" section
of the https://docs.raku.org/type/Proc page :)

And they are described in the "Methods" section of the "Proc" page
because that's where they belong - because they are methods of
the "Proc" class. A function that returns an object of the type
"Proc" does not need to document anything you can do with that
object, just as a function that returns an object of the type "Int"
does not need to document anything you can do with that object.

I mean, the Str class has a method called "chars" that you call to
figure out how many characters there are in a string. Now do you
think that the documentation of the string class should tell you
stuff like "oh, and once you call chars, you can then do several
things with that value, like you can call is-prime to figure out
whether that is a prime number, or you can call sign to figure out
whether this is a positive or a negative number, or you can
call sqrt to get the square root of that number"? No, none of
that belongs in the Str class, because it has nothing to do
with strings; however, it is documented in the Int class, the Real
class, the Numeric class and so on.

So just as the documentation of Str does not tell you that you can
do $name.chars.sqrt, so the documentation of run() does not tell you
that you can do run().exitcode. The documentation of Str says
that "chars" returns an Int; the documentation of "run" says
that it returns a Proc.
 
G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-11 Thread ToddAndMargo via perl6-users

On 11/6/25 3:58 PM, Peter Pentchev wrote:

exitcode
should have been included in the examples in run's documentation.
And exit code should have been included in the definition of
Proc, not buried at the end of the document,



It is in the definition. It is listed as one of the methods, because
that is what it is. "The end of the document" is the section that
lists all of the methods that you can call.


.exitcode in not a method.  The value is an integer.

my class Proc {
...
has $.exitcode is default(Nil);


.exitcode is populate inside run by a method.

method exitcode {
self!wait-for-finish;
$!exitcode
}


When you invoke run, run populates your Proc variable
with many things that come from methods.  The user
does not call them himself by calling those methods.

So what your are saying, correct me if I misinterpret you,
is that

  .exitcode,
  .signal
  .pid
  @.command

Should all go at the end becasue somewhere in the run command,
methods are used to populate them?

How about those things that are file handles, they go
at the end too?


Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/8/25 11:59 AM, Richard Hainsworth wrote:

Hi Todd,

Long time since I responded to one of your questions. This thread seems 
to have a lot in common, both in tone and approach, with other 
assertions you have made.


I'm responding to the original post although I have read all the 
responses by others.


First, lets look at the document in the url you posted. It clearly states:

run

Combined from primary sources listed below'

Although you have been accessing the docs website for many years now, it 
seems that the structure of the website is not as transparent to you as 
it should be. There are about 700 'primary' source pages, and some 1500 
'secondary' ones. The secondary pages are automatically generated every 
time the website is built from the primary ones (about once every 2 
hours - I think).


The reason for this is that quite a few methods are defined for many 
classes (try searching for 'new'). They are each documented in the 
primary sources for those classes, but naturally we want to see a single 
page with all the references in one place. Hence the need for secondary 
pages.


The documentation on 'run' is literally combined from other primary 
sources. You can click on the link to 'independent routines', and in 
that document is a link to the primary document on class 'Proc' (not 
Pro, which you sometimes write).


Raku is quite different from some other languages in the way it handles 
Objects. For example, 'run' as an independent routine, returns an object 
of type 'Proc'. In the same way the fragment 'hello world' creates an 
object of type Str. Hence 'my $v = "hello world" puts an object of type 
Str into the variable $y.


Once the object is created, all the methods associated with that object 
can now be used, so `say $v.tc` will output "Hello world". The method 
`tc` is defined on Str objects, and $v contains a Str object.


In the same way, `my $proc = run ` will run the program 
cat with input 'my-file', and the object will be stored in $proc.


Now that $proc has a Proc object, the method 'exitcode' can be run on $proc.

So, 'exitcode' has nothing to do with the method 'run', and so should 
not be included in the documentation for 'run'.


All the other methods that you noted (in subsequent posts) are 
associated with class Proc and can therefore be run on an object of type 
Proc.


They are not a part of or associated with 'run'.

This way of thinking about objects is fundamental to Raku and what gives 
it a great deal of power. However, Raku is in a sense very modest, you 
dont need to know about its power to use it for simple things.


I hope this helps you understand why there isn't a 'boo boo' in the 
documentation, and why what others have said is actually answering the 
question you asked.


Regards,

Richard (finanalyst)




Hi Richard,

I under stand why it is done that way.  I just
do not like how it is done.

"run" return its results in the OOP class "Proc".
I wish the documentation would define what is
put into your Proc variable when "run" exits.
Not divide it up all over the place.

As you said, Raku does wonderful things for you,
so you do not have to know how everything works.
just trust that it does.

$proc.exit code is an example.  It contains the
exit code from the program you ran.  So
there is no need to rat pack it down somewhere
at the bottom of everything because under
the hood, Raku did it for you.

The doc's should just state what it does up front.
Down the road they can break things down
as to how.

This might seems a bit weird to you becasue
you are one of those experts stand out in your
field, but the docs need to be usable for
both your skill level and beginners like me too.

And, I should not have to find the source code
more readable and explanatory than the documents.
And that should tell you something!

Thank you for the well written letter.
I appreciate it.

-T




Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/8/25 11:04 AM, Peter Pentchev wrote:

On Sat, Nov 08, 2025 at 08:49:16PM +0200, Peter Pentchev wrote:

On Sat, Nov 08, 2025 at 04:15:22AM -0800, ToddAndMargo via perl6-users wrote:

On 11/8/25 2:09 AM, Peter Pentchev wrote:

4. All the parameters to `run` are documented in `run`.


The Docs for Proc:


I assume you are quoting https://docs.raku.org/type/Proc


method new(Proc:U:
 :$in = '-',
 :$out = '-',
 :$err = '-',
 Bool :$bin = False,
 Bool :$chomp = True,
 Bool :$merge = False,
 Str:D :$enc = 'UTF-8',
 Str:D :$nl = "\n",
 --> Proc:D)


The structure of the page that leads to the part you quoted is:

# class Proc

## Methods

### routine new



This is not "the Docs for Proc". Immediately above that part,
it says "routine new", and this is all in a section called "Methods".

What does that mean?

It means that this is the documentation for `Proc.new`, the constructor.
The constructor is only one of the methods.

The rest of the page documents the rest of the methods, or at least
those that are supposed to be accessed by other code, like e.g. exitcode.


Let me try to describe this in a different way, with a different example.

Take the Version class. Very broadly speaking, a class is a kind of type.
The variables of that type are called objects of that class.
The class defines the so-called "methods" that are like functions that
you can call that know that they are supposed to handle this specific
variable (the object). [of course, this is subtly wrong in many details,
but it is kinda right in general]

So let's take the Version class, the one described at

   https://docs.raku.org/type/Version

In the Methods section, it lists several methods that you can call on
either the type or its objects. The first method is called "new", and
that is just one of the methods of the Version class.

The "new" method is described as having a single parameter, a string.
This means that in your code, you can do stuff like:

 my $ver = Version("7.42.616");

Now you have the $ver variable which is of the Version type; it is
an object of the Version class. This means that you can call any other
methods listed in the documentation, like e.g. the parts method that
will return the dot-separated parts of the version string:

 say $ver.parts.elems;
 (output: 3)
 say $ver.parts[0]
 (output: 7)

The parts method is something that you can call once you have an object of
the Version class. The parts of the version are not something that
you pass to the constructor; it is something that the object knows how to
"make" from what you "gave" it in the constructor.

Similarly, Proc is a class, a type. When you call the "new" method -
which is, shall we say once again, only one of the methods you can call -
then you tell it what command you want to run. When you call the "new"
method, you don't tell it what the exit code of the program is, because
*you don't know it at that point* :)

When you call Version.new, you only pass the version string itself,
you do not pass the "parts" list.

When `run` calls Proc.new, it only passes the command itself and a couple of
other things, it does not pass the exit code.

Once you have a Version object, you can call its .parts method to get
the list of parts.

Once you have a Proc object, you can call its .exitcode method to get
the process's exit code.

You do not pass .parts to Version.new.

You do not pass .exitcode to Proc.new.

Does that help?

G'luck,
Peter




Hi Peter,

It does help.  Thank you.

My Keeper starts out with:
 Run allows Raku to call and external program outside
 the “shell”. Results are given back in OOP format
 using the Proc class.

This is one of the examples explaining things:

Example showing values returned in Proc:

my Proc $p = run "ls", "-al", "RunTest.raku", :out, :err;

(my \Proc_4827370660800 = Proc.new(
in => IO::Pipe,
out => IO::Pipe.new(proc => Proc_4827370660800,
path => IO::Path,
chomp => Bool::True,
nl-in => "\n",
nl-out => "\n",
encoding => "utf8"),
err => IO::Pipe.new(proc => Proc_4827370660800,
path => IO::Path,
chomp => Bool::True,
nl-in => "\n",
nl-out => "\n",
encoding => "utf8"),
os-error => Str,
exitcode => Nil,
signal => Any,
pid => 42139,
command => ("ls", "-al", "RunTest.raku")))

[1] > say $p.exitcode
0

[1] > say $p.out
IO::Pipe<(Path)>(opened)

[1] > say $p.out.slurp(:close)
-rwxrwxrwx. 1 todd root 932 Nov  2 22:43 RunTest.raku

[1] > say $p.err
IO::Pipe<(Path)>(opened)

[1] > say $p.err.slurp(:close)


In my Keeper, I explain what EVERY item inside Proc.
And right out he door, not squirreled away by what
is created by a method and what is not.

For example:

:$err
   $p.err is a file handle, usually to STDERR. Use $P.err.Slurp(:close)
   to read it.

   These are "colon-pairs" (like a hash).  Use these arguments to
   redirect to different file handles.

   Syntax to change these values is
   :out($alt-handle)  # handle opened 

Re: boo-boo in run docs?

2025-11-08 Thread Richard Hainsworth

Hi Todd,

Long time since I responded to one of your questions. This thread seems 
to have a lot in common, both in tone and approach, with other 
assertions you have made.


I'm responding to the original post although I have read all the 
responses by others.


First, lets look at the document in the url you posted. It clearly states:

run

Combined from primary sources listed below'

Although you have been accessing the docs website for many years now, it 
seems that the structure of the website is not as transparent to you as 
it should be. There are about 700 'primary' source pages, and some 1500 
'secondary' ones. The secondary pages are automatically generated every 
time the website is built from the primary ones (about once every 2 
hours - I think).


The reason for this is that quite a few methods are defined for many 
classes (try searching for 'new'). They are each documented in the 
primary sources for those classes, but naturally we want to see a single 
page with all the references in one place. Hence the need for secondary 
pages.


The documentation on 'run' is literally combined from other primary 
sources. You can click on the link to 'independent routines', and in 
that document is a link to the primary document on class 'Proc' (not 
Pro, which you sometimes write).


Raku is quite different from some other languages in the way it handles 
Objects. For example, 'run' as an independent routine, returns an object 
of type 'Proc'. In the same way the fragment 'hello world' creates an 
object of type Str. Hence 'my $v = "hello world" puts an object of type 
Str into the variable $y.


Once the object is created, all the methods associated with that object 
can now be used, so `say $v.tc` will output "Hello world". The method 
`tc` is defined on Str objects, and $v contains a Str object.


In the same way, `my $proc = run ` will run the program 
cat with input 'my-file', and the object will be stored in $proc.


Now that $proc has a Proc object, the method 'exitcode' can be run on $proc.

So, 'exitcode' has nothing to do with the method 'run', and so should 
not be included in the documentation for 'run'.


All the other methods that you noted (in subsequent posts) are 
associated with class Proc and can therefore be run on an object of type 
Proc.


They are not a part of or associated with 'run'.

This way of thinking about objects is fundamental to Raku and what gives 
it a great deal of power. However, Raku is in a sense very modest, you 
dont need to know about its power to use it for simple things.


I hope this helps you understand why there isn't a 'boo boo' in the 
documentation, and why what others have said is actually answering the 
question you asked.


Regards,

Richard (finanalyst)

On 03/11/2025 08:03, ToddAndMargo via perl6-users wrote:

Hi All,

I do believe I came across a boo-boo in the docs for "run":

https://docs.raku.org/routine/run

sub run(
    *@args ($, *@),
    :$in = '-',
    :$out = '-',
    :$err = '-',
    Bool :$bin = False,
    Bool :$chomp = True,
    Bool :$merge = False,
    Str:D :$enc = 'UTF-8',
    Str:D :$nl = "\n",
    :$cwd = $*CWD,
    Hash() :$env = %*ENV,
    :$arg0,
    :$win-verbatim-args = False
--> Proc:D)


The above stated that it return a variable of type "Proc".

Type Proc states:

method new(Proc:U:
    :$in = '-',
    :$out = '-',
    :$err = '-',
    Bool :$bin = False,
    Bool :$chomp = True,
    Bool :$merge = False,
    Str:D :$enc = 'UTF-8',
    Str:D :$nl = "\n",
    --> Proc:D)

Hmmm.   They forgot:
 $proc.exitcode

Maybe I am blind?

-T



Re: boo-boo in run docs?

2025-11-08 Thread Peter Pentchev
On Sat, Nov 08, 2025 at 08:49:16PM +0200, Peter Pentchev wrote:
> On Sat, Nov 08, 2025 at 04:15:22AM -0800, ToddAndMargo via perl6-users wrote:
> > On 11/8/25 2:09 AM, Peter Pentchev wrote:
> > > 4. All the parameters to `run` are documented in `run`.
> >
> > The Docs for Proc:
> 
> I assume you are quoting https://docs.raku.org/type/Proc
> 
> > method new(Proc:U:
> > :$in = '-',
> > :$out = '-',
> > :$err = '-',
> > Bool :$bin = False,
> > Bool :$chomp = True,
> > Bool :$merge = False,
> > Str:D :$enc = 'UTF-8',
> > Str:D :$nl = "\n",
> > --> Proc:D)
> 
> The structure of the page that leads to the part you quoted is:
> 
> # class Proc
> 
> ## Methods
> 
> ### routine new
> 
> 
> 
> This is not "the Docs for Proc". Immediately above that part,
> it says "routine new", and this is all in a section called "Methods".
> 
> What does that mean?
> 
> It means that this is the documentation for `Proc.new`, the constructor.
> The constructor is only one of the methods.
> 
> The rest of the page documents the rest of the methods, or at least
> those that are supposed to be accessed by other code, like e.g. exitcode.

Let me try to describe this in a different way, with a different example.

Take the Version class. Very broadly speaking, a class is a kind of type.
The variables of that type are called objects of that class.
The class defines the so-called "methods" that are like functions that
you can call that know that they are supposed to handle this specific
variable (the object). [of course, this is subtly wrong in many details,
but it is kinda right in general]

So let's take the Version class, the one described at

  https://docs.raku.org/type/Version

In the Methods section, it lists several methods that you can call on
either the type or its objects. The first method is called "new", and
that is just one of the methods of the Version class.

The "new" method is described as having a single parameter, a string.
This means that in your code, you can do stuff like:

my $ver = Version("7.42.616");

Now you have the $ver variable which is of the Version type; it is
an object of the Version class. This means that you can call any other
methods listed in the documentation, like e.g. the parts method that
will return the dot-separated parts of the version string:

say $ver.parts.elems;
(output: 3)
say $ver.parts[0]
(output: 7)

The parts method is something that you can call once you have an object of
the Version class. The parts of the version are not something that
you pass to the constructor; it is something that the object knows how to
"make" from what you "gave" it in the constructor.

Similarly, Proc is a class, a type. When you call the "new" method -
which is, shall we say once again, only one of the methods you can call -
then you tell it what command you want to run. When you call the "new"
method, you don't tell it what the exit code of the program is, because
*you don't know it at that point* :)

When you call Version.new, you only pass the version string itself,
you do not pass the "parts" list.

When `run` calls Proc.new, it only passes the command itself and a couple of
other things, it does not pass the exit code.

Once you have a Version object, you can call its .parts method to get
the list of parts.

Once you have a Proc object, you can call its .exitcode method to get
the process's exit code.

You do not pass .parts to Version.new.

You do not pass .exitcode to Proc.new.

Does that help?

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-08 Thread Peter Pentchev
On Sat, Nov 08, 2025 at 04:15:22AM -0800, ToddAndMargo via perl6-users wrote:
> On 11/8/25 2:09 AM, Peter Pentchev wrote:
> > 4. All the parameters to `run` are documented in `run`.
>
> The Docs for Proc:

I assume you are quoting https://docs.raku.org/type/Proc

> method new(Proc:U:
> :$in = '-',
> :$out = '-',
> :$err = '-',
> Bool :$bin = False,
> Bool :$chomp = True,
> Bool :$merge = False,
> Str:D :$enc = 'UTF-8',
> Str:D :$nl = "\n",
> --> Proc:D)

The structure of the page that leads to the part you quoted is:

# class Proc

## Methods

### routine new



This is not "the Docs for Proc". Immediately above that part,
it says "routine new", and this is all in a section called "Methods".

What does that mean?

It means that this is the documentation for `Proc.new`, the constructor.
The constructor is only one of the methods.

The rest of the page documents the rest of the methods, or at least
those that are supposed to be accessed by other code, like e.g. exitcode.

Repeat after me:

The constructor is only one of the methods.
The rest of the methods are described on the rest of the page.

The constructor is only one of the methods.
The rest of the methods are described on the rest of the page.

The constructor is only one of the methods.
The rest of the methods are described on the rest of the page.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/8/25 2:09 AM, Peter Pentchev wrote:

4. All the parameters to `run` are documented in `run`.



The docs for run:

sub run(
*@args ($, *@),
:$in = '-',
:$out = '-',
:$err = '-',
Bool :$bin = False,
Bool :$chomp = True,
Bool :$merge = False,
Str:D :$enc = 'UTF-8',
Str:D :$nl = "\n",
:$cwd = $*CWD,
Hash() :$env = %*ENV,
:$arg0,
:$win-verbatim-args = False
--> Proc:D)


The actual sub:

multi sub run(
*@args where .so,
:$in = '-', :
$out = '-',
:$err = '-',
Bool :$bin,
Bool :$chomp = True,
Bool :$merge,
Str  :$enc,
Str:D :$nl = "\n",
:$cwd = $*CWD, :
$env,
:$arg0,
:$win-verbatim-args = False) {

my $proc := Proc.new(
   :$in, :$out, :$err, :$bin, :$chomp, :$merge, :$enc, :$nl);
$proc.spawn(@args, :$cwd, :$env, :$arg0, :$win-verbatim-args);
$proc
}

Looks like everything is there.



The Docs for Proc:

method new(Proc:U:
:$in = '-',
:$out = '-',
:$err = '-',
Bool :$bin = False,
Bool :$chomp = True,
Bool :$merge = False,
Str:D :$enc = 'UTF-8',
Str:D :$nl = "\n",
--> Proc:D)


The actual source code for Proc:

my class Proc {
has IO::Pipe $.in;
has IO::Pipe $.out;
has IO::Pipe $.err;
has Str $.os-error;
has $.exitcode is default(Nil);
has $.signal;
has $.pid is default(Nil);
has @.command;

has Proc::Async $!proc;
has Bool $!w;
has @!pre-spawn;
has @!post-spawn;
has $!active-handles = 0;
has &!start-stdout;
has &!start-stderr;
has $!finished;

submethod BUILD(
  :$in = '-',
  :$out = '-',
  :$err = '-',
  :$exitcode,
  Bool :$bin,
  Bool :$chomp = True,
  Bool :$merge,
  :$command,
  Str :$enc,
  Str:D :$nl = "\n", :
  $signal --> Nil) {
  @!command := $command.List if command.List

method exitcode {
self!wait-for-finish;
$!exitcode
}

method signal {
self!wait-for-finish;
$!signal
}



A bunch of stuff is missing from the docs:
$.extcode, $.signal, $.pid, @.command.
Mostly the things from "submethod BUILD".
I think that submethod is kind of cool!

The ones with the ! can be forgiven as they
are private to the rakumod.








Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/8/25 2:16 AM, Peter Pentchev wrote:

Oh, sorry, one last (new) thing. You said:


"run" is a method inside Proc's OOP structure.

It is not a method inside `Proc`. It is a routine on its own - it is
something you can just call without mentioning `Proc` - in your program
you call run(...), you don't call Proc.run(...), right?

It is defined inside the same file that defines `Proc`, but that does not
make it a method inside `Proc` - there is no `method` keyword in
the definition of `run` in that file, is there?


Hi Peter,

Made me look at the source code again.  I missed a "}".
You are correct, it is a "sub" exported from Proc.rakumod.
It is not part of the class deceleration or Proc.

Thank you for the correction.

-T


Re: boo-boo in run docs?

2025-11-08 Thread Peter Pentchev
On Sat, Nov 08, 2025 at 12:09:15PM +0200, Peter Pentchev wrote:
> On Sat, Nov 08, 2025 at 01:34:42AM -0800, ToddAndMargo via perl6-users wrote:
> > On 11/6/25 3:58 PM, Peter Pentchev wrote:
> > > It is in the definition. It is listed as one of the methods, because
> > > that is what it is. "The end of the document" is the section that
> > > lists all of the methods that you can call.
> > 
> > "run" is a method inside Proc's OOP structure.
> > "ALL" of Proc's and run's parameters need
> > to be documented.
> 
> 1. A method is not a parameter.
> 
> 2. `exitcode` is not a `run` method, it is a `Proc` method.
> 
> 3. It is documented in `Proc`.
> 
> 4. All the parameters to `run` are documented in `run`.
> 
> I will stop repeating *the same things* over and over again.

Oh, sorry, one last (new) thing. You said:

> > "run" is a method inside Proc's OOP structure.

It is not a method inside `Proc`. It is a routine on its own - it is
something you can just call without mentioning `Proc` - in your program
you call run(...), you don't call Proc.run(...), right?

It is defined inside the same file that defines `Proc`, but that does not
make it a method inside `Proc` - there is no `method` keyword in
the definition of `run` in that file, is there?

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-08 Thread Peter Pentchev
On Sat, Nov 08, 2025 at 01:34:42AM -0800, ToddAndMargo via perl6-users wrote:
> On 11/6/25 3:58 PM, Peter Pentchev wrote:
> > It is in the definition. It is listed as one of the methods, because
> > that is what it is. "The end of the document" is the section that
> > lists all of the methods that you can call.
> 
> "run" is a method inside Proc's OOP structure.
> "ALL" of Proc's and run's parameters need
> to be documented.

1. A method is not a parameter.

2. `exitcode` is not a `run` method, it is a `Proc` method.

3. It is documented in `Proc`.

4. All the parameters to `run` are documented in `run`.

I will stop repeating *the same things* over and over again.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/8/25 1:16 AM, ToddAndMargo via perl6-users wrote:

You will note exitcode, command, pid are
included in the run's method declaration:



Here is the wording of such from my own documentation:

command:
The command method of the Proc class returns a list containing the
arguments that were passed when the Proc object was executed via
spawn, shell, or run. This method provides access to the original
command and its arguments used to invoke the external process.

pid:
The pid method of the Proc class in Raku returns the process ID
(PID) of the external process if it is available, or Nil if not. This
method is used to retrieve the PID value after a process has been
spawned or executed

:$exitcode
Note: this is missing from “run” the documentation, but is shown
  in the “Proc” documentation.
The exitcode method in Raku's Proc class returns the exit
code of an external process, or -1 if the process has not
yet exited.

This is the exist code from the program. It is the similar to
`$?` in bash.

The exit code -1073741510 (0xc13a) is a Windows-specific
  error code that indicates an application was terminated
  abruptly during a logoff or shutdown sequence.

  Typical exist codes (it is dependent on the programmer
  what he sends) are:

  0: Success; the command executed without errors.

  1: A generic or catchall error, often used for unspecified failures
  such as a command not being able to perform its intended operation
  or encountering an unexpected issue.

  2: Indicates misuse of a shell builtin command, such as passing an
  invalid argument, or an issue like a non-existent file or directory
  requiring permissions.

  126: Denotes that a command or script cannot be executed, typically
  due to permission issues preventing execution, even if the file exists.

  127: Means the command was not found, which may occur due to a typo
  in the command name or because the executable is not in the system's
  PATH environment variable.




Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/6/25 3:58 PM, Peter Pentchev wrote:

It is in the definition. It is listed as one of the methods, because
that is what it is. "The end of the document" is the section that
lists all of the methods that you can call.


"run" is a method inside Proc's OOP structure.
"ALL" of Proc's and run's parameters need
to be documented.

Do not leave the user guessing.

The end is all the stuff we didn't think you
need to know does not cut it.

If the things left out at the top were put back
in, the you'd know to look for it.


Re: boo-boo in run docs?

2025-11-08 Thread ToddAndMargo via perl6-users

On 11/7/25 1:43 AM, Peter Pentchev wrote:

On Thu, Nov 06, 2025 at 07:50:47PM -0800, ToddAndMargo via perl6-users wrote:

On 11/6/25 4:44 PM, Peter Pentchev wrote:

What I object to is mainly assertions that the reference-style
documentation is incomplete


Proc is missing exitcode, command, mulitimethod, pid,
exitcode, and signal from its OOP declaration at
the top of the page.


It is not. Please read some more of my mails. There is a difference
between the "new" method and "the OOP declaration": the whole page
documents the methods that you can use on a Proc class or object.


AI Slop?

https://search.brave.com/search?q=raku+are+methods+part+of+an+oop+structure&spellcheck=0&source=alteredQuery&summary=1&conversation=2af824f8fb9764e4613372

Yes, methods are a fundamental part of the object-oriented
programming (OOP) structure in Raku. They are functions
defined within a class that operate on the object's data,
defining the behavior of the objects. Methods are declared
using the method keyword inside a class body and can access
the object's attributes using the self invocant or a custom
invocant name specified in the method's signature. All objects
in Raku derive from the root class Mu, which provides a set of
default methods, and every object supports methods from this
hierarchy. Methods can be public by default, or made private
by prepending a ! to the method name. They can also have typed
parameters, return types, and support features like multi-methods.
The ability to define methods within classes is central to
Raku's support for OOP, enabling encapsulation and the bundling
of data and operations that act on that data.



Take a look at https://docs.raku.org/type/Date

...is it missing "today" and "first-date-in-month" at the top?

It is not. They are methods that are listed where the methods are
listed in the documentation of any Raku class.

G'luck,
Peter



You are correct of the multimethod.  My bad.

This what the docs should include:

You will note exitcode, command, pid are
included in the run's method declaration:

Source:
https://github.com/rakudo/rakudo/blob/main/src/core.c/Proc.rakumod

Proc:

my class Proc {
has IO::Pipe $.in;
has IO::Pipe $.out;
has IO::Pipe $.err;
has Str $.os-error;
has $.exitcode is default(Nil);  \
has $.signal;
has $.pid is default(Nil);
has @.command;

has Proc::Async $!proc;
has Bool $!w;
has @!pre-spawn;
has @!post-spawn;
has $!active-handles = 0;
has &!start-stdout;
has &!start-stderr;
has $!finished;


From run (a method inside Proc's OOP structure):

multi sub run(
   *@args where .so,
   :$in = '-',
   :$out = '-',
   :$err = '-',
Bool :$bin,
Bool :$chomp = True,
Bool :$merge,
Str  :$enc,
Str:D :$nl = "\n", :
$cwd = $*CWD, :
$env,
:$arg0,
:$win-verbatim-args = False)
{
my $proc := Proc.new(:$in, :$out, :$err, :$bin, :$chomp, :$merge, 
:$enc, :$nl);

$proc.spawn(@args, :$cwd, :$env, :$arg0, :$win-verbatim-args);
$proc
}


Every single one of these values in Proc and Pro's run method
need to be discussed in the documentation.




Re: boo-boo in run docs?

2025-11-07 Thread ToddAndMargo via perl6-users

On 11/6/25 1:57 AM, Peter Pentchev wrote:

If you look at
 https://docs.raku.org/type/Proc/Async
There is a ton of them missing.

The documentation of `Proc` declares everything that `Proc` does.
The documentation of `Proc::Async` declares everything that `Proc::Async` does.
Those are two different things.



Not to beat a dead horse, but the horse is
already dead and does not care.

They are very, very closely related.  One
relies on the other. The code for it
is absolutely elegant.

Proc calls Pro::Async, Pro::Async waits for
the program called to terminate, then Proc
picks out what it wants from Pro::Async.

And Pro::Async is part of Proc's class
structure: see line 13 below.

Lines 3 through 20 of Proc.rakumod:

3 my class Proc {
has IO::Pipe $.in;
has IO::Pipe $.out;
has IO::Pipe $.err;
has Str $.os-error;
has $.exitcode is default(Nil);
has $.signal;
has $.pid is default(Nil);
has @.command;

13has Proc::Async $!proc;
has Bool $!w;
has @!pre-spawn;
has @!post-spawn;
has $!active-handles = 0;
has &!start-stdout;
has &!start-stderr;
20has $!finished;




Re: boo-boo in run docs?

2025-11-07 Thread Peter Pentchev
On Thu, Nov 06, 2025 at 07:50:47PM -0800, ToddAndMargo via perl6-users wrote:
> On 11/6/25 4:44 PM, Peter Pentchev wrote:
> > What I object to is mainly assertions that the reference-style
> > documentation is incomplete
> 
> Proc is missing exitcode, command, mulitimethod, pid,
> exitcode, and signal from its OOP declaration at
> the top of the page.

It is not. Please read some more of my mails. There is a difference
between the "new" method and "the OOP declaration": the whole page
documents the methods that you can use on a Proc class or object.

Take a look at https://docs.raku.org/type/Date

...is it missing "today" and "first-date-in-month" at the top?

It is not. They are methods that are listed where the methods are
listed in the documentation of any Raku class.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-06 Thread ToddAndMargo via perl6-users

On 11/6/25 4:44 PM, Peter Pentchev wrote:

What I object to is mainly assertions that the reference-style
documentation is incomplete


Proc is missing exitcode, command, mulitimethod, pid,
exitcode, and signal from its OOP declaration at
the top of the page.

They are all part of Pro's structure.  Putting it
up with the rest tells me to go looking for them
somewhere below.  Not putting them there tells
me they are not in the documentation and I do
not look for  them.

And yes, I can be a pain-in-the-neck sometimes.




Re: boo-boo in run docs?

2025-11-06 Thread ToddAndMargo via perl6-users

On 11/6/25 4:44 PM, Peter Pentchev wrote:

For the record, despite the tone that seems to have escaped in some of
my messages, for which I apologize to Todd...


No problem.  I really appreciate you writing me and not
sugar coating things.  I am in no way offended.



Re: boo-boo in run docs?

2025-11-06 Thread ToddAndMargo via perl6-users

On 11/6/25 3:57 PM, Tom Browder wrote:
On Thu, Nov 6, 2025 at 17:34 ToddAndMargo via perl6-users 
mailto:[email protected]>> wrote:

…

I wish Raku would take a page from Perl5's documentation,

which is very easy for a beginner to pick up.  They
start with simple examples, explain everything thing involved,
then work up to the fancy stuff.   (Raku is a great clean
up of Perl 5, except for the documentation.)

…


Todd, I wholeheartedly agree with you. I do not cast aspersion on the 
Raku doc writers, but I wish we could agree on some practical middle 
ground.  Remember, Perl infra has been around many more decades than 
Raku, and has had many more people tackling the problem.


Best regards,

-Tom (@tbrowder)



Hi Tom,

Oh good gracious, no aspersions on the writers.  They
obviously worked put and extreme amount of work into
it.

Every language I have had to work with over the past 50
years, I have just opened up the manual and looked up
what I needed.  I do hope the writers are looking at my
complaints and decide on that middle ground you speak of.

-T



Re: boo-boo in run docs?

2025-11-06 Thread Peter Pentchev
On Thu, Nov 06, 2025 at 05:57:06PM -0600, Tom Browder wrote:
> On Thu, Nov 6, 2025 at 17:34 ToddAndMargo via perl6-users  [email protected]> wrote:
> …
> 
> I wish Raku would take a page from Perl5's documentation,
> 
> which is very easy for a beginner to pick up.  They
> > start with simple examples, explain everything thing involved,
> > then work up to the fancy stuff.   (Raku is a great clean
> > up of Perl 5, except for the documentation.)
> 
> Todd, I wholeheartedly agree with you. I do not cast aspersion on the Raku
> doc writers, but I wish we could agree on some practical middle ground.
> Remember, Perl infra has been around many more decades than Raku, and has
> had many more people tackling the problem.

For the record, despite the tone that seems to have escaped in some of
my messages, for which I apologize to Todd, I can also clearly see
the difference between Perl 5's long, explanatory documentation with
lots of detailed intro-level documents, and Raku's reference-style one.
I do understand that concise reference-style documentation can be
not entirely helpful for people who do not know a lot about the subject
matter. What I object to is mainly assertions that the reference-style
documentation is incomplete. It is complete, it is just not easy to
grasp for people who have little experience with the concepts they're
reading about.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-06 Thread Peter Pentchev
On Thu, Nov 06, 2025 at 03:34:32PM -0800, ToddAndMargo via perl6-users wrote:
> On 11/6/25 3:01 PM, Peter Pentchev wrote:
> > On Thu, Nov 06, 2025 at 12:25:11PM -0800, ToddAndMargo via perl6-users 
> > wrote:
> > > On 11/6/25 8:18 AM, Peter Pentchev wrote:
> > > > On Thu, Nov 06, 2025 at 06:16:28PM +0200, Peter Pentchev wrote:
> > > > > On Thu, Nov 06, 2025 at 02:27:43AM -0800, ToddAndMargo via 
> > > > > perl6-users wrote:
> > > > > > On 11/6/25 1:57 AM, Peter Pentchev wrote:
> > > > > > > It doesn't need to be; the documentation of `run` already points 
> > > > > > > to
> > > > > > > the documentation of `Proc`, as you point out.
> > > > > > 
> > > > > > In that case, "run's" documentation should have ended at
> > > > > > the Proc link.  None of the examples should have been
> > > > > > included.  No need for further discussion.
> > > > > 
> > > > > That is not true, since the examples document how one can use `run`
> > > > > to start a program; the fact that the returned value is a `Proc`
> > > > > object does not matter. The documentation for `run` documents how
> > > > > you use `run`; the documentation for `shell` documents how you
> > > > > use `shell`. In both cases, they refer to the documentation for `Proc`
> > > > > so that they don't have to repeat what is already written there.
> > > > 
> > > > ...and, perhaps even more importantly, so that the documentation for
> > > > either `run` or `shell` does not need to be changed if something
> > > > changes in `Proc`.
> > > 
> > > Agreed
> > > 
> > > > 
> > > > G'luck,
> > > > Peter
> > > > 
> > > 
> > > So why put any examples in shell and run?  Just refer to
> > > Proc.
> > 
> > Proc is what many functions could return, and Proc is what some
> > functions may even take as an argument. The documentation of Proc
> > only describes Proc itself; it should not (mainly because it cannot
> > possibly) describe everything that uses it :)
> > 
> > I mean, do you think the documentation of Int should describe each and
> > every function that may ever return an Int? Do you think you should
> > look for Proc.exitcode in the documentation of Int?
> > 
> > G'luck,
> > Peter
> > 
> 
> 
> No. But I do believe that the documentation for run should
> include what you need to use the function and not send you
> on a wild goose chase to try and figure it out.

Maybe exitcode should indeed be added as part of the examples in
the `run` documentation, since it is one of the things that are
most often used, just like `out` and `err` are. But the `run`
documentation cannot reasonably include all of the `Proc` members;
the only sensible thing is to refer to `Proc` for everything else.

> exitcode
> should have been included in the examples in run's documentation.
> And exit code should have been included in the definition of
> Proc, not buried at the end of the document,

It is in the definition. It is listed as one of the methods, because
that is what it is. "The end of the document" is the section that
lists all of the methods that you can call.

What you seem to mean is that it is not passed as a parameter to
the constructor - it cannot possibly be, because `run` DOESN'T KNOW
the exitcode when it starts the program :) The exitcode is obtained
later in a way that `Proc` handles internally.

The parameters to the constructor are NOT all the properties of
an object, and they are not all the *methods* you can call on
an object. You don't pass a string's length as a parameter when
you create it out of a series of characters; you get the length
from a method that you call afterwards, once the string has been
built up. Same with the exitcode - it cannot possibly be known
when a command is started, so it is not a parameter to `new`;
it is obtained later, and you can ask about it by calling
the exitcode method.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-06 Thread Tom Browder
On Thu, Nov 6, 2025 at 17:34 ToddAndMargo via perl6-users  wrote:
…

I wish Raku would take a page from Perl5's documentation,

which is very easy for a beginner to pick up.  They
> start with simple examples, explain everything thing involved,
> then work up to the fancy stuff.   (Raku is a great clean
> up of Perl 5, except for the documentation.)

…

>
Todd, I wholeheartedly agree with you. I do not cast aspersion on the Raku
doc writers, but I wish we could agree on some practical middle ground.
Remember, Perl infra has been around many more decades than Raku, and has
had many more people tackling the problem.

Best regards,

-Tom (@tbrowder)


Re: boo-boo in run docs?

2025-11-06 Thread ToddAndMargo via perl6-users

On 11/6/25 3:01 PM, Peter Pentchev wrote:

On Thu, Nov 06, 2025 at 12:25:11PM -0800, ToddAndMargo via perl6-users wrote:

On 11/6/25 8:18 AM, Peter Pentchev wrote:

On Thu, Nov 06, 2025 at 06:16:28PM +0200, Peter Pentchev wrote:

On Thu, Nov 06, 2025 at 02:27:43AM -0800, ToddAndMargo via perl6-users wrote:

On 11/6/25 1:57 AM, Peter Pentchev wrote:

It doesn't need to be; the documentation of `run` already points to
the documentation of `Proc`, as you point out.


In that case, "run's" documentation should have ended at
the Proc link.  None of the examples should have been
included.  No need for further discussion.


That is not true, since the examples document how one can use `run`
to start a program; the fact that the returned value is a `Proc`
object does not matter. The documentation for `run` documents how
you use `run`; the documentation for `shell` documents how you
use `shell`. In both cases, they refer to the documentation for `Proc`
so that they don't have to repeat what is already written there.


...and, perhaps even more importantly, so that the documentation for
either `run` or `shell` does not need to be changed if something
changes in `Proc`.


Agreed



G'luck,
Peter



So why put any examples in shell and run?  Just refer to
Proc.


Proc is what many functions could return, and Proc is what some
functions may even take as an argument. The documentation of Proc
only describes Proc itself; it should not (mainly because it cannot
possibly) describe everything that uses it :)

I mean, do you think the documentation of Int should describe each and
every function that may ever return an Int? Do you think you should
look for Proc.exitcode in the documentation of Int?

G'luck,
Peter




No. But I do believe that the documentation for run should
include what you need to use the function and not send you
on a wild goose chase to try and figure it out.   exitcode
should have been included in the examples in run's documentation.
And exit code should have been included in the definition of
Proc, not buried at the end of the document,

And the examples that do exist should have been written
with simple code, not fancy code to confuse those with
lesser skills.  In other words, no bragging and showing
off in the examples.

I should also not have had pepper the kinds folks here with
questions on run and forced to write my own documentation.

To me, as a beginner (with Raku), the documentation is
difficult to use as it is clearly written as a refresher
for those that already know what they are doing and not
for novices trying to learn the code.

I wish Raku would take a page from Perl5's documentation,
which is very easy for a beginner to pick up.  They
start with simple examples, explain everything thing involved,
then work up to the fancy stuff.   (Raku is a great clean
up of Perl 5, except for the documentation.)


Re: boo-boo in run docs?

2025-11-06 Thread Peter Pentchev
On Thu, Nov 06, 2025 at 12:25:11PM -0800, ToddAndMargo via perl6-users wrote:
> On 11/6/25 8:18 AM, Peter Pentchev wrote:
> > On Thu, Nov 06, 2025 at 06:16:28PM +0200, Peter Pentchev wrote:
> > > On Thu, Nov 06, 2025 at 02:27:43AM -0800, ToddAndMargo via perl6-users 
> > > wrote:
> > > > On 11/6/25 1:57 AM, Peter Pentchev wrote:
> > > > > It doesn't need to be; the documentation of `run` already points to
> > > > > the documentation of `Proc`, as you point out.
> > > > 
> > > > In that case, "run's" documentation should have ended at
> > > > the Proc link.  None of the examples should have been
> > > > included.  No need for further discussion.
> > > 
> > > That is not true, since the examples document how one can use `run`
> > > to start a program; the fact that the returned value is a `Proc`
> > > object does not matter. The documentation for `run` documents how
> > > you use `run`; the documentation for `shell` documents how you
> > > use `shell`. In both cases, they refer to the documentation for `Proc`
> > > so that they don't have to repeat what is already written there.
> > 
> > ...and, perhaps even more importantly, so that the documentation for
> > either `run` or `shell` does not need to be changed if something
> > changes in `Proc`.
> 
> Agreed
> 
> > 
> > G'luck,
> > Peter
> > 
> 
> So why put any examples in shell and run?  Just refer to
> Proc.

Proc is what many functions could return, and Proc is what some
functions may even take as an argument. The documentation of Proc
only describes Proc itself; it should not (mainly because it cannot
possibly) describe everything that uses it :)

I mean, do you think the documentation of Int should describe each and
every function that may ever return an Int? Do you think you should
look for Proc.exitcode in the documentation of Int?

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-06 Thread ToddAndMargo via perl6-users

On 11/6/25 8:18 AM, Peter Pentchev wrote:

On Thu, Nov 06, 2025 at 06:16:28PM +0200, Peter Pentchev wrote:

On Thu, Nov 06, 2025 at 02:27:43AM -0800, ToddAndMargo via perl6-users wrote:

On 11/6/25 1:57 AM, Peter Pentchev wrote:

It doesn't need to be; the documentation of `run` already points to
the documentation of `Proc`, as you point out.


In that case, "run's" documentation should have ended at
the Proc link.  None of the examples should have been
included.  No need for further discussion.


That is not true, since the examples document how one can use `run`
to start a program; the fact that the returned value is a `Proc`
object does not matter. The documentation for `run` documents how
you use `run`; the documentation for `shell` documents how you
use `shell`. In both cases, they refer to the documentation for `Proc`
so that they don't have to repeat what is already written there.


...and, perhaps even more importantly, so that the documentation for
either `run` or `shell` does not need to be changed if something
changes in `Proc`.


Agreed



G'luck,
Peter



So why put any examples in shell and run?  Just refer to
Proc.




Re: boo-boo in run docs?

2025-11-06 Thread Peter Pentchev
On Thu, Nov 06, 2025 at 06:16:28PM +0200, Peter Pentchev wrote:
> On Thu, Nov 06, 2025 at 02:27:43AM -0800, ToddAndMargo via perl6-users wrote:
> > On 11/6/25 1:57 AM, Peter Pentchev wrote:
> > > It doesn't need to be; the documentation of `run` already points to
> > > the documentation of `Proc`, as you point out.
> > 
> > In that case, "run's" documentation should have ended at
> > the Proc link.  None of the examples should have been
> > included.  No need for further discussion.
> 
> That is not true, since the examples document how one can use `run`
> to start a program; the fact that the returned value is a `Proc`
> object does not matter. The documentation for `run` documents how
> you use `run`; the documentation for `shell` documents how you
> use `shell`. In both cases, they refer to the documentation for `Proc`
> so that they don't have to repeat what is already written there.

...and, perhaps even more importantly, so that the documentation for
either `run` or `shell` does not need to be changed if something
changes in `Proc`.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-06 Thread Peter Pentchev
On Thu, Nov 06, 2025 at 02:27:43AM -0800, ToddAndMargo via perl6-users wrote:
> On 11/6/25 1:57 AM, Peter Pentchev wrote:
> > It doesn't need to be; the documentation of `run` already points to
> > the documentation of `Proc`, as you point out.
> 
> In that case, "run's" documentation should have ended at
> the Proc link.  None of the examples should have been
> included.  No need for further discussion.

That is not true, since the examples document how one can use `run`
to start a program; the fact that the returned value is a `Proc`
object does not matter. The documentation for `run` documents how
you use `run`; the documentation for `shell` documents how you
use `shell`. In both cases, they refer to the documentation for `Proc`
so that they don't have to repeat what is already written there.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-06 Thread ToddAndMargo via perl6-users

On 11/6/25 1:57 AM, Peter Pentchev wrote:

It doesn't need to be; the documentation of `run` already points to
the documentation of `Proc`, as you point out.


In that case, "run's" documentation should have ended at
the Proc link.  None of the examples should have been
included.  No need for further discussion.


Re: boo-boo in run docs?

2025-11-06 Thread Peter Pentchev
On Wed, Nov 05, 2025 at 03:51:55PM -0800, ToddAndMargo via perl6-users wrote:
> On 11/5/25 11:09 AM, Will Coleda wrote:
> > https://docs.raku.org/type/Proc#method_exitcode  > type/Proc#method_exitcode>
> 
> Hi Will,
> 
> Perfect!
> 
> Now it need to be added to
>  https://docs.raku.org/routine/run#(Independent_routines)_sub_run
> 
> so someone reading the page that does not
> already know what he is doing can find it.

It doesn't need to be; the documentation of `run` already points to
the documentation of `Proc`, as you point out.

> Unless I am missing it, there is a who slew of things
> not declared in "Proc" either.  They do give below a simple
> list of some of them: command, mulitimethod, pid,
> exitcode, signal.   But now all of them.

> 
> If you look at
> https://docs.raku.org/type/Proc/Async
> There is a ton of them missing.

The documentation of `Proc` declares everything that `Proc` does.
The documentation of `Proc::Async` declares everything that `Proc::Async` does.
Those are two different things.

> So Proc seriously need to declare its OOP definition
> (object). Everything.  Not just a sample of them.

It does. However, there seems to be a bit of confusion here: you seem to
expect everything to be passed to the `new` method, while it doesn't really
make sense to do that :)

In very broad (and, of course, incorrect in the details) strokes,
the object-oriented paradigm says that a class may define a couple of
different kinds of things:
- class methods that are usually used to create objects (variables) of that 
class;
  that includes the constructor, but see below
- class-level properties, but we will not dwell on these for now
- object-level properties: things that you may think of as fields, members,
  variables that are "stored" "in" a single object (a variable of that type);
  sometimes you can modify them directly, sometimes you can only get their 
values
- object methods that you can call a single object (a variable of that type) 
that
  may return more information or may do some things specific to what this class 
is
  supposed to mean

The `new` method is (usually) special; it is used by other things to create
an object of that type. When doing that, some parameters may be passed - those 
are
usually things that determine "how that object should behave", what it should 
"do".
For a process, the parameters say e.g. which command to run, which directory to
use for running it, what to do with the new process's standard output and error
streams, etc. - all things that you need to know *when you start a program*.

The `exitcode` method is something different: it has absolutely no meaning when
`run` tries to create the `Proc` object, since `run` simply *doesn't know* what
the program's exit code will be at that point :) The exit code of the program 
will
be revealed later - that's why it is a method that may return an integer value 
or
it may say "eh, the program is still running, there is no exit code information 
yet".

That's why `exitcode` is not defined in the constructor - it doesn't make sense 
to
put it there, you don't know what it is when you start the program, that's why
you're starting the program in the first place :) And that's why `exitcode` is,
indeed, documented in the `Proc` documentation as a method that you can call to
see what code the program actually exited with.

Hope that helps.

G'luck,
Peter

-- 
Peter Pentchev  [email protected] [email protected] [email protected]
PGP key:https://www.ringlet.net/roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13


signature.asc
Description: PGP signature


Re: boo-boo in run docs?

2025-11-05 Thread ToddAndMargo via perl6-users

On 11/5/25 11:09 AM, Will Coleda wrote:
https://docs.raku.org/type/Proc#method_exitcode 


Hi Will,

Perfect!

Now it need to be added to
 https://docs.raku.org/routine/run#(Independent_routines)_sub_run

so someone reading the page that does not
already know what he is doing can find it.

"exitcode" is really, really important
as it will let you know the status of what
you just called.

The "run" documentation states:

 Runs an external command without involving a
 shell and returns a Proc object. By default, the
 external command will print to standard output
 and error, and read from standard input.

There is a link to Proc, but it is not very helpful to
those just trying to learn what is returned.

A simple discussion of what values are returned in Proc
that apply to the run command would solve this.
Especially since Proc has a lot of things in it
that does not apply to "run".

Unless I am missing it, there is a who slew of things
not declared in "Proc" either.  They do give below a simple
list of some of them: command, mulitimethod, pid,
exitcode, signal.   But now all of them.

If you look at
https://docs.raku.org/type/Proc/Async
There is a ton of them missing.

So Proc seriously need to declare its OOP definition
(object). Everything.  Not just a sample of them.

Thank you for the link!  I added it to
my documentation

-T




Re: boo-boo in run docs?

2025-11-05 Thread Will Coleda
https://docs.raku.org/type/Proc#method_exitcode

^^

On Mon, Nov 3, 2025 at 8:40 PM ToddAndMargo via perl6-users <
[email protected]> wrote:

> On 11/3/25 5:09 PM, Will Coleda wrote:
> > On my cell, but pretty sure exitcode is a method you call on the
> > returned proc, not a parameter you pass in to a constructor.
>
> Hi Will,
>
> What I am looking at is the Proc is a OOP
> (Object-Oriented Programming) construct
> set up as a method.
>
> my int  $x = $p.exitcode
>
> is how you read elements from an OOP construct
> (class).
>
> If the data is in the OOP construct, it
> needs to be defined in the documentation.
>
> "exitcode" is nowhere I can find in either "run"
> or "Proc", but I have missed things in the
> documentation before.   (I do not have a good
> history with the documentation.  I see it as
> a refresher for those that already know what
> they are doing and not for beginners.  And I am
> the very embodiment of a "beginner" with Raku.)
>
> search.brave.con's AI to the rescue:
>
>
> https://search.brave.com/search?q=raku+exitcode&source=web&summary=1&conversation=ec8afd654b7e77860b84ea
>
>  The exitcode method in Raku's Proc class returns the exit
>  code of an external process, or -1 if the process has not
>  yet exited
>
> I am copying the above downing into my "run" keeper.
>
> So if the above is not "AI Slop", "exitcode" in part of
> the Proc's OOP construct and it need to be both show and
> discussed in the documentation.
>
> Yours in confusion,
> -T
>


Re: boo-boo in run docs?

2025-11-03 Thread ToddAndMargo via perl6-users

On 11/3/25 5:09 PM, Will Coleda wrote:
On my cell, but pretty sure exitcode is a method you call on the 
returned proc, not a parameter you pass in to a constructor.


Hi Will,

What I am looking at is the Proc is a OOP
(Object-Oriented Programming) construct
set up as a method.

my int  $x = $p.exitcode

is how you read elements from an OOP construct
(class).

If the data is in the OOP construct, it
needs to be defined in the documentation.

"exitcode" is nowhere I can find in either "run"
or "Proc", but I have missed things in the
documentation before.   (I do not have a good
history with the documentation.  I see it as
a refresher for those that already know what
they are doing and not for beginners.  And I am
the very embodiment of a "beginner" with Raku.)

search.brave.con's AI to the rescue:

https://search.brave.com/search?q=raku+exitcode&source=web&summary=1&conversation=ec8afd654b7e77860b84ea

The exitcode method in Raku's Proc class returns the exit
code of an external process, or -1 if the process has not
yet exited

I am copying the above downing into my "run" keeper.

So if the above is not "AI Slop", "exitcode" in part of
the Proc's OOP construct and it need to be both show and
discussed in the documentation.

Yours in confusion,
-T


Re: boo-boo in run docs?

2025-11-03 Thread Will Coleda
On my cell, but pretty sure exitcode is a method you call on the returned
proc, not a parameter you pass in to a constructor.

On Mon, Nov 3, 2025 at 03:56 ToddAndMargo via perl6-users <
[email protected]> wrote:

> On 11/3/25 12:28 AM, ToddAndMargo via perl6-users wrote:
> > Proposed change:
> >
> > sub run(
> >  *@args ($, *@),
> >  int :exitcode = 0, #   < addition
> >  :$in = '-',
> >  :$out = '-',
> >  :$err = '-',
> >  Bool :$bin = False,
> >  Bool :$chomp = True,
> >  Bool :$merge = False,
> >  Str:D :$enc = 'UTF-8',
> >  Str:D :$nl = "\n",
> >  :$cwd = $*CWD,
> >  Hash() :$env = %*ENV,
> >  :$arg0,
> >  :$win-verbatim-args = False
> > --> Proc:D)
>
>
> OOps, that should have been in Proc, not run:
>
> method new(Proc:U:
>  int :$exitcode = 0, #   < addition
>  :$in = '-',
>  :$out = '-',
>  :$err = '-',
>  Bool :$bin = False,
>  Bool :$chomp = True,
>  Bool :$merge = False,
>  Str:D :$enc = 'UTF-8',
>  Str:D :$nl = "\n",
>  --> Proc:D)
>


Re: boo-boo in run docs?

2025-11-03 Thread ToddAndMargo via perl6-users

On 11/3/25 12:28 AM, ToddAndMargo via perl6-users wrote:

Proposed change:

sub run(
     *@args ($, *@),
     int :exitcode = 0, #   < addition
     :$in = '-',
     :$out = '-',
     :$err = '-',
     Bool :$bin = False,
     Bool :$chomp = True,
     Bool :$merge = False,
     Str:D :$enc = 'UTF-8',
     Str:D :$nl = "\n",
     :$cwd = $*CWD,
     Hash() :$env = %*ENV,
     :$arg0,
     :$win-verbatim-args = False
--> Proc:D)



OOps, that should have been in Proc, not run:

method new(Proc:U:
int :$exitcode = 0, #   < addition
:$in = '-',
:$out = '-',
:$err = '-',
Bool :$bin = False,
Bool :$chomp = True,
Bool :$merge = False,
Str:D :$enc = 'UTF-8',
Str:D :$nl = "\n",
--> Proc:D)


Re: boo-boo in run docs?

2025-11-03 Thread ToddAndMargo via perl6-users

Proposed change:

sub run(
*@args ($, *@),
int :exitcode = 0, #   < addition
:$in = '-',
:$out = '-',
:$err = '-',
Bool :$bin = False,
Bool :$chomp = True,
Bool :$merge = False,
Str:D :$enc = 'UTF-8',
Str:D :$nl = "\n",
:$cwd = $*CWD,
Hash() :$env = %*ENV,
:$arg0,
:$win-verbatim-args = False
--> Proc:D)