Posts Tagged ‘OOP’

December 20th, 2007

CLOS vs. Ruby (3)

Tags: , ,

I thought I sort of understood CLOS, until…
CL-USER> (defclass foo ()
((bar :initform "BAR" :accessor bar)))
 
#<STANDARD-CLASS FOO>
CL-USER> (defparameter *x* (make-instance ‘foo))
*X*
CL-USER> (bar *x*)
"BAR"
CL-USER> (defclass foo ()
((bar :initform "NEWBAR" :accessor bar)
(baz :initform "BAZ" :accessor baz)))
#<STANDARD-CLASS FOO>
CL-USER> (defparameter *y* (make-instance ‘foo))
*Y*
CL-USER> (bar *y*)
"NEWBAR"
CL-USER> (bar *x*)
"BAR"
CL-USER> (baz *y*)
"BAZ"
CL-USER> (baz […]

November 7th, 2007

Javascript forays, PHP adventures (2)

To add yet another language to the ever-expanding list of languages I know well enough to get by but have far from mastered, in the past week or two at work I’ve needed to play with Javascript a lot. I’ve long thought of Javascript as the bane of my existence, if only for the […]

August 14th, 2007

Design Patterns continued (0)

I’m about halfway through Design Patterns: Elements of Reusable Object-Oriented Software, and it’s pretty good. I can’t read Smalltalk very well, so that’s an impediment, but most of the code is C++ so it’s OK. The book itself is very well-written. The patterns are laid out in a clear and thorough format, […]