Permalink
Browse files

Fixed some uses of [] without _ in news.arc.

  • Loading branch information...
1 parent b59de0a commit f311b3879c15a27518bbe0fadcc0ebc9ab609494 @rocketnia rocketnia committed Apr 8, 2012
Showing with 13 additions and 7 deletions.
  1. +13 −7 lib/news.arc
View
@@ -1493,6 +1493,8 @@ function vote(node) {
(aif (and (~blank url) (live-story-w/url url))
(do (vote-for user it)
(item-url it!id))
+ ; NOTE: Here in Anarki, [...] without _ is nullary, so we're
+ ; using (fn (_) (...)) instead.
(if (no user)
(flink [submit-login-warning url title showtext text _])
(no (and (or (blank url) (valid-url url))
@@ -1504,9 +1506,9 @@ function vote(node) {
(flink [submit-page user url title showtext text bothblank* _])
(let site (sitename url)
(or (big-spamsites* site) (recent-spam site)))
- (flink [msgpage user spammage*])
+ (flink:fn (_) (msgpage user spammage*))
(oversubmitting user ip 'story url)
- (flink [msgpage user toofast*])
+ (flink:fn (_) (msgpage user toofast*))
(let s (create-story url (process-title title) text user ip)
(story-ban-test user s ip url)
(when (ignored user) (kill s 'ignored))
@@ -1707,12 +1709,14 @@ function vote(node) {
(= fewopts* "A poll must have at least two options.")
(def process-poll (user title text opts ip)
+ ; NOTE: Here in Anarki, [...] without _ is nullary, so we're using
+ ; (fn (_) (...)) instead.
(if (or (blank title) (blank opts))
- (flink [newpoll-page user title text opts retry*])
+ (flink:fn (_) (newpoll-page user title text opts retry*))
(len> title title-limit*)
- (flink [newpoll-page user title text opts toolong*])
+ (flink:fn (_) (newpoll-page user title text opts toolong*))
(len< (paras opts) 2)
- (flink [newpoll-page user title text opts fewopts*])
+ (flink:fn (_) (newpoll-page user title text opts fewopts*))
(atlet p (create-poll (multisubst scrubrules* title) text opts user ip)
(ip-ban-test p ip)
(when (ignored user) (kill p 'ignored))
@@ -1998,12 +2002,14 @@ function vote(node) {
; the vals coming in from any form, e.g. in aform.
(def process-comment (user parent text ip whence)
+ ; NOTE: Here in Anarki, [...] without _ is nullary, so we're using
+ ; (fn (_) (...)) instead.
(if (no user)
- (flink [comment-login-warning parent whence text])
+ (flink:fn (_) (comment-login-warning parent whence text))
(empty text)
(flink [addcomment-page parent (get-user _) whence text retry*])
(oversubmitting user ip 'comment)
- (flink [msgpage user toofast*])
+ (flink:fn (_) (msgpage user toofast*))
(atlet c (create-comment parent (md-from-form text) user ip)
(comment-ban-test user c ip text comment-kill* comment-ignore*)
(if (bad-user user) (kill c 'ignored/karma))

4 comments on commit f311b38

Owner

This was necesasary because of a recent change to make-br-fn: 957501d

There's also one usage in util.arc and two in arc.arc that would be affected, but since those files are loaded before make-br-fn.arc, I haven't changed them.

Owner

I puzzled over the usages in arc.arc and util.arc as well, and I think those would work anyway because uniq can take 0 or 1 arg.

(There's some crazy weirdness with my home network that's made the arc forum abruptly inaccessible, so I'm stuck reading it in a text-mode browser from my linode server :)

Owner

Whether uniq itself takes an optional arg makes no difference.

The meaning of [uniq] changes from (fn (_) (uniq)) to (fn () (uniq)). In both cases, [uniq] is inflexible about the number of args it takes, and it calls uniq with 0 args.

Owner
Please sign in to comment.