No, my point is that you don't have to do it any differently (unless you mean the machine does different things, in which case that really depends on your compiler).
The note here is that depending on your language, syntax may make the emulation difficult/cumbersome.
If you have classes, you can emulate closures by creating a class that takes the state to close over as constructor arguments, and executes the body of the function as a single method.
If you have closures, you can emulate objects by taking state and returning a bag of functions, which emulate methods. If you need polymorphism, you can call the "parent" closure and just replace the closures in the resulting bag that you need to override.
You can use these to solve problems without altering your approach (though, once again, syntax may be burdensome depending on the language).
The code you write must be different, depending on if you write closures or objects. The way you call upon closures vs. objects also requires different syntax. You must write different code, you must "do it differently".
But I agree they do pretty much a similar thing. You however must write different code depending on which approach you choose, and depending on your language there are pros and cons to each.
No, my point is that you don't have to do it any differently (unless you mean the machine does different things, in which case that really depends on your compiler).
The note here is that depending on your language, syntax may make the emulation difficult/cumbersome.
If you have classes, you can emulate closures by creating a class that takes the state to close over as constructor arguments, and executes the body of the function as a single method.
If you have closures, you can emulate objects by taking state and returning a bag of functions, which emulate methods. If you need polymorphism, you can call the "parent" closure and just replace the closures in the resulting bag that you need to override.
You can use these to solve problems without altering your approach (though, once again, syntax may be burdensome depending on the language).