On 2020-06-08 04:32, Fernando Santagata wrote:
On Mon, Jun 8, 2020 at 1:20 PM ToddAndMargo via perl6-users <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:

    On 2020-06-08 03:38, Fernando Santagata wrote:
      > …and line 3:
      >
      > unit module Informative;
      >


    3: unit module Informative;

    Does not look like a class to me.  What am I missing?


It's a namespace declaration, see:

https://docs.raku.org/language/syntax#index-entry-declarator_unit-declarator_module-declarator_package-Package,_Module,_Class,_Role,_and_Grammar_declaration

That's the reason why the class name is Informative::Informing and not just Informing.

--
Fernando Santagata

Hi Fernando,

I see:

   Several packages may be declared in a single file.
   However, you can declare a unit package at the start
   of the file (preceded only by comments or use
   statements), and the rest of the file will be taken
   as being the body of the package. In this case, the
   curly braces are not required.

   unit module M;
   # ... stuff goes here instead of in {}'s

I thought methods had to be part of classes?  Or
how the above relates to the methods in the module.

I am confused.

-T

Reply via email to