<br><br><div class="gmail_quote">On Mon, Jan 18, 2010 at 8:59 PM, Colin Putney <span dir="ltr">&lt;<a href="mailto:cputney@wiresong.ca">cputney@wiresong.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
On 2010-01-18, at 8:23 PM, Andreas Raab wrote:<br>
<br>
&gt; It&#39;s not. Check the comment:<br>
&gt;<br>
&gt;       [&#39;true&#39; asByteArray] -&gt; [&quot;Version 1.0 TTF file&quot;<br>
&gt;               &quot;<a href="http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html" target="_blank">http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html</a><br>
&gt;               The values &#39;true&#39; (0x74727565) and 0x00010000 are recognized by the Mac OS<br>
&gt;               as referring to TrueType fonts.&quot;<br>
&gt;               ^Array with: 0 &quot;only one font&quot;<br>
&gt;       ].<br>
&gt;<br>
&gt; Since this code has no performance implication whatsoever, I find &#39;true&#39; asByteArray vastly more readable and intention revealing than  #[116 114 117 101].<br>
<br>
</div>It&#39;s more intention revealing, yes. What I don&#39;t like is that it relies on the unspecified semantics of #asByteArray. If the implementation of String changes (and it&#39;s happened once in recent history, so it&#39;s not just a &quot;theoretical&quot; worry), then you may not get the bytes you were expecting.<br>

<br>
The code above specifies the intention, but not the actual bytes required. The exact byte sequence is important though, enough so that the author felt the need to specify it in the comment. I&#39;d rather see the exact bytes in the code, and the intention in the comment.<br>

<font color="#888888"><br>
Colin<br>
</font></blockquote></div><br><div>I agree, and hence why not:</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">       [#[ 16r74 &quot;t&quot; 16r72 &quot;r&quot; 16r75 &quot;u&quot; 16r65 &quot;e&quot; ] -&gt; [&quot;Version 1.0 TTF file&quot;<br>
               &quot;<a href="http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html" target="_blank" style="color: rgb(0, 0, 204); ">http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6.html</a><br>               The values &#39;true&#39; (16r74727565 in ascii) and 16r00010000 are recognized by the Mac OS<br>
               as referring to TrueType fonts.&quot;<br>               ^Array with: 0 &quot;only one font&quot;<br>       ].<br></span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">?  Use of 16r is to be preferred to 0x because this is a comment to be read by Smalltalk programmers.</span></font></div>