-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
This part of the guide doesn't compile with latest version:
devel, haven't tried stable
# Line
var b = cast[ptr TGenericSeq](a)
# Output
Error: expression cannot be cast to TGenericSeqNot error, but non-matching behavior that makes the guide hard to follow
# Code
var num :int
var p = num.addr
p[] = 30
echo num.addr.repr
echo num
# Output
ptr 30
30To "fix" this, I wrote:
template reprByte(n :int) :string=
## Converts the address representation to its hex ByteAddress instead
cast[ByteAddress](n.addr).repr
template reprOld(n :int) :string=
## Converts the address representation to a format that looks more similar to the old output
n.addr.repr & " " & n.reprByteI don't think these two templates fit a simple tutorial.
Just mentioning what I used to get a behavior similar to what the guide shows, so I could reason about the guide content.
Metadata
Metadata
Assignees
Labels
No labels