(defun hello (a b) (setq ans (+ a b)) (message "Ans: %d" ans)) hello (hello 1 3) "Ans: 4"フォーマット
defun NAME ARGUMENT-LIST BODY-FORMSTable: defun の引数
| 引数 | 意味 |
| NAME | 関数名 |
| ARGUMENT-LIST | 引数リスト |
| BODY-FORMS | 関数の中身 |
HTTP Post する elisp を関数で定義すると下記のようになる
(defun http-post (server)
(setq proc (open-network-stream "http-proc" "*http-buffer*" server 80))
(set-process-coding-system proc 'binary 'binary)
(process-send-string
proc
(format (concat
"POST /test.php HTTP/1.0\r\n"
"Content-Type: application/x-www-form-urlencoded\r\n"
"Content-Length: 23\r\n"
"\r\n"
"fname=hello&lname=world"))))
http-post
(http-post "localhost")
nil
0 件のコメント:
コメントを投稿