[Cuis] 4 additions to core?

H. Hirzel hannes.hirzel at gmail.com
Sat May 9 14:21:33 CDT 2015


Hello Juan

As from the porting effort for NeoCSV I propose the following
additions for discussion to add to the core.

All methods are from Pharo 4.0

See attachment.


Regards

Hannes




'From Cuis 4.2 of 25 July 2013 [latest update: #2243] on 9 May 2015 at
7:17:46.231872 pm'!

!String methodsFor: 'copying' stamp: 'hjh 5/9/2015 16:32'!
join: aCollection
	"'*' join: #('WWWWW' 'W  EW' 'zzzz')
		->  'WWWWW*W  EW*zzzz' "

	| w |		
	w := WriteStream on: String new.
	aCollection do: [ :elem | w nextPutAll: elem asString] separatedBy:
[w nextPutAll: self].
	^String fromString: w contents! !

!String methodsFor: 'formatting' stamp: 'hjh 5/9/2015 17:03'!
withCRs
	"Return a copy of the receiver in which backslash (\) characters have
been replaced with carriage returns."

	^ self collect: [ :c | c = $\ ifTrue: [ Character cr ] ifFalse: [ c ]].! !


!Symbol methodsFor: 'private' stamp: 'hjh 5/9/2015 17:37'!
value: anObject
	^anObject perform: self.! !


!Character methodsFor: 'testing' stamp: 'hjh 5/9/2015 17:11'!
isCharacter

	^ true.! !
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2244-CuisCore-HannesHirzel-2015May04-06h01m-hjh.1.cs.st
Type: application/octet-stream
Size: 858 bytes
Desc: not available
URL: <http://jvuletich.org/pipermail/cuis_jvuletich.org/attachments/20150509/675e4b98/attachment-0003.obj>


More information about the Cuis mailing list