// readonly_map_view.hako — 読み取り専用ビュー（誤更新防止用）

using selfhost.shared.common.box_helpers as BoxHelpers

static box ReadOnlyMapView {
  _m

  of(m) {
    local v = new ReadOnlyMapView()
    v._m = m
    return v
  }

  has(key) { return me._m.has(key) }
  get(key) { return BoxHelpers.map_get(me._m, key) }

  set(key, val) {
    print("[ReadOnlyMapView] set forbidden: key=" + (""+key))
    return 0
  }
  delete(key) {
    print("[ReadOnlyMapView] delete forbidden: key=" + (""+key))
    return 0
  }
  clear() {
    print("[ReadOnlyMapView] clear forbidden")
    return 0
  }
}

static box ReadOnlyMapViewStub { main(args) { return 0 } }
