Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Lisp-like let in Mathematica?

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

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
like

  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.

^L


  • 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?