From: Luke J Crook
Subject: #\+ as a function ?
Date: 
Message-ID: <zrcCa.43997$x67.1890805@twister.socal.rr.com>
I need to convert a character, i.e. #\+ so that it may be passed as a
function parameter to FUNCALL. I have been going though ANSI Common Lisp,
but cannot find a function or macro to convert #\+ into perhaps '-

Is there a way to get "-" into '-, if so then (setf operator (format nil
"~A" #\+) would be my first step.

-Luke

From: Adam Warner
Subject: Re: #\+ as a function ?
Date: 
Message-ID: <pan.2003.06.01.02.11.48.410100@consulting.net.nz>
Hi Luke J Crook,

> I need to convert a character, i.e. #\+ so that it may be passed as a
> function parameter to FUNCALL. I have been going though ANSI Common Lisp,
> but cannot find a function or macro to convert #\+ into perhaps '-
> 
> Is there a way to get "-" into '-, if so then (setf operator (format nil
> "~A" #\+) would be my first step.

If I understand you correctly you want to convert a string into a symbol
before FUNCALLing it. For example:

(funcall (read-from-string (string #\+)) 1 2) => 3

Note that SYMBOL-NAME converts from a symbol to its string representation.

(symbol-name '+) => "+"

Something at the back of my mind is nagging me that there may be a better
function than READ-FROM-STRING for converting strings into symbols. But
SYMBOL-NAME doesn't list a cross-reference from See Also.

Regards,
Adam
From: Nils Goesche
Subject: Re: #\+ as a function ?
Date: 
Message-ID: <874r3a5ym3.fsf@darkstar.cartan>
"Adam Warner" <······@consulting.net.nz> writes:

> Something at the back of my mind is nagging me that there may
> be a better function than READ-FROM-STRING for converting
> strings into symbols. But SYMBOL-NAME doesn't list a
> cross-reference from See Also.

FIND-SYMBOL and INTERN.  And sometimes, what you really want is
CASE ;-)

Regards,
-- 
Nils G�sche
Ask not for whom the <CONTROL-G> tolls.

PGP key ID #xD26EF2A0
From: Adam Warner
Subject: Re: #\+ as a function ?
Date: 
Message-ID: <pan.2003.06.01.03.03.17.239138@consulting.net.nz>
Hi Nils Goesche,

>> Something at the back of my mind is nagging me that there may
>> be a better function than READ-FROM-STRING for converting
>> strings into symbols. But SYMBOL-NAME doesn't list a
>> cross-reference from See Also.
> 
> FIND-SYMBOL and INTERN.

Ouch. Thanks :-D
From: Luke J Crook
Subject: Re: #\+ as a function ?
Date: 
Message-ID: <OxgCa.5381$49.329125@twister.socal.rr.com>
"Adam Warner" <······@consulting.net.nz> wrote in message
···································@consulting.net.nz...
> Hi Luke J Crook,
>
> > I need to convert a character, i.e. #\+ so that it may be passed as a
> > function parameter to FUNCALL. I have been going though ANSI Common
Lisp,
> > but cannot find a function or macro to convert #\+ into perhaps '-
> >
> > Is there a way to get "-" into '-, if so then (setf operator (format nil
> > "~A" #\+) would be my first step.
>
> If I understand you correctly

Yes, sorry. I seem to have substituted - for +.

-Luke