On Oct 9, 2:44 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 9, 2008 at 2:03 PM, Paul Barry <[EMAIL PROTECTED]> wrote:
>
> > What about having #"pattern" work like is does now, and then having #/
> > pattern/ work similarly to Ruby, Python, Perl, etc. regular expression
> > in that they not require double escaping of characters like '\'? So
> > in other words:
>
> I would vote against any new syntax that doesn't allow for a
> user-chosen delimiter. If we introduce something new, it should solve
> the problem more completely than that.
>
> > The advantage to this is that it is backwards compatible.
>
> That's true and good, and if Rich is open to it, I think #r/foo/ or
> #~/foo/ or something would be a great choice, allowing for / or " or
> perhaps even () for delimiting the regex.
>
> > I don't think the arbitrary delimiter is as necessary as not having to
> > include
> > extra escaping characters because it is a string.
>
> I actually prefer " over / as the only allowed delimiter. Matching
> file paths with / as the delimiter is not uncommon, and rather
> painful:
> #/\/usr\/lib\/*.so/
>
> The contexts where " have to be quoted often don't seem quite as bad:
> #"<img src=\"file://foo/bar\">"
>
Let's stay on track with your first simple proposal - eliminating
escaping of \ and \" being non-terminating.
Arbitrary delimiters begs the question of why not in strings too, and
I think the editor/tools issues are real, as well as the general
inability to grok code with user-defined character interpretation.
The question is, are people willing to deal with the breakage in the
short term?
Could there be a reader warning, if \\ is seen in patterns?
Is there a possible conversion or safe interpretation of existing
patterns (esp. \\\" and \\\\)
How tricky is the print side?
Rich
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---