2 ms·
It looks nice, but I can't help but wonder why not go all the way to Smalltalk instead? helper := FileHelper new. "declare variable 'helper' via type infe
by fusiongyro 14y ago
It looks nice, but I can't help but wonder why not go all the way to Smalltalk instead?
helper := FileHelper new. "declare variable 'helper' via type inference"
files := [] "empty array literal implies mutable"
files addObject: (helper openFile: 'readme.txt'). "can group message in parens"
files do: [ | FileHandle handle | "all objects are pointers, so no '*' needed"
self log: 'File descriptor is %@', (Number)(handle fileDescriptor) ).
self handle: closeFile ].
^ 0
Of course, you'd still have to solve the lack of syntax for defining classes and methods, but there are a couple solutions to that problem out there already.
- tbe 14y agoA Smalltalk compiler for the Objective-C runtime exists here: http://etoileos.com/dev/docs/languages/smalltalk/ http://etoileos.com/dev/docs/languages/smalltalk/
- fusiongyro 14y agoCool. Does it work with Cocoa on OS X?