# HG changeset patch # User Adam Chlipala # Date 1331402013 18000 # Node ID a1a1d66aebac10b89c39e118ef7c5b94b4ad5dbe # Parent ea292bf9431fe9446e2f6a8ee3f9b095b29ff8d0 Change to yield [option string] diff -r ea292bf9431f -r a1a1d66aebac lib/ur/basis.urs --- a/lib/ur/basis.urs Sat Mar 03 16:41:20 2012 -0500 +++ b/lib/ur/basis.urs Sat Mar 10 12:53:33 2012 -0500 @@ -830,7 +830,7 @@ val postData : postBody -> string con radio = [Body, Radio] -val radio : formTag string radio [Id = id] +val radio : formTag (option string) radio [Id = id] val radioOption : unit -> tag ([Value = string, Checked = bool] ++ boxAttrs) radio [] [] [] con select = [Select] diff -r ea292bf9431f -r a1a1d66aebac src/cjr_print.sml --- a/src/cjr_print.sml Sat Mar 03 16:41:20 2012 -0500 +++ b/src/cjr_print.sml Sat Mar 10 12:53:33 2012 -0500 @@ -1,4 +1,4 @@ -(* Copyright (c) 2008-2011, Adam Chlipala +(* Copyright (c) 2008-2012, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -2868,6 +2868,16 @@ string "}}", newline] end + | TOption _ => + box [string "uw_input_", + p_ident x, + space, + string "=", + space, + string "uw_get_input(ctx, ", + string (Int.toString n), + string ");", + newline] | _ => box [string "request = uw_get_", string f, diff -r ea292bf9431f -r a1a1d66aebac tests/radio.ur --- a/tests/radio.ur Sat Mar 03 16:41:20 2012 -0500 +++ b/tests/radio.ur Sat Mar 10 12:53:33 2012 -0500 @@ -1,13 +1,15 @@ -val handler = fn x => - You entered: {cdata x.A} - +fun handler x = return + You entered: {[case x.A of + None => "nothing at all" + | Some v => v]} + -val main = fn () => - - -
  • A
  • -
  • B
  • -
    - - - +fun main () = return +
    + +
  • A
  • +
  • B
  • + + + +
    diff -r ea292bf9431f -r a1a1d66aebac tests/radio.urs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/radio.urs Sat Mar 10 12:53:33 2012 -0500 @@ -0,0 +1,1 @@ +val main : unit -> transaction page