mktany2k / funcito

Automatically exported from code.google.com/p/funcito
0 stars 0 forks source link

does InvocationManager need a full-blown stack? #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I've realized that InvocationManager doesn't really need a Stack. It is simply 
pushing/popping one item.

I've written a version where InvocationManager simply holds an Invokable. All 
the tests pass. This seems simpler to understand and will be somewhat faster. 
It will also be easier to lock down for thread-safety, if we choose.

Is there any reason to use a Stack? e.g. for future design/features?

Original issue reported on code.google.com by codeto...@gmail.com on 26 Nov 2011 at 10:53

GoogleCodeExporter commented 9 years ago
The new version could be considered a Toggle. You can do a get() and put() but 
they must be called in the proper order.

Original comment by codeto...@gmail.com on 26 Nov 2011 at 1:35

GoogleCodeExporter commented 9 years ago
yeah, I have been pondering that ever since I put it in.  If you have a 
simplification, then go for it.

Original comment by kandpwel...@gmail.com on 29 Nov 2011 at 6:59

GoogleCodeExporter commented 9 years ago
Sounds fun... I'm on it

Original comment by codeto...@gmail.com on 30 Nov 2011 at 12:28

GoogleCodeExporter commented 9 years ago
I've introduced InvokableState which is a simple wrapper around a pointer. 
Quite minimalist, though not thread-aware.

Tests for InvocationManager pass untouched and new tests for InvokableState.

Original comment by codeto...@gmail.com on 30 Nov 2011 at 1:30

GoogleCodeExporter commented 9 years ago
Looks great.

Original comment by kandpwel...@gmail.com on 30 Nov 2011 at 6:01