@vaporeon_ (i say "pure lambda calculus" but i'm using if statements and purrimitive types. you COULD actually do this in Pure Lambda Calculus but it would be a bit obnoxious)
@vaporeon_ it enables recursion-like behavior in with just lambda abstraction and application:
# (fun f n -> if n == 0 then 1 else n * f f (n - 1))
(fun f n -> if n == 0 then 1 else n * f f (n - 1))
6;;
- : int = 720
@vaporeon_ yeah the purroblem is that the function takes an argument that is of the same type as the function itself. if it were pawsible to (safely) type it it would be a recursive type!
@vaporeon_ potentially fun question: why did i have to use a void pointer fur the type of the furst argument to fac?
@vaporeon_ the fact that printf template strings allow quines to happen is more or less the same idea as this hack to do general recursion without explicit recursion
#include <stdio.h>
int fac(void *f, int n) {
int (*g)(void *, int) = f;
if (n == 0) {
return 1;
}
return n * g(f, n - 1);
}
int main(void) {
printf("6! == %d\n", fac(&fac, 6));
}
a technique that is generalizable, btw. (not that you would ever need to use the Y combinator in any purractical situation)
@vaporeon_ i don’t have any experience writing quines so i don’t really have much to say besides “nice, that’s sick”
@vaporeon_ *gives you
and Vaporeon treats*
@coriander delicious cookie
@wallhackio yes that is 100% definitely what i meant
@coriander @wallhackio @Lady idk if i like “panting like a dog” purr se but panting is definitely hot
like i’ve literally done this befur, i'm not learning anything aside from what i’ve furgotten. though thankfully i have furgotten enough fur some of the purroblems to be conceptually challenging
@vaporeon_ a tabby is a cat with an M-shaped fur pattern on its forehead and stripes on its body. color is not relevant
@vaporeon_ is he… *gestures with hands in an inexplicably homophobic manner* unsigned?
not really sure why they felt the need to recreate Write Once Run Anywhere when it just compiles to native code by default anyway
@vaporeon_ yes i mean the IR
it’s pronounced “ashling”. canonically a black housecat or any of the grass cat pokémon, but currently experiencing daily TFs. Commewnist. it/she and more. i automatically change my pfp on the furst post of the day
GlitchCat syscatmin and meowstodev; @ me about techincal problems with the instance, or fur feature requests. i got a job due to some extent to my work on this instance
i have very strong opinions about the sonic furanchise. pokémon has me in a chokehold when it comes to merchandise
available via email with the same username and domain. DM/email for other purrotocols
workplace policy is to clarify that all of my opinions expressed here are my own, and not those of my employer
“all this shit is still incomprehensible but im glad u accomplished something” ―@wallhackio