lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I was not aware of underscore.lua (and barely of underscore.js) a month ago when I set the direction for my functional programing component.  I have looked at it some (and now own the Functional _javascript_ book).  If I were to do an applications-level functional programming course, underscore.lua seems to provide a reasonable ibrary to build on.  It has a bit different flavor, however, than programming with "cons" level recursive functions if one also wants to work at the lower level.

In that component of my class, I redeveloped a number of other examples, including versions of examples from chapters 1 and 2 of SICP.  I also developed a small module of Lisp-style "linked"lists -- actually following the names I am accustomed to from Haskell.  I was able to explore 3 different implementations of my six core primitives to illustrate different techniques in Lua.


On Sat, Oct 5, 2013 at 2:11 AM, Jay Glascoe <jay.glascoe@gmail.com> wrote:
I think I'll use Underscore.lua to cover the usual functional stuff:


Its sister library, Underscore.js, is reasonably popular.  Plus there's a book on the _javascript_ version.



On Fri, Oct 4, 2013 at 11:53 PM, H. Conrad Cunningham <hcc@cs.olemiss.edu> wrote:
As far as functional programming goes, I find Lua to be quite powerful with its higher-order, first-class functions (closures) and tail call optimization.  But since most of my previous teaching of functional programming has been in Haskell or Scala, I have had to adjust my thinking somewhat.  Immutable, hierarchical list structures, Currying, and terse _expression_ of code are pervasive in the other languages, but are not native to Lua's approach.