[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how expressive are they?
Guy Steele - Sun Microsystems Labs <Guy.Steele@sun.com> writes:
> Date: Fri, 22 Nov 2002 14:44:59 -0800 (PST)
> From: Avi Bryant <email@example.com>
> To: Guy Steele - Sun Microsystems Labs <Guy.Steele@sun.com>
> cc: firstname.lastname@example.org, <email@example.com>
> Subject: how expressive are they?
> Smalltalk doesn't need primitives or macros:
> x and: [y] and: [z]
> x ifTrue: [y] ifFalse: [z]
> And see how much wordier these are than (AND x y z) and (IF x y z).
Note too that he's not comparing apples and apples. In a lisp
language something is true if it isn't nil. Looking at my handy dandy
Smalltalk image, I find that Object#and:, Object#ifTrue: and all the
other handy dandy 'query + block' methods, with the exception of
'Object#ifNotNil:' don't actually exist. So, to duplicate the lispish
semantics that becomes
x ifNotNil: [y] ifNotNil: [z].
x ifNotNil: [z] ifNil: [y].
Which are, admittedly more specific about what's going on, but aren't
exactly paragons of compactly expressive power.
I do wonder if this argument isn't getting a bit silly though...
"It is a truth universally acknowledged that a language in
possession of a rich syntax must be in need of a rewrite."
-- Jane Austen?