Skip to content

Commit b8691e8

Browse files
committed
Make some more examples compile, the easy ones here
1 parent 669b7c9 commit b8691e8

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

doc/Type/FatRat.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
=SUBTITLE Rational number (arbitrary-precision)
66
7-
class FatRat is Cool does Rational[Int, Int]
7+
class FatRat is Cool does Rational[Int, Int] {}
88
99
A C<FatRat> is a rational number stored with arbitrary size numerator and
1010
denominator. Arithmetic operations involving a C<FatRat> and optionally L<Int>

doc/Type/Instant.pod6

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,26 @@ compiler version you're using. For example, the December 31, 2016 leap second
2727
was announced in July and shipped with Rakudo 2016.07, so 2016.06 and earlier
2828
releases won't know about it:
2929
30-
$ perl6-2016.06 -e 'say Instant.from-posix: 1485726595'
31-
Instant:1485726631
30+
=begin code :skip-test
31+
$ perl6-2016.06 -e 'say Instant.from-posix: 1485726595'
32+
Instant:1485726631
3233
33-
$ perl6-2016.07 -e 'say Instant.from-posix: 1485726595'
34-
Instant:1485726632
34+
$ perl6-2016.07 -e 'say Instant.from-posix: 1485726595'
35+
Instant:1485726632
36+
=end code
3537
3638
Since a Rakudo compiler always returns 0 for future leap seconds it doesn't
3739
know about, you can patch your old code when new leap seconds are announced,
3840
so it will give correct results, regardless of what version of the compiler
3941
it runs on:
4042
41-
$ perl6-2016.06 -e 'say ($*VM.version before v2016.07 ?? 1 !! 0) + Instant.from-posix: 1485726595'
42-
Instant:1485726632
43+
=begin code :skip-test
44+
$ perl6-2016.06 -e 'say ($*VM.version before v2016.07 ?? 1 !! 0) + Instant.from-posix: 1485726595'
45+
Instant:1485726632
4346
44-
$ perl6-2016.07 -e 'say ($*VM.version before v2016.07 ?? 1 !! 0) + Instant.from-posix: 1485726595'
45-
Instant:1485726632
47+
$ perl6-2016.07 -e 'say ($*VM.version before v2016.07 ?? 1 !! 0) + Instant.from-posix: 1485726595'
48+
Instant:1485726632
49+
=end code
4650
4751
=head1 Methods
4852
@@ -67,7 +71,7 @@ It is the inverse of L<#method from-posix>, except that the second return
6771
value is C<True> if *and only if* this Instant is in a leap
6872
second.
6973
70-
say DateTime.new("1999-01-01T00:00:00Z").Instant.to-posix # (915148800 False)
74+
say DateTime.new("1999-01-01T00:00:00Z").Instant.to-posix; # (915148800 False)
7175
say DateTime.new('1998-12-31T23:59:60Z').Instant.to-posix; # (915148800 True)
7276
7377
=head2 method Date

doc/Type/NumStr.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
=SUBTITLE Dual Value Floating-point number and String
66
7-
class NumStr is Num is Str
7+
class NumStr is Num is Str { }
88
99
The dual value types (often referred to as L<allomorphs|/language/glossary#Allomorph>)
1010
allow for the representation of a value as both a string and a numeric type, typically

doc/Type/Stash.pod6

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ a literal, append two colons:
1919
my sub lexical { };
2020
method a_method() { }
2121
}
22-
2322
say Boring::.^name; # Stash
2423
say Boring.WHO === Boring::; # True
2524
2625
Since it inherits from L<Hash|/type/Hash>, you can use all the usual hash
2726
functionality:
2827
29-
say Boring::.keys.sort; # &package_sub Nested
30-
say Boring::<Nested>; # (Nested)
28+
=for code :skip-test
29+
say Boring::.keys.sort; # (&package_sub Nested)
30+
say Boring::<Nested>; # (Nested)
3131
3232
As the example above shows only "our"-scoped things appear in the C<Stash>
3333
(nested classes are "our" by default, but can be excluded with "my".) Lexicals

doc/Type/Uni.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
=SUBTITLE A string of Unicode codepoints
66
7-
class Uni does Positional[uint32] does Stringy
7+
class Uni does Positional[uint32] does Stringy { }
88
99
Unlike L<Str|/type/Str>, which is made of Grapheme clusters, Uni is string
1010
strictly made of Unicode codepoints. That is, base characters and combining

doc/Type/Version.pod6

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ In comparisons, early parts take precedence over later parts.
3232
3333
=head2 method new
3434
35-
method new(Str:d $s)
35+
method new(Str:D $s)
3636
3737
Creates a Version from a string C<$s>. The string is combed
3838
for the numeric, alphabetic, and wildcard components of the version object.

0 commit comments

Comments
 (0)