POV-Ray : Newsgroups : povray.pov4.discussion.general : comma at end of last element in list Server Time
29 Mar 2024 05:43:36 EDT (-0400)
  comma at end of last element in list (Message 1 to 5 of 5)  
From: Dan Connelly
Subject: comma at end of last element in list
Date: 15 Oct 2008 14:18:19
Message: <48f633eb$1@news.povray.org>
What I'd like to see is an allowed comma at the end of the last element in a list. 
This would facilitate the populating of lists from within a loop.  There's now the
need (AFAICT) a silly check for the last element to omit the comma.

Dan


Post a reply to this message

From: Trevor G Quayle
Subject: Re: comma at end of last element in list
Date: 15 Oct 2008 14:35:01
Message: <web.48f636eeeded49c981c811d20@news.povray.org>
Dan Connelly <djc### [at] yahoocom> wrote:
> What I'd like to see is an allowed comma at the end of the last element in a list. 
This would facilitate the populat
ing of lists from within a loop.  There's now the need (AFAICT) a silly check for the
last element to omit the comma.
>
> Dan

Usually I workaround by adding the comma before the number, that way there is no
comma at the end of the list.  This works usually because most items that I have
created that use lists (meshes, splines, polygons) have a float preceding the
list, usually the number of items conatined in the list.

-tgq


Post a reply to this message

From: Warp
Subject: Re: comma at end of last element in list
Date: 15 Oct 2008 15:30:04
Message: <48f644bb@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> [-- text/plain, encoding 8bit, charset: iso-8859-1, 14 lines --]

> Dan Connelly <djc### [at] yahoocom> wrote:
> > What I'd like to see is an allowed comma at the end of the last element in a list.
 This would facilitate the populat
> ing of lists from within a loop.  There's now the need (AFAICT) a silly check for
the last element to omit the comma.
> >
> > Dan

> Usually I workaround by adding the comma before the number, that way there is no
> comma at the end of the list.  This works usually because most items that I have
> created that use lists (meshes, splines, polygons) have a float preceding the
> list, usually the number of items conatined in the list.

  Also you could skip using commas completely. Just put your elements in
parentheses (to avoid ambiguity in situations like "2 -1") and you don't
need commas at all.

-- 
                                                          - Warp


Post a reply to this message

From: Trevor G Quayle
Subject: Re: comma at end of last element in list
Date: 15 Oct 2008 15:55:00
Message: <web.48f649a2eded49c981c811d20@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> > [-- text/plain, encoding 8bit, charset: iso-8859-1, 14 lines --]
>
> > Dan Connelly <djc### [at] yahoocom> wrote:
> > > What I'd like to see is an allowed comma at the end of the last element in a
list.  This would facilitate the pop
ulat
> > ing of lists from within a loop.  There's now the need (AFAICT) a silly check for
the last element to omit the comm
a.
> > >
> > > Dan
>
> > Usually I workaround by adding the comma before the number, that way there is no
> > comma at the end of the list.  This works usually because most items that I have
> > created that use lists (meshes, splines, polygons) have a float preceding the
> > list, usually the number of items conatined in the list.
>
>   Also you could skip using commas completely. Just put your elements in
> parentheses (to avoid ambiguity in situations like "2 -1") and you don't
> need commas at all.
>
> --
>                                                           - Warp

Yes that may be better.  I was unaware that I could skip the commas in those
types of items (I knew you could in primitives).  Is this stated anywhere in
the docs explicitly or is one of those read between the lines to discover?

-tgq


Post a reply to this message

From: Warp
Subject: Re: comma at end of last element in list
Date: 15 Oct 2008 16:35:37
Message: <48f65419@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> Yes that may be better.  I was unaware that I could skip the commas in those
> types of items (I knew you could in primitives).  Is this stated anywhere in
> the docs explicitly or is one of those read between the lines to discover?

  I don't remember the docs well enough to say for sure, but I would say
it's more or less an undocumented feature.

-- 
                                                          - Warp


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.