2017-11-07 12:09 GMT+01:00 Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com >:Concerning syntactic sugar (even if it's pure Smalltalk) I have same cicrconspectionIn the case of #name >> #size it's like we are creating another language for the basic mechanisms we already have (send messages)What we try to achieve here is in fact the reify the send, what is not really in the base Smalltalk.For a more functional style, we would rapidly need currying anyway so even more syntactic sugar...Yes, that would be my worry. There is a value in keeping simple consistent semantics... especially because there is no one else still maintaining that focus (apart from STEPS that is) and that we are under constant pressure from other languages to add stuff.
For SortFunction, I think we all agree that there's no debate, procedural style is so ugly������ people sorted: [:a :b |�������������� a name���������������������� ifNil:������������������������������ [ b name���������������������������� �� ���� ifNil: [a age > b age]���������������������������� �� ���� ifNotNil: [true "a first"]]���������������������� ifNotNil:������������������������������ [ b name���������������������������� �� ���� ifNil: [false "b first"]���������������������������� �� ���� ifNotNil: [a name = b name���������������������������������������������� ifTrue: [a age > b age]���������������������������������������������� ifFalse: [a name < b name]]]compared to:������ people sorted: #name ascending undifiedFirst , #age descendingor even������ people sorted: (#name collatedWith: #isNil) , #age descendingI find that exemple interesting because the obvious solution to the procedural style is to create a nice, correct People>>#>, which is of great value for the overall code understanding. So, is it a good idea to make it easier not to write a proper #>?
10 years ago now, we designed a DSL above our parallel language, with the same kind of tradeoffs you described there. We ended up discarding it, because we had to maintain the full procedural code for the cases we couldn't cover. Discarding it was a wise decision.
Now, if you explained me something like that:people nilFirst ascendingThen I'd be more convinced. Or evenpeople sorted nilFirst ascending (if one would prefer restricting the implementations of #nilFirst).Could the symbol use be a smell of not putting the right responsabilities into the People class?Thierry������������������������������������������