<div dir="ltr"><div><span style="white-space:pre">        </span>Here is a proposal to make Smalltalk more </div><div>functional.</div><div><br></div><div><span style="white-space:pre">        </span>If a Block B is never assigned to any variable in</div><div>a Method M and B is not returned by M and B is evaluated </div><div>by M</div><div> </div><div><span style="white-space:pre">        </span>then B should be inlined by the Compiler as a way</div><div>of allocating and assigning immutable local variables</div><div>which can be part of a more functional local style of </div><div>Smalltalk programming.</div><div><br></div><div><span style="white-space:pre">     </span>Functional is good. Look at Haskell Scala Java F# </div><div>Ocaml lisp etc which are all going functional. Look at </div><div>category theory which is the theory of function composition</div><div>and function combination. It is good to base programming</div><div>on math. Look at Smalltalk Traits which are state free.</div><div>Smalltalk can be more functional.</div><div><br></div><div><span style="white-space:pre">    </span>No value Activation should be done by ( B value.. )</div><div>in M at runtime but only immutable local variable </div><div>assignments followed by immutable variable accesses.</div><div><br></div><div><span style="white-space:pre">     </span>Here is an example of a local tail recursive function</div><div>using only immutable variables :</div><div><br></div><div>  [ :recurse | recurse value: input value: recurse </div><div>  ] value:[ :input1 :recurse |</div><div><span style="white-space:pre">       </span>( input1 message1 )</div><div><span style="white-space:pre">           </span>ifTrue:[ input1 message2 ]</div><div><span style="white-space:pre">            </span>ifFalse:[ </div><div><span style="white-space:pre">                   </span>recurse<span style="white-space:pre">              </span>value:( input1 message3 )</div><div><span style="white-space:pre">                             </span> <span style="white-space:pre">            </span>value: recurse ] ]</div><div><br></div><div>Category Theory for programmers by Bartosz Milewski</div><div><a href="https://www.youtube.com/watch?v=I8LbkfSSR58&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_">https://www.youtube.com/watch?v=I8LbkfSSR58&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_</a></div><div><br></div><div>Thank you </div><div>Kjell E Godø</div><div><br></div></div>