donraab.medium.com

Donald Raab: Smalltalk Blocks (opens in new tab)

The expression of the square bracketPhoto by on In the Smalltalk programming language, blocks are anonymous deferred pieces of code that can be stored in variables or passed as parameters. Literal blocks start and end with square brackets — []. In Pharo Smalltalk, a block is an instance of the BlockClosure class. In a block, the pipe character separates the parameters on the left and the expression on the right (e.g. [ :parameter | expression ]. A zero argument block will have no pipe (e.g. [...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help