Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

GCed languages often also have a mechanism for running code on scope exit. For example Lua's <close> attribute, which runs a metamethod when it goes out of scope rather than having to wait for GC:

  function readfile(name)
    local f <close> = assert(io.open(name))
    return assert(f:read"a")
  end


Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: