Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4170
| From | "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: special iterator |
| Date | 2011-08-03 23:24 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <j1clar$g5p$1@smc.vnet.net> (permalink) |
| References | <j15773$b4v$1@smc.vnet.net> |
On Aug 1, 5:40 am, lorenzo <lorenzo_...@yahoo.it> wrote:
> Thanks for all the answers,
>
> I used Delete, apparently it returns a list without the j-th element and
the original list is not affected by any side effect:
>
> wi = Function[{x, j, func, data},
> Product[func[x - Delete[data, j][[i]]],
> {i, 1, Length[data] - 1}]];
You said: "...and the original list is not affected by any side
effect:"
That's not surprising as it is true for many / most functions working
on some argument: they work on a copy of the argument and return a
copy too. Exceptions are functions like AppendTo and the like.
Cheers --Sjoerd
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [Mathematica] special iterator lorenzo <lorenzo_ktm@yahoo.it> - 2011-08-01 03:40 +0000 Re: special iterator "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-08-03 23:24 +0000
csiph-web