From: Rick DeNatale Date: 2009-07-15T06:00:44+09:00 Subject: Re: Twelve rules of Ruby On Tue, Jul 14, 2009 at 3:36 PM, Ryan Davis wrote: > > On Jul 14, 2009, at 06:16 , David A. Black wrote: > >> Not sure why they wrapped weirdly (at least on my screen), but here's >> a correctly-wrapped version, I hope. > >> 1. Classes are objects. > > I prefer to tell my students: EVERYTHING is an object, even classes. Well almost > I think it conveys the ontology a bit better. > >> 4. A code block is a syntactic construct, not an object. > > See #1. EVERYTHING is an object, even blocks. No, David makes a valid point. There is a difference in Ruby between a block which is not an object, and a proc/lambda which is. Also, variables are not objects either, they refer to objects, and might be part of the state of an object (or on the invocation stack or ...) but they are not themselves objects. This is also true in Smalltalk were we always used the same mantra of "everything is an object." The mantra is not completely true in Smalltalk either. This latter reminds me of the Daltonian model of atoms as indivisible lumps, vs the current paradigm in Physics. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale