Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- proc createSequence: seq[int] =
- result = @[10, 20]
- proc mainProc =
- let a = createSequence()
- let b = a[0].unsafeAddr # OK
- for x in a:
- let c = x.unsafeAddr # Error
- for i in 0..<a.len:
- let c = a[i].unsafeAddr # OK
- for i in 0..<a.len:
- let x = a[i]
- let c = x.unsafeAddr # OK
- if isMainModule:
- mainProc()
Advertisement
Add Comment
Please, Sign In to add comment