cl-annot 주석을 사용하는 함수를 컴파일하는 방법은 무엇입니까?Slime에서 cl-annot을 사용하는 방법 (Lucerne에서 다른 뷰를 정의하는 방법)
사용 사례 :
Lucerne이 경로를 정의하는 데 사용은 :
@route app "/profile/:username"
(defview profile (username)
(let* ((user (utweet.models:find-user username))
;; The user's timeline
(user-tweets (utweet.models:user-tweets user))
;; Is the user viewing his own profile?
(is-self (string= (lucerne-auth:get-userid)
username)))
(render-template (+profile+)
:user user
:tweets (display-tweets user-tweets)
:is-self is-self)))
나는 그것이 하나 개의보기로 작업했다. 그러나 두 번째 글을 작성하고 C-c-c
으로 컴파일하면 작동하지 않습니다. 나는 이맥스에 대한 slime-annot.el
을 설치,하지만 난 단지 내가 처음에 (annot:enable-annot-syntax)
을 썼다 않았다
The variable @ROUTE is unbound. [Condition of type UNBOUND-VARIABLE]
얻을.
이렇게 차단 지점 :/어떻게 우리는 cl-annot을 사용하여 새로운 것을 정의 할 수 있습니까?
감사
는PS : related issue
편집 : 파일 구조에 대한 자세한 :
(in-package :cl-user)
(defpackage lucerne-books
(:use :cl
:lucerne
:cl-arrows
:str)
(:export :app)
(:documentation "Main lucerne-books code."))
(in-package :lucerne-books)
(annot:enable-annot-syntax)
;;; App
(defapp app
:middlewares ((clack.middleware.static:<clack-middleware-static>
:root (asdf:system-relative-pathname :lucerne-books #p"assets/")
:path "/static/")))
;;; Templates
(djula:add-template-directory
(asdf:system-relative-pathname :lucerne-books #p"templates/"))
(defparameter +index+ (djula:compile-template* "index.html"))
;;; Views
@route app "/" ;; first created: it works
(defview index()
(render-template (+index+)
:foo "you"))
@route app "/rst" ;; this view won't work, not accessible
(defview index()
(render-template (+index+)
:foo "rst"))
@route app "/following/:username" ;; this one neither
(defview user-following (username)
(let ((user username))
(render-template (+index+)
:foo user)))
저는 Lucrene을 모르지만 최근에 문제없이 cl-annot을 사용했습니다. doc에 명시된대로 파일의 시작 부분에 "(annot : enable-annot-syntax)"를 삽입 했습니까? 파일 구조에 대해 더 많은 정보를 제공 할 수 있습니까? –
예 주석 구문을 활성화했습니다. 내 코드와 파일 구조에 대한 자세한 정보로 내 질문을 편집했습니다. – Ehvince
그것은 원시인 프로젝트에서 발견 한'(syntax : use-syntax : annot)'과 함께 작동합니다. 왜 나처럼하지 마! – Ehvince