[Pharo-project] Play and crash

laurent laffont laurent.laffont at gmail.com
Wed Apr 13 16:16:24 CEST 2011


This works:

counter := Class new
              superclass: Object;
              addInstVarNamed: 'counter';
              compile: 'initialize
                           counter := 0';
              compile: 'counterString
                           ^ counter asString';
              compile: 'increment
                           counter := counter + 1.
                           self changed:#counterString';
              compile: 'decrement
                           counter := counter - 1.
                           self changed:#counterString';
              new.

(UITheme builder newColumn: {
  UITheme builder newLabelFor: counter getLabel: #counterString getEnabled:
nil.
  UITheme builder newRow: {
    UITheme builder newButtonFor: counter action: #increment label: '+'
help: nil.
    UITheme builder newButtonFor: counter action: #decrement label: '-'
help: nil.
  }
}) openInWindowLabeled: 'Counter example'.



This one crashes the VM (tried on PharoOneClick 1.2 OSX, Cog and StackVM):

(Class new
  superclass: StringMorph;
  compile: 'step self contents: Time now printString';
  new)
    openCenteredInWorld



Any idea ?



Laurent Laffont - @lolgzs <http://twitter.com/#!/lolgzs>

Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Blog: http://magaloma.blogspot.com/
Developer group: http://cara74.seasidehosting.st
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/pharo-project/attachments/20110413/72bef365/attachment.htm>


More information about the Pharo-project mailing list