<br><br><div class="gmail_quote">2009/11/24 Colin Putney <span dir="ltr">&lt;<a href="mailto:cputney@wiresong.ca">cputney@wiresong.ca</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="im"><br>
On 23-Nov-09, at 10:41 PM, Denis Kudriashov wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/11/21 Colin Putney &lt;<a href="mailto:cputney@wiresong.ca" target="_blank">cputney@wiresong.ca</a>&gt;<br>
I really need to rewrite the tutorial to de-emphasize paths. You should use FSReference for everything. Once I get Eliot&#39;s suggestion implemented, the above will be:<br>
<br>
ref := FSReference D / &#39;Squeak&#39; / &#39;3.10&#39;.<br>
<br>
Hi<br>
<br>
I don&#39;t like global objects referencess in code. I cant mock global object in tests.<br>
I like VW dsl for that. For FileSystem it&#39;s can be:<br>
<br>
&#39;d://squeak/3.10&#39; asFileReference.<br>
</blockquote>
<br></div>
I&#39;m not sure I follow. The only global here is the class FSReference. #D is an instance creation method. I don&#39;t see how the message you suggest is any more flexible. You can&#39;t mock out the implementation of asFileReference any more easily than that of #D, right?</blockquote>

<div><br>No. But maybe it&#39;s not really problem. For method<br><br>writeMessageTo: filename<br>  FSReference / filename writeStreamDo: [:s | ... ]<br>  <br>I can&#39;t mock writing data to real file. <br>But I can rewrite this method with &quot;filename&quot; as FSReference:<br>

<br>writeMessageTo: filename<br>
  filename writeStreamDo: [:s | ... ]<br><br>And now I can mock this behavior by pass mockobject as filename instead of real FSReference.<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">

</blockquote>
And I think syntax based on strings more simple and elegant:<br>
<br>
&#39;smalltalk&#39; \ &#39;squeak&#39; \ &#39;3.10&#39; writeStreamDo: [: f | ]<br><br>&#39;smalltalk\squeak&#39; \ &#39;3.10&#39; writeStreamDo: [: f | ]<br>
<br>
&#39;smalltalk\squeak&#39; asFileReference<font color="#888888"><br><br>
</font></div><div>And last expression will hide work with disks on windows (when we wrote <br>   &#39;c:/smalltalk&#39; asFileReference <br>or <br>  &#39;c:&#39; \ &#39;smalltalk&#39;  <br>)<br><br>I use message #\ because #/ already used in String protocol<br>

<br></div></div><br>