No matching definitions.

tourist/dsl

src/tourist/dsl.tur

Route type and HTTP method constructors.

Since: v0.1.0

defn

route-new

(route-new [method : cstr pat : int handler : int] :)

construct a Route from a compiled pattern handle.

methodHTTP method string: "GET", "POST", "PUT", "DELETE", or ""
for any-method matching
patthe route struct's generic payload slot as a raw :int: a
compiled Pattern bridged via (:: p :int) for real routes, 0
for middleware, or a sub-app handle for url-map!/cascade!
items (see tourist/routing). Kept :int precisely because the
slot is polymorphic across item kinds.
handlerTurmeric function value (fn [req :int] :int)

:int -- Route handle; free with route-free (which also frees pat)

(route-new "GET" (router-compile "/hello") my-handler)

Since: v0.1.0

defn

route-method

(route-method [r : int] :)

HTTP method string of a Route ("" means any).

r:int Route handle

:cstr -- e.g. "GET", "POST", or "" for any

Since: v0.1.0

defn

route-pattern

(route-pattern [r : int] :)

generic payload slot of a Route.

r:int Route handle

:int -- raw payload slot (a Pattern for real routes, 0 / sub-app handle otherwise)

Since: v0.1.0

defn

route-handler

(route-handler [r : int] :)

raw handler function value of a Route.

r:int Route handle

:int -- Turmeric function value; call via route-call-handler

Since: v0.1.0

defn

route-call-handler

(route-call-handler [r : int req : int] :)

invoke a Route's handler with a request.

r:int Route handle
req:int Request handle (from httpd/request or tourist ctx)

:int -- Response handle returned by the handler

(route-call-handler route req)

Since: v0.1.0 (TUR_APPLY1 dispatch: fat-closure ABI audit, 2026-06-23)

defn

route-free

(route-free [r : int] :)

release a Route handle, its compiled pattern and its handler.

r:int Route handle, or 0 (no-op)

:void

(route-free r)

Since: v0.1.0

defn

get!

(get! [pattern : cstr handler : (fn [Ctx])

declare a GET route.

patternroute pattern string, e.g. "/hello/:name"
handler(fn [Ctx] Response) request handler -- may capture

:int -- Route handle; consumed by tourist

(get! "/hello/:name"
    (fn [req] (text "hi")))

Since: v0.1.0

defn

post!

(post! [pattern : cstr handler : (fn [Ctx])

declare a POST route.

patternroute pattern string
handler(fn [Ctx] Response) request handler -- may capture

:int -- Route handle

Since: v0.1.0

defn

put!

(put! [pattern : cstr handler : (fn [Ctx])

declare a PUT route.

patternroute pattern string
handler(fn [Ctx] Response) request handler -- may capture

:int -- Route handle

Since: v0.1.0

defn

delete!

(delete! [pattern : cstr handler : (fn [Ctx])

declare a DELETE route.

patternroute pattern string
handler(fn [Ctx] Response) request handler -- may capture

:int -- Route handle

Since: v0.1.0

defn

any!

(any! [pattern : cstr handler : (fn [Ctx])

declare a route matching any HTTP method.

patternroute pattern string
handler(fn [Ctx] Response) request handler -- may capture

:int -- Route handle

(any! "/catch-all" (fn [req] (text "ok")))

Since: v0.1.0

Internal definitions
__route-alloc
__route-free-struct
__route-drop-handler
__handler->int