Re: [q-lang-users] [qlist] Re: Suggestions on how to debug?
Brought to you by:
agraef
From: Andrew B. <and...@ya...> - 2006-12-20 03:34:20
|
On 19 Dec 2006, at 15:02, Albert Graef wrote: >> No, the current version is not. And yes, I guess you're right with >> your >> suspicion that regex_next is the culprit here. It shouldn't be a big >> deal to rewrite regex_next so that it's tail-recursive, though. > Yeah, I realized this in the car this morning on my way to work. The function call hidden in the [] syntax threw me off. > Ok, here is a tail-recursive implementation of regex. Just put this at > the beginning of your script and fetch_history "AA" goes through > without > a hitch (takes a while, though). (I might also use this definition in > the next version of clib, but not right now as I haven't tested it > thoroughly yet and I don't want to hold back the 7.6 release any > longer.) > I would like to see it fixed in the next version. If it bit me once, it'll bite me again. Also, would you be receptive to the idea of switching to PCRE for your regular expression library? I know that it is yet another dependancy, but it is maintained, and quite a bit more powerful than the regular GNU one. > Also note that using regex to just split a string at a given delimiter > is really overkill. There's the split function which does this much > faster (clib provides a C implementation of that function). To use > this, > just s/regsplit "g"/split/ in your script and fetch_history "AA" runs > much faster. I'll admit that my eyes glazed over a bit while reading the long lists of supplied functions in the documentation. I should go back and re-read that part once I get a bit more comfortable with the language itself. -andrew |