-
-
Notifications
You must be signed in to change notification settings - Fork 40
add atRow: method for PMMatrix #201
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
Conversation
|
|
||
| ] | ||
|
|
||
| { #category : #'cell accessing' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any programmer tests to write here, @rakki-18 ? I seems simple enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemalvarambhia Yeah sure, I will write some tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hemalvarambhia Yeah sure, I will write some tests.
TYSM
hemalvarambhia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments. Would appreciate your thoughts.
src/Math-Matrix/PMMatrix.class.st
Outdated
| ] | ||
|
|
||
| { #category : #'cell accessing' } | ||
| PMMatrix >> atRow: anInteger [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anInteger -> rowNumber . Here should be 0 index it, do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By cell accessing, you mean accessing a matrix element? If so, maybe that's a more domain-driven naming. Again, thoughts welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anInteger->rowNumber. Here should be 0 index it, do you think?
Yes, rowNumber makes more sense. But atColumn: method had the argument name as anInteger, so I thought it would be better to stick on to the same here also. Shall I change it to rowNumber?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By cell accessing, you mean accessing a matrix element? If so, maybe that's a more domain-driven naming. Again, thoughts welcome.
Yeah, cell accessing doesn't seem the exact category for this method but again I stuck on to this because atColumn: method also had the same category.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anInteger->rowNumber. Here should be 0 index it, do you think?Yes,
rowNumbermakes more sense. ButatColumn:method had the argument name asanInteger, so I thought it would be better to stick on to the same here also. Shall I change it torowNumber?
Yes please. It makes the code clearer, I think.
I would suggest you do the same for the argument name for atColumn. Great spot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By cell accessing, you mean accessing a matrix element? If so, maybe that's a more domain-driven naming. Again, thoughts welcome.
Yeah, cell accessing doesn't seem the exact category for this method but again I stuck on to this because
atColumn:method also had the same category.
Leave it as it is in this PR, and propose a separate one for improving the category name.
|
@hemalvarambhia I have made all the changes. Can you please check again now? |
hemalvarambhia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. One small change to make, and then merge at your leisure.
A nice small PR that was easy to review.
Thank you for taking my feedback on board. ❤️
src/Math-Matrix/PMMatrix.class.st
Outdated
| PMMatrix >> atColumn: acolumnNumber [ | ||
|
|
||
| ^ self columnAt: anInteger | ||
| ^ self columnAt: acolumnNumber |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aColumnNumber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I have corrected it.
|
I notice that it's master being merged to master. That looks odd. Is it intended, @rakki-18 ? If it was, normally our practise is to create a well named branch. |
Oh my bad, I will make a new branch for my PR from next time. |
The
PMMatrixclass did not have the methodatRow:initialised even though the methodatColumn:was initialised.The method,
atRow:is introduced through this PR.