Coding style best practices (was: Re: [plt-scheme] Scheme program to serve files over HTTP)

From: Amit Saha (lists.amitsaha at
Date: Tue Jul 28 12:42:00 EDT 2009

Hello Noel, all:

Noel Welsh wrote:
> Some notes:

Thanks a lot for the comments.



> - In larger programs you'll want to record types in comments.  E.g.:
> ;; serve : Integer -> (-> Void)
> (define (serve port-no)
>   (define listener (tcp-listen port-no 5 #t))
>   (define (loop)
>     (accept-and-handle listener)
>     (loop))
>   (define t (thread loop))
>   (lambda ()
>     (kill-thread t)
>     (tcp-close listener)))

serve : Integer -> (-> Void)

So this indicates a procedure by the name 'serve' taking a Integer 
parameter and a 'Void' return type? However, here I am returning a 
procedure, right ?

Also, how would I specify more than one parameter? like serve : Integer, 
Integer-> (-> Void)

Is there such a styling guide available on the web?

Thanks again.


email: at
IRC: cornucopic on #scheme, #lisp, #math, #linux

Posted on the users mailing list.