Hi Michael,
On 2013-06-24 Michael Abbott wrote:
> On Mon, 24 Jun 2013, Andrew Johnson wrote:
> > This is a C API, C doesn't have closures
>
> Of course C has closures, they just require a little cooperation from the
> called function part. A closure in C is a function taking at least one
> void* parameter together with a void* value to pass to it.
The void* parameter is what we've always regarded as a context pointer for
the function. The storage for that data has to be managed by the programmer
though, so while it performs the same job as a closure it isn't a real one.
http://en.wikipedia.org/wiki/Closure_(computer_science) says:
"The idiom is similar to closures in functionality, but not in syntax."
> In truth a C++ closure is exactly the same thing, only in disguise.
C++11 has closures which it calls lambda-expressions; they look very useful,
but do move the language even more in the direction of line-noise IMHO.
- Andrew
--
Advertising may be described as the science of arresting the human
intelligence long enough to get money from it. -- Stephen Leacock
- Replies:
- Re: Problem in errlogRemoveListener Benjamin Franksen
- References:
- Re: Problem in errlogRemoveListener Andrew Johnson
- Re: Problem in errlogRemoveListener Andrew Johnson
- Re: Problem in errlogRemoveListener Michael Abbott
- Navigate by Date:
- Prev:
Re: PyEpics speed Daron Chabot
- Next:
cannot start test application Costello, Charles C.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Problem in errlogRemoveListener Michael Abbott
- Next:
Re: Problem in errlogRemoveListener Benjamin Franksen
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
<2013>
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|