Pragmatic directives: Difference between revisions
Content deleted Content added
mNo edit summary |
→{{header|Perl 6}}: add entry |
||
Line 171: | Line 171: | ||
<lang perl>no warnings; # disable warnings pragma module |
<lang perl>no warnings; # disable warnings pragma module |
||
no strict; # disable strict pragma module</lang> |
no strict; # disable strict pragma module</lang> |
||
=={{header|Perl 6}}== |
|||
The Perl 6 pragma mechanism is nearly identical to Perl 5's, piggybacking on the notation for importing modules (pragmas are distinguished by case from normal modules, which are generally of mixed case). By convention pragmas are lowercase, unless they are indicating the use of an unsafe feature, in which case they are in all caps. |
|||
<lang perl6>use MONKEY_TYPING; |
|||
augment class Int { |
|||
method times (&what) { what() xx self } # pretend like we're Ruby |
|||
}</lang> |
|||
Unlike Perl 5, there is no <tt>use strict;</tt> pragma, however, since Perl 6 is strict by default. Importation of a pragma is lexically scoped as in Perl 5, but note that unlike in Perl 5, <i>all</i> importation is lexical in Perl 6, so pragmas are not special that way. |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |