Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Can the code of a function obtain the names of its arguments?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg124436] Re: Can the code of a function obtain the names of its arguments?
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Thu, 19 Jan 2012 05:15:30 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Attributes[xPrint] = {HoldAll, Listable};
xPrint[x_] := (Print[HoldForm[x], " =", Tab, x]);
xPrint[x_, y__] := (xPrint[x]; xPrint[y])

a = 5;
b = 6;
xPrint[a, b, Pi, a + b]

a =	5

b =	6

\[Pi] =	\[Pi]

a+b =	11

Bobby

On Wed, 18 Jan 2012 04:59:30 -0600, James Stein <mathgroup at stein.org>  
wrote:

> I fear the answer is no, because I suspect that once values are bound to
> the names, there might seem to be scant use in keeping the names around.
>
> But I have a little debugging routine in mind I'd like to implement, so  
> I'm
> hoping the answer is yes. (And if yes, how?)


-- 
DrMajorBob at yahoo.com



  • Prev by Date: Re: log-like symbols?
  • Next by Date: Re: Question about function
  • Previous by thread: Re: Can the code of a function obtain the names of its arguments?
  • Next by thread: Question about function