This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun select (selector) | |
(remove-if-not selector *person-db*)) | |
(defun make-where-exprs (args) | |
(loop while args | |
collect `(equal (getf person ,(pop args)) ,(pop args)))) | |
(defmacro where (&rest args) | |
`#'(lambda (person) | |
(and ,@(make-where-exprs args)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CL-USER> (defun sample () | |
`#'(lambda () | |
(+ 3 5))) | |
CL-USER> (defmacro sample2 () | |
`#'(lambda () | |
(+ 3 5))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro five-macro (arg) | |
`(+ 5 ,arg)) | |
(macroexpand-1 '(five-macro 2) | |
> (+ 5 2) | |
(five-macro 2) | |
> 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun five-function () | |
'(+ 5 2)) | |
(five-function 2) | |
> (+ 5 2) | |
(eval (five-function 2)) | |
> 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro print-macro (arg) | |
`(print ,arg)) | |
(macroexpand-1 '(print-macro (+ 2 3))) | |
> (PRINT (+ 2 3)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun print-function (arg) | |
`(print ,arg)) | |
(print-function (+ 2 3)) | |
> (PRINT 5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defparameter *person-db* '((:name "Anster" :age 26 :address "Seoul"))) | |
(defun select (selector-fn) | |
(remove-if-not selector-fn *person-db*)) | |
(defun where (&key name age address) | |
#'(lambda (row) | |
(and | |
(if name (equal (getf row :name) name) t) | |
(if age (equal (getf row :age) artist) t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ (select (where :name "Anster")) | |
> ((:NAME "Anster" :AGE 26 :ADDRESS "Seoul")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro where (&rest args) | |
`#'(lambda (person) | |
(and ,@(loop while args | |
collect `(equal (getf person ,(pop args)) ,(pop args)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: cp949 -*- | |
from bs4 import BeautifulSoup | |
import urllib2 | |
import re | |
# print soup.original_encoding | |
# get all certification link | |
url = "http://www.hrd.go.kr/jsp/HRDP/HRDP300/HRDP310/HRDP311/HRDP311_2List.jsp?keco_cd=&keco_nm=&orderField=jm_nm&orderDir=asc&pageNo=1&jm_cd=&kecoM=&kecoS=&srchKey=&rowsPerPage=1000" | |
contents = urllib2.urlopen(url).read().decode('cp949', 'ignore') |
OlderNewer