Use eval-expr not aser in handler dispatch
aser in SX doesn't have access to helper/now/state-get. eval-expr evaluates the body in the current env, returns the AST. The OCaml handler interception then calls aser server-side with the full env. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -41,9 +41,9 @@
|
||||
(params body closure)
|
||||
(if
|
||||
(or (nil? params) (empty? params))
|
||||
(aser body)
|
||||
(eval-expr body)
|
||||
(let
|
||||
((bindings (map (fn (p) (let ((name (if (symbol? p) (symbol-name p) (str p)))) (if (= name "&key") nil (if (= name "&rest") nil (let ((val (or (request-arg name) (request-form name)))) (list (make-symbol name) (or val nil))))))) (filter (fn (p) (let ((name (if (symbol? p) (symbol-name p) (str p)))) (and (not (= name "&key")) (not (= name "&rest"))))) params))))
|
||||
(let
|
||||
((let-form (list (quote let) (filter (fn (b) (not (nil? b))) bindings) body)))
|
||||
(aser let-form))))))
|
||||
(eval-expr let-form))))))
|
||||
|
||||
Reference in New Issue
Block a user