From f0d22c716240a72126980c386d9e8d1f0cd3dd27 Mon Sep 17 00:00:00 2001 From: Keita Haga Date: Sun, 5 Dec 2010 21:27:25 +0900 Subject: [PATCH] classes.tuple: minor fixes in tuple-examples article --- core/classes/tuple/tuple-docs.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/classes/tuple/tuple-docs.factor b/core/classes/tuple/tuple-docs.factor index 037ecf8715..7443e02cc5 100644 --- a/core/classes/tuple/tuple-docs.factor +++ b/core/classes/tuple/tuple-docs.factor @@ -190,7 +190,7 @@ $nl { $subsections "tuple-inheritance-example" "tuple-inheritance-anti-example" -} +} "Declaring a tuple class final prohibits other classes from subclassing it:" { $subsections POSTPONE: final } { $see-also "call-next-method" "parametrized-constructors" "unions" "mixins" } ; @@ -215,12 +215,14 @@ ARTICLE: "tuple-examples" "Tuple examples" { $table { "Reader" "Writer" "Setter" "Changer" } { { $snippet "name>>" } { $snippet "name<<" } { $snippet ">>name" } { $snippet "change-name" } } + { { $snippet "position>>" } { $snippet "position<<" } { $snippet ">>position" } { $snippet "change-position" } } { { $snippet "salary>>" } { $snippet "salary<<" } { $snippet ">>salary" } { $snippet "change-salary" } } - { { $snippet "position>>" } { $snippet "position<<" } { $snippet ">>position" } { $snippet "change-position" } } } "We can define a constructor which makes an empty employee:" -{ $code ": ( -- employee )" - " employee new ;" } +{ $code + ": ( -- employee )" + " employee new ;" +} "Or we may wish the default constructor to always give employees a starting salary:" { $code ": ( -- employee )"