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


Groups > comp.soft-sys.math.mathematica > #4108 > unrolled thread

Re: special iterator

Started byDrMajorBob <btreat1@austin.rr.com>
First post2011-07-31 11:34 +0000
Last post2011-07-31 11:34 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: special iterator DrMajorBob <btreat1@austin.rr.com> - 2011-07-31 11:34 +0000

#4108 — Re: special iterator

FromDrMajorBob <btreat1@austin.rr.com>
Date2011-07-31 11:34 +0000
SubjectRe: special iterator
Message-ID<j13eja$57c$1@smc.vnet.net>
If "explore" means "Print", it could be

list = Range[10];
j = 4;
MapIndexed[#2 != {j} && Print@# &, list];

1

2

3

5

6

7

8

9

10

or

Scan[Print, Delete[list, j]]

1

2

3

5

6

7

8

9

10

I can think of no functional solution that doesn't produce (and discard)  
an extraneous list of length n or n-1, where n is Length@list.

Bobby

On Sat, 30 Jul 2011 04:58:46 -0500, lorenzo <lorenzo_ktm@yahoo.it> wrote:

> Hello everybody,
>
> I would like to define an iterator to explore all the elements in a list  
> except for the one of index j.
>
> something like:
> {index,0,Length[myList]} and if index == j  ---> index++
>
> Is it possible?
> Can I do this without deleting the j-th element?
>
> Thank you very much for helping :)
>


-- 
DrMajorBob@yahoo.com

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web