html design questions
brian <briand-/[email protected]> Mon, 9 Apr 2007 20:49:58 -0700
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
I am working on an x3d/vrml97 module very similar, as you can
imagine, to the HTML module found in the smlnj-lib.
I was looking at the module and had some sml questions about it:
I've noticed a lot of this sort of thing:
structure CellVAlign =
struct
type align = string ref
val top = ref "TOP"
val middle = ref "MIDDLE"
val bottom = ref "BOTTOM"
val baseline = ref "BASELINE"
fun toString (ref s) = s
val fromString = match [top, middle, bottom, baseline]
end
Why are the vals assiged to sting ref instead of just a string ?
I'm also not clear on the point of using a structure. Why not just
use a type:
type CellVAlign = string
?
In any case a big thanks to whoever wrote it. It's going to be very
helpful !
Thanks
Brian
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV