Re: Albatross-users Digest, Vol 6, Issue 2
"Cameron Blackwood" <[email protected]> Wed, 19 Oct 2005 23:00:19 +1000
| Newsgroups | gmane.comp.web.albatross.general |
|---|---|
| Message-ID | <[email protected]> |
Frederick Polgardy Jr wrote:
|
| sep = ''
| for item in someList:
| print sep+item
| sep = ', '
| for item in nextList:
| print sep+item
| sep = ', '
Very nice solution....
But I ended up putting an is_last variable in each object so I can do
this:
<al-for iter="iarg" expr="f.inputs">
<al-exec expr="a=iarg.value()">
<al-value expr="a.printf('C_%(name_api)s')" noescape><al-if expr="not a.is_last or f.outputs">,</al-if whitespace>
</al-for>
Which is still ugly but, I think, readable :)
|
| HTH,
| Fred
cam
--
/ `Rev Dr' cam at darkqueen.org Roleplaying, virtual goth \
< http://darkqueen.org Poly, *nix, Python, C/C++, genetics, ATM >
\ [+61 3] 9809 1523[h] skeptic, Evil GM(tm). Sysadmin for hire /
---------- Random Quote ----------
I just got my PRINCE bumper sticker ... But now I can't remember WHO he is ...