On Wed, 26 Jul 2006, [email protected] wrote:
hi phil-
on the one hand, i agree with you. on the other hand though, it’s important
to realize that no language/terminology is static. one of my pet peeves are
people who cling too tightly to rules or accepted meanings since, if we were
all like that, no new words or meanings would every spring into existence.
Let’s not get too global about this. Disagreeing about a Ruby module
name does not mean thinking that language, in general, is static, etc.
etc. I can prove my post-structuralist credentials to you any time
you feel you need evidence that I’m aware of the rudiments of
post-Saussurian lingustics Meanwhile, let’s get back to the topic
at hand.
publicly and tom releases tons of code), i’m willing to at least consider
that
our notion of duck typing may be able to be improved upon. in partucular, i
feel that inclusion of the word ‘typing’ in ‘duck typing’ is totally broken
with respect to the way the purists, like david, are using it: their
argument
basically goes that you cannot code ‘duck typing’ because one cannot know
apriori, using any current methodology available in ruby, whether or not a
method call or set of method calls with work out how you require them to.
this is flawed in at least two ways:
That’s not exactly what I’ve been saying; rather, my point has been
that I think that the concept of “duck typing” is in a category that
isn’t a category of things that can be written in code. If it is
something that can be written in code, then we need a new term for the
thing we used to call “duck typing”, which is a programming practice
that does not depend on or have any special relationship to any
particular modules or methods. (But let’s drop it; I’ve obviously
failed to put across that point.)
you concede that some sort of apriori checking can be used to determine
same_duck_type = [a,b].each{|obj| obj.send ‘msg’ rescue break false}
not toms since present reasoning about ‘duck typing’ does indeed imply an
infinite number of one member sets and it, therefore, not very useful.
I think one of the interesting things about Ruby is that it’s “ducks
all the way down”. respond_to? is just a method, etc. (This should
appeal to your Derridian side As with language in general, one
just goes ahead and uses it, based on pragmatic considerations and
experience. Language itself is, as you’ve pointed out, unfixed – but
that doesn’t mean that we just stare helplessly at each other, nor
that you look at your own first paragraph and despair of what the
words mean. Similarly, the mise-en-abyme of Ruby messages doesn’t
mean that one can’t do anything.
i understand the notion of just writing code and ‘seeing if objects can act
in that role’ as being a philisophical contruct - nevertheless i also think
that it’s certainly understood and implied in the term ‘type’ that certain
keys fit in certain locks and that unless a test can be made to atomicaly
test for this condition the phrase ‘type’ is in error.
I’ve always felt that the Achilles’ heel of the duck typing metaphor
was the “then it is a duck” – which implies that there’s a Duck
thing out there which something else can “be”. I don’t think it’s
supposed to be an airtight analytical tool for Ruby’s design, though,
just (as Dave says) a way of thinking about programming in Ruby.
David