ferret icon indicating copy to clipboard operation
ferret copied to clipboard

Lambda with a function as parameter throws an error

Open kloimhardt opened this issue 11 months ago • 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.

kloimhardt avatar Jul 28 '23 15:07 kloimhardt