ArchGDAL, getfeature() error

To me it appears that getfeature requires a function as it’s first parameter. That is what:

fs = ArchGDAL.getfeature(layer, 1) do f
      ArchGDAL.getgeom(f)  
end

is doing. It creates a small function that calls ArchGDAL.getgeom(f) and passes it in as the first parameter to the method. Later when you do f = ArchGDAL.getfeature(layer, 1) there is no function being passed in.