Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Replace node constructors with explicit initialization #184

Merged
merged 3 commits into from
Aug 11, 2017
Merged

Conversation

smarr
Copy link
Owner

@smarr smarr commented Aug 11, 2017

This change removes a lot of trivial constructors and thus, reduces the boilerplate code for all primitives.

However, it comes at the additional complexity of non-final fields for the source section as well as the VM, where needed.
Furthermore, it needs extra calls to initialize(.) methods, which means we need to ensure things are initialized in the in the right order:

  1. set source section
  2. optionally, set the eager primitive flag
  3. set VM, i.e., context

With this order, initializations of breakpoints and other things that require source sections and the VM, are only safe in the last step, after setting the VM.

smarr added 3 commits August 9, 2017 15:18
- adapt primitive instantiation

Signed-off-by: Stefan Marr <git@stefan-marr.de>
Signed-off-by: Stefan Marr <git@stefan-marr.de>
- avoids duplicating the same knowledge
- gives us common interface for init, avoiding constructor
- add corresponding classes AritySystemOperation
- make sure to initialize nodes in the right order
  1. set source section
  2. optionally, set the eager primitive flag
  3. set VM, i.e., context
  With this order, initializations of breakpoints and other things that
  require source sections and the VM, are only safe in the last step,
  after setting the VM.

Signed-off-by: Stefan Marr <git@stefan-marr.de>
@smarr smarr force-pushed the prim-constructors branch from 2cbabed to bc4e21b Compare August 11, 2017 12:43
@smarr smarr added this to the v0.6.0 - Black Diamonds milestone Aug 11, 2017
@smarr smarr added the enhancement Improves the implementation with something noteworthy label Aug 11, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.028% when pulling bc4e21b on prim-constructors into 570195f on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 80.028% when pulling bc4e21b on prim-constructors into 570195f on master.

@smarr smarr changed the base branch from master to dev August 11, 2017 13:21
@smarr smarr merged commit 52c7832 into dev Aug 11, 2017
@smarr smarr deleted the prim-constructors branch August 11, 2017 13:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement Improves the implementation with something noteworthy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants