Skip to content

Commit

Permalink
Small fixes to make all PBE1 tests green.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oscar Nierstrasz committed May 10, 2011
1 parent ce07708 commit ae06af0
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion BasicClasses/BasicClasses.tex
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ \subsection{Printing}
Note that some objects such as arrays are self-evaluating or not depending on the objects they contain. For example, an array of booleans is self-evaluating whereas an array of persons is not.
The following example shows that a \subind{Array}{dynamic} array is self-evaluating only if its elements are:
\begin{code}{@TEST}
{10@10 . 100@100} --> {10@10 . 100@100}
{10@10. 100@100} --> {10@10. 100@100}
{Browser new . 100@100} --> an Array(a Browser 100@100)
\end{code}
Expand Down
6 changes: 3 additions & 3 deletions Collections/Collections.tex
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ \subsection{Array}
The following code creates an array of three elements consisting of the number \ct{4}, the fraction \ct{3/2} and the string \ct{'lulu'}.
\begin{code}{@TEST | anArray |}
Array with: 4 with: 3/2 with: 'lulu' --> {4 . (3/2) . 'lulu'}
Array with: 4 with: 3/2 with: 'lulu' --> {4. (3/2). 'lulu'}
\end{code}
\paragraph{Literal creation with \ct|\#()|.}
Expand Down Expand Up @@ -455,7 +455,7 @@ \subsection{Dictionary}
colors at: #red put: Color red.
colors at: #yellow --> Color yellow
colors keys --> a Set(#blue #yellow #red)
colors values --> {Color blue . Color yellow . Color red}
colors values --> {Color blue. Color yellow. Color red}
\end{code}

Dictionaries compare keys by equality. Two keys are considered to be the same if they return true when compared using \ct{=}. A common and difficult to spot bug is to use as key an object whose \ct{=} method has been redefined but not its \ct{hash} method. Both methods are used in the implementation of dictionary and when comparing objects.
Expand All @@ -468,7 +468,7 @@ \subsection{Dictionary}
\begin{code}{@TEST | colors |}
colors := Dictionary newFrom: { #blue->Color blue . #red->Color red . #yellow->Color yellow }.
colors removeKey: #blue.
colors associations --> {#yellow->Color yellow . #red->Color red}
colors associations --> {#yellow->Color yellow. #red->Color red}
\end{code}

\paragraph{IdentityDictionary.}
Expand Down
2 changes: 1 addition & 1 deletion FAQ/FAQ.tex
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ \section{Browsing the system}
\begin{code}{@TEST | newMethods |}
newMethods := [:aClass| aClass methodDict keys select:
[:aMethod | (aClass superclass canUnderstand: aMethod) not ]].
newMethods value: True --> an IdentitySet(#asBit)
newMethods value: True --> an IdentitySet(#asBit #xor:)
\end{code}

\begin{faq}
Expand Down
2 changes: 1 addition & 1 deletion Metaclasses/Metaclasses.tex
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ \section{Every class is an instance of a metaclass}
TranslucentColor allSuperclasses --> an OrderedCollection(Color Object ProtoObject)
TranslucentColor instVarNames --> #('alpha')
TranslucentColor allInstVarNames --> #('rgb' 'cachedDepth' 'cachedBitPattern' 'alpha')
TranslucentColor selectors --> an IdentitySet(#pixelValueForDepth: #pixelWord32 #convertToCurrentVersion:refStream: #isTransparent #scaledPixelValue32 #bitPatternForDepth: #storeArrayValuesOn: #setRgb:alpha: #alpha #isOpaque #pixelWordForDepth: #isTranslucentColor #hash #isTranslucent #alpha: #storeOn: #asNontranslucentColor #privateAlpha #balancedPatternForDepth:)
TranslucentColor selectors --> an IdentitySet(#pixelWord32 #asNontranslucentColor #privateAlpha #pixelValueForDepth: #isOpaque #isTranslucentColor #storeOn: #pixelWordForDepth: #scaledPixelValue32 #alpha #bitPatternForDepth: #hash #isTransparent #isTranslucent #balancedPatternForDepth: #setRgb:alpha: #alpha: #storeArrayValuesOn:)
\end{code}
\cmindex{Class}{subclasses}
\cmindex{Behavior}{allSuperclasses}
Expand Down
2 changes: 1 addition & 1 deletion Model/Model.tex
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ \subsection{Self sends and super sends}

Consider the message \ct{constructorString}, which we can send to any morph:
\begin{code}{@TEST | anEllipse | anEllipse := EllipseMorph new.}
anEllipse constructorString --> '((EllipseMorph newBounds: (0@0 corner: 50@40) color: Color yellow) setBorderWidth: 1 borderColor: Color black)'
anEllipse constructorString --> '(EllipseMorph newBounds: (0@0 corner: 50@40) color: Color yellow)'
\end{code}
The return value is a string that can be evaluated to recreate the morph.

Expand Down
11 changes: 6 additions & 5 deletions PBE-TO-DO.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
# PBE TO-DO
$Id$

---

This is the TODO list for "Pharo By Example", listing pending actions and current status of chapters.

---
# PHARO BOOK 1

## TO DO:

- Upgrade to new Pharo image (don't forget to check all the tests!)

- Incorporate Thomas Schrader's formatting suggestions? (See Regex/ToSh-Regex.tex)
- From: "symingz" <symingz@foxmail.com>
Date: April 10, 2010 13:57:36 GMT+02:00
Expand All @@ -32,8 +32,6 @@ What the book says is different, though. For example, when '(1 + 2) + (x a)' is
- pretty print (r) shortcut does nothing (issue 1312)
- context-clicking on process browser raises an error (issue 1313)

## SUPPRESS fi ligatures in headings:
- perl -pi -e 's/(\\(chapter|section|subsection).*)fi/\1f{}i/g;' $*

---
# PHARO BOOK 2
Expand Down Expand Up @@ -73,6 +71,9 @@ What the book says is different, though. For example, when '(1 + 2) + (x a)' is

- Gofer (Argh this is in french now I wonder if this is not any faster that you read the french and write the english because you will probably rewrite a part of my english)

## Regex
- stable, but some tests appear to be broken (in the PBE1 image)

## STATUS OF NEW CHAPTERS

* High priority for revision
Expand Down
8 changes: 4 additions & 4 deletions Reflection/Reflection.tex
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
% --------------------------------------------
\graphicspath{{figures/} {../figures/}}
\begin{document}
% \renewcommand{\nnbb}[2]{} % Disable editorial comments
\renewcommand{\nnbb}[2]{} % Disable editorial comments
\sloppy
\fi

Expand Down Expand Up @@ -576,7 +576,7 @@ \subsection{Intelligent breakpoints}
Starting from \ct!thisContext!, \ct!haltIf:! goes up through the execution stack, checking if the name of the calling method is the same as the one passed as parameter.
If this is the case, then it raises an exception which, by default, summons the debugger.

It is also possible to supply a boolean or a boolean block as an argument to \ct{haltIf:}, but these cases are straightforward and do not make use of \ct{thisContext}.
It is also possible to supply a boolean or a boolean block as an argument to \ct{haltIf:}, but these cases are straightforward and do not make use of \lct{thisContext}.

%======================================
\section{Intercepting messages not understood}
Expand Down Expand Up @@ -903,8 +903,8 @@ \section{Pragmas}

As instances of the class \clsind{Pragma}, pragmas are first class objects. A compiled method answers to the message \mthind{CompiledMethod}{pragmas}. This method returns an array of pragmas.

\begin{code}{@TEST}
(SplitJoinTest class >> #showDocumentation) pragmas
\begin{code}{}
(SplitJoinTest class >> #showDocumentation) pragmas.
--> an Array(<ignoreForCoverage>)
(Float>>#+) pragmas --> an Array(<primitive: 41>)
\end{code}
Expand Down
2 changes: 2 additions & 0 deletions Regex/Regex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -927,6 +927,8 @@ \subsection{Enumeration and Replacement}
\mthind{RxMatcher}{copy:replacingMatchesWith:} and
\mthind{RxMatcher}{copy:translatingMatchesUsing:}.

% It seems that tests spanning multiple lines are not handled -- strange, since
% this must have worked, once upon a time ... omn 2011-05-10
\begin{code}{@TEST | seuss aWords |}
seuss := 'The cat in the hat is back'.
aWords := '\<([^aeiou]|[a])+\>' asRegex. "match words with 'a' in them"
Expand Down

0 comments on commit ae06af0

Please sign in to comment.