Lisp question

Rakesh Rao

Usenet Archive
Joined
Jan 9, 2000
Messages
134
Reaction score
0
I am stumped on this. How do I find the value and type of a symbol name which will be passed from a VBA routine as a lisp function argument?

For example,

(setq Name "Rakesh")

(setq Age 35)

I need to write a function:

(ValueOf "Name")

should return "Rakesh"

(ValueOf "Age")

should return 35

Any help is appreciated and thanks in advance.

Regards
Rakesh
 
Rakesh said:
(setq Name "Rakesh")

(setq Age 35)

There is no need for a function to determine the value of a symbol. The symbol is bound to its value and may be used wherever the value would be used, just like in VBA:

(setq newValue (1+ Age))

You can verify this by simply evaluating the symbol at the command line:

Command: !Age
35

Command: !Name
"Rakesh"

As for determining the type of a symbol, use the TYPE function.
 
Frank, he may not know that ! is shorthand for eval, to force the evaluation of a symbol.
 

Latest threads

Back
Top