Skip to content

Instantly share code, notes, and snippets.

@timsgardner
Created December 5, 2014 06:26
Show Gist options
  • Select an option

  • Save timsgardner/4f8b6d58a0c7c7f4d848 to your computer and use it in GitHub Desktop.

Select an option

Save timsgardner/4f8b6d58a0c7c7f4d848 to your computer and use it in GitHub Desktop.
mathematica let
SetAttributes[let, HoldAll]
let[bndgs_, expr_] :=
Activate[
Fold[
{acc, bndg} \[Function] Inactive[With][{bndg}, acc],
Inactivate[expr],
Reverse[Inactivate[bndgs]]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment