values into mul

Q&A's, tips, howto's
Locked
joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

values into mul

Post by joejoe »

Hi,

I am trying this:

Code: Select all

(set 'abc "8888")
(println abc)
(println (mul 2 abc))
and getting this:

Code: Select all

8888

ERR: value expected in function mul : abc
What would be the way to get values into the mul function?

Thanks!

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: values into mul

Post by rickyboy »

Use read-expr.

Code: Select all

(println (mul 2 (read-expr abc)))
(λx. x x) (λx. x x)

joejoe
Posts: 173
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: values into mul

Post by joejoe »

rickyboy,

You're the man, thanks big!

I hadn't gotten so far as the read-expr, much appreciated! =)

Locked