Lack is a Common Lisp library which allows web applications to be constructed of modular components. It was originally a part of [Clack](https://github.com/fukamachi/clack), however it's going to be rewritten as an individual project since Clack v2 with performance and simplicity in mind.
The scope is defining Lack applications and wrapping it up with Lack middlewares. On the other hand, [Clack](https://github.com/fukamachi/clack) is an abstraction layer for HTTP and HTTP servers and provides unified API.
## Warning
This software is still BETA quality. The APIs are being finalized.
- The HTTP request method: `:GET`, `:HEAD`, `:OPTIONS`, `:PUT`, `:POST`, or `:DELETE`.
-`:script-name` (Required, String)
- The initial portion of the request URI path that corresponds to the Clack application. The value of this key may be an empty string when the client is accessing the application represented by the server's root URI. Otherwise, it is a non-empty string starting with a forward slash (`/`).
- The remainder of the request URI path. The value of this key may be an empty string when you access the application represented by the server's root URI with no trailing slash.
An application returns a list of three elements for a normal request, which respectively expresses an HTTP status code, headers, and response body data.
The status code must be an integer greater than or equal to 100, and should be an HTTP status code as documented in [RFC 2616](https://www.ietf.org/rfc/rfc2616.txt).
The headers must be a property list. If the same key name appears multiple times in it, those header lines will be sent to the client separately (e.g. multiple `Set-Cookie` lines).
The response body must be returned from the application in one of three formats, a list of strings, a list of byte vectors, or a pathname.
### Delayed Response and Streaming Body
Lack allows applications to provide a callback-style response instead of the three-element list. This allows for a delayed response and a streaming body.
To enable a delayed response, the application should return a callback as its response.
An application may omit the third element (the body) when calling the responder. If the body is omitted, the responder will return a function which takes a body chunk and `:close` keyword argument.
This delayed response and streaming API is useful if you want to implement a non-blocking I/O based server streaming or long-poll Comet push technology.