Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@JelF
Copy link
Contributor

@JelF JelF commented Jan 31, 2020

Closes #20

@JelF JelF requested a review from tycooon January 31, 2020 12:17
end

macro memoize def g; end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. It can be tested like expect(G.memoize(:g)).to eq :g
  2. Also via class-reader and @memoize_result = memoize def d, I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, but i want to avoid G modifications in specs.

I.e. i could use F, but when i call memoize on F, it will have F#m memoized

Copy link
Contributor

@AlexWayfer AlexWayfer Jan 31, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but i want to avoid G modifications in specs.

define_method is modification, but OK.

I.e. i could use F, but when i call memoize on F, it will have F#m memoized

That's why stabbing consts is better then global definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

define_method is modification, but OK.

Is is called before suite

That's why stabbing consts is better then global definition.

This PR does not point specs refactoring, but i agree with that a lot

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not point specs refactoring

I know, I know, just side notes.

@tycooon tycooon merged commit aaf7f62 into tycooon:master Jan 31, 2020
@tycooon
Copy link
Owner

tycooon commented Jan 31, 2020

Thanks for PR!

@JelF JelF deleted the return-method-name-from-memoize branch January 31, 2020 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

return method name from memoize

3 participants