block:
        proc byLet(v:int): X =
          result = X(v)
          let x{.byaddr.} = result
        discard byLet(1)
      
      block:
        proc byVar(v:int): X =
          result = X(v)
          var x{.byaddr.} = result
      discard byVar(2)
      
      block:
        proc byCast(v:sink int):X = move(cast[var X](v.addr))
        discard byCast(3)
      
      block:
        proc byLetCastMove(v:int): X =
          let x = X(v)
          result = move(cast[var X](x.unsafeAddr)
        discard byLetCastMove(6)
    
    
    Run

but you really shouldn't do any of those they're all horrible

i'm not being helpful

Reply via email to