Skip to content

Commit 0888dcc

Browse files
committed
Re-indexing of new as new (method)
I couldn't think of a better way to address #2309. Generated pages don't have an intro, and adding one by hacking the generator would be a slippery slope. Order can probably be changed, but once again, this is not going to satisfy everyone; if it's hacked, same problem as above. If we want to define an order for generated routine pages, this would need metadata all across the site. Adding a prologue for routines would be a nice thing, but once again, it would need changes in the generator *and* adding many new and different pages. So I've opted for just adding a new index entry, which does not overwrite the previous one, but adds a new entry point for those who want to know about new as a method. The section in the object language page is good enough. I'll close #2309, if you want to suggest something else, please feel free to reopen with that suggestion.
1 parent 70a123a commit 0888dcc

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

doc/Language/objects.pod6

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ declared type:
523523
# OUTPUT: «the child's somewhat more fancy frob is called␤»
524524
=end code
525525
526+
X<|new (method)>
526527
=head2 X<Object construction|BUILDALL (method)>
527528
528529
Objects are generally created through method calls, either on the type
@@ -615,14 +616,14 @@ positional arguments, you must write your own C<new> method:
615616
However this is considered poor practice, because it makes correct
616617
initialization of objects from subclasses harder.
617618
618-
Another thing to note is that the name C<new> is not special in Perl 6. It
619-
is merely a common convention. You can call C<bless> from any method at all,
620-
or use C<CREATE> to fiddle around with low-level workings.
619+
Another thing to note is that the name C<new> is not special in Perl 6. It is
620+
merely a common convention, one that is followed quite thoroughly in L<most Perl
621+
6 classes|/routine/new>. You can call C<bless> from any method at all, or use
622+
C<CREATE> to fiddle around with low-level workings.
621623
622-
Another pattern of hooking into object construction is
623-
by writing your own method C<BUILDALL>. To make sure that
624-
initialization of superclasses works fine, you
625-
need to C<callsame> to invoke the parent classes C<BUILDALL>.
624+
Another pattern of hooking into object construction is by writing your own
625+
C<BUILDALL> method. To make sure that initialization of superclasses works fine,
626+
you need to C<callsame> to invoke the parent classes C<BUILDALL>.
626627
627628
=begin code
628629
class MyClass {

0 commit comments

Comments
 (0)