gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Re: darcs vs tla


From: Andrew Suffield
Subject: Re: [Gnu-arch-users] Re: darcs vs tla
Date: Fri, 12 Nov 2004 16:09:08 +0000
User-agent: Mutt/1.5.6+20040907i

On Fri, Nov 12, 2004 at 10:37:02AM +0000, Catalin Marinas wrote:
> Dustin Sallings <address@hidden> writes:
> >     IN some cases, yeah, quite a bit.  For example, how many lines
> > of the equivalent of this (contrived because I'm too lazy to look for
> > anything better) example in C?
> >
> >     # Create a hash table mapping all of the md5s of the word list
> > to the words in the list
> >     ht = dict([ (md5.md5(word).hexdigest(), word) for word in
> > words])
> 
> I wouldn't compare Python with C (maybe assembler with C is a better
> comparison) but Python with C++. C++ does not support list
> comprehension but you can probably write the above in a single line
> (exept for the variable declarations) using the STL library:
> 
> for_each(words.begin(), words.end(), add_to_dict(dict));

That's valid C code. You just need a library...

-- 
  .''`.  ** Debian GNU/Linux ** | Andrew Suffield
 : :' :  http://www.debian.org/ |
 `. `'                          |
   `-             -><-          |

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]