[etoys-dev] Etoys: Files-Richo.2.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Oct 14 18:45:50 EDT 2011


Ricardo Moran uploaded a new version of Files to project Etoys:
http://source.squeak.org/etoys/Files-Richo.2.mcz

==================== Summary ====================

Name: Files-Richo.2
Author: Richo
Time: 14 October 2011, 7:45:37 pm
UUID: 4b4a91a3-f143-ed49-862b-b7b624a1241b
Ancestors: Files-bf.1

Added two useful methods to FileStream class: #fileNamed:do: and #forceNewFileNamed:do: (taken from Squeak)

=============== Diff against Files-bf.1 ===============

Item was added:
+ ----- Method: FileStream class>>fileNamed:do: (in category 'instance creation') -----
+ fileNamed: fileName do: aBlock
+ 	"Avi Bryant says, ''This idiom is quite common in other languages that make heavy use of closures (i.e. Lisp (with-file 'foo' (f) ...) and Ruby (File.open('foo'){|f|...})).  It's time Squeak had it, too.''
+ 	
+ 	Returns the result of aBlock."
+ 	
+ 	^self detectFile: (self fileNamed: fileName) do: aBlock!

Item was added:
+ ----- Method: FileStream class>>forceNewFileNamed:do: (in category 'instance creation') -----
+ forceNewFileNamed: fileName do: aBlock
+ 	"Avi Bryant says, ''This idiom is quite common in other languages that make heavy use of closures (i.e. Lisp (with-file 'foo' (f) ...) and Ruby (File.open('foo'){|f|...})).  It's time Squeak had it, too.''
+ 	
+ 	Returns the result of aBlock."
+ 	
+ 	^self detectFile: (self forceNewFileNamed: fileName) do: aBlock!



More information about the etoys-dev mailing list