- Subject: [mg2912] Re: [mg2890] Part
- From: brucec (Bruce Carpenter)
- Date: 9 Jan 1996 08:03:38 -0600
- Approved: firstname.lastname@example.org
- Distribution: local
- Newsgroups: wri.mathgroup
- Organization: Wolfram Research, Inc.
- Sender: mj at wri.com
>npos is the position of the element I need.
>does not work, as it returns the second and the first
>w[[ npos[],npos[] ]]
>does the wanted thing, but I would prefer a shorter and
>more general way.
>Hans Friedrich Steffani
Here is another way to solve your problem. A top-level mechanism has been
provided to specify a sequence of variables:
w[[##]]& @@ npos
In a pure function, # specifies the first variable, #n specifies the nth
variable, ## the sequence of all variables, and ##n the sequence of
variables starting with the nth one.
(This is documented in Wolfram's Mathematica: A System for Doing
Mathematics by Computer.)
I am not critical of the use of Sequence to do this, I just prefer to use
documented commands when possible.
Prev by Date:
Next by Date:
Re: Showing Intermidate steps
Previous by thread:
Next by thread: