|
Daniel Pfeffer wrote: Those who fall in love with themselves will have no rivals.
...and they'll always have a partner...
|
|
|
|
|
Did you ever read the story of Onan in the black book?
Sidetracking:
Now that I have brought up Onan... He it the most misunderstood character in the entire bible. His sin was that he refused to copulate with his sister-in-law after his older brother was dead before generating offspring.
The "official" argument he gave against it that he wanted his kids to be counted as his own, not as kids of his dead brother. (The tradition said that Tamar's first child should be counted as the child of Er, the dead brother, no matter who was the biological father.) Between the lines, we can read that Tamar was an immature child bride - years later she ended up as the wife of Shelah, the younger brother of Onan and Er, still a boy when Onan was "sinning" by not going to bed with his sister-in-law. In those days, a husband was always older than the wife, so it it obvious that Tamar was even younger than the immature Shelah. That explains why the oldest brother, Er, didn't succeed in having a child with Tamar before he died, and it gives a believable explanation why Onan refused to deposit his seed in her.
So, Onan should be praised as a hero, fighting against the use of child brides, rather than as the epitome of the sin of wasting your seed on activities that cannot contribute to making girls pregnant.
|
|
|
|
|
All of this went over my head, except perhaps for:
Member 7989122 wrote: the epitome of the sin of wasting your seed on activities that cannot contribute to making girls pregnant.
...and now I have Monty Python's Every Sperm is Sacred stuck in my head. How far am I from the point to all this...?
|
|
|
|
|
/ravi
|
|
|
|
|
I can't make up my mind.
Regards,
Rob Philpott.
|
|
|
|
|
Yes, it is, and it's not re-entrant.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Interesting, I didn't know/have forgotten about the re-entrancy.
Seems you can do it in C#, but that's with a capital 'M'ain, and is a language for wimps.
Regards,
Rob Philpott.
|
|
|
|
|
I couldn't agree more.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
The non-re-entrancy part comes about because you can't call it yourself. It's not a callback in the strict sense of the term but in effect it is if you think of it as the designated function for the OS to call to run the program. It is not specified in code (this is why it fails the strict definition) but it is implicitly known to the linker and can be overridden. In the case of programs for Windows, it IS overridden to be WinMain.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Rick York wrote: you can't call it yourself. Indeed you can, but you need to know what you are doing.
Rick York wrote: but it is implicitly known to the linker Not quite, there is a reference to it in the run time libraries which must be satisfied at link time.
Rick York wrote: in the case of programs for Windows, it IS overridden to be WinMain. But there is a main() inside the Windows libraries, which again gets called by the run time (unless it has changed in the last 20+ years). And that then calls in to WinMain.
|
|
|
|
|
Actually things are a little different. In the Visual Studio source, VC/Tools/MSVC/**version**/crt/src/vcruntime/vcstartup_internal.h has the prototypes and the calls are in exe_common.inl. WinMain and main are two different calls along with their wide character versions.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
I suspected this might be the case, but I have not had access to the source for a number of years.
|
|
|
|
|
There were only minor changes. For the most part, what you wrote is correct.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Rob Philpott wrote: C# ... is a language for wimps To quote my elderly cat, "Fight me, bitch."
Software Zen: delete this;
|
|
|
|
|
It's how I express my intent daily to my ungrateful computer - I'm hooked, but its still the kid's soft play of computer languages.
Regards,
Rob Philpott.
|
|
|
|
|
C is for wimps
Real programmers use butterflies
Real programmers use butterflies
|
|
|
|
|
Real programmers use galaxy-sized gravitic lenses.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
Focused using butterflies
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Focused using butterflies
that are manipulated using gravitic lenses
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
created from the silk of butterfly cocoons
Real programmers use butterflies
|
|
|
|
|
lol, you got me there.
#SupportHeForShe
Government can give you nothing but what it takes from somebody else. A government big enough to give you everything you want is big enough to take everything you've got, including your freedom.-Ezra Taft Benson
You must accept 1 of 2 basic premises: Either we are alone in the universe or we are not alone. Either way, the implications are staggering!-Wernher von Braun
|
|
|
|
|
I was just reading this yesterday[^]
Quote: All C++ programs must have a main function. If you try to compile a C++ .exe project without a main function, the compiler will raise an error. (Dynamic-link libraries and static libraries don't have a main function.) The main function is where your source code begins execution, but before a program enters the main function, all static class members without explicit initializers are set to zero. In Microsoft C++, global static objects are also initialized before entry to main. Several restrictions apply to the main function that do not apply to any other C++ functions. The main function:
* Cannot be overloaded (see Function Overloading).
* Cannot be declared as inline.
* Cannot be declared as static.
* Cannot have its address taken.
* Cannot be called.
But, maybe you are thinking it is a callback from the OS?
Or maybe you're just asking a rhetorical question?
|
|
|
|
|
Just pondering it really. Yes, I meant in effect it was called from the OS. Must admit I didn't know you couldn't call main() yourself - obviously never tried. Or quite possibly forgotten.
Then I started wondering what a callback function actually is (despite using them for years and years and years). It's just a function, and it's the way it's called that makes it a callback in a sense. And that made me think of indirect addressing rather than direct addressing at the low level. But then, are virtual functions callbacks? Not really but they are called indirectly...
I think it's time to go home.
Regards,
Rob Philpott.
|
|
|
|
|
raddevus wrote: * Cannot have its address taken.
* Cannot be called.
Lies. You can call main, and you can take its address. This compiles and runs in VS2019:
#include <iostream>
int main(int argc, char **argv)
{
if(argc <= 1) {
auto main_ptr{main};
std::cout << "pointer to main = " << main_ptr << std::endl;
std::cout << "exiting ..." << std::endl;
return 0;
}
std::cout << "argc = " << argc << std::endl;
main(--argc, argv);
}
Interestingly, in linux you auto main_ptr{main} is 1, but for windows it looks like an address: 0008151E
Update: I should also point out that the instances where you might need to call main from within you program are vanishingly small. In general, if you think you need to, you're almost certainly wrong.
|
|
|
|
|
That has always been my thought.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|