Pragmatic directives: Difference between revisions

Content added Content deleted
(Added Erlang)
Line 242: Line 242:
no strict; # disable strict pragma module</lang>
no strict; # disable strict pragma module</lang>
=={{header|Perl 6}}==
=={{header|Perl 6}}==
{{works with|rakudo|2015-10-20}}
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.
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;
<lang perl6>use MONKEY-TYPING;
augment class Int {
augment class Int {
method times (&what) { what() xx self } # pretend like we're Ruby
method times (&what) { what() xx self } # pretend like we're Ruby