I agree, my prop was low level, yours is higher level (extensible)<br /> <br /> Nicolas<br /><br />Diego Fernandez:<br /> <blockquote style="border-left: 1px solid blue; border-right: 1px solid blue; margin: 10px">&gt; My proposition is:<br /> &gt;<br /> &gt; Number&gt;&gt;readFrom: aStringOrStream<br /> &gt;     ^self readFrom: aStringOrStream ifFail: [^self error: &#39;cannot read a<br /> &gt; number&#39;]<br /> &gt;<br /> &gt; If nil is what you want, you will have to write:<br /> &gt;     value := Number readFrom: aStream ifFail: [nil].<br /> &gt; A little longer than your proposition:<br /> &gt;     value := Number readfrom: aStream.<br /> <br /> The mine is:<br /> Number&gt;&gt;readFrom: aStringOrStream<br />       ^NumberParser new parse: aStringOrStream<br /> <br /> NumberParser&gt;&gt;parse: aStringOrStream<br />        &quot;on failure&quot;<br />         NumberParsingException signal<br />         &quot;or just ParseException&quot;<br /> <br /> I think that #readFr
 om: must be an extension of Number.<br /> So if you want more control of the parsing you can configure an<br /> instance of NumberParser.<br /> (may be you can have a FortranNumberParser :)).<br /> </blockquote>
<br><br><hr style="border:0;height:1px;color:#d1d1db;background-color:#d1d1db;">
<table cellpadding=0 cellspacing=0><tr><td><a href="http://web.ifrance.com/"><img border=0 align=left src="http://image.ifrance.com/mail/colibri.gif"></a></td>
<td style="line-height:7px"><a href="http://web.ifrance.com/" style="line-height:11px;font-family:arial;font-size:11px;color:#1b174a;text-decoration:none"><b><span style="color:#9b90d5">i</span>FRANCE</b></a>
<br><a href="http://web.ifrance.com/services/" style="line-height:6px;font-family:arial;font-size:11px;color:#1b174a;text-decoration:none">exprimez-vous !</a></td></tr></table>