2017-04-20 1 views
0

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))) 
+0

저는 Lucrene을 모르지만 최근에 문제없이 cl-annot을 사용했습니다. doc에 명시된대로 파일의 시작 부분에 "(annot : enable-annot-syntax)"를 삽입 했습니까? 파일 구조에 대해 더 많은 정보를 제공 할 수 있습니까? –

+0

예 주석 구문을 활성화했습니다. 내 코드와 파일 구조에 대한 자세한 정보로 내 질문을 편집했습니다. – Ehvince

+0

그것은 원시인 프로젝트에서 발견 한'(syntax : use-syntax : annot)'과 함께 작동합니다. 왜 나처럼하지 마! – Ehvince

답변

0
: 나는 루체른의 프로젝트 창조자와 프로젝트를 생성, 이것은 내 주요 파일의 시작입니다

원시인 프로젝트에서 다른 표기법을 발견했습니다. 그것은 CL-ANNOT의 문서에 표시되지 않지만 작동합니다

(syntax:use-syntax :annot) 

나는 이제 C-c C-c 새로운 노선.

관련 문제