(count:0, for z in charlist("0123456789abcdef") do (hex[z]:count,
count:count+1),
count:10, for z in charlist("ABCDEF") do (hex[z]:count, count:count+1),
hex[q]:=error("invalid hex digit ", q),
hexstring2int(r):= block([ans:0],
for z in charlist(r) do (ans:16*ans,ans:ans+hex[z]),
ans))$
/*all done. Now try */
hexstring2int("FFF");
/* you can do this, too, as suggested by Martin Schoenecker. */
prefix("0x")$
0x(e):=hexstring2int(e)$
0x"FF"
/*I see no easy way to remove the need for quotes. */