3 ms·
For most Smalltalks I am familiar with, using uppercase for globals and pool variables and lowercase for local variables is just a convention. The Smalltalk an
by jecel 10y ago
For most Smalltalks I am familiar with, using uppercase for globals and pool variables and lowercase for local variables is just a convention.
The Smalltalk and C code are not equivalent. The C code version of the Smalltalk would be:
m = FileLocator(home / 'Music');
exists(m);
isDirectory(m);
return allChildrenMatching(m, '.mp3');
while the Smalltalk version of your C code would be:
m := FileLocator home / 'Music'.
(m exists and: [m isDirectory]) ifTrue: [ ^ m allChildrenMatching: '.mp3']
The use of the keyword syntax for control structure does make things look backwards compared to other languages, but the semantics are the same. So you can have exists and isDirectory be functions that return booleans in both C and Smalltalk or have them be some kind of filtering/setter operation in both languages.