private int showscreen (LuaCallFrame callFrame, int nArguments) {
        int screen = (int)LuaState.fromDouble(callFrame.get(0));
        EventTable et = null;
        if (nArguments > 1) {
            Object o = callFrame.get(1);
            if (o instanceof EventTable) et = (EventTable)o;
        }
        Engine.log("CALL: ShowScreen("+screen+") " + (et == null ? "" : et.name), Engine.LOG_CALL);
        Engine.ui.showScreen(screen, et);
        return 0;
    }
Distance object's fake GetValue or __call method

Called from Lua code: dist:GetValue("metres") or dist("ft"),
where 'dist' is double, converts the number to specified units
and returns as double.
main/src/main/java/cgeo/geocaching/wherigo/openwig/WherigoLib.java