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

Attachment: signature.asc
Description: PGP signature

Reply via email to