| I've been looking at srv.arc and I have a few comments. First, it is unusably broken on many plaforms due to the reasons people have posted before (date, news.arc, mkdir, etc.) srv.arc has a severe lack of consistency. I count five (!) different ways of defining a continuation function: e.g. defop takes "req" and body, defop-raw takes "(str req)" and body, aform takes a continuation function, w/link takes a continuation expression, and onlink takes a continuation body. A bizarre bug: arc> (defop mylink req (prn "hello"))
arc> (defopr mylink req (prn "newlink"))
arc> (defop mylink req (prn "hello"))
The result is /mylink generates a page that is the text for a redirect, including "Location:" (because redirector* is still set), but outputs this as HTML and doesn't redirect. This puzzled me for a while.Parts of srv.arc seem nice and orthogonal. You can define a page or a redirect, without or with header access, with defop, defopr, defop-raw, and defopr-raw. You can make a form of these four types with aform, arform, aformh, and arform. But the bizarre part is that aform uses defopr, not defop. I.e. both aform and aformh go through /x so aform needs an extra (prn). The set of operations seems somewhat random. Onlink seems mostly redundant with linkf. Operations that you'd expect for consistency are missing: w/rlink-if, timed-arform, rurl-for. There's also the puzzling jfnurl*, which is a supposedly but not-really asynchronous call. I'm pretty sure that harvest-fnids will die in the split if there are < 2000 fnids and > 18000 timed-fnids, but I haven't verified this. (Is lack of consistency something that bothers other people, or do I have the wrong mindset here? Some things seem like accidental lack of consistency. But maybe the motivation behind 5 ways of creating continuation functions is that it makes the code shorter since you can pick the shortest technique and save a few characters. If so, it strikes me as the wrong tradeoff to make the language more difficult to use in order to make programs a few characters shorter. I.e. "onlink" makes the language more powerful according to the "brevity = power" metric since it can save a "do" token, but remembering that onlink works the opposite of w/link makes the language marginally harder to use.) |