ConversionNotFound infinite loop.

Tony Garnock-Jones tonyg at lshift.net
Fri Nov 4 12:28:36 PST 2005


This is a problem independent of a possible other problem to do with
sockets specifically.

Try this:

<blockquote>
c@(ConversionNotFound traits) describeOn: out
[
  out
   ; 'A suitable conversion method could not be found to convert between
these two objects:\n'
   ; [c source printString] on: ConversionNotFound do: [|:x| x exit:
'|||printString Failed|||']
   ; '\n'
   ; [c target printString] on: ConversionNotFound do: [|:x| x exit:
'|||printString Failed|||']
   ; '\n'.
].

1 conversionNotFoundTo: 2.
</blockquote>

It'll loop indefinitely. That's not what I expected! Note that the
following version, differing only in that the on:do: is split out into a
separate method, works as expected:

<blockquote>
root@(Root traits) printStringWithFailureTruncation
[
  [root printString] on: ConversionNotFound do: [|:x| x exit:
'|||printString Failed|||']
].

c@(ConversionNotFound traits) describeOn: out
[
  out
   ; 'A suitable conversion method could not be found to convert between
these two objects:\n'
   ; c source printStringWithFailureTruncation
   ; '\n'
   ; c target printStringWithFailureTruncation
   ; '\n'.
].
</blockquote>


Tony




More information about the Slate mailing list