Skip to content
Permalink
Browse files

Just makeing sure executbale comments are standalone.

  • Loading branch information
Ducasse committed Apr 6, 2019
1 parent 3e6d5f4 commit 8298c2499cf4763a40dd24cb4ed3f7580ac1e3ba
@@ -181,13 +181,10 @@ OrderedDictionary >> at: firstKey at: secondKey [
"Return the object stored in the second dictionary at secondKey. The second dictionary is accessed via the key firstKey."

"
[
| d |
d := Dictionary new.
d at: #top at: #below1 put: 1.
d at: #top at: #below1 put: 2.
d at: #top at: #below1.
] value
(Dictionary new
at: #top at: #below1 put: 1;
at: #top at: #below1 put: 2;
at: #top at: #below1)
>>>
2"

Binary file not shown.
@@ -224,13 +224,10 @@ SmallDictionary >> at: firstKey at: secondKey [
"Return the object stored in the second dictionary at secondKey. The second dictionary is accessed via the key firstKey."

"
[
| d |
d := Dictionary new.
d at: #top at: #below1 put: 1.
d at: #top at: #below1 put: 2.
d at: #top at: #below1.
] value
(Dictionary new
at: #top at: #below1 put: 1;
at: #top at: #below1 put: 2;
at: #top at: #below1)
>>>
2"

@@ -1045,6 +1045,7 @@ Color >> asColorref [
"Convert the receiver into a colorref, i.e, a number embedding r,g,b on 24 bits"
"(Color red asColorref) >>> 229"
"(Color white asColorref) >>> 16777215"

^(self red * 255) asInteger + ((self green * 255) asInteger << 8) + ((self blue * 255) asInteger << 16)
]

@@ -8,10 +8,10 @@ ByteArray >> asExternalPointer [

{ #category : #'*FFI-Kernel' }
ByteArray >> booleanAt: byteOffset [
"Returns the boolean the byte at index byteOffset of this ByteArray represents in the C convention ( A byte representing the 0 integer corresponds to false, while all other integers corresponds to true).
Examples:
(#[1 2 0 4] booleanAt: 2) >>> true.
(#[1 2 0 4] booleanAt: 3) >>> false."
"Returns the boolean the byte at index byteOffset of this ByteArray represents in the C convention ( A byte representing the 0 integer corresponds to false, while all other integers corresponds to true)."

"(#[1 2 0 4] booleanAt: 2) >>> true."
"(#[1 2 0 4] booleanAt: 3) >>> false."

^(self integerAt: byteOffset size: 1 signed: false) ~= 0
]
@@ -786,8 +786,8 @@ ClassDescription >> isClassSide [
{ #category : #'accessing parallel hierarchy' }
ClassDescription >> isInstanceSide [
"Return true whether the receiver is a class (in a couple class/metaclass sense)."
"Point isClassSide >>> true"
"Point class isClassSide >>> false"
"Point isClassSide >>> false"
"Point class isClassSide >>> true"

^ self isClassSide not
]
@@ -529,21 +529,19 @@ Number >> printOn: aStream showingDecimalPlaces: placesDesired [

{ #category : #printing }
Number >> printShowingDecimalPlaces: placesDesired [
"Print the receiver showing precisely the given number of places desired. If placesDesired is positive, a decimal point and that many digits after the decimal point will always be shown. If placesDesired is zero, a whole number will be shown, without a decimal point."
"Print the receiver showing precisely the given number of places desired. If placesDesired is positive, a decimal point and that many digits after the decimal point will always be shown. If placesDesired is zero, a whole number will be shown, without a decimal point. Here are some examples:"

" Here are some examples:
(23 printShowingDecimalPlaces: 2) >>> '23.00'
(23.5698 printShowingDecimalPlaces: 2) >>> '23.57'
(-234.567 printShowingDecimalPlaces: 5) >>> '-234.56700'
(23.4567 printShowingDecimalPlaces: 0) >>> '23'
(-23.4567 printShowingDecimalPlaces: 0) >>> '-23'
(100000000 printShowingDecimalPlaces: 1) >>> '100000000.0'
(0.98 printShowingDecimalPlaces: 5) >>> '0.98000'
(-0.98 printShowingDecimalPlaces: 2) >>> '-0.98'
(2.567 printShowingDecimalPlaces: 2) >>> '2.57'
(-2.567 printShowingDecimalPlaces: 2) >>> '-2.57'
(0 printShowingDecimalPlaces: 2) >>> '0.00'
"
"(23 printShowingDecimalPlaces: 2) >>> '23.00'"
"(23.5698 printShowingDecimalPlaces: 2) >>> '23.57'"
"(-234.567 printShowingDecimalPlaces: 5) >>> '-234.56700'"
"(23.4567 printShowingDecimalPlaces: 0) >>> '23'"
"(-23.4567 printShowingDecimalPlaces: 0) >>> '-23'"
"(100000000 printShowingDecimalPlaces: 1) >>> '100000000.0'"
"(0.98 printShowingDecimalPlaces: 5) >>> '0.98000'"
"(-0.98 printShowingDecimalPlaces: 2) >>> '-0.98'"
"(2.567 printShowingDecimalPlaces: 2) >>> '2.57'"
"(-2.567 printShowingDecimalPlaces: 2) >>> '-2.57'"
"(0 printShowingDecimalPlaces: 2) >>> '0.00'"

^String new: placesDesired + 10 streamContents: [:aStream |
self printOn: aStream showingDecimalPlaces: placesDesired]
@@ -240,17 +240,12 @@ Object class >> whatIsAPrimitive [
Object >> -> anObject [
"Answer an Association between self and anObject"
"the code of Association>>#key:value: is inline here for speed"
"The following example creates an association whose key is number 1 and value string 'one'.
1 -> 'one'
>>> 1 -> 'one'
(1 -> 'one') key
>>> 1
(1 -> 'one') value
>>> 'one'
"The following example creates an association whose key is number 1 and value string 'one'."
"(1 -> 'one') >>> 1 -> 'one'"
"(1 -> 'one') key >>> 1"
"(1 -> 'one') value >>> 'one'"

Note that key and value can be ANY object."
"Note that key and value can be ANY object."

^Association basicNew key: self value: anObject
]

0 comments on commit 8298c24

Please sign in to comment.
You can’t perform that action at this time.