|
So it was yaccing with a lisp?
I, for one, like Roman Numerals.
|
|
|
|
|
Did you give it your number, baby?
#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
|
|
|
|
|
It probably depends on the language, compiler, system, etc.
As far as I know, in the languages I use, there nothing special about call-back functions, it's only about how an ordinary function is used.
There's no reason to declare that no language will ever allow it.
I seem to recall having a desire for a recursive main. : ) Just because.
modified 22-Jan-20 11:51am.
|
|
|
|
|
How dare you ask programming questions in the lounge?!! I'm outraged.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Yeah, it's good to be reckless sometimes. Send me the codez and I'll go away.
Regards,
Rob Philpott.
|
|
|
|
|
I figure every function is a callback function - it's just a matter of perspective.
Real programmers use butterflies
|
|
|
|
|
It's an "entry point"; "Main" wasn't something that was part of a "response", other than "call static Main in class x".
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
If you take the view that your application is an interruption to a busy operating system's schedule, but it figures it should let you do your thing before you whine and get all bitchy about it, then yes, it is a callback function.
Software Zen: delete this;
|
|
|
|
|
Are you asking if it's masculine or feminine?
I've no idea, and I don't want to look, just in case.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Only if used as such, e. g. in this code:
#include <iostream>
using namespace std;
static int call_countdown = 3;
typedef int (*MyCallbackFun)();
int foo(MyCallbackFun cb, int count)
{
static int foo_counter = 0;
++foo_counter;
cout << "enter foo[" << foo_counter <<"]: " << count << endl;
int result = cb();
cout << "exit foo[" << foo_counter << "]: " << result << endl;
return result;
}
int bar()
{
static int bar_counter = 0;
++bar_counter;
cout << "bar[" << bar_counter << "]" << endl;
return -1;
}
int main()
{
static int call_counter = 0;
++call_counter;
cout << "enter main[" << call_counter << "]" << endl;
int result = 0;
if (call_counter < 5)
{
result = (call_counter>2)
? foo(bar, call_counter)
: foo(main, call_counter);
}
cout << "exit main[" << call_counter << "]: " << result << endl;
return call_counter;
}
You can test it here: https://www.onlinegdb.com/online_c++_compiler[^] or trust me that the output is:
enter main[1]
enter foo[1]: 1
enter main[2]
enter foo[2]: 2
enter main[3]
enter foo[3]: 3
bar[1]
exit foo[3]: -1
exit main[3]: -1
exit foo[3]: 3
exit main[3]: 3
exit foo[3]: 3
exit main[3]: 3
The tricky bit about this is that by using main() as a callback function, you're also using it recursively, which complicates matters considerably: it's easy to mess up the code and get an endless recursion. (that's why I added counters and output in every function)
It's doable, but definitiely not a good idea.
GOTOs are a bit like wire coat hangers: they tend to breed in the darkness, such that where there once were few, eventually there are many, and the program's architecture collapses beneath them. (Fran Poretto)
|
|
|
|
|
No. It's a state in the Northeast.
Oh Well.....
|
|
|
|
|
Ever seen an Antelope? It's incredible how they get that little ladder up to the nest window.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Then they flea to the circus.
It's been 6 months since I joined the gym and there's been no progress. I'm going there tomorrow in person to find out what's really going on!
JaxCoder.com
|
|
|
|
|
... or just roll along with the dung beetles
after many otherwise intelligent sounding suggestions that achieved nothing the nice folks at Technet said the only solution was to low level format my hard disk then reinstall my signature. Sadly, this still didn't fix the issue!
|
|
|
|
|
I gnu[^] you'd turn that into a pun!
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
They do not have opposable thumbs so they could never use a ladder.
Therefore they canteloupe you melon head!
I, for one, like Roman Numerals.
|
|
|
|
|
I have seen an earwig on cold days.
And back in the earliest days of pay bathrooms, it was just a centipede, before it went up to a dime.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
No, but I've seen a horse fly!
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
had to turn off my sense of reality for a while but Terminator Dark Fate was better than I was expecting.
yeah the same story again again (updated, twists), but watchable none the less.
and anyway being robots (or whatever) it's ok for the bad-then-good-then-bad-then-good... characters to keep coming back. (as I said lower the reality filter)
so far one of the few remaining movie series they haven't turned into some sort of moral [clinical depression inducing] statement (the batman - dark knight and on) or made purely to show off the latest in special effects (latest john wick - cgi ad nauseam with barely any discernible plot). they also don't overdo whatever is the latest hollywood PC sickness
after many otherwise intelligent sounding suggestions that achieved nothing the nice folks at Technet said the only solution was to low level format my hard disk then reinstall my signature. Sadly, this still didn't fix the issue!
|
|
|
|
|
I suspect it's a "Brain-out-bottle-of-wine-in" movie.
I've watched a few of those over the years!
I'll just wait till it's out of the cinema.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Check your brain at the door movies!
The Running Man - another Arnold classic.
(Whoever thought of casting Richard Dawson as a smarmy game show host was a genius. I wonder how he came up with the idea? )
Everybody loves at least one of these movies - what is yours?
I, for one, like Roman Numerals.
|
|
|
|
|
lopatir wrote: latest john wick - cgi ad nauseam with barely any discernible plot
I was made to sit through that one a few months ago. I honestly don't recall seeing a movie with so little plot. I haven't seen the first two, but clearly I haven't missed anything.
Oh, and how does Keanu Reeves keep getting work?
|
|
|
|
|
|
i liked My Own Private Idaho
Real programmers use butterflies
|
|
|
|
|
Yeah, as far as Terminator movies go I enjoyed it.
modified 23-Jan-20 2:03am.
|
|
|
|