K
Kaz Kylheku
You didn't have a choice.
How odd.
Not really. Keeping the base API in C means that these functions can be used
from C programs, and also are easier to use from other languages.
You didn't have a choice.
How odd.
Not really. Keeping the base API in C means that these functions can be used
from C programs, and also are easier to use from other languages.
They can be declared as C, but still written in C++.
...
[inline Qz operator +(Qz& x, Qz& y)
{ Qz tmp; (void) tmp.add(x, y); return tmp; }
[inline Qz operator +()(Qz& x, Qz& y, int w)
{ Qz tmp; (void) tmp.addw(x, y, w); return tmp; }
inline Qz operator *(Qz& x, Qz& y)
{ Qz tmp; (void) tmp.mul(x, y); return tmp; }]
...
};
Willem said:JohnF wrote:
) Doesn't Church's thesis and Turing completeness
) kind of take the steam out of any "linguistic relativity"
) idea applied to programming languages? At best, there's
) maybe some "stylistic relativity", depending on how you
) prefer designing/writing code. But regarding what's
) computable, and what computable functions a given language
) can express, that's pretty much a done deal. No???
No.
What Turing is saying, in a sense, is that you can always emulate the
features of language A in language B, and therefore you can compute the
same things. However, you have to be familiar with language A to be able
to emulate its features in language B.
The upside to this is: if you learn a very different language, such as lisp
or haskell or prolog, or even ruby, you can then go back to C and implement
the new features that make programming so much easier, but which you never
knew existed before you learned those languages.
Claiming that it is only "stylistic relativity" is like claiming that the
invention of the train really wasn't that important, because people could
get where they wanted already simply by walking.
SaSW, Willem
Nick Keighley said:my own application. Though doubtless plenty of other people thought of
it first. I think there's a good reason SW is still a hypothesis; that
is that not all linguists believe it. People seem to be pretty
flexible at stretching their language to cover new situtations.
yes you can compute anything in any reasonable programming language
(all well known programmign languages are "reasonable" from this point
of view), but the set of computations that can be computed easily and
conventiently is much smaller.
I /could/ write a Lisp compiler in COBOL but I suspect I wouldn't
enjoy it.
If I'm using an old dialect of Basic I won't automatically think of
recursion as a way to solve a problem.
I'm deliberatly learning languages outside the imperitive/OO camp. It /
does/ change the way you look at things.
Why is he against operator overloading in C?
But then.... he proposes using operator overloading and
wrotes this code:
Very interesting. I've been aware of Sapir-Whorf for
a long time regarding linguistics, but hadn't been
aware of its interpretation with respect to programming
languages. Googling blub and sapir-whorf, and then reading
http://en.wikipedia.org/wiki/Linguistic_relativity
brings the following question to mind:
Doesn't Church's thesis and Turing completeness
kind of take the steam out of any "linguistic relativity"
idea applied to programming languages? At best, there's
maybe some "stylistic relativity", depending on how you
prefer designing/writing code. But regarding what's
computable, and what computable functions a given language
can express, that's pretty much a done deal. No???
Le 30/11/11 22:42, Jorgen Grahn a écrit : ....
That is because you did not know that Fortran has operator
oerloading, C#, even Java.
I have added operatr overloading
to the lcc-win compiler and it is very useful.
I don't care about those languages. But I could have sworn that Java
didn't have it, and my googling just shows me people rationalizing the
fact ...
As an isolated feature? I'd much rather have function overloading. I
might consider operator overloading mildly useful in a future C
standard -- if it contained function overloading and references as
well.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.