Skip to content

Commit

Permalink
Merge pull request #815 from perl6/revert-814-signature-test-option
Browse files Browse the repository at this point in the history
Revert "New pod config option: 'signature'"
  • Loading branch information
Altai-man committed Aug 7, 2016
2 parents ab1f2b0 + 753a50d commit 69198a3
Show file tree
Hide file tree
Showing 18 changed files with 122 additions and 348 deletions.
10 changes: 0 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,6 @@ To export examples from all .pod6-files use `make extract-examples`. To run
individual tests pick the right .p6-file from `examples/` as a parameter to
`perl6`.

### Signatures

Signatures are part of actual code and need to be tested too. But without the body every
signature will cause an error during the test. Use the pod-config option `signature` to
automatically add an empty body.

=begin code :signature
method new(*@codes)
=end code

### Skipping tests

Some examples fail with compile time exceptions and would interrupt the test
Expand Down
48 changes: 13 additions & 35 deletions doc/Type/Any.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ List or a list-like type.
Defined as:
=begin code :signature
multi method ACCEPTS(Any:D: Mu $other)
=end code
multi method ACCEPTS(Any:D: Mu $other) {}
Usage:
Expand All @@ -38,9 +36,7 @@ Many built-in types override this for more specific comparisons
Defined as:
=begin code :signature
method any() returns Junction:D
=end code
method any() returns Junction:D {}
Usage:
Expand All @@ -58,9 +54,7 @@ C<any>-L<Junction|/type/Junction> from it.
Defined as:
=begin code :signature
method all() returns Junction:D
=end code
method all() returns Junction:D {}
Usage:
Expand All @@ -78,9 +72,7 @@ C<all>-L<Junction|/type/Junction> from it.
Defined as:
=begin code :signature
method one() returns Junction:D
=end code
method one() returns Junction:D {}
Usage:
Expand All @@ -98,9 +90,7 @@ C<one>-L<Junction|/type/Junction> from it.
Defined as:
=begin code :signature
method none() returns Junction:D
=end code
method none() returns Junction:D {}
Usage:
Expand Down Expand Up @@ -137,10 +127,8 @@ into the newly created Array.
Defined as:
=begin code :signature
multi sub reverse(*@list ) returns List:D
multi method reverse(List:D:) returns List:D
=end code
multi sub reverse(*@list ) returns List:D {}
multi method reverse(List:D:) returns List:D {}
Usage:
Expand Down Expand Up @@ -175,10 +163,8 @@ Examples:
Defined as:
proto method map(|) is nodal { * }
=begin code :signature
multi method map(\SELF: &block;; :$label, :$item)
multi method map(HyperIterable:D: &block;; :$label)
=end code
multi method map(\SELF: &block;; :$label, :$item) {}
multi method map(HyperIterable:D: &block;; :$label) {}
C<map> will iterate over the invocant and apply the number of positional
parameters of the code object from the invocant per call. The returned values
Expand All @@ -188,9 +174,7 @@ of the code object will become elements of the returned C<Seq>.
Defined as:
=begin code :signature
method deepmap(&block -->List) is nodal
=end code
method deepmap(&block -->List) is nodal {}
C<deepmap> will apply C<&block> to each element and return a new C<List> with
the return values of C<&block>, unless the element does the C<Iterable> role.
Expand All @@ -203,9 +187,7 @@ For those elements C<deepmap> will descend recursively into the sublist.
Defined as:
=begin code :signature
method duckmap(&block) is rw is nodal
=end code
method duckmap(&block) is rw is nodal {}
C<duckmap> will apply C<&block> on each element and return a new list with
defined return values of the block. For undefined return values, C<duckmap>
Expand Down Expand Up @@ -264,9 +246,7 @@ Interprets the invocant as a list, and returns the last index of that list.
=head2 method pairup
=begin code :signature
method pairup() returns List
=end code
method pairup() returns List {}
Interprets the invocant as a list, and constructs a list of
L<pairs|/type/Pair> from it, in the same way that assignment to a
Expand All @@ -279,9 +259,7 @@ list item, if any, is considered to be a key again).
=head2 sub exit
=begin code :signature
sub exit(Int() $status = 0)
=end code
sub exit(Int() $status = 0) {}
Exits the current process with return code C<$status>.
Expand Down
54 changes: 16 additions & 38 deletions doc/Type/Array.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ scalar containers, which means you can assign to array elements.
Defined as:
=begin code :signature
multi sub pop(Array:D )
multi method pop(Array:D:)
=end code
multi sub pop(Array:D ) {}
multi method pop(Array:D:) {}
Usage:
Expand All @@ -42,10 +40,8 @@ Example:
Defined as:
=begin code :signature
multi sub push(Array:D, **@values) returns Array:D
multi method push(Array:D: **@values) returns Array:D
=end code
multi sub push(Array:D, **@values) returns Array:D {}
multi method push(Array:D: **@values) returns Array:D {}
Usage:
Expand Down Expand Up @@ -92,11 +88,8 @@ Defined as
=begin code :skip-test
sub append(\array, elems)
=end code
=begin code :signature
multi method append(Array:D: \values)
multi method append(Array:D: **@values is raw)
=end code
multi method append(Array:D: \values) {}
multi method append(Array:D: **@values is raw) {}
Usage:
Expand Down Expand Up @@ -124,10 +117,8 @@ Example:
Defined as:
=begin code :signature
multi sub shift(Array:D )
multi method shift(Array:D:)
=end code
multi sub shift(Array:D ) {}
multi method shift(Array:D:) {}
Usage:
Expand All @@ -151,11 +142,8 @@ Example:
Defined as:
=begin code :signature
multi sub unshift(Array:D, **@values) returns Array:D
multi method unshift(Array:D: **@values) returns Array:D
=end code
multi sub unshift(Array:D, **@values) returns Array:D {}
multi method unshift(Array:D: **@values) returns Array:D {}
Usage:
Expand Down Expand Up @@ -187,11 +175,8 @@ Defined as
=begin code :skip-test
sub prepend(\array, elems)
=end code
=begin code :signature
multi method prepend(Array:D: \values)
multi method prepend(Array:D: **@values is raw)
=end code
multi method prepend(Array:D: \values) {}
multi method prepend(Array:D: **@values is raw) {}
Usage:
Expand All @@ -213,11 +198,8 @@ Example:
Defined as:
=begin code :signature
multi sub splice(@list, $start, $elems?, *@replacement) returns Array
multi method splice(Array:D $start, $elems?, *@replacement) returns Array
=end code
multi sub splice(@list, $start, $elems?, *@replacement) returns Array {}
multi method splice(Array:D $start, $elems?, *@replacement) returns Array {}
Usage:
Expand Down Expand Up @@ -261,9 +243,7 @@ Example:
Defined as:
=begin code :signature
method default
=end code
method default {}
Usage:
Expand Down Expand Up @@ -292,9 +272,7 @@ the type object C<(Any)>.
Defined as:
=begin code :signature
method of
=end code
method of {}
Usage:
Expand Down
36 changes: 9 additions & 27 deletions doc/Type/Attribute.pod6
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ The usual way to obtain an object of type C<Attribute> is by introspection:
Defined as:
=begin code :signature
method name(Attribute:D:) returns Str:D
=end code
method name(Attribute:D:) returns Str:D {}
Usage:
Expand All @@ -53,9 +51,7 @@ so if an attribute is declared as C<has $.a>, the name returned is C<$!a>.
Defined as:
=begin code :signature
method package(Attribute:D:) returns Mu:U
=end code
method package(Attribute:D:) returns Mu:U {}
Usage:
Expand All @@ -69,9 +65,7 @@ Returns the package (class/grammar/role) to which this attribute belongs.
Defined as:
=begin code :signature
method has_accessor(Attribute:D:) returns Bool:D
=end code
method has_accessor(Attribute:D:) returns Bool:D {}
Usage:
Expand All @@ -85,9 +79,7 @@ Returns C<True> if the attribute has a public accessor method.
Defined as:
=begin code :signature
method readonly(Attribute:D:) returns Bool:D
=end code
method readonly(Attribute:D:) returns Bool:D {}
Usage:
Expand All @@ -102,9 +94,7 @@ Returns C<False> for attributes marked as C<is rw>.
Defined as:
=begin code :signature
method type(Attribute:D:) returns Mu
=end code
method type(Attribute:D:) returns Mu {}
Usage:
Expand All @@ -118,9 +108,7 @@ Returns the type constraint of the attribute.
Defined as:
=begin code :signature
method get_value(Attribute:D: Mu $instance)
=end code
method get_value(Attribute:D: Mu $instance) {}
Usage:
Expand All @@ -137,9 +125,7 @@ used with care. Here be dragons.
Defined as:
=begin code :signature
method set_value(Attribute:D: Mu $instance, Mu \new_val)
=end code
method set_value(Attribute:D: Mu $instance, Mu \new_val) {}
Usage:
Expand All @@ -154,9 +140,7 @@ used with care. Here be dragons.
=head2 trait is required
=begin code :signature
multi sub trait_mod:<is> (Attribute $attr, :$required!)
=end code
multi sub trait_mod:<is> (Attribute $attr, :$required!) {}
Marks an attribute as being required. If a value is not provided
during object construction, an exception is thrown.
Expand All @@ -178,9 +162,7 @@ constructors written using L<bless>.
=head2 trait is rw
=begin code :signature
multi sub trait_mod:<is> (Attribute:D $attr, :$rw!)
=end code
multi sub trait_mod:<is> (Attribute:D $attr, :$rw!) {}
Marks an attribute as read/write as opposed to the default
C<readonly>. The default accessor for the attribute will return a
Expand Down

0 comments on commit 69198a3

Please sign in to comment.