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

Submitted a new version of puzzler 26 as puzzler 28 #58

Merged
merged 2 commits into from Nov 12, 2012
Merged

Conversation

demobox
Copy link
Collaborator

@demobox demobox commented Nov 7, 2012

Based on the original submission by Vassil Dichev

@demobox
Copy link
Collaborator Author

demobox commented Nov 11, 2012

@vdichev thoughts on this one..?

The motivation for this puzzler comes from interactions with Java libraries, where you may be tempted to "convert" to more "natural" Scala types by casting. In this particular case - <tt>java.lang.Integer</tt> to <tt>Int</tt> - the types are not <em>quite</em> the same, unfortunately, and this is ultimately the source of the puzzler.
</p>
<p>
Scala automatically handles convertions such as <tt>java.lang.Integer</tt> to <tt>Int</tt> using autoboxing. If you decompile the resuting code with a Java decompiler (<tt>scalac -Xprint:jvm</tt> outputs something different!) we get
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be "resulting"

@vdichev
Copy link

vdichev commented Nov 12, 2012

@demobox This looks very clean and concise! Thanks for taking the time to finish this through!

demobox added a commit that referenced this pull request Nov 12, 2012
Submitted a new version of puzzler 26 as puzzler 28
@demobox demobox merged commit d7ed641 into master Nov 12, 2012
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.

None yet

3 participants