Possible Duplicate:
What is a ‘Closure’?
I read more and more about closures but I don't really get what it is from a practical standpoint. I read the wikipedia page on it but it doesn't really clear anything up for me because I have more of a practical background in programming (self taught) as opposed to a computer science background. If this is a reundant question, I apologize as my initial search didn't yield anything that really answered it for me.
edit: Thanks for pointing me in the right direction! I see this has already been clearly answered before so I will close the question out.
Eric Lippert's blog does a pretty good job at explaining this in a practical sense.
And so does Kyle at SO
An operation is said to be closed over a set when the result of that operation also belongs to that set.
For example - Consider a set of positive integers. Addition is a closed operation over this set because adding two positive integers would always give a positive integer.
However subtraction is not closed over this set because 2 - 3 would give -1 which does not belong to the set of positive integers.
cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With