I'm coming from Tcl-world ...

Andreas Leitgeb Andreas.Leitgeb at siemens.at
Mon Aug 5 08:58:49 EDT 2002


holger krekel <pyth at devel.trillke.net> wrote:
> Heiko Wundram wrote:
>> There is no way to do anything like that in Python, there just isn't.
> Huh? Maybe you mean there isn't this exact syntax which is correct.
As I already f'up'd to Heiko, I think he was right.

Using generators can solve my problem in most cases, but it
still is not as general & powerful as the loop I asked for.

It's not that I ask for adding one to Python, it's just
that now I know, whenever I'd have felt like using such
a for-loop I'd have to do it differently.

> def counted_doubler(...): ... yield(i,s) ...
> for i,s in counted_doubler(42,'*'):
while this shows how to use more than one loop-var parallel,
 (which looks like a useful idiom: thanks) it's not
a complete replacement for other languages' "for".

> Syntactic sugar is relatively 
> minimal compared to other languages.
I don't understand, why "Syntactic sugar" has such a negative 
connotation in most language-newsgroups. 
It's usually syntactic sugar, that makes a language pleasing to
work with.
Languages without sugar (such as lisp/scheme but also various 
assembler-langs as far as I know them) are really abhorrent for me.

Python also does have it's portion of s.s., and it's good it does.

-- 
Newsflash: Sproingy made it to the ground !
  read more ... <http://avl.enemy.org/sproingy/>



More information about the Python-list mailing list