Definitions

from Wiktionary, Creative Commons Attribution/Share-Alike License.

  • noun programming An evaluation strategy in which the arguments to a function are evaluated when the function needs to use them.

Etymologies

Sorry, no etymologies found.

Support

Help support Wordnik (and make this page ad-free) by adopting the word call-by-name.

Examples

  • As you can surmise from the fact that it has a name, it is not some newfangled shiny toy idea, it goes back to ALGOL 60, where it was known as call-by-name.

    raganwald 2009

  • One thing that's interesting to notice about this strategy is that it seems stricter than call-by-name.

    Planet Haskell 2009

  • For that reason, I prefer call-by-name semantics when an expression is not meant to be persisted beyond the function invocation.

    raganwald 2009

  • We could argue that since our call-by-name functions have different behaviour than ordinary functions or methods, they ought to have different syntax.

    raganwald 2009

  • As is standard with the rewrite gem, only the code in the do ... end block is affected by your change. call-by-name, in summary

    raganwald 2009

  • But it feels like a move in an interesting direction: if it is a win to sometimes meta-program Ruby's syntax with DSLs, it ought to also be a win to sometimes meta-program Ruby's semantics with call-by-name functions.

    raganwald 2009

  • The application of call-by-name as a substitute for full-blown macros isn't novel either.

    raganwald 2009

  • Caching of this sort is what distinguishes call-by-need from call-by-name and allows lazy evaluation to work efficiently for data representations.

    Planet Haskell 2009

  • Functions with call-by-name semantics communicate the same thing as blocks: The expressions are to be consumed by the function.

    raganwald 2009

  • You can write your own functions with call-by-name semantics using called_by_name just as you see here.

    raganwald 2009

Comments

Log in or sign up to get involved in the conversation. It's quick and easy.