Allen's lambda syntax proposal

Anton van Straaten anton at
Wed Dec 3 10:13:28 PST 2008

Brendan Eich wrote:
> Allen Wirfs-Brock put his proposal, which will not shock you who know 
> Smalltalk or Allen, on the whiteboard:
> // Instead of lambda (a, b, c) { ... }, why not:
> { |a, b, c| ... } ?

Can't resist a historical note (which I haven't seen mentioned, but 
perhaps I missed something): the Clipper language[1] in its version 5.0, 
circa 1990, used this exact syntax for its "code block" data type, which 
were in fact lexically scoped lambdas.[2]

Not surprisingly, Clipper adapted its code block syntax from Smalltalk. 
  Curly brackets were used instead of Smalltalk's square brackets, 
presumably to fit better with existing Clipper syntax, which used curly 
brackets for array definitions like {1,2,3} and square brackets for 
array subscripts like x[2].

Googling for "clipper code block" turns up various pages with example 
uses.  Unfortunately, the examples that come up are all quite simple 
ones, but code blocks, being lambdas, were capable of much more.


[1] Clipper was originally a compiler for Ashton-Tate's dBASE database 
system/language, and was developed by the now-defunct Nantucket 
Corporation.  It was ultimately sold to Computer Associates.

[2] The terminology surrounding lambdas was unfamiliar to most Clipper 
programmers at the time - the Clipper community referred to captured 
lexical variables as "detached locals".  Googling for that exact term 
will turn up various examples of its use in the context of Clipper and 
its descendants such as Harbour and xHarbour.

More information about the Es-discuss mailing list