Syntax irregularities in Smalltalk
In one aspect, Smalltalk is a very small and elegant language. But I find there are some hidden intricacies when you actually use it. One example is the difference between using the messages whileTrue: and ifTrue:. whileTrue: expects a Block, while ifTrue: expects a Boolean. In the following, at first glance it's not understood why one uses square brackets and the other parenthesis:
[count < 10] whileTrue: [count := count + 1]Once you understand the semantics of Smalltalk then you comprehend it, but I find this somewhat odd. If Block supported the messages of Boolean, I think the syntax would be more orthogonal:
(count < 10) ifTrue: [count := count + 1]
([x > 0] and: [x < 10]) and: ([y > 0] and: [y < 10])Compared with the odd amalgamation of []s and ()s:
((x > 0) and: [x < 10]) and: [(y > 0) and: [y < 10]]
13 Comments:
It's not really a syntax irregularity at all. ifTrue: is not part of the language, it is a message selector just like any other. If you want blocks to respond to ifTrue: etc you can implement it very easily.
BlockClosure>>ifTrue: aBlock
self value ifTrue: [ ^aBlock value ].
It's actually the regularity of Smalltalk syntax that you are noticing. Everything is an object, and control structures are not part of the language, they are part of the library.
By Mike Hales, at 1:39 PM
I completely understand what you're saying, but I'm talking about syntax at the perceptual level, not the semantic level. For example, when a non-Smalltalker sees:
([x > 0] and: [x < 10]) and: ([y > 0] and: [y < 10])
It's not clear why some expressions use parenthesis and some use square brackets. Once you learn Smalltalk, then it's easy to understand why. This is what I'm talking about when I speak of irregularity - the perceptual grokking of a language.
Maybe contrary to others, I believe that a language should be easy to grok. For example, when I first was learning Dylan, I didn't know the language but I could read the sample code just fine.
By Mike Austin, at 2:03 PM
Hello. I found some interesting offers about loans. It would be desirable to discuss with
knowing people. What do you think?
[URL=http://loan.maybachexelero.org/guaranteed-bad-credit-personal-loan.html]guaranteed bad credit personal loan[/URL]
[URL=http://loan.maybachexelero.org/no-fax-payday-loan.html]no fax payday loan[/URL]
[URL=http://loan.maybachexelero.org/consolidate-loan-student.html]consolidate loan student[/URL]
[URL=http://loan.maybachexelero.org/home-equity-loan-refinancing.html]home equity loan refinancing[/URL]
[URL=http://loan.maybachexelero.org/acs-student-loan.html]acs student loan[/URL]
By Anonymous, at 2:37 AM
Get 10 Ringtones
free ringtone
obie trice ringtone
memphis bleek ringtone
nick lachey ringtone
nickelback ringtone
music ringtone
By Anonymous, at 5:12 PM
Hi All. Don't delete please!
[url=http://fofofo.125mb.com/stress-relief.htm]stress relief[/url]
[url=http://fofofo.125mb.com/stress-relief-and-relaxation-technique.htm]stress relief and relaxation technique[/url]
[url=http://fofofo.125mb.com/natural-stress-relief.htm]natural stress relief[/url]
[url=http://fofofo.125mb.com/stress-relief-tip.htm]stress relief tip[/url]
[url=http://fofofo.125mb.com/stress-relief-technique.htm]stress relief technique[/url]
[url=http://fofofo.125mb.com/stress-relief-product.htm]stress relief product[/url]
[url=http://fofofo.125mb.com/herbal-stress-relief.htm]herbal stress relief[/url]
[url=http://fofofo.125mb.com/relagen.htm]relagen[/url]
Thanks.
By Anonymous, at 6:53 AM
Halo people. Let's take a look. A great sollution for you.
hemorrhoids relief
hemorrhoids pain relief
hemorrhoids relief treatment
venapro
review venapro
hemorrhoids herbal treatment
stop smoking aid
nicocure
nicocure patch
stop smoking
stop smoking aids
stop smoking drug
stop smoking medicine
stop smoking patch
meds to stop smoking
new stop smoking drug
stop smoking product
stop smoking treatment
Don't delete this. Thanks!
By Anonymous, at 9:41 PM
Halo people. Let's take a look. A great sollution for you.
pain relief
natural pain relief
lower back pain relief
chronic pain relief
neck pain relief
pain relief medication
knee pain relief
toothache pain relief
natural back pain relief
natural pain product relief
headache pain relief
pain relief cream
tooth pain relief
pain relief product
pain relief drug
pain relief patch
menstrual pain relief
eazol
Don't delete this. Thanks!
By Anonymous, at 7:34 AM
Wazzup people. Let's take a look. A great sollution for you.
hair removal
body hair removal
hair removal product
permanent hair removal at home
facial hair removal
permanent pubic hair removal
permanent body hair removal
facial hair removal product
nair hair removal product
permanent hair removal product for man
pubic hair removal product
prescription facial hair removal
hair removal for man
bikini hair removal
cream hair permanent removal
best cream hair removal
cream hair removal revitol
cream face hair removal
Don't delete this. Thanks!
By Anonymous, at 10:33 PM
Halo All. Let's take a look. A great sollution for you.
hgh energizer
hgh
hgh supplement
hgh product
buy hgh
best hgh
hgh pill
best hgh product
hgh jintropin
buy hgh online
hgh natural
hgh sale
best hgh supplement
hgh vital
prescription hgh
hgh natural supplement
cheap hgh
hgh online
Don't delete this. Thanks!
By Anonymous, at 12:20 PM
Hi people. Watch. A great sollution for you.
herbal
herbal product
herbal medicine
herbal alternative medicine
acne treatment
proactive acne treatment
hemorrhoids relief
hemorrhoids pain relief
pain relief
natural pain relief
hair removal
body hair removal
hgh energizer
hgh
pheromone spray
pheromone
stress relief
stress relief technique
Don't delete this. Thanks!
By Anonymous, at 4:54 AM
Hello
remeron
remeron side effects
remeron mirtazapine
lawsuit remeron
remeron weight gain
remeron rd
remeron withdrawal
remeron and anxiety
remeron medication
remeron forum
remeron antidepressant
medication and side effects remeron
remeron soltab
remeron dosage
remeron depression
remeron sleep
remeron drug
overnight remeron
combining prozac remeron
remeron prescription
G'night
By Anonymous, at 2:33 PM
Wazzup people. Watch. A great sollution for you.
herbal treatment
herbal health
natural herbal medicine
acne herbal medicine
best acne treatment
natural acne treatment
hemorrhoids relief treatment
stop smoking
lower back pain relief
chronic pain relief
hair removal product
permanent hair removal at home
hgh supplement
hgh product
human pheromone
pheromone perfume
natural stress relief
stress relief tip
Don't delete this. Thanks!
By Anonymous, at 7:43 PM
runescape money
runescape gold
runescape money
runescape gold
wow power leveling
wow powerleveling
Warcraft Power Leveling
Warcraft PowerLeveling
buy runescape gold
buy runescape money
runescape items
runescape gold
runescape money
runescape accounts
runescape gp
dofus kamas
buy dofus kamas
Guild Wars Gold
buy Guild Wars Gold
lotro gold
buy lotro gold
lotro gold
buy lotro gold
lotro gold
buy lotro gold
runescape money
runescape power leveling
runescape money
runescape gold
dofus kamas
cheap runescape money
cheap runescape gold
Hellgate Palladium
Hellgate London Palladium
Hellgate money
Tabula Rasa gold
tabula rasa money
lotro gold
buy lotro gold
Tabula Rasa Credit
Tabula Rasa Credits
Hellgate gold
Hellgate London gold
dofus kamas
buy dofus kamas
wow power leveling
wow powerleveling
Warcraft PowerLeveling
Warcraft Power Leveling
World of Warcraft PowerLeveling
World of Warcraft Power Leveling
runescape power leveling
runescape powerleveling
eve isk
eve online isk
eve isk
eve online isk
血管瘤
肝血管瘤
音乐剧
北京富码电视
富码电视
富码电视台
7天酒店
7天连锁酒店
7天连锁
自清洗过滤器
过滤器
压力开关
压力传感器
流量开关
流量计
液位计
液位开关
温湿度记录仪
风速仪
可燃气体检测仪
By Anonymous, at 11:24 PM
Post a Comment
<< Home