POV-Ray : Newsgroups : povray.off-topic : Standard libraries : Re: Standard libraries Server Time
6 Sep 2024 13:17:54 EDT (-0400)
  Re: Standard libraries  
From: Nicolas Alvarez
Date: 6 Mar 2009 17:28:09
Message: <49b1a378@news.povray.org>
Darren New wrote:
>>   Of course that's pure BS. Most currently popular languages are being
>> constantly developed further and their libraries enhanced. Look at Java,
>> C# or the .NET framework. It's not that long ago that Java didn't even
>> have generics. Now it has them.
> 
> Generics in Java are syntactic sugar. It still generates exactly the same
> code as the equivalent source done in the obvious way.

Lambdas are just syntactic sugar to defining an anonymous function, where
the code will end up stored somewhere else. Very similar to string literals
really.

> If C++ added lambdas and they actually had things like pointers to stack
> frames and so on, I'd probably not be bothered.

std::for_each(someList.begin(), someList.end(), [&](int x) {
  total += x
});

"The specific internal implementation can vary, but the expectation is that
the lambda function will store the actual stack pointer of the function it
is created in, rather than individual references to stack variables."

> Looking the little I did at the Boost lambda's, they're utterly awful
> compared to any other language with real lambdas built in.
[...]
> When C# added LINQ, they didn't try to change the syntax of the language
> without modifying the compiler.

What makes you think C++0x won't modify the compiler?! *Boost* tries to add
complex stuff without modifying the compiler. C++0x adds stuff to the core
syntax, not via a dozen stacked templates with operator overloads.


Post a reply to this message

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