MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Lisp-like let in Mathematica?

  • To: mathgroup at
  • Subject: [mg63443] Lisp-like let in Mathematica?
  • From: theran at
  • Date: Sat, 31 Dec 2005 06:40:46 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Are functions like

  RealizeGraphicMatroid[G_] :=
    IncidenceMatrix[#] - IncidenceMatrix[ReverseEdges[#]] & @
OrientGraph[G] // Transpose

considered to be good Mathematica style?  This does what I want, but it
has the problem of being written in a right-to-left-to-right style.  Is
there an operator that works like let in Lisp that can give a local
name to a temporary value in an easier to read way?  I guess something

  Let[a_ , b_, body_] :=
    (body /. a -> #) & @ b

would work, but I'm relatively new to Mathematica and was wondering if
there is a built-in or less clunky solution.


  • Prev by Date: timer
  • Next by Date: Re: Palette Problem
  • Previous by thread: timer
  • Next by thread: is there a way to have the "Get" accept C formed %E numbers like Read does for Real?