develooper Front page | perl.perl6.users | Postings from August 2020

Re: Place for examples in a Raku module?

Thread Previous
From:
JJ Merelo
Date:
August 14, 2020 06:06
Subject:
Re: Place for examples in a Raku module?
Message ID:
CAJoLtgd7bX2LgdMUsgCJ=85EpCpT8+qsZUfJ8qdot2yWWSTmjg@mail.gmail.com
Hi,

El vie., 14 ago. 2020 a las 6:25, Stuart Hungerford (<
stuart.hungerford@gmail.com>) escribió:

> Hi,
>
> I'd like to add some example modules to a Raku module I'm working on.
> These are not strictly tests, nor stand-alone scripts, but modules of
> compilable code that show suggested ways to use the roles and classes
> in the module. They're not strictly needed to make use of the module.
>
> I can see I could create an "examples" sub-directory in the lib
> directory of the module and make sure it does not appear in the
> "provides" metadata for the module. I think I could also create pod6
> documents with large sections of embedded code too but I figure there
> must be idiomatic Raku ways of doing this.
>

Any one of those is acceptable. The second way is a good one, for instance.
"Idiomatic" Raku is never the one and only way of doing things; it's
sometimes the most efficient way of doing something, compiler-wise, but we
take pride in the TIMTOWDI slogan. In this case, I don't see any
performance constraint or layout convention, so any, or both ways, are
totally OK.

Cheers

JJ

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About