So, an aspect
Wh… what do you mean, “originally as a joke”?
I honestly thought C++ (aka dumping ground of programming concepts) would implement this for “completeness”.
They should add it in C++26
C++60
It’s in Intercal, a joke language from '70s. Mark Rendle describes it here in his talk at NDC. This whole talk is ridiculous btw.
This is the same language where you have to say
PLEASE
sometimes or it won’t compile. But if you sayPLEASE
too much, the compiler will think you’re pandering and also refuse to compile. The range between too polite and not polite enough is not specified and varies by implementation.I love how arbitrary, cultural and opinionated that must be to work with. You’d learn something about the implimenter of the compiler by using it for a while.
This is hilarious!
TBH I fail to see the significant difference between this and a function declaration.
Doesn’t it steal control flow? More like a break point, except you define where execution continues.
I wonder if it’s a compile error to have multiple conflicting COMEFROM statements, or if it’s random, kind of like Go’s select statement.
How awesome would it be to be able to steal the execution stack from arbitrary code; how much more awesome if it was indeterminate which of multiple conflicting COMEFROM frames received control! And if it included a state closure from the stolen frame?
Now I want this.
I wonder if it’s a compile error to have multiple conflicting COMEFROM statements
I think there’s at least one INTERCAL implementation where that’s how you start multi-threading
Its like if subroutine
bar
could say its going to execute at line N of routinefoo
. But if you were just readingfoo
then you’d have no clue that it would happen.You can simulate this effect with bad inheritance patterns.
Guy who worked at my place before me kept using these and GOTO statements all over the place.
His name? Cotton-eyed Joe
Thanks for the catchy tune, now the song sticks in my mind again. Last time was long time ago. :)
Looks like C# 12 interceptors:
[InterceptsLocation(@"C:\testapp\Program.cs", line: 4, column: 5)]
I know it looks awful, but it’s not intended for direct use, but rather for source generators for native ahead of time compilation.
https://andrewlock.net/exploring-the-dotnet-8-preview-changing-method-calls-with-interceptors/
You’re gonna love HCF then!
til
deleted by creator
It’s basically a simpler version of a callback