views:

41

answers:

2

Hello all!

I'm trying to convert hexadecimal number to hexadecimal number presentation.

for example is below.

CL-USER> (foo 0D)
#x0D

Should i use macro function?

A: 

Are you saying that you want to format a number as a hexadecimal string? If so, you would want something like this: (format nil "~x" #x0D)

Gabe
wanna return value~ :-)
rafael
I don't understand what you're looking for. Can you try to be more explicit?
Gabe
sorry~. I misunderstood your answer. Thank you very much Gabe.
rafael
+2  A: 

0D is a symbol (by default). Get its name with SYMBOL-NAME as a string. Use PARSE-INTEGER with :RADIX 16 to get the number.

If you don't have any reason for it, representing hex numbers as symbols is nothing I would do.

Rainer Joswig