tag:blogger.com,1999:blog-12753102.post7464984896315763556..comments2024-03-28T15:41:37.170-04:00Comments on Ben's Journal: In Support Of Multiple Return ValuesBen Simonhttp://www.blogger.com/profile/09833753747177544979noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-12753102.post-31544667046285652532009-06-08T17:39:37.515-04:002009-06-08T17:39:37.515-04:00Grant -
That's an excellent point about value...Grant -<br /><br />That's an excellent point about values conveying specific intent. I like it.<br /><br />-BenBen Simonhttps://www.blogger.com/profile/09833753747177544979noreply@blogger.comtag:blogger.com,1999:blog-12753102.post-19177013901097509962009-06-07T22:10:37.922-04:002009-06-07T22:10:37.922-04:00There are also other threads in comp.lang.scheme i...There are also other threads in comp.lang.scheme if you go looking.grant rettkehttps://www.blogger.com/profile/09439997834215273665noreply@blogger.comtag:blogger.com,1999:blog-12753102.post-32484352043758239972009-06-07T22:10:07.117-04:002009-06-07T22:10:07.117-04:00Hi Ben,
I am pro-values. The reason I like is tha...Hi Ben,<br /><br />I am pro-values. The reason I like is that it communicates to the reader your intent regarding that to which a function evaluates. <br /><br />You could have returned a list, but that would have told the user that you can return any number of results, including the empty list.<br /><br />You could have created a record (structure), but it really isn't structure data that you intend to reuse anywhere else (much like lambda functions). <br /><br />Enter values: you are documenting your intent. The only way to use those values is to bind them, so bam, you are done.<br /><br />You allude to PHP's list destructuring, but syntax really isn't the issue here as you could use PLT match or any of the other match libraries to do the same thing. I think what you are talking about is capturing intent, and that is what values does. <br /><br />That said, here are some wildly varying views on this:<br /><br />http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/ba8873b2f955af67/54ac3c381f9fed47?q=values+performance&lnk=ol&grant rettkehttps://www.blogger.com/profile/09439997834215273665noreply@blogger.com