Le jeudi 31 décembre 2009 à 00:56 +0100, Paolo Bonzini a écrit : > On 12/30/2009 11:15 PM, Gwenael Casaccio wrote: > > - "I tried to put these from the most common to the > > least common" > > - tag = 'file' ifTrue: [self files add: cdata] > > ifFalse: [ > > - tag = 'filein' ifTrue: [self fileIns add: cdata] > > ifFalse: [ > > - tag = 'prereq' ifTrue: [self prerequisites add: > > cdata] ifFalse: [ > > - tag = 'provides' ifTrue: [self features add: cdata] > > ifFalse: [ > > - tag = 'module' ifTrue: [self modules add: cdata] > > ifFalse: [ > > - tag = 'directory' ifTrue: [self relativeDirectory: > > cdata] ifFalse: [ > > - tag = 'name' ifTrue: [self name: cdata] ifFalse: [ > > - tag = 'url' ifTrue: [self url: cdata] ifFalse: [ > > - tag = 'namespace' ifTrue: [self namespace: cdata] > > ifFalse: [ > > - tag = 'library' ifTrue: [self libraries add: cdata] > > ifFalse: [ > > - tag = 'built-file' ifTrue: [self builtFiles add: > > cdata] ifFalse: [ > > - tag = 'sunit' ifTrue: [self sunitScripts add: > > cdata] ifFalse: [ > > - tag = 'start' ifTrue: [self startScript: cdata] > > ifFalse: [ > > - tag = 'stop' ifTrue: [self stopScript: cdata] > > ifFalse: [ > > - tag = 'callout' ifTrue: [self callouts add: cdata] > > ifFalse: [ > > - tag = openingTag ifTrue: [^self] ifFalse: [ > > - self error: 'invalid tag ' , > > tag]]]]]]]]]]]]]]]]. > > + tag = openingTag ifTrue: [ ^ self ]. > > + self perform: (self class tags at: tag ifAbsent: [ > > self error: 'invalid tag ', tag ]) with: cdata. > > I forgot to say that things like this one embarrass me. :-)
I agree, but on the other hand the long list of if statements bothers me too :-p Nico
signature.asc
Description: Ceci est une partie de message numériquement signée
_______________________________________________ help-smalltalk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-smalltalk
