diff options
author | Stanislav (Stanley) Modrak <44023416+smith558@users.noreply.github.com> | 2023-03-08 09:35:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-08 09:35:48 +0000 |
commit | 4c79407041c1a1969815368c11003cb5ea20a837 (patch) | |
tree | c464ca387191c91f0dc2572ef4b281a3c7aa1844 /smalltalk.html.markdown | |
parent | e3ee5b81faad348586ff50dda2100046bd17591f (diff) | |
parent | fbaa905e23f26d20b37a3886dd8e07cd6edb8680 (diff) |
Merge branch 'master' into patch-4
Diffstat (limited to 'smalltalk.html.markdown')
-rw-r--r-- | smalltalk.html.markdown | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/smalltalk.html.markdown b/smalltalk.html.markdown index aaa592dc..d4016ecf 100644 --- a/smalltalk.html.markdown +++ b/smalltalk.html.markdown @@ -60,7 +60,7 @@ doSomethingWith: argumentObject Everything here except the `^` involves sending more messages. Event the `ifTrue:` that you might think is a language control structure is just Smalltalk code. -We start by sending `size` to `self`. `self` is the object currently running the code - so in this case it is the myObject we started with. `size` is a very common message that we might anticipate tells us something about how big an object is; you could look it up with the Smalltalk tools very simply. The result we get is then sent the message `>` with the plain old integer 4 (which is an object too; no strange primitive types to pollute the system here) and nobody should be surprised the `>` is a comparison that answers true or false. That boolean (which is actually a Boolean object in Smalltalk) is sent the message `ifTrue:` with the block of code between the `[]` as its argument; obvioulsy a true boolean might be expected to run that block of code and a false to ignore it. +We start by sending `size` to `self`. `self` is the object currently running the code - so in this case it is the myObject we started with. `size` is a very common message that we might anticipate tells us something about how big an object is; you could look it up with the Smalltalk tools very simply. The result we get is then sent the message `>` with the plain old integer 4 (which is an object too; no strange primitive types to pollute the system here) and nobody should be surprised the `>` is a comparison that answers true or false. That boolean (which is actually a Boolean object in Smalltalk) is sent the message `ifTrue:` with the block of code between the `[]` as its argument; obviously a true boolean might be expected to run that block of code and a false to ignore it. If the block is run then we do some more message sending to the argument object and noting the `^` we return the answer back to our starting point and it gets assigned to `result`. If the block is ignored we seem to run out of code and so `self` is returned and assigned to `result`. |