Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.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:34:21 -0500 Date: Mon, 01 Aug 2011 20:34:20 -0700 From: Patricia Shanahan 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: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Lines: 35 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 70.230.200.54 X-Trace: sv3-ZpnnOmv71XC8KvzxX2AmmBqWSXb3z3tpjia6L0PhCIlcgLagBbsWkgYMWT3Xi7WCdmAKINJx6rWY35/!u5gxj0rwIQ8RlfDlT4iolQbm68kX7rcgJcK3cveu7pWEafSyBv8sp8YO4robjFTQoTa7q2X0I0J3!bm4AUwKZ4Mqo7Waj7YmduynWF95OhOHaTYKrI+Lo4caXWw== 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: 2486 Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6730 On 8/1/2011 7:43 PM, Stefan Ram wrote: > Eric Sosman 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 body = l.sublist( 1, l.size() ); for( final E e : body ) ... Patricia