Skip to content

Commit

Permalink
Merge branch 'master' of github.com:perl6/specs
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Sep 29, 2010
2 parents 02bd8f2 + 58fe2d8 commit 4d77c0b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions S09-data.pod
Expand Up @@ -207,8 +207,8 @@ specification, but "unspace" is allowed:
Note that the square brackets are a compile-time declarator, not a run-time
operator, so you can't use the "dotted" form either:

my @values.[10]; # Error
my @keys\ .[10]; # Error
my @values.[10]; # An indexing, not a fixed-size declaration
my @keys\ .[10]; # Ditto

Attempting to access an index outside an array's defined range will fail:

Expand Down
19 changes: 16 additions & 3 deletions S12-objects.pod
Expand Up @@ -2227,8 +2227,8 @@ world (the class already knows its own structure, after all), a set of
C<multi> methods are presented to be a single C<proto> method. You need to
use C<.candidates> on that to break it down further.

The C<.^attributes> method returns a list of attribute descriptors
that have traits like these:
The C<.^attributes> method returns a list of C<Attribute> objects
that have methods like these:

name
type
Expand All @@ -2238,8 +2238,21 @@ that have traits like these:
has-accessor
build
readonly
get_value($obj)
set_value($obj, $new_value)

It also takes the parameters:
Note that an C<Attribute> is not tied to a particular object of a type, but
rather to the type itself. Which is why C<get_value> and C<set_value> need to
receive the actual object as first positional parameter.

[Conjecture: if it's not feasible for a meta class or a representation to
implement C<set_value> and C<get_value>, it may die with an helpful error
message when these methods are called.]

C<set_value> and C<get_value> violate the perceived privateness of attributes,
and thus should be used with care, and at the user's own risk.

C<.^attributes> It also takes the parameters:

:local only methods defined in the current class
:local($n) out $n levels
Expand Down

0 comments on commit 4d77c0b

Please sign in to comment.