On May 6, 2009, at 1:57 AM, dhs827 wrote:
> 2. Would it be better (or even possible) to learn about matching and
> string processing in general, independent of the programming language?
>
> I know about regex, but that's not enough: I need to learn about
> "matching in context", where "context" means "more matching", or even
> something like "explicit non-matches" (hope you can divine my meaning
> here).


This may not be what you're looking for but in general, if regular  
expressions are not enough, the solution may be to investigate context- 
free and (especially in your case) context-sensitive languages, which  
are really the next two levels of expressiveness above regular  
expressions. I think language design and compiler implementation might  
be quite useful to you in an oblique way, but it could also be a blind  
alley. On the other hand, NLP work (AFAICT) seems to focus more on  
analysis and less on interaction, so that might not be of much use to  
you either. For a historical perspective, you might want to look at  
SNOBOL, "the String Oriented Symbolic Language" 
<http://en.wikipedia.org/wiki/SNOBOL 
 >, <http://www.snobol4.org/csnobol4/curr/>. No recursion in it,  
however, IIRC. Prolog's definite clause grammars come to mind too as  
another thing to look into (and recursion friendly) but this is more  
focussed on grammar than on strings per se. 
<http://en.wikipedia.org/wiki/Definite_clause_grammar 
 > Most of the tools out there either deal with strings simply or with  
grammars.

I hope I misunderstood the phrase "explicit non-matches", because I  
believe that problem is intractable, or at least leads to  
unpleasantries like negation of the expression "foo" being "[^f]|[^f] 
[^o]|[^f][^o][^o]|f[^o]|fo[^o]|f$|fo$|^$", which I'm not even sure  
would really work and I doubt looks more tractable or pleasant from  
context-free or context-sensitive languages. Imagine what that would  
be like for a complicated expression. Also there's a difference  
between the negation of a match and the match of a negated expression;  
negating "I have a match" doesn't seem to be the same as negating "I  
have no match"—what's the location, length and content of the negated  
non-match? (Am I high?)

I do suspect that whatever you come up with is going to look like a  
separate language regardless of what language you implement it in,  
simply because it doesn't seem to resemble anything anyone else is  
doing at the moment. I hope you'll keep us abreast of your progress.  
It will be enlightening.

—
Daniel Lyons
http://www.storytotell.org -- Tell It!


--~--~---------~--~----~------------~-------~--~----~
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 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to