Re: Lisp-like let in Mathematica?
- To: mathgroup at smc.vnet.net
- Subject: [mg63463] Re: [mg63443] Lisp-like let in Mathematica?
- From: Pratik Desai <pdesai1 at umbc.edu>
- Date: Sun, 1 Jan 2006 01:16:21 -0500 (EST)
- References: <200512311140.GAA28074@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
theran at gmail.com wrote: >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. > > > > Have you tried Block or Module? Pratik