chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] "raw" strings


From: Tobia Conforto
Subject: Re: [Chicken-users] "raw" strings
Date: Fri, 10 Oct 2008 11:31:12 +0200

Since escaping backslashes inside string literals can get tedious, I wondered wether a non-escaping string-syntax might be handy.

Yes, raw strings (ala Python) are a useful piece of syntax to have.
But specialized regexp syntax (ala Perl) is even better.

I personally use raw strings quite often in Python and not just for regexps, but it's true that we already have #<<EOF for that.

A much more handy syntax to have would be that of #/what\.*/i being read into (delay (regexp "what\\.*" #t)) --and having all the regexp functions accept promises, of course.

A specialized regexp syntax IHMO should:
 - not require escaping of backlashes
 - include all supported switches (case insensitive, multiline, etc.)
 - memoize or otherwise cache the compilation step
 - allow for changing the delimiter: #r(what\.*)i
these are all essential features.

A somewhat useful but not essential feature would be a verbose version:
   #r/
      what   ;the "what" word, case insensitive
      \.*    ;followed by zero or more full stops
   /ix
but I guess this requires support by the underlying regexp library.


Tobia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]