Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4121 > unrolled thread
| Started by | lorenzo <lorenzo_ktm@yahoo.it> |
|---|---|
| First post | 2011-08-01 03:40 +0000 |
| Last post | 2011-08-03 23:24 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
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
| From | lorenzo <lorenzo_ktm@yahoo.it> |
|---|---|
| Date | 2011-08-01 03:40 +0000 |
| Subject | Re: [Mathematica] special iterator |
| Message-ID | <j15773$b4v$1@smc.vnet.net> |
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}]];
[toc] | [next] | [standalone]
| From | "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> |
|---|---|
| Date | 2011-08-03 23:24 +0000 |
| Subject | Re: special iterator |
| Message-ID | <j1clar$g5p$1@smc.vnet.net> |
| In reply to | #4121 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web