The Artima Developer Community
Sponsored Link

Programming in Scala Forum
By-name parameters

1 reply on 1 page. Most recent reply: Nov 28, 2008 2:10 PM by Vladimir Kelman

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Vladimir Kelman

Posts: 46
Nickname: vkelman
Registered: Feb, 2008

By-name parameters Posted: Nov 27, 2008 10:20 AM
Reply to this message Reply
Advertisement
Could you explain please, why are "By-name parameters" called this way - "by-name"?
I understand how they work: they are like a hint to a compiler, that before a function invocation, a parameter myPAR should be expanded into function literal () => myPAR:

myAssert(5 > 3)
will be expanded into
myAssert(() => 5 > 3)


Vladimir Kelman

Posts: 46
Nickname: vkelman
Registered: Feb, 2008

Re: By-name parameters Posted: Nov 28, 2008 2:10 PM
Reply to this message Reply
I asked the same question on Nabble Scala - User forum and got several interesting answers. Maybe it would be good to use them for a footnote in some future redaction of "Programming in Scala"?

Flat View: This topic has 1 reply on 1 page
Topic: How does The Book sell so far? Previous Topic   Next Topic Topic: val similar to Java final?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use