Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove :T smiley from specs
The :U smiley has taken the place of :T over the years, and the only
difference specified between them (where :U accepts Failures but :T does
not) doesn't appear to make sense anymore. Now :U is spec'd to mean type
objects, and :D means instances.

The only potentially significant change for rakudo is the change from :T
to :U as the default smiley for method new's invocant, but depending on
existing implementation may already be how it works.
  • Loading branch information
ShimmerFairy committed Aug 8, 2015
1 parent 584047e commit 68eb8a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions S06-routines.pod
Expand Up @@ -941,9 +941,9 @@ using the type name in from of the parameter:
If no explicit type constraint is given, it defaults to the type of the
surrounding package for method invocants, and to C<Any> everywhere else.

A bare C<:D>, C<:U>, C<:T> or C<:_> instead of a type constraint limits the
default type to definite, undefined, type objects or any object. The default
still applies, so in
A bare C<:D>, C<:U> or C<:_> instead of a type constraint limits the default
type to definite objects (aka instances), undefined objects (aka type objects),
or any object, respectively. The default still applies, so in

class Con {
method man(:U: :D $x)
Expand Down
6 changes: 2 additions & 4 deletions S12-objects.pod
Expand Up @@ -1620,21 +1620,19 @@ from it by appending an appropriate adverbial to its name:

Int:_ Allow either defined or undefined Int values
Int:D Allow only defined (concrete) Int values
Int:U Allow only undefined (abstract or failure) Int values
Int:T Allow Int only as a type object
Int:U Allow only undefined (abstract) Int values

That is, these mean something like:

Int:D Int:_ where DEFINITE($_)
Int:U Int:_ where not(DEFINITE($_))
Int:T Int:U where none(Failure)

where C<DEFINITE> is a boolean macro that says whether the object
in question has a valid concrete representation (see L</Introspection> below).

In standard Perl 6, C<Int> is generally assumed to mean C<Int:_>, except
for invocants, where the default is C<Int:D>. (The default C<new> method
has a prototype whose invocant is C<:T> instead, so all new methods all
has a prototype whose invocant is C<:U> instead, so all new methods all
default to allowing type objects.)

These defaults may be changed within a lexical scope by various pragmas.
Expand Down

0 comments on commit 68eb8a2

Please sign in to comment.