[Lisp] Chapter 12 구조체(Structures)
·
Major/Lisp
1. Types - type & type-of : 어떤 데이터 타입인지 - (typep '변수 '데이터타입) = t/nil - (type-of '변수) = 데이터 타입리턴 - (typep #'list 'funtion) 함수는 #' 붙여줘야함 2. Structures - Structures: 내가 정의한 데이터타입 - DEFSTRUCT: 새로운 데이터 타입 정의 (defstruct starship (captain nil) (name nil) (speed 0) (condition ‘green) (shields ‘down)) (setf s1 (make-starship)) //구조체 선언 (starship-captain) //구조체안 변수 접근 - 응용 (defun alert (x) ;; causing a st..