Dynamic variable names: Difference between revisions

Changed the way to set the value in the table: “add” is deprecated in version 1.4 of Nim compiler.
m (→‎dynamic classes: requires comment -> requires() builtin)
(Changed the way to set the value in the table: “add” is deprecated in version 1.4 of Nim compiler.)
Line 874:
write(stdout, "Enter a var name: ")
let sVar = readLine(stdin)
varMap.add([$svar,] = theVar.addr)
echo "Variable ", sVar, " is ", ptrToInt(varMap[$sVar])
 
Anonymous user