Skip to content

Commit 714b715

Browse files
committed
Final retouches for tomorrow's article
1 parent cf33725 commit 714b715

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

20th/articles/rfc307.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
# RFC 307: PRAYER - what gets said when you bless something by Simon Cozens
22

33
In a context with apocalypses and exegeses, no wonder there's also a
4-
PRAYER somewhere, in this [RFC
4+
PRAYER somewhere: precisely in this [RFC
55
307](https://raku.org/archive/rfc/307.html), by Simon Cozens, which
66
was actually *rejected*, but somehow ended up anyway in [Apocalypse
77
12](https://raku.org/archive/doc/design/apo/A12.html) together with
8-
the one it was rejected for, [RFC
8+
the one it that superseded it, [RFC
99
189](https://raku.org/archive/rfc/189.html). Both proposals talk about
10-
what is going ot happen when an object is created (*blessed*).
10+
what is going ot happen when an object is created, an action that has
11+
traditionally been called [*blessing*](https://perldoc.perl.org/functions/bless.html) in the Perl world.
1112

12-
So let's get first to the rejected one, which is simpler. It proposes
13+
So let's get first to the rejected one, which is simpler. It says
1314

1415
> This RFC proposes a special sub, PRAYER, which is automatically
1516
called on blessing.
1617

17-
The term *blessing* is Perlese for creating an object. In Perl
18+
The term *blessing* is Perlese for welcoming a data structure into the
19+
object world. In Perl
1820
[objects are little more than hashes with a tag tacked on
1921
them](https://perldoc.perl.org/perlobj.html), so you *bless* a data
2022
structure with the class it's going to belong to. However, that's
@@ -44,6 +46,11 @@
4446
`AUTOLOAD` which is called when a method does not exist in a class,
4547
as well as `DESTROY`.
4648

49+
> Other RFCs, recently commented, proposed other seudo-classes that
50+
used capital leters:
51+
[`NEXT`](https://raku-advent.blog/2020/08/14/rfc-190-by-damian-conway-next-pseudoclass-for-method-redispatch/),
52+
for instance.
53+
4754
This last method is interesting: it's called at a certain *phase* in
4855
the object lifecycle; at the very end of it, namely.
4956

@@ -52,25 +59,26 @@
5259

5360
So Perl had a single
5461
[*phaser*](https://docs.raku.org/language/phasers). This RFC
55-
advocated for getting, at least, a couple of symmetric ones. Which
62+
advocated for getting, at least, a couple of symmetric ones, at both
63+
ends of the object lifecycle. Which
5664
was precisely in the turf of [RFC
5765
189](https://raku.org/archive/rfc/189.html), which proposed a set of
5866
hierarchical `BUILD` (lost chance to call them `INCEPT`) and
59-
`DESTROY` calls, invocated up and down the object inheritance chain.
67+
`DESTROY` calls, invoked up and down the object inheritance chain.
6068

61-
But this RFC goes a little beyond that, or sideways from that, so it
69+
Which is why this RFC was rejected, I guess. However, this RFC goes a little beyond that, or sideways from that, so it
6270
made sense to pick it up for the apocalypsis 12, instead of
6371
subsuming it into 189. In a way, `BUILD` is what it asks for off the
6472
bat: it's the "prayer" that gets called from `bless`. But rephrase
65-
it slightly, "what's called when somethin *has been blessed*" and it
73+
it slightly, "what's called when something *has been blessed*" and it
6674
becomes something totally different: not a building routine, but a,
6775
wait for it, *tweaking* routine (or method, or *submethod*, which is
6876
what it eventually became).
6977

7078
In this way, Raku got
7179
[`TWEAK`](https://docs.raku.org/language/objects#index-entry-TWEAK). RFC
7280
189 begat BUILD, which creates a nice and bundled object. But
73-
*after* this object has been created, and it's nicely wrapped into a
81+
*after* this object has been created, and it's solidly wrapped into a
7482
`self` data structure, you might still need to `TWEAK` it, and do
7583
stuff that can only be done when and if the object is already
7684
BUILT. This is what TWEAK is for. And it can be put to good use in
@@ -80,9 +88,9 @@
8088
to register `self` with some external object, or, actually, anything
8189
you might want to do with an object that has been aready blessed.
8290

83-
This also says something about the process; an RFC that was rejected
84-
eventually ended up as a nice, and interesting, feature of the final
85-
language. Because, in the true open source spirits, with many eyes
91+
This also says something about the process that created Raku; an RFC that was rejected
92+
eventually ended up as an useful, and interesting, feature of the final
93+
language. Because, in the true open source spirit, with many eyes
8694
all bugs are shallow, and also many eyes look stuff all over again
8795
and find its real worth and meaning. Which is what you need when
8896
designing a 100 year language, I guess.

0 commit comments

Comments
 (0)