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. Here's an example:
* (let ((a 42))
#?"foo: \xC4\N{U with diaeresis}\nbar: ${a}")
"foo: ��
bar: 42"
It can be found at <http://weitz.de/cl-interpol/>.
CL-INTERPOL was originally designed as an addendum to CL-PPCRE to
escape backslash hell - see <http://weitz.de/cl-ppcre/#backslash>. I
think it can stand on its own feet now. (Note that the version of
CL-PPCRE it should be fully compatible with, 0.7.0, has not been
released yet.)
Have fun,
Edi.
PS: Peter Seibel made me do it. Thanks.
"Edi Weitz" <···@agharta.de> wrote
> 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. Here's an example:
>
> * (let ((a 42))
> #?"foo: \xC4\N{U with diaeresis}\nbar: ${a}")
> "foo: ��
> bar: 42"
>
> It can be found at <http://weitz.de/cl-interpol/>.
>
> CL-INTERPOL was originally designed as an addendum to CL-PPCRE to
> escape backslash hell - see <http://weitz.de/cl-ppcre/#backslash>. I
> think it can stand on its own feet now. (Note that the version of
> CL-PPCRE it should be fully compatible with, 0.7.0, has not been
> released yet.)
Great!
How about using CL-PPCRE and/or this to implement a simple (TeX like or
whatever) syntax for cl-typesetting ? ;-)
Marc
PS If only people could start to write more code like this to improve Common
Lisp instead of writing zillions of posts in endless Lisp vs (or Scheme
Python ARC Java ...) threads. :(
Just imagine how many libraries we would have if just a few % of the lines of
text written in these posts were converted to useful Lisp code...
On Wed, 22 Oct 2003 20:53:56 +0200, "Marc Battyani" <·············@fractalconcept.com> wrote:
> If only people could start to write more code like this to improve
> Common Lisp instead of writing zillions of posts in endless Lisp vs
> (or Scheme Python ARC Java ...) threads. :( Just imagine how many
> libraries we would have if just a few % of the lines of text written
> in these posts were converted to useful Lisp code...
Hmm, maybe we should start working on a converter to do that for us... :)
Edi.
"Marc Battyani" <·············@fractalconcept.com> writes:
> Just imagine how many libraries we would have if just a few % of the lines of
> text written in these posts were converted to useful Lisp code...
What makes you think the text in these posts are written manually?
Edi Weitz wrote:
> 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. Here's an example:
>
> * (let ((a 42))
> #?"foo: \xC4\N{U with diaeresis}\nbar: ${a}")
> "foo: ��
> bar: 42"
Stupid question. Would it be so hard to make it more FORMAT like? I.e.
use ~% for newline etc etc.
Cheers
--
Marco
On Thu, 23 Oct 2003 10:53:55 -0400, Marco Antoniotti <·······@cs.nyu.edu> wrote:
> Stupid question. Would it be so hard to make it more FORMAT like?
> I.e. use ~% for newline etc etc.
No, most likely not.[1] However, my main goal was to follow Perl's
crude syntax because a) it is intended as a supporting library for
CL-PPCRE and b) Perl's shell-like syntax will probably be more
appealing/familiar to "newbies." I have a hard time imagining Lisp
old-timers using my software.
Cheers,
Edi.
[1] Now that I think of it it is probably even easier to (partly)
support FORMAT's syntax because you don't have that many
exceptional cases (like Perl's strange scoping rules for \Q,
etc.).
Edi Weitz <···@agharta.de> wrote:
> #?"foo: \xC4\N{U with diaeresis}\nbar: ${a}")
Very nice!
On a related topic, there's now a Cliki page for macro-characters of
used by various libraries at:
http://www.cliki.net/Macro%20Characters
Similar in spirit to:
http://www.cliki.net/Features
Cheers,
-- Nikodemus
On 23 Oct 2003 10:58:07 GMT, Nikodemus Siivola <········@kallio.cs.hut.fi> wrote:
> On a related topic, there's now a Cliki page for macro-characters of
> used by various libraries at:
>
> http://www.cliki.net/Macro%20Characters
Good idea. Perhaps you should link them to the corresponding
packages. Let me guess:
I infix package from CMU AI repository
? cl-interpol
` Michael Parker's clawk
U (Portable) AllegroServe (?)
Seems that everyone is using sub-characters of #\# because they are
afraid of using up the precious "full" macro characters that are
left... :)
Edi.
Edi Weitz <···@agharta.de> wrote:
>> http://www.cliki.net/Macro%20Characters
>
> Good idea. Perhaps you should link them to the corresponding
> packages.
Very true. Though I was sort of thinking about the interface /
implementations issue, since I'm thinking of adopting #` for Osicat
for the same purpose it serves in clawk...
Hence there are now fields for both "meaning", and "used by".
> Seems that everyone is using sub-characters of #\# because they are
> afraid of using up the precious "full" macro characters that are
> left... :)
Heh. But maybe for no good reason really, since load binds *readtable*.
Cheers,
-- Nikodemus