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


Groups > comp.lang.java.programmer > #6731

Re: looping through a list, starting at 1

X-FeedAbuse http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.16.109
Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!nospam.fr.eu.org!usenet-fr.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!news.glorb.com!postnews.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Mon, 01 Aug 2011 22:35:02 -0500
Date Mon, 01 Aug 2011 20:35:01 -0700
From Patricia Shanahan <pats@acm.org>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: looping through a list, starting at 1
References <list-20110802003845@ram.dialup.fu-berlin.de> <j17l8r$1p2$1@dont-email.me> <loop-20110802043110@ram.dialup.fu-berlin.de> <duOdncA0Gu6g7arTnZ2dnUVZ_gKdnZ2d@earthlink.com>
In-Reply-To <duOdncA0Gu6g7arTnZ2dnUVZ_gKdnZ2d@earthlink.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Message-ID <duOdncM0Gu767arTnZ2dnUVZ_gKdnZ2d@earthlink.com> (permalink)
Lines 40
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 70.230.200.54
X-Trace sv3-IZqpO+iOIYg0P8+oKC5uKEeE5WsrhvQQ1Lo7ns68sreWFJ6PXpgzMmG8wGyqwHXH5Hku/We/sZr+4Fh!uf2OeKV9SoJ/pw8liCi5OFeEHeDNVyeqqOJI3gZD0WsmAMS07z29qORxmm+qhAJDdTyVsFfy2Etm!OJyYauI3mR2drFNQUfrhRMa3w3FFSFIrddvzzSpGfts3Ww==
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2645
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6731

Show key headers only | View raw


On 8/1/2011 8:34 PM, Patricia Shanahan wrote:
> On 8/1/2011 7:43 PM, Stefan Ram wrote:
>> Eric Sosman<esosman@ieee-dot-org.invalid> writes:
>>> ... and "natural" is a little unnatural, it seems to me. If
>>> the various E are truly independent -- if l is merely a Collection
>>> for the purposes of the loop -- one wonders where the interloper at
>>> position 0 came from.
>>
>> This is code for my new mark-up language. A section might
>> look like:
>>
>> < [This is an example heading]
>>
>> [This is the first paragraph of the body.]
>>
>> [This is the last paragraph of the body.]>
>>
>> . The first entry of a section always is interpreted as its
>> heading, so a heading does not require additional mark-up.
>>
>> The code to convert this section to HTML converts the first
>> entry »[This is an example heading]« into an HTML heading
>> element. Then it loops through the rest of the entries to
>> convert them to HTML paragraph elements.
>>
>
> Given that context, I prefer the sublist option, but suggest giving it
> an identifier. It may not even be necessary to have a comment explaining
> the skipped header:
>
> List<String> body = l.sublist( 1, l.size() );

I should have used "E" instead of "String" here.

>
> for( final E e : body ) ...
>
> Patricia
>

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: looping through a list, starting at 1 Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-01 21:50 -0400
  Re: looping through a list, starting at 1 Patricia Shanahan <pats@acm.org> - 2011-08-01 20:34 -0700
    Re: looping through a list, starting at 1 Patricia Shanahan <pats@acm.org> - 2011-08-01 20:35 -0700
  Re: looping through a list, starting at 1 Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-02 07:31 -0400
  Re: looping through a list, starting at 1 Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2011-08-02 14:38 -0500
    Re: looping through a list, starting at 1 markspace <-@.> - 2011-08-02 12:50 -0700
      Re: looping through a list, starting at 1 Chris Riesbeck <Chris.Riesbeck@gmail.com> - 2011-08-03 13:34 -0500

csiph-web