For example, look in the "Roles" main documentation section.
There are many places where the bareword "self" is used, whereas I
believe the current syntax is "$?SELF" for the same thing, and has
been for awhile.
For example:
self.some_other_method;
And:
any reference to C<self> or the type of the invocant
And:
C<self!attr()>
This problem may go beyond Synopsis 12, so I suggest doing a
search'n'replace in all the synopsis. Or at least in all of Synopsis
12.
I'm fairly sure the "self" syntax is invalid.
Moreover, S12 explicitly says that Perl 6 has no barewords, save
package names in specific circumstances.
-- Darren Duncan
Actually, I seem to recall `self` being accepted as the correct form,
though I can't remember exactly when that was.
> I'm fairly sure the "self" syntax is invalid.
It's just a 0-ary sub call, I believe.
> Moreover, S12 explicitly says that Perl 6 has no barewords, save
> package names in specific circumstances.
I think that just means P6 has no
barewords-that-are-interpreted-as-strings. You still need to use
"bareword" syntax to write things like class names and subroutine
calls, after you've declared them.
Any "syntactic bareword" without a preceding declaration is assumed to
be a list operator that will be declared later. (Syntactic barewords
are also legal just before `=>`, which autoquotes.)
Stuart
I know that 'self' was valid syntax a year ago, but afterwards only
$?SELF was allowed. Besides, the latter is visually consistent with
things like $?CLASS. And the $?SELF form just looks better besides.
It stands out more, as it should, because it is special. -- Darren
Duncan