diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2013-04-30 13:38:02 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2013-04-30 13:38:02 -0400 |
commit | b2dc3a9199369af04cf3ee9db0d1ebb5576a594b (patch) | |
tree | 538dc6f0a54cd47dfcab54adfb337608ad374382 | |
parent | 63fc8aaf40dfd70129a8d8ae1eed71b43c889591 (diff) |
Forum: Rename “asker” to “author”
-rw-r--r-- | forum/asker.urs | 17 | ||||
-rw-r--r-- | forum/author.ur (renamed from forum/asker.ur) | 12 | ||||
-rw-r--r-- | forum/author.urs | 17 | ||||
-rw-r--r-- | forum/forum.ur | 12 | ||||
-rw-r--r-- | forum/lib.urp | 2 |
5 files changed, 30 insertions, 30 deletions
diff --git a/forum/asker.urs b/forum/asker.urs deleted file mode 100644 index 99be711..0000000 --- a/forum/asker.urs +++ /dev/null @@ -1,17 +0,0 @@ -type asker - -val anonymous : asker -val namedAsker : string -> asker - - -(********************************* Instances *********************************) - -val eq_asker : eq asker - -val show_asker : show asker - -(* 'read' producing an 'asker' is guaranteed to never fail, so you can use -'readError' with impunity. *) -val read_asker : read asker - -val sql_asker : sql_injectable asker diff --git a/forum/asker.ur b/forum/author.ur index 947f20c..e0b1989 100644 --- a/forum/asker.ur +++ b/forum/author.ur @@ -1,8 +1,8 @@ -type asker = option string +type author = option string -val eq_asker = Option.eq +val eq_author = Option.eq -val show_asker = +val show_author = mkShow ( fn nameOpt => case nameOpt of @@ -10,7 +10,7 @@ val show_asker = | Some nam => nam ) -val read_asker = +val read_author = let fun parse text = case text of "Anonymous" => None @@ -19,8 +19,8 @@ val read_asker = mkRead parse (compose Some parse) end -val sql_asker = sql_option_prim +val sql_author = sql_option_prim val anonymous = None -val namedAsker = Some +val namedAuthor = Some diff --git a/forum/author.urs b/forum/author.urs new file mode 100644 index 0000000..619aced --- /dev/null +++ b/forum/author.urs @@ -0,0 +1,17 @@ +type author + +val anonymous : author +val namedAuthor : string -> author + + +(********************************* Instances *********************************) + +val eq_author : eq author + +val show_author : show author + +(* 'read' producing an 'author' is guaranteed to never fail, so you can use +'readError' with impunity. *) +val read_author : read author + +val sql_author : sql_injectable author diff --git a/forum/forum.ur b/forum/forum.ur index db33f8d..e8a4be5 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -21,7 +21,7 @@ functor Make(Template : sig end) = struct open Styles -open Asker +open Author style questionList style questionMetadata @@ -31,7 +31,7 @@ style questionEntryBody table question : { Id : int, Title : string, Body : string, - Asker : asker + Author : author } PRIMARY KEY Id sequence questionIdS @@ -44,7 +44,7 @@ fun prettyPrintQuestion row : xbody = <li> <h3>{[row.Question.Title]}</h3> {[row.Question.Body]} - <span class={questionMetadata}>Asked by {[row.Question.Asker]}</span> + <span class={questionMetadata}>Asked by {[row.Question.Author]}</span> </li> </xml> @@ -83,7 +83,7 @@ fun main () : transaction page = <textbox {#Title} placeholder="Title" class={questionEntryTitle} /><br /> <textarea {#Body} class={questionEntryBody} /><br /> Asking as: - <select {#Asker}> + <select {#Author}> {case askerOpt of None => <xml/> | Some nam => <xml><option>{[nam]}</option></xml>} @@ -97,8 +97,8 @@ fun main () : transaction page = and ask submission = id <- nextval questionIdS; - dml (INSERT INTO question (Id, Title, Body, Asker) - VALUES ({[id]}, {[submission.Title]}, {[submission.Body]}, {[readError submission.Asker]})); + dml (INSERT INTO question (Id, Title, Body, Author) + VALUES ({[id]}, {[submission.Title]}, {[submission.Body]}, {[readError submission.Author]})); main () end diff --git a/forum/lib.urp b/forum/lib.urp index a45ef70..687859e 100644 --- a/forum/lib.urp +++ b/forum/lib.urp @@ -5,5 +5,5 @@ rewrite style Main/Forum/ Forum/ $/option ../styles -asker +author forum |