기타언어 (2) 썸네일형 리스트형 [LISP] 사용자 정의함수 ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※ 따로 LISP 컴파일러나 실행기를 다운받기 싫어서 online에서 진행 오른쪽상단의 [get started] -> [try lisp online] 을 눌러서 해당 command line에서 진행 https://common-lisp.net/ Welcome to Common-Lisp.net! Get started Welcome to Common-Lisp.net Introduction Welcome to the amazing world of Common Lisp, the programmable programming language. This site is one among many gateways to Co.. [LISP] LISt Process language 기본 함수 car : list의 맨 앞에 있는 원소 반환 (car '(a b c)) -> a cdr : 맨 앞에 있는 원소를 제외한 나머지 반환 (cdr '(a b c)) -> (b c) cons : list안에 넣어서 반환 (cons 'a '(b c)) -> (a b c) (cons '(a) '(b c)) -> ((a) b c) atom : atom이면 true (atom 'a) -> T (atom '(a)) -> NIL eq : 같으면 true 다르면 false * atom에만 적용 (eq 'a 'a) -> T (eq 'a 'b) -> NIL (eq '(a) '(a)) -> NIL 기본적으로 전위(prefix)표기 (+ 1 2 3) -> 6 (- 10 1 2) -> 7 (and (atom'a) (eq.. 이전 1 다음