Kurt Stephens

Nerd Up!

Recent comments

Random image

Latest image

Syndicate

Syndicate content

Browse archives

« August 2008  
Mo Tu We Th Fr Sa Su
        1 2 3
4 5 6 7 9
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

metaobject protocol

LL source on github, LL Design Talk Slides

Kurt on Sat, 2008-07-19 16:22.

The source for LL is available at http://github.com/kstephens/ll/tree/master.

Also located there are the slides from my June 2008 talk at the Chicago Lisp Users Group on the design of the LL object-oriented Scheme interpreter:

http://github.com/kstephens/ll/tree/master%2Fsrc%2Fll%2Fdoc%2Fll_system_...


Cheap Advice for Ruby

Kurt on Fri, 2007-09-07 01:22.

Advice is a programming construct from the Lisp world that pre-dates aspect-oriented and object-oriented programming. Advice is code that is placed before, after or around an existing function’s body. Examples of advice can be seen in Emacs: in Emacs Lisp, the advice is specified with macro syntax that expands to lambdas.

Wrote this (err… something similar at work :) in Ruby just before I found http://aquarium.rubyforge.org. The advice bodies are bound as methods using Class#define_method with a Proc; the advice has access to privates.

It provides simple :before, :after and :around advice objects that can be applied to and removed from multiple instance methods on multiple classes. It’s not AOP because there are no point-cuts patterns, but it is a bit more object-oriented than a typical Lisp advice macro.

See Aquarium for more industrial-strength AOP-style programming.


Ruby : Touching The Obj-C Void : nil is nil

Kurt on Sat, 2007-08-04 03:42.

A long time ago, in Objective-C on the NeXT, one could often remove nil checks, because all messages to nil would immediately return nil (or 0 depending on the caller’s method signature).

How many times have we seen this in Ruby?:

def foo
  bar && bar.baz && bar.baz.caz("x")
end

Syndicate content