help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Entering the whileTrue: object at the st> prompt causes a parser err


From: Paolo Bonzini
Subject: Re: Entering the whileTrue: object at the st> prompt causes a parser error
Date: Mon, 4 Jan 2021 23:50:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

On 04/01/21 22:06, Gary Highberger wrote:
ifTrue: works as expected, whileTrue: fails. Is this behavior known, expected?

st> (true) ifTrue: ['foobar']
'foobar'
st> (true) whileTrue: ['foobar']
Object: true error: did not understand #whileTrue:
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
True(Object)>>doesNotUnderstand: #whileTrue: (SysExcept.st:1448)
UndefinedObject>>executeStatements (a String:1)
nil
st>

Hi,

the receiver of #whileTrue: is a block.  The following works:

[true] whileTrue: ['foobar' printNl]

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]