Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add Integer#to_d #649

Merged
merged 3 commits into from
Apr 15, 2018
Merged

Add Integer#to_d #649

merged 3 commits into from
Apr 15, 2018

Conversation

hachi8833
Copy link
Member

Fixes #647

@ghost ghost assigned hachi8833 Apr 14, 2018
@ghost ghost added the in progress label Apr 14, 2018
@codecov
Copy link

codecov bot commented Apr 14, 2018

Codecov Report

Merging #649 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #649      +/-   ##
==========================================
+ Coverage   82.91%   82.92%   +0.01%     
==========================================
  Files          56       56              
  Lines        7486     7492       +6     
==========================================
+ Hits         6207     6213       +6     
  Misses       1026     1026              
  Partials      253      253
Impacted Files Coverage Δ
vm/integer.go 74.58% <100%> (+0.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 71edf12...22e5789. Read the comment docs.

vm/integer.go Outdated
Name: "to_d",
Fn: func(receiver Object, sourceLine int) builtinMethodBody {
return func(t *thread, args []Object, blockFrame *normalCallFrame) Object {
r := receiver.(*IntegerObject)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add argument check here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do that.

I also found that arg checks are missing in other methods so I'd add them in another PR.

vm/integer.go Outdated
Name: "to_d",
Fn: func(receiver Object, sourceLine int) builtinMethodBody {
return func(t *thread, args []Object, blockFrame *normalCallFrame) Object {
if len(args) > 1 {
Copy link
Member

Choose a reason for hiding this comment

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

why does it receive one argument? I don't see we use any here

Copy link
Member Author

Choose a reason for hiding this comment

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

I should've mentioned about #648

Copy link
Member

Choose a reason for hiding this comment

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

I think either you also implement the feature that requires the argument, or you set the limit to 0 until you're going to implement that

Copy link
Member Author

Choose a reason for hiding this comment

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

I see!

@st0012 st0012 added this to the version 0.1.10 milestone Apr 15, 2018
Remove temporal comments
@ghost ghost assigned st0012 Apr 15, 2018
@st0012 st0012 merged commit 583fecb into master Apr 15, 2018
@ghost ghost removed the in progress label Apr 15, 2018
@st0012 st0012 deleted the fix#647 branch April 15, 2018 16:49
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.

2 participants