[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MIT-Scheme-users] Simple Client/Server
From: |
Matt Birkholz |
Subject: |
Re: [MIT-Scheme-users] Simple Client/Server |
Date: |
Mon, 27 Apr 2009 15:21:03 -0700 |
> On Mon, Apr 27, 2009 at 11:01 PM, Matt Birkholz
> <address@hidden> wrote:
> >> From: Amit Saha <address@hidden>
> >> Date: Mon, 27 Apr 2009 21:02:40 +0530
> >>
> [...] You intend to echo one line and disconnect? Don't feel like
> > closing the connection explicitly?
>
> I don't think I get what you say.. [...]
open-tcp-server-socket returns a port. You never close it. You only
pass it to read-line, once.
The manual says close-tcp-server-socket does not affect existing
connections. They will not be closed until Scheme exits (unless the
client closes its end).
> >> [...]
> >> Anything else I am missing?
> >
> > I cannot miss the "((let" in line 2. I rarely see that in code --
> > only when someone has a short (let ...) snippet that looks up a
> > procedure (for a fancy dispatch). My paren flasher suggests you are
> > passing it zero arguments. You don't get an error message before the
> > disconnect, about a bogus value that should be a procedure?
>
> No error message or bogus value. There was one extra '(' in ((let.. .
> I have removed it..
Hey, every paren is sacred! You did not remove an "extra" paren. You
removed a function call!
This is a function call: (proc arg1 arg2)
This is two function calls: ((proc arg1 arg2)). The first (inner) one
had better return a procedure expecting zero arguments!