1

Or does the term "value" already exclude functions?

I'm trying to explain why (in JavaScript, for instance) calling foo(2 + 2) is different from calling foo(() => 2 + 2), (assuming foo can handle a function as argument for the purpose of lazily computing a value). In the first example, the argument that foo receives is 4, while in the second, the argument it receives is the function () => 2 + 2 itself. I want to describe the difference as "passing a value" versus "passing a function", but I'm wondering if there's a more precise term.

Ty Mick
  • 75
  • 1
  • 7
  • I don't know if this is what you might be looking for. But functions that receive functions as arguments are called `higher order functions` – Miguel Alorda Jun 19 '21 at 15:36
  • This is not an answer but more like a pointer on a compass. Take a look at Lambda Calculus definitions for [Beta Reduction](https://wiki.haskell.org/Beta_reduction) and [Eta Conversion](https://wiki.haskell.org/Eta_conversion). In other words don't think of a value, think of a kind of process needed to simplify the expression. – Guy Coder Jun 22 '21 at 13:58

1 Answers1

0

I'm not sure there's precedent for this, recently I've started to use the term nonfunction in JavaScript to refer to all values that are not functions

richytong
  • 2,387
  • 1
  • 10
  • 21