Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #7989

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

From "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Can the code of a function obtain the names of its arguments?
Date 2012-01-19 10:06 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <jf8pur$3ds$1@smc.vnet.net> (permalink)
References <jf68qh$g85$1@smc.vnet.net>

Show all headers | View raw


On Wed, 18 Jan 2012 11:01:37 -0000, James Stein <mathgroup@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?)

names[args___] := HoldForm /@ Unevaluated[{args}];
SetAttributes[names, HoldAll];

In :=
a = 1; b = 2;
names[a, b, {a, b}]

Out =
{HoldForm[a], HoldForm[b], HoldForm[{a, b}]}

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Can the code of a function obtain the names of its arguments? James Stein <mathgroup@stein.org> - 2012-01-18 11:01 +0000
  Re: Can the code of a function obtain the names of its arguments? "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2012-01-19 10:06 +0000

csiph-web