Commit f5c503fa authored by Rinus Plasmeijer's avatar Rinus Plasmeijer
Browse files

*** empty log message ***

parent 143e75f7
...@@ -13,7 +13,7 @@ import DataFile ...@@ -13,7 +13,7 @@ import DataFile
:: FoF :== (*HtmlStream -> *HtmlStream) :: FoF :== (*HtmlStream -> *HtmlStream)
:: *NWorld // io states... :: *NWorld // io states...
= { worldC :: !*World // world for any io = { worldC :: *World // world for any io
, inout :: *HtmlStream // to read from stdin and write to stdout , inout :: *HtmlStream // to read from stdin and write to stdout
, gerda :: *Gerda // to read and write to a relational database , gerda :: *Gerda // to read and write to a relational database
, datafile :: *DataFile // to read and write to a Clean database in a file , datafile :: *DataFile // to read and write to a Clean database in a file
......
...@@ -199,9 +199,6 @@ doHtmlClient userpage world ...@@ -199,9 +199,6 @@ doHtmlClient userpage world
# world = snd (fclose sio world) # world = snd (fclose sio world)
= world = world
mkHSt :: *FormStates *NWorld -> *HSt mkHSt :: *FormStates *NWorld -> *HSt
mkHSt states nworld = {cntr=0, states=states, request= http_emptyRequest, world=nworld, submits = False, issub = False } mkHSt states nworld = {cntr=0, states=states, request= http_emptyRequest, world=nworld, submits = False, issub = False }
...@@ -633,15 +630,32 @@ where ...@@ -633,15 +630,32 @@ where
showType (RV r) = "::Real" showType (RV r) = "::Real"
showType (BV b) = "::Bool" showType (BV b) = "::Bool"
// The following two functions are not an example of decent Clean programming, but it works thanks to lazy evaluation...
toHtml :: a -> BodyTag | gForm {|*|} a toHtml :: a -> BodyTag | gForm {|*|} a
toHtml a toHtml a
# (na,_) = mkForm (Set,mkFormId "__toHtml" a <@ Display) (mkHSt emptyFormStates (abort "illegal call to toHtml!\n")) //# (na,_) = mkForm (Set,mkFormId "__toHtml" a <@ Display) (mkHSt emptyFormStates (abort "illegal call to toHtml!\n"))
# (na,_) = mkForm (Set,mkFormId "__toHtml" a <@ Display) (mkHSt emptyFormStates dummy)
= BodyTag na.form = BodyTag na.form
where
dummy = { worldC = abort "dummy world for toHtml!\n"
, inout = [# !]
, gerda = abort "dummy gerda for toHtml!\n"
, datafile = abort "dummy datafile for toHtml!\n"
}
toHtmlForm :: !(*HSt -> *(Form a,*HSt)) -> [BodyTag] | gForm{|*|}, gUpd{|*|}, gPrint{|*|}, gParse{|*|}, TC a toHtmlForm :: !(*HSt -> *(Form a,*HSt)) -> [BodyTag] | gForm{|*|}, gUpd{|*|}, gPrint{|*|}, gParse{|*|}, TC a
toHtmlForm anyform toHtmlForm anyform
//# (na,hst) = anyform (mkHSt emptyFormStates (abort "illegal call to toHtmlForm!\n"))
# (na,hst) = anyform (mkHSt emptyFormStates (abort "illegal call to toHtmlForm!\n")) # (na,hst) = anyform (mkHSt emptyFormStates (abort "illegal call to toHtmlForm!\n"))
= na.form = na.form
where
dummy = { worldC = abort "dummy world for toHtmlForm!\n"
, inout = [# !]
, gerda = abort "dummy gerda for toHtmlForm!\n"
, datafile = abort "dummy datafile for toHtmlForm!\n"
}
toBody :: (Form a) -> BodyTag toBody :: (Form a) -> BodyTag
toBody form = BodyTag form.form toBody form = BodyTag form.form
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment