#at:append:separator: to ignore empty appends?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

#at:append:separator: to ignore empty appends?

Boris Popov, DeepCove Labs (SNN)
Just a suggestion that #at:append:separator: should probably ignore empty
appends,

at: keyString append: aString separator: separatorString
        (aString isNil or: [aString isEmpty]) ifTrue: [^self at: keyString].
        ^self
                at: keyString
                put: (String streamContents:
                                        [:stream |
                                        self
                                                at: keyString
                                                ifPresent:
                                                        [:s |
                                                        stream
                                                                nextPutAll:
s;
                                                                nextPutAll:
separatorString].
                                        stream nextPutAll: aString
displayString])

This would avoid cases like '... class="">' and such,

Cheers!

-Boris

--
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

[hidden email]

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

smime.p7s (4K) Download Attachment