MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xedpfo/dreamlanguage/19rldxtyew29t/
r/ProgrammerHumor • u/ClipboardCopyPaste • Oct 24 '26
211 comments sorted by
View all comments
Show parent comment
99
int (*(*signal(int, int (*)(int)))(int))(int);
The elegance and simplicity of C is truly unmatched
12 u/frikilinux2 Oct 24 '26 So for you C belongs in hell, doesn't it? 20 u/UdPropheticCatgirl Oct 24 '26 I mean how could it belong anywhere else? 2 u/frikilinux2 Oct 24 '26 Ok but can you find me an example of so many pointers. I accept s link to kernel.org or something like that 17 u/UdPropheticCatgirl Oct 24 '26 I mean my declaration is not completely made up...It's just fairly standard linux sig hangler, except most other codebases would use actual typedefs and macros to split it into multiple declarations see here and here. 7 u/frikilinux2 Oct 24 '26 Ok, I'll accept it. 4 u/DeVinke_ Oct 24 '26 If this is the elegance of your c code, you're definitely going to hell. -4 u/Kadabrium Oct 24 '26 The joke here is arrays of higher order functions don't even exist in functional languages, because they dont use arrays lol 7 u/UdPropheticCatgirl Oct 24 '26 The joke here is arrays of higher order functions don't even exist in functional languages, because they dont use arrays lol You realize, that there are no arrays in that C type right? In Scala it would be: type Signal = (Int, Int => Int) => (Int => (Int => Int)) also I struggle to think of somewhat mainstream functional language without arrays... In haskell you could do: import Data.Array funcs :: Array Int (Int -> Int) funcs = listArray (0, 2) [id, (+1), (*2)] , in OCaml: let funcs : (int -> int) array = [| (fun x -> x); (fun x -> x + 1); (fun x -> x * 2) |] and in Scala: val funcs: Array[Int => Int] = Array( x => x, x => x + 1, x => x * 2 )
12
So for you C belongs in hell, doesn't it?
20 u/UdPropheticCatgirl Oct 24 '26 I mean how could it belong anywhere else? 2 u/frikilinux2 Oct 24 '26 Ok but can you find me an example of so many pointers. I accept s link to kernel.org or something like that 17 u/UdPropheticCatgirl Oct 24 '26 I mean my declaration is not completely made up...It's just fairly standard linux sig hangler, except most other codebases would use actual typedefs and macros to split it into multiple declarations see here and here. 7 u/frikilinux2 Oct 24 '26 Ok, I'll accept it.
20
I mean how could it belong anywhere else?
2 u/frikilinux2 Oct 24 '26 Ok but can you find me an example of so many pointers. I accept s link to kernel.org or something like that 17 u/UdPropheticCatgirl Oct 24 '26 I mean my declaration is not completely made up...It's just fairly standard linux sig hangler, except most other codebases would use actual typedefs and macros to split it into multiple declarations see here and here. 7 u/frikilinux2 Oct 24 '26 Ok, I'll accept it.
2
Ok but can you find me an example of so many pointers. I accept s link to kernel.org or something like that
17 u/UdPropheticCatgirl Oct 24 '26 I mean my declaration is not completely made up...It's just fairly standard linux sig hangler, except most other codebases would use actual typedefs and macros to split it into multiple declarations see here and here. 7 u/frikilinux2 Oct 24 '26 Ok, I'll accept it.
17
I mean my declaration is not completely made up...
It's just fairly standard linux sig hangler, except most other codebases would use actual typedefs and macros to split it into multiple declarations see here and here.
7 u/frikilinux2 Oct 24 '26 Ok, I'll accept it.
7
Ok, I'll accept it.
4
If this is the elegance of your c code, you're definitely going to hell.
-4
The joke here is arrays of higher order functions don't even exist in functional languages, because they dont use arrays lol
7 u/UdPropheticCatgirl Oct 24 '26 The joke here is arrays of higher order functions don't even exist in functional languages, because they dont use arrays lol You realize, that there are no arrays in that C type right? In Scala it would be: type Signal = (Int, Int => Int) => (Int => (Int => Int)) also I struggle to think of somewhat mainstream functional language without arrays... In haskell you could do: import Data.Array funcs :: Array Int (Int -> Int) funcs = listArray (0, 2) [id, (+1), (*2)] , in OCaml: let funcs : (int -> int) array = [| (fun x -> x); (fun x -> x + 1); (fun x -> x * 2) |] and in Scala: val funcs: Array[Int => Int] = Array( x => x, x => x + 1, x => x * 2 )
You realize, that there are no arrays in that C type right?
In Scala it would be:
type Signal = (Int, Int => Int) => (Int => (Int => Int))
also I struggle to think of somewhat mainstream functional language without arrays...
In haskell you could do:
import Data.Array funcs :: Array Int (Int -> Int) funcs = listArray (0, 2) [id, (+1), (*2)]
, in OCaml:
let funcs : (int -> int) array = [| (fun x -> x); (fun x -> x + 1); (fun x -> x * 2) |]
and in Scala:
val funcs: Array[Int => Int] = Array( x => x, x => x + 1, x => x * 2 )
View all comments
Show parent comment
99
u/UdPropheticCatgirl Oct 24 '26
int (*(*signal(int, int (*)(int)))(int))(int);
The elegance and simplicity of C is truly unmatched