problem in porting from smalltalk

Lukas Renggli renggli at gmail.com
Thu Feb 23 19:47:02 UTC 2006


> This is in the spirit of whileTrue: optimization in VW.
> Of course, most senders of #and: would have to be rewritten with block
> receiver to profit by compiler optimization.

That doesn't make sense, #and: and #whileTrue: are completely
different constructs. See the difference when writing down the
execution path of a and b as regular expressions:

      a and: [ b ] -> ab?

      [ a ] whileTrue: [ b ] -> a(ba)*

There is no point in putting expressions into a block that are
executed exactly once. This also violates the SmallLint rule "Block
immediately evaluated".

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch



More information about the Squeak-dev mailing list