Skip to content

Commit 1ea73e3

Browse files
committed
Extend explanation
1 parent 14a8a51 commit 1ea73e3

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

doc/Language/traits.pod6

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ On the other hand, X<P6opaque> is the default representation used for
9090
all objects in Raku.
9191
9292
class Thar {};
93-
say Thar.REPR; #OUTPUT: «P6opaque␤»
93+
say Thar.REPR; # OUTPUT: «P6opaque␤»
9494
9595
The L<metaobject protocol|/language/mop> uses it by default for every object
9696
and class unless specified otherwise; for that reason, it is in general not
@@ -110,14 +110,22 @@ routines.
110110
111111
=head2 X<C<is implementation-detail>,traits> trait
112112
113-
Note: this trait is available in Rakudo compiler starting from 2020.05 release.
113+
Note: this trait has been available in Rakudo compiler starting from 2020.05 release.
114114
115-
The C<is> with C<implementation-detail> argument is used by Raku
116-
language implementations and module authors to mark particular
117-
routines (including methods) as not meant to be a public API.
115+
This trait is used by Raku language implementations and module authors
116+
to mark particular routines (including methods) as not meant to be a
117+
part of public API. While such routines can be found when looked up
118+
directly, they will not appear in results of introspection:
118119
119-
Applying this trait makes the C<is-implementation-detail> method on
120-
L<Code|/type/Code> to return C<True>.
120+
my &do-not-use-routine = CORE::<&DYNAMIC>;
121+
say CORE::.keys.grep(* eq '&DYNAMIC'); # OUTPUT: «()␤»
122+
123+
Such routines are not meant for use by users and their behavior and availability can be changed
124+
anytime.
125+
126+
Applying this trait makes the C<is-implementation-detail> method called on
127+
L<Code|/type/Code> to return C<True>, thus giving a hint to the user not to use it
128+
if they are not willing to maintain this code in case of changes for years to come:
121129
122130
my &fail-routine = &fail;
123131
unless &fail-routine.is-implementation-detail {

0 commit comments

Comments
 (0)