Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!m.cs.uiuc.edu!ibma0.cs.uiuc.edu!ibma0.cs.uiuc.edu!murphy From: murphy@ibma0.cs.uiuc.edu (michael r murphy) Newsgroups: comp.lang.lisp Subject: strings with escape characters Summary: How to read a string without interpreting escape characters? Keywords: strings, escape characters Message-ID: <27E0EDEE.49E5@ibma0.cs.uiuc.edu> Date: 15 Mar 91 15:53:18 GMT Sender: news@ibma0.cs.uiuc.edu Organization: University of Illinois at Urbana-Champaign Lines: 28 I'm rather new to using Lisp and I am having a problem with strings. I would like to read in a C string and keep the escape characters as is. I have enclosed a sample of my problem. What I would like is: (setf foo "\nThis is a c string\n") "\nThis is a c string\n" I just want to get the \ in there without it being interpreted as an escape. I can then handle printing it out. Help. Script started on Fri Mar 15 09:46:15 1991 murphy|ibma0|[51]% acl Allegro CL 3.2.beta.1 [IBM RS/6000] (0/0/0) Copyright (C) 1985-1990, Franz Inc., Berkeley, CA, USA (setf foo "\nThis is a c string\n") "nThis is a c stringn" (setf foo |"\nThis is a c string\n"|) Error: Attempt to take the value of the unbound symbol |"nThis is a c stringn"| [1] :exit ; Exiting Lisp murphy|ibma0|[52]% ^D script done on Fri Mar 15 09:47:00 1991 murphy@cs.uiuc.edu OR mick@uiuc.edu