From: Slobodan Blazeski
Subject: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <3689e29b-7493-45c1-9572-4da07572ee9d@e10g2000prf.googlegroups.com>
I want to add a string in my code that uses string delimiter " is
there any way to copy paste it without manually adding \?
Example:
Jim O'Brien said "I wasn't here yesterday, period." and ...

Is it possible to somehow copy paste it as string instructing the
reader to ignore " without manually adding \ or read it in the REPL  ?

thanks
Slobodan

From: mac
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <f24e3793-788b-41ab-8b66-149eff89c2e4@s8g2000prg.googlegroups.com>
CL-INTERPOL - String interpolation for Common Lisp

http://www.weitz.de/cl-interpol/

HTH
From: Slobodan Blazeski
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <e5a776f9-116f-4284-a79c-8de45645b412@x69g2000hsx.googlegroups.com>
On Jan 4, 1:14 am, mac <········@gmail.com> wrote:
> CL-INTERPOL - String interpolation for Common Lisp
>
> http://www.weitz.de/cl-interpol/
>
> HTH

Does it need something else to be set after installing it and loading
it with asdf, both slime/sbcl and lispworks say that #? is not
defined ?
CL-USER> (asdf:oos 'asdf:load-op :cl-interpol)
NIL
CL-USER> (in-package cl-interpol)
#<PACKAGE "CL-INTERPOL">
INTERPOL> (setf x #?(dbhsfhsd))
; Evaluation aborted.
INTERPOL> #?dsjfhsdj
; Evaluation aborted.
INTERPOL> #?dsjfhsdj

cheers
Slobodan

CL-USER> (asdf:oos 'asdf:load-op :cl-interpol)
NIL
CL-USER> (in-package cl-interpol)
#<PACKAGE "CL-INTERPOL">
INTERPOL> (setf x #?(dbhsfhsd))
; Evaluation aborted.
INTERPOL> #?dsjfhsdj
; Evaluation aborted.
INTERPOL> #?dsjfhsdj
From: Edi Weitz
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <uabnl5xh0.fsf@agharta.de>
On Fri, 4 Jan 2008 08:28:01 -0800 (PST), Slobodan Blazeski <·················@gmail.com> wrote:

> Does it need something else to be set after installing it and
> loading it with asdf, both slime/sbcl and lispworks say that #? is
> not defined ?

Reading the documentation might be helpful.  Quote:

  CL-INTERPOL installs ? (question mark) as a "sub-character" of the
  dispatching macro character # (sharpsign), i.e. it relies on the
  fact that sharpsign is a dispatching macro character in the current
  readtable when ENABLE-INTERPOL-SYNTAX is invoked.

Edi.

-- 

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

  http://weitz.de/eclm2008/

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Slobodan Blazeski
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <fb82dad4-7233-4e9c-aaa9-49f888acbfd1@j78g2000hsd.googlegroups.com>
On Jan 4, 6:09 pm, Edi Weitz <········@agharta.de> wrote:
> On Fri, 4 Jan 2008 08:28:01 -0800 (PST), Slobodan Blazeski <·················@gmail.com> wrote:
> > Does it need something else to be set after installing it and
> > loading it with asdf, both slime/sbcl and lispworks say that #? is
> > not defined ?
>
> Reading the documentation might be helpful.  Quote:
>
>   CL-INTERPOL installs ? (question mark) as a "sub-character" of the
>   dispatching macro character # (sharpsign), i.e. it relies on the
>   fact that sharpsign is a dispatching macro character in the current
>   readtable when ENABLE-INTERPOL-SYNTAX is invoked.

Sorry about that, but it would nice to add (ENABLE-INTERPOL-SYNTAX)
before the examples just for the lazy bastards who skip the text and
go immediately to code.

Anyway I found a solution to my problem without additional
dependencies.
First I setq a variable to a read-line as suggested  by Alan Crowe:
(setq x (read-line))
than paste the whole string in the repl, deleting the spaces in lines
in order the string to be like a one big single line and then
(prin1 x) ; file:///home/bobi/lisp/HyperSpec-7-0/HyperSpec/Body/f_wr_pr.htm#prin1
 will do the magic showing a string that could be later pasted in an
editor file.
Pretty cool, it seems that designers or common lisp did a good
thinking before adding so much functionality in  the spec.
If anybody has a better idea I'm all ears.

cheers and thanks to all for your advices.
Slobodan
From: Madhu
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <m3zlvjjy8j.fsf@robolove.meer.net>
* Slobodan Blazeski Wrote on Fri, 4 Jan 2008 11:19:36 -0800 (PST):
| Anyway I found a solution to my problem without additional
| dependencies.  

Here's something from my init file: I use a reader macro #$"foo" to read
strings, and you can use any character which does not appear in the body
of the string to delimit the string instead of #\".

I'm not sure if this ^^^^ is a problem with the string you are pasting.

For convenience I also allow #${foo}, #(foo), etc. but that can be
overridden by a special.

(defvar *matching-delim-pairs* '((#\( . #\)) (#\{ . #\}) (#\[ . #\]))
  "Alist of (LDELIM . RDELIM) characters, for delimiting strings read by
VERBATIM-STRING-READER.")

(defvar *use-matching-delim-pairs-p* t
  "If non-NIL VERBATIM-STRING-READER will look in *MATCHING-DELIM-PAIRS* to
find a matching string delimiter.")

(eval-when (:compile-toplevel :load-toplevel :execute)
(defun verbatim-string-reader (stream $ arg)
  (declare (ignore $ arg))
  (let* ((delim (read-char stream t))
	 (match (or (and *use-matching-delim-pairs-p*
			 (cdr (assoc delim *matching-delim-pairs*)))
		    delim)))
    (loop for c = (read-char stream t)
	  if (char= c match) do (return (coerce string 'string))
	  else collect c into string))))

(eval-when (:compile-toplevel :load-toplevel :execute)
(set-dispatch-macro-character #\# #\$ #'verbatim-string-reader))

(setf (documentation 'verbatim-string-reader 'function) #$<reads
$#X...X, where "..." is read verbatim. X, the first character read is
treated as the delimiter. If *USE-MATCHING-DELIM-PAIRS-P* is non-NIL
(default), look in the alist *MATCHING-DELIM-PAIRS* to find a matching
delimiter, which is then used to terminate reading the string<)
From: Edi Weitz
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <u63y95xer.fsf@agharta.de>
On Thu, 3 Jan 2008 16:14:08 -0800 (PST), mac <········@gmail.com> wrote:

> CL-INTERPOL - String interpolation for Common Lisp

How would that help with the OP's problem?

-- 

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

  http://weitz.de/eclm2008/

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: mac
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <616c4008-cb34-4003-8554-ebec5ab1f4ed@l1g2000hsa.googlegroups.com>
Hi Edi,

On Jan 4, 9:10 am, Edi Weitz <········@agharta.de> wrote:
> On Thu, 3 Jan 2008 16:14:08 -0800 (PST), mac <········@gmail.com> wrote:
> > CL-INTERPOL - String interpolation for Common Lisp
>
> How would that help with the OP's problem?
>

If I understand the problem correctly, the OP wants to use a different
quoting char for strings, similar to perl's '', "", qq{} or q//

and you can use cl-interpol to achieve similar effect (without any
interpolation):

#?(Jim O'Brien said "I wasn't here yesterday, period." and ...)


I have some private patch that I haven't submitted to the list which
would allow one to do something like this (again, handy construct from
sh and perl)

;; h for herestring

#?hEOL
CL-INTERPOL is a library for Common Lisp which modifies the reader so
that you
can have interpolation within strings similar to Perl or Unix Shell
scripts. It
also provides various ways to insert arbitrary characters into literal
strings
even if your editor/IDE doesn't support them.

EOL


Cheers,
-- Mac
From: Slobodan Blazeski
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <467ee3b9-9b0e-469f-ba42-2a9b360a033d@i3g2000hsf.googlegroups.com>
On Jan 4, 8:22 pm, mac <········@gmail.com> wrote:
> Hi Edi,
>
> On Jan 4, 9:10 am, Edi Weitz <········@agharta.de> wrote:
>
> > On Thu, 3 Jan 2008 16:14:08 -0800 (PST), mac <········@gmail.com> wrote:
> > > CL-INTERPOL - String interpolation for Common Lisp
>
> > How would that help with the OP's problem?
>
> If I understand the problem correctly, the OP wants to use a different
> quoting char for strings, similar to perl's '', "", qq{} or q//

Hi Mac
Sorry for not explaining my problem more clearly, but the problem was
that I needed below regex to be set to a lisp variable in my editor
with something like this
(defvar  *regex* monster-below)
The problem was that lisp understands "" as string delimiters so I
need to insert \ in front of all " for lisp reader to treat them as
ordinary characters, and that's a lot of \. So I needed I way
automatize it.The best solution I found is to copy-paste monster-below
into a file , than evaluate
 (setf regex (apply #'concatenate 'string
			    (let ((in (open "/home/bobi/regex" :if-does-not-exist nil)))
			      (when in
				(loop for line = (read-line in nil)
				   while line collect line)))))
afterwards prin1 was doing my job by  producing output suitable for
input to read and returning a string with inserted escape characters \
that I could paste into my editor file
(prin1 regex]

Solution with cl-interpol worked this time because there was no #\{ #
\} characters in the regex but I believe mine is a more general
solution with a little hustle.

cheers
Slobodan

[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\
xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xf
f\n\015()]*)*\)[\040\t]*)*(?:(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\x
ff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n\015
"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\
xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80
-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*
)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\
\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\
x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x8
0-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|"[^\\\x80-\xff\n
\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[\040\t]*(?:\([^\\\x
80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^
\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040
\t]*)*)·@[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([
^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\
\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\
x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-
\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()
]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\
x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\04
0\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\
n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\
015()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?!
[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\
]]|\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\
x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\01
5()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)*|(?:[^(\040)<>@,;:".
\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]
)|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[^
()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037]*(?:(?:\([^\\\x80-\xff\n\0
15()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][
^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)|"[^\\\x80-\xff\
n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015"]*)*")[^()<>@,;:".\\\[\]\
x80-\xff\000-\010\012-\037]*)*<[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?
:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-
\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(··@[\040\t]*
(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015
()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()
]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\0
40)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\
[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\
xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*
)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80
-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x
80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t
]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\
\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])
*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x
80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80
-\xff\n\015()]*)*\)[\040\t]*)*)*(?:,[\040\t]*(?:\([^\\\x80-\xff\n\015(
)]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\
\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)·@[\040\t
]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\0
15()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015
()]*)*\)[\040\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(
\040)<>@,;:".\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|
\\[^\x80-\xff])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80
-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()
]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x
80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^
\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040
\t]*)*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".
\\\[\]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff
])*\])[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\
\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x
80-\xff\n\015()]*)*\)[\040\t]*)*)*)*:[\040\t]*(?:\([^\\\x80-\xff\n\015
()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\
\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)?(?:[^
(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-
\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\xff\
n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|
\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))
[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff
\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\x
ff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(
?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\
000-\037\x80-\xff])|"[^\\\x80-\xff\n\015"]*(?:\\[^\x80-\xff][^\\\x80-\
xff\n\015"]*)*")[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\x
ff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)
*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*)·@[\040\t]*(?:\([^\\\x80-\x
ff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-
\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)
*(?:[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\
]\000-\037\x80-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\]
)[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-
\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\x
ff\n\015()]*)*\)[\040\t]*)*(?:\.[\040\t]*(?:\([^\\\x80-\xff\n\015()]*(
?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]*(?:\\[^\x80-\xff][^\\\x80
-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)*\)[\040\t]*)*(?:[^(\040)<
>@,;:".\\\[\]\000-\037\x80-\xff]+(?![^(\040)<>@,;:".\\\[\]\000-\037\x8
0-\xff])|\[(?:[^\\\x80-\xff\n\015\[\]]|\\[^\x80-\xff])*\])[\040\t]*(?:
\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\xff\n\015()]
*(?:\\[^\x80-\xff][^\\\x80-\xff\n\015()]*)*\))[^\\\x80-\xff\n\015()]*)
*\)[\040\t]*)*)*>)
From: mac
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <47aec43e-040e-488e-bbf2-2f5e1bdc7de2@x69g2000hsx.googlegroups.com>
> Solution with cl-interpol worked this time because there was no #\{ #
> \} characters in the regex but I believe mine is a more general
> solution with a little hustle.

If your string contains all of the cl-interpol special chars, then you
can use the HERE DOC construct that I illustrated above. Email me if
you need the patch.


> [\040\t]*(?:\([^\\\x80-\xff\n\015()]*(?:(?:\\[^\x80-\xff]|\([^\\\x80-\

What a monster. Is this practical? How can one verify that it works
and there's no false positive/negative?

Anyway, have fun.
-- Mac
From: Slobodan Blazeski
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <49fbd9dc-9897-4ecf-ba92-1f832f228c96@e23g2000prf.googlegroups.com>
n Jan 5, 12:06 am, mac <········@gmail.com> wrote:
> What a monster. Is this practical? How can one verify that it works
> and there's no false positive/negative?
What are false positives/negatives? The emails that don't conform to
standard,  emails that are valid but  99.9% mail readers can't send
mail to them, or something defined ad-hoc by programmers who *know*
how valid email look like without even reading the standard or
thinking about mail readers.
It seems that everything boils down to what type of wrong do you want
to have. For a complete discussion of the mail validation situation
with regex read this
http://groups.google.com/group/comp.lang.lisp/browse_thread/thread/0a144a4cdfa70dd6/83bb27c701bfa3e2?hl=en&lnk=raot#83bb27c701bfa3e2

happy lisping
Slobodan
>
> Anyway, have fun.
> -- Mac
From: Maciej Katafiasz
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <4e206c26-d65b-414d-96a6-934332bc3068@j78g2000hsd.googlegroups.com>
On Jan 4, 11:05 pm, Slobodan Blazeski <·················@gmail.com>
wrote:
> Sorry for not explaining my problem more clearly, but the problem was
> that I needed below regex to be set to a lisp variable in my editor
> with something like this
> (defvar  *regex* monster-below)

Reading Friedl, eh?

Cheers,
Maciej
From: Edi Weitz
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <u4pdt46jq.fsf@agharta.de>
On Fri, 4 Jan 2008 11:22:29 -0800 (PST), mac <········@gmail.com> wrote:

> If I understand the problem correctly, the OP wants to use a
> different quoting char for strings, similar to perl's '', "", qq{}
> or q//
>
> and you can use cl-interpol to achieve similar effect (without any
> interpolation):
>
> #?(Jim O'Brien said "I wasn't here yesterday, period." and ...)

Uh, right.  It probably shows that I never use this stuff myself... :)

Thanks,
Edi.

-- 

European Common Lisp Meeting, Amsterdam, April 19/20, 2008

  http://weitz.de/eclm2008/

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: D Herring
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <JuudnauWAr5k-OPanZ2dnUVZ_r6rnZ2d@comcast.com>
Slobodan Blazeski wrote:
> I want to add a string in my code that uses string delimiter " is
> there any way to copy paste it without manually adding \?
> Example:
> Jim O'Brien said "I wasn't here yesterday, period." and ...
> 
> Is it possible to somehow copy paste it as string instructing the
> reader to ignore " without manually adding \ or read it in the REPL  ?

Take a look at #" and #> on http://hcsw.org/XML.html
(near the bottom of the page)

- Daniel

P.S.  Here's a nestable version of #".
(defun |#"-reader| (stream sub-char numarg)
   (declare (ignore sub-char numarg))
   (let ((chars)
         (depth 0))
     (do ((prev (read-char stream) curr)
          (curr (read-char stream)
                (read-char stream)))
         ((and (= depth 0)
               (char= prev #\")
               (char= curr #\#)))
       (when (and (char= prev #\#)
                  (char= curr #\"))
         (incf depth))
       (when (and (char= prev #\")
                  (char= curr #\#))
         (decf depth))
       (push prev chars))
     (coerce (nreverse chars) 'string)))
From: Alan Crowe
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <861w8xpqg7.fsf@cawtech.freeserve.co.uk>
Slobodan Blazeski <·················@gmail.com> writes:

> I want to add a string in my code that uses string delimiter " is
> there any way to copy paste it without manually adding \?
> Example:
> Jim O'Brien said "I wasn't here yesterday, period." and ...
> 
> Is it possible to somehow copy paste it as string instructing the
> reader to ignore " without manually adding \ or read it in the REPL  ?
> 

How about setting READ-LINE running at the REPL.
While it is waiting, paste in your string.

Hit return and there you have it!

Alan Crowe
Edinburgh
Scotland
From: Slobodan Blazeski
Subject: Re: How to copy paste string that contain string delimiters?
Date: 
Message-ID: <9884025f-48a8-4d69-a9d8-11f1d4f8b3bc@v29g2000hsf.googlegroups.com>
On Jan 4, 4:20 pm, Alan Crowe <····@cawtech.freeserve.co.uk> wrote:
> Slobodan Blazeski <·················@gmail.com> writes:
> > I want to add a string in my code that uses string delimiter " is
> > there any way to copy paste it without manually adding \?
> > Example:
> > Jim O'Brien said "I wasn't here yesterday, period." and ...
>
> > Is it possible to somehow copy paste it as string instructing the
> > reader to ignore " without manually adding \ or read it in the REPL  ?
>
> How about setting READ-LINE running at the REPL.
> While it is waiting, paste in your string.
>
> Hit return and there you have it!
>
> Alan Crowe
> Edinburgh
> Scotland

It works in the REPL  but I also need it in file.

thanks
Slobodan