nakkaya/ferret

Lambda with a function as parameter throws an error

kloimhardt opened this issue · 0 comments

I create inctest.clj with the following content

(println ((fn [f] (f 0)) inc))

When compiling, an error occurs:

$ g++ -std=c++11 -pthread inctest.cpp
inctest.cpp:2812:40: error: 'inc' does not refer to a value
          run(println(),run(FN__4519(),inc)); 
                                       ^
inctest.cpp:2685:24: note: declared here
                 class inc final : public lambda_i{

Note: replacing inc with (identity inc) works and prints the number 1 as expected.