[CMake] functions as first class objects

Alexander Neundorf a.neundorf-work at gmx.net
Thu Nov 19 13:56:16 EST 2009


On Thursday 19 November 2009, David Manura wrote:
> On Wed, Nov 18, 2009 at 4:58 PM, Alexander Neundorf wrote:
> > On Wednesday 18 November 2009, David Manura wrote:
> >> That would be better than nothing, though it does have a limitation in
> >> that you cannot wrap a function more than once.
> >
> > Not sure. Have you tried ?
>
> function(test)
>   message("1")
> endfunction(test)
> test()
>
> function(test)
>   message("2")
>   _test()
> endfunction(test)
> test()  # ok
>
> function(test)
>   message("3")
>   _test()
> endfunction(test)
> test()  # infinite loop

Yes, I mean it doesn't automatically change the invocation of _test() to 
__test().
Does calling __test() call test 1 actually ? (that's what I meant)

Alex


More information about the CMake mailing list