Row Alternation
David Farber
rdrvr.biz at gmail.com
Tue Nov 18 17:51:10 MET 2008
On Nov 17, 2008, at 11:59 PM, Damien Cassou wrote:
> On Tue, Nov 18, 2008 at 12:28 AM, David Farber <rdrvr.biz at gmail.com>
> wrote:
>> Here's a little change set I whipped up today. It annotates Table
>> rows with
>> 'class=odd' or 'class=even' so that you can apply css to color
>> alternate
>> rows. Comments, criticisms, etc., welcome.
>
> Part of your code reads:
>
> visitTableRow: anObject
> html tableRow
> class: (anObject rowAlternation isNil ifFalse: [ anObject
> rowAlternation ]);
> with: [ super visitTableRow: anObject ]
>
>
> class: (anObject rowAlternation isNil ifFalse: [ anObject
> rowAlternation ])
>
> seems to be equivalent to:
>
> class: anObject rowAlternation
>
> which seems wrong because you will add a nil class in some cases.
You are right--the ifFalse is redundant. I originally had more
complicated logic to try to avoid a nil argument to class:.
> What about:
>
> html tableRow
> class: anObject rowAlternation if: anObject rowAlternation notNil
Cool. I didn't see class:if:.
Thanks,
David
More information about the smallwiki
mailing list