Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!das-news.harvard.edu!news2.near.net!MathWorks.Com!news.duke.edu!convex!darwin.sura.net!news.larc.nasa.gov!saimiri.primate.wisc.edu!aplcenmp!hall
From: hall@aplcenmp.apl.jhu.edu (Marty Hall)
Subject: Re: [Help] Concatenate problem
Message-ID: <CwqtF8.Kn7@aplcenmp.apl.jhu.edu>
Organization: JHU/APL AI Lab, Hopkins P/T CS Faculty
References: <CwLuIH.FBy@cunews.carleton.ca>
Date: Mon, 26 Sep 1994 15:23:32 GMT
Lines: 27

In article <CwLuIH.FBy@cunews.carleton.ca> kmn@doe.carleton.ca (Kim-Minh Nguyen) writes:

>My problem is how can I assign character : and characters foo 
>to variable Parm to form :foo ?

I'm not sure if FOO is a string or a symbol in your example. Here's
something that will handle either:

(defmethod Add-Colon ((Sym symbol))
  (if (keywordp Sym)
      Sym
      (intern (symbol-name Sym) :keyword)))

(defmethod Add-Colon ((Str string))
  (intern (string-upcase Str) :keyword))

Eg (setq Parm (Add-Colon 'foo))

You could concatenate the strings together (using CONCATENATE or
FORMAT) and then do READ-FROM-STRING, but that is relatively
expensive. 
						- Marty
(proclaim '(inline skates))
hall@aplcenmp.apl.jhu.edu



