mirror of
https://github.com/vale981/myway
synced 2025-03-05 09:51:42 -05:00
Don't set a handler function name as an identifier.
This commit is contained in:
parent
a15c72ebd5
commit
f4d00bc0a6
2 changed files with 2 additions and 23 deletions
|
@ -11,8 +11,6 @@
|
||||||
(:import-from :myway.route
|
(:import-from :myway.route
|
||||||
:route
|
:route
|
||||||
:make-route)
|
:make-route)
|
||||||
(:import-from :myway.util
|
|
||||||
:function-name)
|
|
||||||
(:export :make-mapper
|
(:export :make-mapper
|
||||||
:connect
|
:connect
|
||||||
:next-route
|
:next-route
|
||||||
|
@ -28,8 +26,7 @@
|
||||||
:make-route))
|
:make-route))
|
||||||
(in-package :myway)
|
(in-package :myway)
|
||||||
|
|
||||||
(defun connect (mapper url fn &key (method '(:GET)) regexp (name (when (functionp fn)
|
(defun connect (mapper url fn &key (method '(:GET)) regexp name)
|
||||||
(function-name fn))))
|
|
||||||
(add-route mapper
|
(add-route mapper
|
||||||
(make-route url
|
(make-route url
|
||||||
:method method
|
:method method
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
(:use :cl)
|
(:use :cl)
|
||||||
(:import-from :cl-utilities
|
(:import-from :cl-utilities
|
||||||
:with-collectors)
|
:with-collectors)
|
||||||
(:export :make-collector
|
(:export :make-collector))
|
||||||
:function-name))
|
|
||||||
(in-package :myway.util)
|
(in-package :myway.util)
|
||||||
|
|
||||||
(defun make-collector ()
|
(defun make-collector ()
|
||||||
|
@ -16,20 +15,3 @@
|
||||||
(unless (eq data none)
|
(unless (eq data none)
|
||||||
(buffer data))
|
(buffer data))
|
||||||
buffer)))))
|
buffer)))))
|
||||||
|
|
||||||
(defun function-name (fn)
|
|
||||||
(when (symbolp fn)
|
|
||||||
(return-from function-name fn))
|
|
||||||
#+ccl (ccl:function-name fn)
|
|
||||||
#-ccl
|
|
||||||
(multiple-value-bind (lambda closurep name) (function-lambda-expression fn)
|
|
||||||
(declare (ignore closurep))
|
|
||||||
(cond
|
|
||||||
(lambda nil)
|
|
||||||
((and (listp name)
|
|
||||||
(or (eq (car name) 'labels)
|
|
||||||
(eq (car name) 'flet)))
|
|
||||||
(cadr name))
|
|
||||||
((and (listp name)
|
|
||||||
(eq (car name) 'lambda)) nil)
|
|
||||||
(T name))))
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue