C++0x legacy code problem [closed] - syntax

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
As all you know, C++0x can't bring lots of important changes because of legacy code: all legacy code (including C code) can be compilable with a C++0x compiler.
So why don't add something like #pragma syntax(language_version), which will allow new syntax with breaking changes?
#include <legacy_code_header.h>
#pragma syntax(2098)
// something strange
func(x)
{
return x + 1, x * 2;
}
int main()
{
a, b = func(1.0);
return a + b;
}

Some C++0x compilers might allow this. After all, #pragmas are generally compiler specific and not dictated by the standard. Others support this with command line options.

Related

About monads and LINQ [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I stumbled upon some statements suggesting that LINQ is powered by monads.
Several C# programmers have asked what a monad is and how it's like LINQ. But I'm a Haskell programmer, and I'm asking what LINQ is and how it's like having monads.
The little I know about LINQ is that it lets you write arbitrary SQL in the middle of your C# code. I'm told it's meant to be possible to implement LINQ for other datatypes, but I've never seen it done. Presumably that's the part where things get interesting. (?)
Any comments or helpful reading would be appreciated.

How many times does this for loop run? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
int main()
{
for(;;) {
printf("INSIDE FOR LOOP");
return 0;
}
}
How many times is the printf statement gonna be printed? and why?
The statement is printed 1 time. The return exits the loop and the program.
It loops forever because there is no condition (what normally goes between the ;;).

Comparing multiple values in an if statement - Ruby [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can you compare multiple values in a single if statement in Ruby? If so, how? I know in other languages, you would just use a double ampersand (&&), but I have never seen any example or documentation about it, even in the official ruby documentation! Thanks for all the help in advance.
Yes, you can use the && operator
if a == 1 && b == 2
# do things
end
It IS in the documentation.
http://www.ruby-doc.org/docs/ProgrammingRuby/html/tut_expressions.html#UG

Searching for numerical algorithm realization [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Im searching for numerical algorithm realization for nonlinear equations system solver on PHP, C, C++, Java (with readable code :). Where I can find them?
Thx.
Look in Numerical Recipes -- the latest edition has reasonable C++ code. Even if they don't have code to exactly solve your specific application, there's a good chance they have something you can use.

What do these Fortran (90) statements do? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have run into the follow code and I do not understand it. What does it do?
A(*)
do n=(k,k-1,j+1-k)
A(*) looks like (part of) the declaration of an 'assumed-size array'; the typical use of this would be in the declaration of a dummy argument to a procedure. Distinguish carefully between assumed-size and 'automatic' arrays. Assumed-size arrays are deprecated in modern Fortran but common in FORTRAN77 and earlier variations.
do n=(k,k-1,j+1-k) looks like a syntactically-incorrect loop statement. The correct form would be do n=k,k-1,j+1-k which loops over the range [k,k-1] in strides of size j+1-k.

Resources