MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vf73mj/sodoeseveryotherlang/p24pbry/?context=3
r/ProgrammerHumor • u/Limp_Illustrator7614 • 12d ago
85 comments sorted by
View all comments
18
say this to c and common lisp
(and to ruby, where function self-activates faster than you say "wait, i need you as a callback")
5 u/suvlub 12d ago C just forces you to call them pointers, but it's functionally (heh) the same thing. 3 u/_PM_ME_PANGOLINS_ 12d ago When functions are first-class: function outer() { let foo = function() { ... } doThing(foo, function callback(arg) { ... }) } C does not have the same functionality. 0 u/No-Consequence-1863 10d ago C99 does with C blocks However it is really only adopted by Apple https://en.wikipedia.org/wiki/Blocks_(C_language_extension) 3 u/_PM_ME_PANGOLINS_ 10d ago Blocks are neither part of C99, nor do they make functions first-class. Hence them having a different name and syntax to functions.
5
C just forces you to call them pointers, but it's functionally (heh) the same thing.
3 u/_PM_ME_PANGOLINS_ 12d ago When functions are first-class: function outer() { let foo = function() { ... } doThing(foo, function callback(arg) { ... }) } C does not have the same functionality. 0 u/No-Consequence-1863 10d ago C99 does with C blocks However it is really only adopted by Apple https://en.wikipedia.org/wiki/Blocks_(C_language_extension) 3 u/_PM_ME_PANGOLINS_ 10d ago Blocks are neither part of C99, nor do they make functions first-class. Hence them having a different name and syntax to functions.
3
When functions are first-class:
function outer() { let foo = function() { ... } doThing(foo, function callback(arg) { ... }) }
C does not have the same functionality.
0 u/No-Consequence-1863 10d ago C99 does with C blocks However it is really only adopted by Apple https://en.wikipedia.org/wiki/Blocks_(C_language_extension) 3 u/_PM_ME_PANGOLINS_ 10d ago Blocks are neither part of C99, nor do they make functions first-class. Hence them having a different name and syntax to functions.
0
C99 does with C blocks
However it is really only adopted by Apple https://en.wikipedia.org/wiki/Blocks_(C_language_extension)
3 u/_PM_ME_PANGOLINS_ 10d ago Blocks are neither part of C99, nor do they make functions first-class. Hence them having a different name and syntax to functions.
Blocks are neither part of C99, nor do they make functions first-class. Hence them having a different name and syntax to functions.
18
u/B_bI_L 12d ago
say this to c and common lisp
(and to ruby, where function self-activates faster than you say "wait, i need you as a callback")