From: Christophe R. <cs...@ca...> - 2005-06-10 13:31:12
|
Thiemo Seufer <th...@ne...> writes: > Christophe Rhodes wrote: >> Thiemo Seufer <th...@ne...> writes: >> >> > the appended patch implements branch relaxation in the mips port >> > for branches >18 bits. It also fixes the dependency declarations >> > for some branch instructions. >> >> Thank you; merged in sbcl-0.9.1.36. > > A small followup patch, whic uses "when" instead of "if". > > + (when (= opcode bcond-op) > + (when (logand r2 #b10000) > + (progn (setf r2 (logand r2 #b01111)) > + (setf linked t)))) Ah, but... here the indentation is all wrong :-) WHEN has the macro lambda list (test &body body), and the Lisp community over many years has essentially standardized on indenting body forms just two spaces from their parent form. So a standard WHEN expression should be formatted as (when (= opcode bcond-op) (do-something) (do-something else) (and so on)) If the test, for some reason, needed to be on its own line, then the indentation would be (when (= opcode bcond-op) (do-something)) so that the test, which is not a body form, is visually distinguished. This is a pretty general rule, by the way, so even things like multiple-value-bind end up looking like (multiple-value-bind (foo bar) (truncate 19 3) (frob foo) (frob bar) (frob baz)) if all the subforms are split onto their own lines. If you're using emacs, (setq lisp-indent-function 'common-lisp-indent-function) gets you a certain amount of the way there, though that indent function doesn't do complex loop, or indeed define-vop, terribly well. Cheers, Christophe |