# Do not understand this closure

**URL:** <https://rubytalk.org/t/do-not-understand-this-closure/30292>\
**Category:** ruby-talk\
**Created:** [24 August 2006 17:52 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292 "2006-08-24T17:52:01Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Matthew\_Johnson](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@Matthew\_Johnson](https://rubytalk.org/u/Matthew_Johnson)\
**Post date:** [25 August 2006 13:17 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/21 "2006-08-25T13:17:11Z")

</div>

> . . . except that in Lisps the () is list syntax, and the reason  
> closures and methods share that syntax is that everything is a list.  
> That's my understanding, anyway. Then again, I'm no Lisp expert.
> 
> On the other hand, Perl might be a good example of unified syntax for  
> methods and closures. In both cases, calling the thing involves a  
> dereferencing, for which -\>() is the syntax.

True, I was thinking of invocation and typed () where that doesn't apply to Lisp. The point was that in some languages invocation is accomplished in the same way since the two forms of definition are semantically equivalent. If I remember correctly (it has been quite a while since I've looked at Lisp and Scheme) this is actually a difference between Scheme and Lisp. Scheme has a single namespace for variable definitions and function definitions whereas in Common Lisp the two are separate. I actually much prefer the Scheme approach and consider it to be more beautiful and simple. The biggest barrier to something like this in Ruby (at least in 1.8.x) is that the parameters are handled slightly differently for the two (ex. procs cannot take a block).

Matthew

---

<div class="post-metadata">

**Author:** ![Chad\_Perrin1](https://avatars.discourse-cdn.com/v4/letter/c/977dab/32.png) [@Chad\_Perrin1](https://rubytalk.org/u/Chad_Perrin1)\
**Post date:** [25 August 2006 13:39 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/22 "2006-08-25T13:39:46Z")

</div>

I wasn't aware of that -- it seems like a pretty severe (if rarely  
imposing) limitation. At first glance, it also looks like a largely  
arbitrary limitation, though I'm pretty sure there are at least  
implementation issues involved, since last I checked the Ruby community  
doesn't seem to suffer from Guidoism (aka: lambdas are one line of code,  
period, because I say so, also period).

> **···**
>
> On Fri, Aug 25, 2006 at 10:17:11PM +0900, Matthew Johnson wrote:
> 
> > \>. . . except that in Lisps the () is list syntax, and the reason  
> > \>closures and methods share that syntax is that everything is a list.  
> > \>That's my understanding, anyway. Then again, I'm no Lisp expert.  
> > \>  
> > \>On the other hand, Perl might be a good example of unified syntax for  
> > \>methods and closures. In both cases, calling the thing involves a  
> > \>dereferencing, for which -\>() is the syntax.
> > 
> > True, I was thinking of invocation and typed () where that doesn't  
> > apply to Lisp. The point was that in some languages invocation is  
> > accomplished in the same way since the two forms of definition are  
> > semantically equivalent. If I remember correctly (it has been quite  
> > a while since I've looked at Lisp and Scheme) this is actually a  
> > difference between Scheme and Lisp. Scheme has a single namespace  
> > for variable definitions and function definitions whereas in Common  
> > Lisp the two are separate. I actually much prefer the Scheme  
> > approach and consider it to be more beautiful and simple. The  
> > biggest barrier to something like this in Ruby (at least in 1.8.x) is  
> > that the parameters are handled slightly differently for the two (ex.  
> > procs cannot take a block).
> 
> --  
> CCD CopyWrite Chad Perrin [[http://ccd.apotheon.org](http://ccd.apotheon.org) ]  
> print substr("Just another Perl hacker", 0, -2);

---

<div class="post-metadata">

**Author:** ![Gustav\_Railist](https://avatars.discourse-cdn.com/v4/letter/g/d2c977/32.png) [@Gustav\_Railist](https://rubytalk.org/u/Gustav_Railist)\
**Post date:** [9 September 2006 21:40 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/23 "2006-09-09T21:40:38Z")

</div>

Hey

I can't seem to get this simple DRb client to access the server over my network...  
I get a bad file descriptor error.  
############# The Client Script ################  
require 'drb'  
DRb.start\_service  
server = DRbObject.new(nil, "druby://#{ARGV.shift}")  
my\_id = server.initialize\_me  
puts my\_id

############# The Server Script ###############  
require 'drb'  
class PerformAlexaUpdate  
&nbsp;&nbsp;def initialize\_me  
&nbsp;&nbsp;&nbsp;&nbsp;return 'hello'  
&nbsp;&nbsp;end  
end  
h\_server = DRb::DRbServer.new 'druby://127.0.0.1:5555', PerformAlexaUpdate.new  
h\_server.thread.join

> **···**
>
> ###########################################
> 
> Any ideas will be greatly appreciated!
> 
> Thanks in advance,  
> Gustav

---

<div class="post-metadata">

**Author:** ![Matthew\_Johnson](https://avatars.discourse-cdn.com/v4/letter/m/3bc359/32.png) [@Matthew\_Johnson](https://rubytalk.org/u/Matthew_Johnson)\
**Post date:** [25 August 2006 14:32 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/24 "2006-08-25T14:32:26Z")

</div>

> I wasn't aware of that -- it seems like a pretty severe (if rarely  
> imposing) limitation. At first glance, it also looks like a largely  
> arbitrary limitation, though I'm pretty sure there are at least  
> implementation issues involved, since last I checked the Ruby community  
> doesn't seem to suffer from Guidoism (aka: lambdas are one line of code,  
> period, because I say so, also period).

This has been changed in Ruby 1.9 so it seems to open the possibility of changing things in the future (to a unified method and variable namespace), although I would be surprised if such a change were to happen.

Matthew

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [9 September 2006 23:39 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/25 "2006-09-09T23:39:44Z")

</div>

Gustav - Railist wrote:

> Hey
> 
> I can't seem to get this simple DRb client to access the server over my network...

...

> h\_server = DRb::DRbServer.new 'druby://127.0.0.1:5555',

What about using an eternally visible network interface, in place of loopback? (Or did you just put that in for the question to a public list?) Try druby://localhost:5555, for example.

> **···**
>
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

---

<div class="post-metadata">

**Author:** ![Francis\_Cianfrocca](https://avatars.discourse-cdn.com/v4/letter/f/7bcc69/32.png) [@Francis\_Cianfrocca](https://rubytalk.org/u/Francis_Cianfrocca)\
**Post date:** [10 September 2006 00:34 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/26 "2006-09-10T00:34:43Z")

</div>

An eternally visible network interface! I can't decide if that's every  
sysadmin's dream or nightmare.

Sorry, Joel, no offense meant, but I couldn't resist 🙂

> **···**
>
> On 9/9/06, Joel VanderWerf \<vjoel@path.berkeley.edu\> wrote:
> 
> > What about using an eternally visible network interface, in place of  
> > loopback?

---

<div class="post-metadata">

**Author:** ![Joel\_VanderWerf1](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@Joel\_VanderWerf1](https://rubytalk.org/u/Joel_VanderWerf1)\
**Post date:** [10 September 2006 02:02 UTC](https://rubytalk.org/t/do-not-understand-this-closure/30292/27 "2006-09-10T02:02:49Z")

</div>

Francis Cianfrocca wrote:

> **···**
>
> > On 9/9/06, Joel VanderWerf \<vjoel@path.berkeley.edu\> wrote:
> > 
> > > What about using an eternally visible network interface, in place of  
> > > loopback?
> > 
> > An eternally visible network interface! I can't decide if that's every  
> > sysadmin's dream or nightmare.
> > 
> > Sorry, Joel, no offense meant, but I couldn't resist 🙂
> 
> I am externally grateful to you for pointing that out 😉
> 
> --  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

[Previous page](https://rubytalk.org/t/do-not-understand-this-closure/30292.md?page=1)
