Whoever that is, they aren't the project creator.
1,147 karma · joined March 26, 2011
Whoever that is, they aren't the project creator.
I suppose I could accept "regex" as not being a regular expression as such, but the two are used so interchangeably that maintaining a distinction isn't very realistic. I'd personally rather a regular expression described a regular language, and "PCRE" (or so) used for the Turing-complete expressions with a similar syntax.
On my Kindle, at least, words seem to be separated at most 1 em, and any more and they go 'ragged right' instead of hyphenating — which I actually found far more pleasant than even Liang's LaTeX hyphenation algorithm in terms of readability.
redo: while(true) {
for(Item x : xs)
if(f(x))
continue redo;
break;
}
With goto, redo:
for(Item x : xs)
if(f(x))
goto redo;
Most people seem at first to balk at the goto, even though they're functionally identical, and the goto is much clearer and less error prone...Edit: Interesting idea, though. With social networks like Facebook you really need to have met in order to befriend — it doesn't encourage random meetings. When I was younger I would find likeminded people by chance on odd websites; I think that's become harder as I've grown older.
The OP's approach is perfect: always navigate to wherever the caret is placed. I would personally drop the ugly gradients in favour of hyperlink-style underlines, but seriously, thanks for an elegant solution to a simple problem.
Also, I don't believe the mass duplication of code necessary for your approach is acceptable, even within a library.
(By the way, you're looking for Haskell's Either type, but ([a],[b]) and [Either a b] are equivalent here.)
If parseLog just returned an error upon failure we would have to same problem as exceptions do, as explained in section 1. So we have to make parseLog return two lists: one of entries, and one of errors. We would then have to search through the error list fixing and reparsing each error. In Python this would be something like,
def parseLogInteractively(file):
return parseLinesInteractively(file.readLines())
def parseLinesInteractively(lines):
entries, errors = parseLines(lines)
if errors:
entries += parseLinesInteractively(askToFixEntry(e.text) for e in errors)
return entries
Again we lose the ability to abstract the function 'parseLog'. And I don't know about you, but this looks far worse to me than "resume FixEntry" in terms of exposing implementation details.(Please, can this stop?)