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

Lua:

    local debug = require "debug" -- in case 5.2
    debug.setmetatable(1, {__tostring=function(n)
      return ("%g"):format(n+1)
    end})

    print(2+2)
Trying to make 2+2==5 evaluate as true is a lot harder. Although Lua lets you define a custom + operator, it's a fallback not an override.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: