Thanh Dinh Khac

I am a software engineer with a passion for ProgrammingLanguage. I use CeePlusPlus and JavaLanguage in my daily work but my favorite is PythonLanguage. I have learnt the basic of RubyLanguage, HaskellLanguage and LispLanguage.

Hi Thanh. They say that the more languages you learn first, the more awesome SmalltalkLanguage will be when you get to it.

That's why you should try RubyLanguage. --PhlIp (currently besotted with PythonLanguage - please don't remind me of it!)

I learned RubyLanguage a few months back. I really liked BlocksInRuby.

My favorite quote is "Closures are poor man's objects and objects are poor man's closures" - ClosuresAndObjectsAreEquivalent. From Charming Python (
      #------- Smalltalk-style (Python) tax calculation -------#
      class TaxCalc?:
          def taxdue(self):
              return (self.income-self.deduct)*self.rate
          def setIncome(self,income):
              self.income = income
              return self
          def setDeduct(self,deduct):
              self.deduct = deduct
              return self
          def setRate(self,rate):
              self.rate = rate
              return self
      print "Smalltalk-style taxes due =",             
      #------- Python Functional-Style tax calculations -------#
      from functional import *

taxdue = lambda: (income-deduct)*rate incomeClosure = lambda income,taxdue: closure(taxdue) deductClosure = lambda deduct,taxdue: closure(taxdue) rateClosure = lambda rate,taxdue: closure(taxdue)

taxFP = taxdue taxFP = incomeClosure(50000,taxFP) taxFP = rateClosure(0.30,taxFP) taxFP = deductClosure(10000,taxFP) print "Functional taxes due =",taxFP()

print "Lisp-style taxes due =", incomeClosure(50000, rateClosure(0.30, deductClosure(10000, taxdue)))(

View edit of April 9, 2011 or FindPage with title or text search