<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 2/3/12 3:33 AM, Juan Jose Garcia-Ripoll wrote:
<blockquote
cite="mid:CANejTzr0+Gk1Jnk2ziwF+RnFsWksqU4c9usxM6xx0ud+jK2VGQ@mail.gmail.com"
type="cite">
<div class="gmail_quote">On Fri, Feb 3, 2012 at 1:40 AM, Raymond
Toy <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:toy.raymond@gmail.com">toy.raymond@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
1. You have to check after reading the string to see what it
contains. (I guess a very small compile-time cost.)<br>
</blockquote>
<div><br>
</div>
<div>Indeed the cost is very small and can be included in the
routine that reads the string into the buffer.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">2. Because I
didn't think any lisp did that, but it's not illegal to do so.<br>
3. It's a burden on the user if the type of a constant string
depends on what's in it. Being illiterate, I only know ASCII,
so, perhaps this isn't a problem in practice.<br>
</blockquote>
</div>
<br>
I implemented this because after I introduced Unicode all programs
began using 4 times more memory than non-unicode versions of it.
It is natural: symbols, strings, code, all data can be either
base-string or extended-strings and if the core does not try to
save space, everything defaults to the most expensive version.</blockquote>
<br>
Indeed. This is one reason why cmucl uses utf-16 strings. For
most users this is not a problem because most characters are in the
BMP.<br>
<br>
<blockquote
cite="mid:CANejTzr0+Gk1Jnk2ziwF+RnFsWksqU4c9usxM6xx0ud+jK2VGQ@mail.gmail.com"
type="cite"><br>
<div>I had a look at f2cl's code and the following code would more
or less fix it. There might be simpler ways, such as looking
only at PARAMETER statements, but my fortran is a bit rusty and
I do not know f2cl so well. Note also that one possible
optimization could be to use LOAD-TIME-VALUE around COERCE, for
those lisps that would not precompute the COERCE statement.</div>
</blockquote>
<br>
Thanks for this fix. I was looking for something a bit deeper in
the guts of f2cl, but this will probably be fine for now.<br>
<br>
Ray<br>
<br>
</body>
</html>