3 ms·
Sure you can - just not anonymously. Kind of like how you can have "higher order functions" and "closures" in Java with anonymous classes - roughly equivalent,
by flatline 14y ago
Sure you can - just not anonymously. Kind of like how you can have "higher order functions" and "closures" in Java with anonymous classes - roughly equivalent, but awkward and not quite what the language was designed for. C is probably better in this regard than Java, but the lack of managed memory is a major drawback.
- JoeAltmaier 14y agoRight. SO you can program 'functionally' in those languages, but they are not 'functional programming languages' because they don't support it natively.
- sixbrx 14y ago"just not anonymously" Just not depending on anything in the environment either except globals, which is a huge limitation. So writing a function inc by = \x -> x + by becomes unnecessarily difficult for example.
- aaronblohowiak 14y agothen you just have a void* / fn ptr couple that you pass around..