Nicer haltOnce

Hi,

Yesterday we improved #haltOnce to be more like a “once” BreakPoint:

	-> state per *each* haltOnce send
		(this means you can put two in one method and they are independent)
	-> when putting a haltOnce, it is enabled by default
	-> The global menu entry just resets all haltOnce to be active again.

Interesting is how trivial this was to implement… in class Halt 
once
    | node |
    node := thisContext sender sender sourceNodeExecuted.
    (node hasProperty: #haltOnce) ifTrue: [^self]. 
    node propertyAt: #haltOnce put: true.
    ^ self signal.


This means, we get the AST node of the “haltOnce” message send. Then we put an annotation there.
To reset all (enable all), the global many just does:

	#haltOnce senders do: #recompile.

Done.

This will be in 60082.

	Marcus
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: