[Ur] File I/O

Adam Chlipala adamc at impredicative.com
Tue Nov 1 09:34:11 EDT 2011


James Parker wrote:
> I'm currently an undergraduate at the University of Maryland and am starting a project using Ur/Web. I was wondering if there was a standard library for file reading and writing. I had read previously that users were expected to use C FFI for this functionality, but perhaps things have changed since then.
>    

As Marc noted, standard file IO APIs are incompatible with Ur/Web's 
transactional model.  I'm not a big fan of files, in any context.  If 
you explain what your underlying goal is, then we may be able to suggest 
good ways to achieve it in Ur/Web.

> One more thing I noticed is I get the following error when including "©" in xml tags:
>
> Unsupported XML character entity copy
> Parse failure
>
> I believe that this should be valid html.
>    

The error message isn't meant to suggest it's invalid HTML, but merely 
that the Ur/Web lexer doesn't support it yet.  I could copy-and-paste a 
table of all valid HTML entities into the Ur/Web lexer/parser source 
code.  Is that the best way to support all these little shorthands?  
(You're not losing expressive power, as far as I know, since the 
"&#NNN;" form is already supported.)



More information about the Ur mailing list