kpreid comments on Prisoner's Dilemma (with visible source code) Tournament - LessWrong

47 Post author: AlexMennen 07 June 2013 08:30AM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (232)

You are viewing a single comment's thread. Show more comments above.

Comment author: kpreid 08 June 2013 03:36:27AM *  0 points [-]

Why are the terms "passing source code" and "passing a lambda" being used interchangeably? My experience with functional programming does not allow for any inspection into a lambda except by experimentation, whereas "passing the source code" implies more direct knowledge of its internals.

I don't see any other occurrences of “a lambda” on this page, but maybe the original post has been edited.

I would assume that “a lambda” should be taken as short for “a lambda expression”, i.e. an evaluatable s-expression (a form, in Common Lisp terminology; it is unclear to me whether Scheme has a corresponding word). The result of evaluating a lambda expression is not “a lambda”, it is “a procedure [value]”. Procedures (‘functions’ in most languages) have the opaqueness you are thinking of.

(Irrelevant to this question, but relevant to the topic of use/mention, expression/value, syntax/semantics, distinctions in programming: The process of obtaining a procedure/function essentially involves three inputs:

  1. the lambda expression (or other form of function definition),
  2. the environment for free variables (or other form of context/stdlib/set-of-primitives), and
  3. the evaluator (or “the language implementation”)

One of the things language designers can play with is what goes in part 2 and what goes in part 3.)