Search found 94 matches

by Kompottkin
Fri Aug 01, 2008 12:59 am
Forum: Common Lisp
Topic: define-compiler-macro
Replies: 11
Views: 30625

Re: define-compiler-macro

By the way, as a real-world example, I have actually used DEFINE-COMPILER-MACRO with quite satisfying effects in Objective-CL , an Objective-C bridge for Common Lisp. Background: In order to invoke the method insertObject:atIndex: on the NSArray array with the arguments thing and position , I'd writ...
by Kompottkin
Fri Aug 01, 2008 12:30 am
Forum: Common Lisp
Topic: define-compiler-macro
Replies: 11
Views: 30625

Re: define-compiler-macro

hmm, but how you have such info at compile time ? Recall what qbg said (emphasis mine): Then when you compile functions that call FIB with an integer literal ... Of course, a call like (fib x) (which the compiler macro will simply see as the list (fib x) -- note that the symbol x is not integerp !)...
by Kompottkin
Wed Jul 30, 2008 5:19 am
Forum: Common Lisp
Topic: Accessing parent objects in CLOS
Replies: 7
Views: 14438

Re: Accessing parent objects in CLOS

Without a concept like this like you would have in Java ... But there is such a concept: (defclass game () ((score :initform 0 :accessor game-score) (game-ball :accessor game-ball))) (defmethod initialize-instance :after ((game game) &rest args) (declare (ignore args)) (with-slots (game-ball) g...
by Kompottkin
Sun Jul 27, 2008 1:31 am
Forum: Common Lisp
Topic: Printable CLOS objects..?
Replies: 5
Views: 11699

Re: Printable CLOS objects..?

You can override how CLOS objects print and the output can be essentially anything you want. Just in case the OP doesn't know how: You can do this by defining a method on print-object . ... Depending on your needs, you could do something as simplistic as making the printed version of a "foo&qu...