3 ms·
I think I'm looking at an implementation of ifTrue[1], but it's a bit dense to someone who's not familiar with Smalltalk. Maybe you could walk me through it? [
by aaron-santos 10y ago
I think I'm looking at an implementation of ifTrue[1], but it's a bit dense to someone who's not familiar with Smalltalk. Maybe you could walk me through it?
[1] - http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f=packages/stinst/parser/STCompiler.st;hb=HEAD#l842 http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f...
- dfox 10y agoThat's the compiler part that optimizes the elegance away :). The interesting part is here [1], note that it will work without any support from the compiler. [1] - http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f=kernel/False.st;h=b1a85e58e6e90bc2034bf653d6276d12b8d1dae6;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f... and http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f=kernel/True.st;h=eab5d9b9f11c501598115916dc234f8f50580c1f;hb=HEAD http://git.savannah.gnu.org/gitweb/?p=smalltalk.git;a=blob;f...
- aaron-santos 10y agoMuch more straight forward. If I'm reading it correctly, True and False are subclasses of Boolean and each of which implements a complementary pair of ifTrue and ifFalse methods? Elegantly symmetric. :)