static int (*func)(void);
static int func1(void)
{
/* first function */
}
static int func2(void)
{
/* second function */
}
static void __attribute__((constructor)) init(void)
{
func = condition ? &func1 : &func2;
}
int public_func(void)
{
return func();
}
@Pyautogui This is for a shared library. Is there a way to do this without declaring so many functions?
@Ginger PythonAnywhere + Flask is pretty easy to set up, I'm working on a website for a group project rn and we got one up and running (okay, it's not fully functional) in ~2 days
Huh, I knew var was a valid variable name in Java but that's just because of backwards compatibility jank. Why should let be allowed as a valid variable name? It probably takes extra effort in the parser to allow backtracking for something like let = 5
@allxy We already have Adám in the same timezone as pxeger, though pxeger is more active here
I think you or lyxal would be best
Is it possible for you to use only the emanresu A account or only the allxy account all the time?
Maybe DLosc could be an RO too but I think he has a US timezone?
One objection I can see someone making to PyGamer becoming an RO is that his account is often taken over by his brother, who may or may not do malicious things
Short of giving Pygamer tips on how to beat up his brother, I don't think there's any way to prevent that from happening
Speaking of Perl... does anyone known if $foo = { a => 1, b => 8, c => 256 }->{$foo} is a good way to replace a with 1, b with 8, and c with 256 in $foo without having a multi-line if statement? In Perl 4.x sans modules, fwiw.
@lyxal Or to spend the last seven years developing a golfing language that is never going to do as well at code golf as other languages developed around the same time ;P
Yes, all of it
Stack Exchange Data Explorer lists all spam or offensive flags ("red" flags) in its Votes table. When messing around with this query listing all votes on the site, I noticed that Meta has actually had 5 spam flags and one offensive flag cast. So, I did a little digging to find when...
tinylisp 2, 16 bytes
(w"Hello, World!
The write builtin, given a string, outputs its contents to stdout. Its short alias is w.
Just "Hello, World! would work except it outputs "Hello, World!" with quotes.
In accordance with our meta agreement, since one candidate received more votes than the others, we have a new featured language! Throughout May 2022, our Language of the Month will be:
Desmos
What's a Language of the Month?
See the meta post for nominations. In short, during May, those who wish...
I think I had a plan like that for Appleseed, though I never got around to implementing it. I guess I might consider it, but it's pretty far down the priority list.
@AidenChow An earlier language of mine based on tinylisp. It attempted to add more practical-language features. Didn't get very far before I stopped working on it, but I still use it from time to time when I spot a challenge that goes well with infinite lists.
@AidenChow like all bounties, they're subject to the awarder being happy to award a bounty, but yeah, generally, anyone can get a bounty as long as they meet whatever conditions are set out
My problem with Curry was that the initial simple programs I tried to write ended up just being Haskell. And I'm still very new to Haskell; I think Curry is probably more fun if you're already fluent in Haskell and can focus on the beyond-Haskell features.
@DLosc yeah, i couldn’t find challenges to apply it to where the non Haskell stuff would actually have been needed . A suggested challenge list would’ve been nice
Being fluent in prolog would probably help with curry too
the use of clp(fd) is pretty pervasive and it's specifically a modification to actually work over the infinite domain of all integers, so you can get some surprising results if you try too hard to abuse it