Re: html design questions
John Reppy <[email protected]> Tue, 10 Apr 2007 07:36:50 -0500
| Newsgroups | gmane.comp.lang.sml.smlnj |
|---|---|
| Message-ID | <[email protected]> |
I wrote this code, but it was a very long time ago. The use of substructures was to structure the name space. The use of refs was probably a way to make testing equality fast, but I suspect was unnecessary. If I were to do it again, I'd just use the Atom.atom type for the attributes. - John P.S. I've been working on a library for 3d graphics in SML (right now it only works on MLton, but I hope to port it to SML/NJ eventually). I've written a loader for obj files, but I'm interested in seeing your code when it is finished. On Apr 9, 2007, at 10:49 PM, brian wrote: > 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 > _______________________________________________ > Smlnj-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/smlnj-list > ------------------------------------------------------------------------- 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