我以如下方式设置了调度表:
(setq hunchentoot:*dispatch-table*
(mapcar #'(lambda (regex-and-handler)
(hunchentoot:create-regex-dispatcher (first regex-and-handler)
(second regex-and-handler)))
(list (list "^/one$" #'page-one)
(list "^/two$" #'page-two))))现在,如果我重新定义函数page-one,*dispatch-table*仍然使用旧的定义,只有在重新计算(setq ...)表单时才使用新的定义。有没有办法让它选择新的函数定义?
发布于 2019-09-18 20:14:27
在计算列表时,使用函数名作为符号,而不是使用function (reader syntax #')将符号解析为函数对象。换句话说:
....
(list (list "^/one$" 'page-one)
(list "^/two$" 'page-two))))https://stackoverflow.com/questions/57992322
复制相似问题