Notification behavior different between VAST v7.0 and v8.5.2

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Notification behavior different between VAST v7.0 and v8.5.2

Dave Grems
I am porting an application that is currently on VA Smalltalk v7.0 to VA Smalltalk v8.5.2.  The majority of the port was successful, however, in initiating some of the unit tests, saw immediately there was a change in the behavior on the Notification class.  In VAST 7, If the Notification is triggered within some process, after the notification, the process (method) continues.  This is especially important to this application as it may log several Notifications within an editing loop.  In VAST v8.5.2, the process stops at the first Notification invocation rather than resuming the loop process.  This is best illustrated by the following code:

  | index |
 
  index := 0.
  [
  [ index <= 10 ]
    whileTrue: [
      index > 5 ifTrue: [ Notification signal: index asString ].
      index := index + 1.
      ].
  ] on: Notification do: [ :aNotification | Transcript show: 'Index = ', aNotification messageText; cr ].
  Transcript show: 'Done'.


When run in a VAST v7 environment, the following is displayed in the Transcript window:

Index = 6
Index = 7
Index = 8
Index = 9
Index = 10
Done


However, when run in VAST v8.5.2, the following is what is displayed in the Transcript:

Index = 6
Done


This is a significant departure from the Notification behavior in v7.0, especially when an instance method on Notification indicates the invoking process should be resumable.  Any help/advice would be greatly appreciated!

Thanks,
Dave Grems

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Notification behavior different between VAST v7.0 and v8.5.2

Marten Feldtmann-2
But

| index |
 
  index := 0.
  [
  [ index <= 10 ]
    whileTrue: [
      index > 5 ifTrue: [ Notification signal: index asString ].
      index := index + 1.
      ].
  ]
   on: Notification
   do: [ :aNotification |
           Transcript show: 'Index = ', aNotification messageText; cr.
           aNotification resume ].
  Transcript show: 'Done'.

works as expected ...

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Notification behavior different between VAST v7.0 and v8.5.2

Dave Grems
In reply to this post by Dave Grems
Perfect!  Thanks You!

On Tuesday, June 4, 2013 1:07:09 PM UTC-5, Dave Grems wrote:
I am porting an application that is currently on VA Smalltalk v7.0 to VA Smalltalk v8.5.2.  The majority of the port was successful, however, in initiating some of the unit tests, saw immediately there was a change in the behavior on the Notification class.  In VAST 7, If the Notification is triggered within some process, after the notification, the process (method) continues.  This is especially important to this application as it may log several Notifications within an editing loop.  In VAST v8.5.2, the process stops at the first Notification invocation rather than resuming the loop process.  This is best illustrated by the following code:

  | index |
 
  index := 0.
  [
  [ index <= 10 ]
    whileTrue: [
      index > 5 ifTrue: [ Notification signal: index asString ].
      index := index + 1.
      ].
  ] on: Notification do: [ :aNotification | Transcript show: 'Index = ', aNotification messageText; cr ].
  Transcript show: 'Done'.


When run in a VAST v7 environment, the following is displayed in the Transcript window:

Index = 6
Index = 7
Index = 8
Index = 9
Index = 10
Done


However, when run in VAST v8.5.2, the following is what is displayed in the Transcript:

Index = 6
Done


This is a significant departure from the Notification behavior in v7.0, especially when an instance method on Notification indicates the invoking process should be resumable.  Any help/advice would be greatly appreciated!

Thanks,
Dave Grems

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Notification behavior different between VAST v7.0 and v8.5.2

John O'Keefe-3
In reply to this post by Dave Grems
Dave -

The solution provided by Marten is exactly correct. This change in the behavior when falling out the bottom of a handler block for a class-based exception was made in V8.0.1 to achieve compatibility with other Smalltalk implementations (the ANSI Smalltalk standard does not address what this behavior should be). This change should have been covered by a page in our Migration Guide, but since I can't find such a page I will create it.

John

On Tuesday, June 4, 2013 2:07:09 PM UTC-4, Dave Grems wrote:
I am porting an application that is currently on VA Smalltalk v7.0 to VA Smalltalk v8.5.2.  The majority of the port was successful, however, in initiating some of the unit tests, saw immediately there was a change in the behavior on the Notification class.  In VAST 7, If the Notification is triggered within some process, after the notification, the process (method) continues.  This is especially important to this application as it may log several Notifications within an editing loop.  In VAST v8.5.2, the process stops at the first Notification invocation rather than resuming the loop process.  This is best illustrated by the following code:

  | index |
 
  index := 0.
  [
  [ index <= 10 ]
    whileTrue: [
      index > 5 ifTrue: [ Notification signal: index asString ].
      index := index + 1.
      ].
  ] on: Notification do: [ :aNotification | Transcript show: 'Index = ', aNotification messageText; cr ].
  Transcript show: 'Done'.


When run in a VAST v7 environment, the following is displayed in the Transcript window:

Index = 6
Index = 7
Index = 8
Index = 9
Index = 10
Done


However, when run in VAST v8.5.2, the following is what is displayed in the Transcript:

Index = 6
Done


This is a significant departure from the Notification behavior in v7.0, especially when an instance method on Notification indicates the invoking process should be resumable.  Any help/advice would be greatly appreciated!

Thanks,
Dave Grems

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/va-smalltalk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.