mirror of
https://github.com/vale981/myway
synced 2025-03-04 17:31:41 -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
|
||||
:route
|
||||
:make-route)
|
||||
(:import-from :myway.util
|
||||
:function-name)
|
||||
(:export :make-mapper
|
||||
:connect
|
||||
:next-route
|
||||
|
@ -28,8 +26,7 @@
|
|||
:make-route))
|
||||
(in-package :myway)
|
||||
|
||||
(defun connect (mapper url fn &key (method '(:GET)) regexp (name (when (functionp fn)
|
||||
(function-name fn))))
|
||||
(defun connect (mapper url fn &key (method '(:GET)) regexp name)
|
||||
(add-route mapper
|
||||
(make-route url
|
||||
:method method
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
(:use :cl)
|
||||
(:import-from :cl-utilities
|
||||
:with-collectors)
|
||||
(:export :make-collector
|
||||
:function-name))
|
||||
(:export :make-collector))
|
||||
(in-package :myway.util)
|
||||
|
||||
(defun make-collector ()
|
||||
|
@ -16,20 +15,3 @@
|
|||
(unless (eq data none)
|
||||
(buffer data))
|
||||
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