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">> My proposition is:<br /> ><br /> > Number>>readFrom: aStringOrStream<br /> > ^self readFrom: aStringOrStream ifFail: [^self error: 'cannot read a<br /> > number']<br /> ><br /> > If nil is what you want, you will have to write:<br /> > value := Number readFrom: aStream ifFail: [nil].<br /> > A little longer than your proposition:<br /> > value := Number readfrom: aStream.<br /> <br /> The mine is:<br /> Number>>readFrom: aStringOrStream<br /> ^NumberParser new parse: aStringOrStream<br /> <br /> NumberParser>>parse: aStringOrStream<br /> "on failure"<br /> NumberParsingException signal<br /> "or just ParseException"<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>