Subject: Re: swi jpl character coding

From: Jan Wielemaker <[email-masked]>
Date: Mon, 18 Dec 2000 13:58:32 +0100

> Jan Wielemaker wrote:
> 
> > One problem might be the textual
> > representation of atoms containing illegal UTF-8 sequences.  It whould
> > be nice if write_canonical and read can deal with *any* Prolog term.
> 
> [including floats, and cyclic and recombinant terms please! :-]

You mean write_canonical should write floats at maximum precision?
See the Prolog flag `float_format' Cyclic terms don't have a textual
representation in the (ISO) syntax and (as discussed before) are so
poorly supported that writing is just a minor problem.

With recombinant you mean ?- X = foo(A), Y = bar(X,X). (i.e. a term
with shared subterms)?  Basically there is no way to distinguish this
from bar(foo(A), foo(A)), except if you use set_arg/3 to modify the
shared subterm.  You want this for compactness of the written term?

> > Assuming UTF-8 you could make the atom start with an illegal sequence
> > and add a foreign routine to return its type.
> 
> OK, that's neat: let's have UTF-8 for textual names, hooks for optional
> custom handling of non-UTF-8 atoms (with some default catch-all handling).

I wouldn't claim `neat'.  `Hacky but useful'?  One thing is you don't
want to know how Prolog stores its atoms.

> NB is there some de facto standard type system we should be using, e.g.
> those MIME type thingies?

depends on these types yoy want want to express, I would say.

	Regards --- Jan