Skip to content

Commit 10edf02

Browse files
author
Oscar Nierstrasz
committed
rename
git-svn-id: https://www.iam.unibe.ch/scg/svn_repos/SqueakByExample/Book@12051 54883e8d-cf1d-0410-83d6-f114b9419f37
0 parents  commit 10edf02

File tree

305 files changed

+64112
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+64112
-0
lines changed

BasicClasses/BasicClasses.bbl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
%
2+
% This bibliography was produced by using jurabib.bst
3+
%
4+
\begin{thebibliography}{}
5+
6+
\bibitem[{Woolf\jbdy {1998}}%
7+
{}%
8+
{{0}{}{incollection}{1998}{}{}{}{5--18}%
9+
{Addison Wesley\bibbdsep {} 1998}}%
10+
{{Null Object}%
11+
{}{}{1}{}{}{}{}{}}%
12+
]{Wool98a}
13+
\jbbibargs {\bibnf {Woolf} {Bobby} {B.} {} {}} {Bobby Woolf} {au} {\bibapifont
14+
{Null Object}\bibatsep\ \incolledformat {\bibenf {Martin} {Robert} {R.} {}
15+
{}\Bibbfsesep \bibenf {Riehle} {Dirk} {D.} {} {}\Bibbstesep \bibenf
16+
{Buschmann} {Frank} {F.} {} {}}{\edfont {\editorsname}}{\bibbtfont {Pattern
17+
Languages of Program Design 3}\bibatsep\ }{}{} \apyformat {Addison
18+
Wesley\bibbdsep {} 1998} \jbPages{5--18}} {\bibhowcited} \jbdoitem
19+
{{Woolf}{Bobby}{B.}{}{}} {{Martin}{Robert}{R.}{}{}; {Riehle}{Dirk}{D.}{}{};
20+
{Buschmann}{Frank}{F.}{}{}} {} \bibAnnoteFile {Wool98a}
21+
22+
\end{thebibliography}

BasicClasses/BasicClasses.tex

Lines changed: 757 additions & 0 deletions
Large diffs are not rendered by default.

BasicClasses/LeftOver.tex

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
% $Author$
2+
% $Date$
3+
% $Revision$
4+
%=================================================================
5+
\ifx\wholebook\relax\else
6+
% --------------------------------------------
7+
% Lulu:
8+
\documentclass[a4paper,10pt,twoside]{book}
9+
\usepackage[
10+
papersize={6in,9in},
11+
hmargin={.75in,.75in},
12+
vmargin={.75in,1in},
13+
ignoreheadfoot
14+
]{geometry}
15+
\input{../common.tex}
16+
\pagestyle{headings}
17+
\setboolean{lulu}{true}
18+
% --------------------------------------------
19+
% A4:
20+
% \documentclass[a4paper,11pt,twoside]{book}
21+
% \input{../common.tex}
22+
% \usepackage{a4wide}
23+
% --------------------------------------------
24+
\graphicspath{{figures/} {../figures/}}
25+
\begin{document}
26+
\renewcommand{\nnbb}[2]{} % Disable editorial comments
27+
\sloppy
28+
\fi
29+
%=================================================================
30+
31+
%-----------------------------------------------------------------
32+
\subsection{Associating}
33+
\sd{I would remove that section too}
34+
The \emph{associating} method category contains a single method \ct{->}, which is used to create an \ct{Association} between a key (the receiver) and a value (the argument). An \ct{Array} of \ct{Associations} can be used to conveniently initialize a \ct{Dictionary}:
35+
36+
\begin{code}{@TEST}
37+
Dictionary newFrom: { #start -> (1@1) . #end -> (3@4) } --> a Dictionary(#end->3@4 #start->1@1 )
38+
\end{code}
39+
40+
\ct{Object>>>-->} is an example of a \emph{Shortcut Constructor Method}\footnote{See: Kent Beck, \emph{Smalltalk Best Practice Patterns}, Prentice-Hall, 1997.}, which allows you to construct an object by sending a message to one of its constructor arguments. Shortcut Constructor Methods have the great advantage that they make object creation much more concise, but if abused they can clutter the receiver class with many methods unrelated to the key responsibilities of the class.
41+
42+
%-----------------------------------------------------------------
43+
\subsection{Converting}
44+
45+
\sd{here}
46+
\sd{I do not like to talk about that here. I would remove that section. Add a note on the asString and printString difference}
47+
Whenever it is possible in Smalltalk to convert an object from one class \ct{A} to be an instance of another class \ct{B}, this is usually accomplished by sending it a message of the form \ct{asB}. Of course, there is no magic, so this must be implemented at the appropriate level. There are a few such messages provided already by the class \ct{Object}. The most important are \ct{asString} and \ct{asOrderedCollection}.
48+
49+
Every object should have a \ct{String} representation. The default implementation is to return the \ct{printString} representation of the object. We will see this in more detail when we look at \ct{Object}'s \emph{printing} method category below.
50+
51+
\begin{code}{}
52+
Object>>>asString
53+
"Answer a string that represents the receiver."
54+
^ self printString
55+
\end{code}
56+
57+
\begin{code}{@TEST}
58+
Object new --> an Object
59+
\end{code}
60+
61+
The other standard conversion method is \ct{asOrderedCollection}:
62+
63+
\begin{code}{}
64+
Object>>>asOrderedCollection
65+
"Answer an OrderedCollection with the receiver as its only element."
66+
^ OrderedCollection with: self
67+
\end{code}
68+
69+
\begin{code}{@TEST}
70+
1 asOrderedCollection --> an OrderedCollection(1)
71+
\end{code}
72+
73+
74+
%=================================================================
75+
\ifx\wholebook\relax\else
76+
\end{document}\fi
77+
%=================================================================

0 commit comments

Comments
 (0)