Skip to content

Commit

Permalink
Add glossary entry, and link references, closes Raku#4018
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Mar 26, 2022
1 parent 99f0c78 commit dfd3fb8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions doc/Language/glossary.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,26 @@ A document originally written by L<#TheDamian>, in which he tried to explain
the L<Apocalypses|#Apocalypse> to the common (wo)man. Now only kept as an
historical document for reference. See also L<#Synopsis>.
X<|forward declaration>
=head1 Forward declarations
Declare the scope and/or type of a functional entity (class or routine)
without actually declaring its code by using
the L<"stub" operator|/language/operators#index-entry-..._operators>; code
will be declared later on in the same file.
=for code
grammar Quux {
my regex future {...};
say "foobarbaz" ~~ /<future>/;
regex future { f \w** 2 b \w ** 2 }
}
In this case, the regex acts as a method; please note that the scope is only
declared once.
X<|fiddly>
=head1 fiddly
Expand Down
4 changes: 2 additions & 2 deletions doc/Language/typesystem.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ automatically if no such scope exists already.
put Foo::Bar::.keys;
# OUTPUT: «C␤»
X«|... (forward declaration)»
X«Forward declarations» can be provided with a block containing only C<...>. The
X«Forward type declarations» can be provided with a block containing only C<...>,
the L<"stub" operator|/language/operators#index-entry-..._operators>. The
compiler will check at the end of the current scope if the type is defined.
class C {...}
Expand Down

0 comments on commit dfd3fb8

Please sign in to comment.