연휴이고 하니 뜬금없이 LISP 공부중인데 전에도 이해 못했고 이번에도 이해 못하고 있는 lisp -_-
LISP는 LISt Process 의 약자로
이름대로 모든것으로 LIST 에 기반하여 표현하게 되며, 리스트는 () 로 둘러쌓여 표현된다.
이러한 이유로 lisp 소스를 보면 ()가 가득히 둘러쌓여 가독성이 떨어지는 형태가 된다.
또한 리스트에서 계산등은 모두 전위표기법을 사용하게 되며 기본 연산은 다음과 같이 표현된다.
CL-USER>(+ 1 2 ) ; 1 + 2
3
CL-USER> (- 1 2 ) ; 1 - 2
-1
CL-USER> (/ 1 2) ; 1 / 2
1/2
CL-USER> (* 1 2) ; 1 * 2
2
CL-USER> (mod 3 2) ; 3 % 2
1
CL-USER> (log 2) ; log(2)
0.6931472
CL-USER> (sqrt 2) ; sqrt(2)
1.4142135
CL-USER> (< 1 2) ; 1 < 2
T
그리고 기호를 가지는 변수(?)는 setq 명령어를 이용하여 선언한다.
val을 입력하면 해석할 수 없는 변수이기 때문에 에러가 나지만 setq를 통해서 값을 정해주면
val만 입력해도 입력했던 값이 나오게 된다.
CL-USER> val
Invoking restart: Return to sldb level 2.
; Evaluation aborted on #<UNBOUND-VARIABLE #xC7B642E>.
CL-USER> (setq val 100)
100
CL-USER> val
100
CL-USER> (setq str "This is test string")
"This is test string"
CL-USER> str
"This is test string"
아무튼 defvar 라는 키워드를 이용해서 변수를 선언 할수도 있는데 setq와는 다르게 리턴되는 값이 다르다
CL-USER> (defvar loop 10)
LOOP
CL-USER> loop
10
함수는 defun (DEFine + FUNction 인 듯?)을 통해서 선언이 가능하다.
단순하게 3을 리턴하는 함수로 three 라는 것을 만드는 예제이다.
> (defun three () 3)
THREE
> (three)
3
> (+ (three) 1)
4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> three()
error: unbound variable - THREE
> three
error: unbound variable - THREE
> (+ three 1)
error: unbound variable - THREE
인자를 사용하는 함수로 인자는 아래와 같이 사용한다.
CL-USER> (defun add (x y) (+ x y))
ADD
CL-USER> (add 3 4)
7
리스트는 아래와 같이 '을 먼저 찍고 해주면 된다. (아직 이해 부족.. OTL)
물론 리스트도 setq로 선언하여 사용이 가능하다.
> '(1 2 3)
(1 2 3)
> (1 2 3)
error: bad function - 1
'/어포스트로피/apostrophe
'foo는 (quote foo) 와 동일하고 s expression 에서 함수가 아닌 것으로 해석하도록 하는 명령어이다.
어떻게 보면 변수로 인식시킨다고 해야 하려나? replace 라고 된것을 보면 -_-
Creating sets (actually, creating variables) can be done with setf : this creates a set called learned with three members:
(setf learned '(VB C++ LISP))
The apostrophe is uses to designate that something in brackets isn't a function (or an S-expression). Basically, if LISP receives something like (VB C++ LISP) it assumes VB is the name of a function and C++ and LISP are its arguments. The apostrophe says that this isn't a function, it's a list, and can itself be an argument in a function.
매번 헷갈리는게 이 핀이 위에서 보는건지 아래서 보는건지 알수가 없다는거 -_-
아무튼, 여러개를 동시에 보니 항상 같은 배열이고, 5번 쪽에 구멍이 뚫린것을 봐서는
보드 기준 위에서 아래로 내려다 보고 만든 핀 배열인 것으로 생각이 된다.
만약 커넥터측의 회로를 만들어서 떔질을 한다면 아래에서 위로 보고 좌우가 뒤집히게 결선을 해야 할려나?
winehq faq에 의하면 다시 마운트 해서 하라는데, 그런다고 해서 CD 내용이 달라지는 것도 아닐테고..
그냥 복사해서 해봐야 할 듯?
6.2. I double-clicked on an .exe file, but the system said "The file foo.exe is not marked as executable..."
If the dialog says "Read about the executable bit", with a hyperlink, try clicking on the hyperlink and reading about the executable bit.
If the file is on your hard drive, right-click it, choose Properties / Permissions, and check "Allow executing file as program".
If the file is on a CD-ROM, you can run it from the commandline as described above. Or, if you know how to use 'mount', remount the cd-rom to mark all files as executable with a command like mount -o remount,mode=0777,exec /media/cdrom but using the real mount point if it's different from /media/cdrom.
This is the default table (if no -t option is passed). It contains the built-in chains INPUT (for packets destined to local sockets), FORWARD (for packets being routed through the box), and OUTPUT (for locally-generated packets).
nat:
This table is consulted when a packet that creates a new connection is encountered. It consists of three built-ins: PREROUTING (for altering packets as soon as they come in), OUTPUT (for altering locally-generated packets before routing), and POSTROUTING (for altering packets as they are about to go out).
mangle:
This table is used for specialized packet alteration. Until kernel 2.4.17 it had two built-in chains: PREROUTING (for altering incoming packets before routing) and OUTPUT(for altering locally-generated packets before routing). Since kernel 2.4.18, three other built-in chains are also supported: INPUT (for packets coming into the box itself),FORWARD (for altering packets being routed through the box), and POSTROUTING (for altering packets as they are about to go out).
raw:
This table is used mainly for configuring exemptions from connection tracking in combination with the NOTRACK target. It registers at the netfilter hooks with higher priority and is thus called before ip_conntrack, or any other IP tables. It provides the following built-in chains: PREROUTING (for packets arriving via any network interface)OUTPUT (for packets generated by local processes)
1. 그걸 알면 이러고 있겠습니까?
2. 그걸 알면 이미 죽었겠죠. 목표를 찾아서 이룩했는데 무슨 재미로 사나요
3. 아버님은요?
이런 오만 개드립 시뮬레이션 중 게임이 떠오르는데...
아마도 신이 인간에게 있어 삶의 목표를 히든 퀘스트로 해서 준 이유는
목표가 태어나자 마자 뿅~ 하고 주어지고
그걸 달성하고 나면 의욕저하로 다들 뒈질테니 적당하게 숨겨놓고는 목표를 찾아봐라~ 이러는거 아닐까? 라는 망상 -_-
솔찍히 인생이 퀘스트가 주어지는대로 사는것도 아니고
어떤 목적이나 목표가 주어진다고 하면 그것만 달성하면 전역시켜주지 않는 말년병장의 느낌일것 같은데
오히려 그러한 목적이 숨겨지거나 정해지지 않음으로서
인생의 즐거움을 주려는 창조주의 선물이 아닐까? 라는 생각이 들었다.
만약, 정말 노력해서 인생의 목표나 목적을 알아냈고 달성했다면
살아갈 이유나 가치가 있을까? 자살하지 않을까?
+
만약 찾는다고 해도. 그게 정답인지 알 수 없고
만약 찾는다고 해도, 미련으로 인해 놓칠 수도 있고
만약 찾는다고 해도, 더 좋은게 있을꺼라는 희망으로 놔버릴 수도 있고
결국은 사악한 작가(창조주)의 독자들이 싫어하는 열린 결말?