Skip to content

Commit

Permalink
update: src/
Browse files Browse the repository at this point in the history
  • Loading branch information
netpyoung committed Feb 3, 2024
1 parent c54f677 commit 0015e42
Show file tree
Hide file tree
Showing 44 changed files with 431 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 들어가며

🚧 사이트 공사중입니다.
🚧 사이트 공사중입니다.

## Ref

- [wiki: Common Lisp](https://en.wikipedia.org/wiki/Common_Lisp)
3 changes: 3 additions & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# 기초

- [아톰](./basic/atom.md)
- [Cons](./basic/cons.md)
- [표현식](./basic/expression.md)
- [심볼](./basic/symbol.md)
- [주석](./basic/comment.md)
Expand All @@ -18,12 +19,14 @@
- [데이터 타입](./basic/type/type.md)
- [숫자](./basic/type/number.md)
- [불리언](./basic/type/boolean.md)
- [문자](./basic/type/char.md)
- [문자열](./basic/type/string.md)
- [배열](./basic/type/array.md)
- [벡터](./basic/type/vector.md)
- [해시테이블](./basic/type/hashtable.md)
- [구조체](./basic/type/structure.md)
- [map](./basic/map.md)
- [print](./basic/print.md)
- [파일 입출력](./basic/file.md)
- [바인드](./basic/bind.md)
- [패키지](./basic/package.md)
Expand Down
1 change: 1 addition & 0 deletions src/advanced/asdf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# asdf
1 change: 1 addition & 0 deletions src/advanced/debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 디버그
1 change: 1 addition & 0 deletions src/advanced/error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 에러
1 change: 1 addition & 0 deletions src/advanced/gensym.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# gensym
1 change: 1 addition & 0 deletions src/advanced/macro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 매크로
1 change: 1 addition & 0 deletions src/advanced/type-part2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 타입 part2
12 changes: 12 additions & 0 deletions src/basic/atom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 아톰

``` lisp
(atom 1)
;;=> T
(atom 'atom)
;;=> T
(atom nil)
;;=> T
```
1 change: 1 addition & 0 deletions src/basic/bind.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 바인드
1 change: 1 addition & 0 deletions src/basic/comment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 주석
1 change: 1 addition & 0 deletions src/basic/comparison.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 비교
1 change: 1 addition & 0 deletions src/basic/condition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 조건문
62 changes: 62 additions & 0 deletions src/basic/cons.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Cons

s-expression

cons cell

car cdr

cons가 아닌 것은 아톰


``` lisp
(atom (cons 1 2))
;;=> NIL
```

``` lisp
(consp '())
;;=> NIL
(consp '(1))
;;=> T
(consp '(1 . 2))
;;=> T
(consp '(1 2))
;;=> T
```

``` lisp
(type-of '())
;;=> NULL
(typep '() 'atom)
;;=> T
(type-of '(1))
;;=> CONS
(typep '() 'cons)
;;=> NIL
(typep '() 'list)
;;=> T
(typep '(1) 'cons)
;;=> T
(typep '(1) 'list)
;;=> T
(typep '(1 . 2) 'cons)
;;=> T
(typep '(1 . 2) 'list)
;;=> T
```

## 짚고 넘어가기

- `car` / `cdr`
- `first` / `rest`
- `cons`
- `consp
1 change: 1 addition & 0 deletions src/basic/expression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 표현식
1 change: 1 addition & 0 deletions src/basic/file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 파일 입출력
1 change: 1 addition & 0 deletions src/basic/function.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 함수
1 change: 1 addition & 0 deletions src/basic/lambda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 람다
1 change: 1 addition & 0 deletions src/basic/map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# map
1 change: 1 addition & 0 deletions src/basic/package.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 패키지
19 changes: 19 additions & 0 deletions src/basic/print.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# print


``` lisp
(setq a '(1 2 3 4 5 6))
;;=> (1 2 3 4 5 6)
(dotimes (i 7)
(let ((*print-length* i))
(format t "~&~D -- ~S~%" i a)))
;;>> 0 -- (...)
;;>> 1 -- (1 ...)
;;>> 2 -- (1 2 ...)
;;>> 3 -- (1 2 3 ...)
;;>> 4 -- (1 2 3 4 ...)
;;>> 5 -- (1 2 3 4 5 ...)
;;>> 6 -- (1 2 3 4 5 6)
;;=> NIL
```
1 change: 1 addition & 0 deletions src/basic/recursion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 재귀
1 change: 1 addition & 0 deletions src/basic/return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# return
1 change: 1 addition & 0 deletions src/basic/symbol.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 심볼
25 changes: 25 additions & 0 deletions src/basic/type/array.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 배열


``` lisp
(defparameter *array* (make-array '(2 4) :initial-element 0))
;;=> *ARRAY*
*array*
;; => #2A((0 0 0 0) (0 0 0 0))
(aref *array* 0 0)
;; => 0
(setf (aref *array* 0 0) 100)
;; => 100
*array*
;; => #2A((100 0 0 0) (0 0 0 0))
(setf (aref *array* 1 1) 100)
;; => 100
*array*
;; => #2A((100 0 0 0) (0 100 0 0))
```
1 change: 1 addition & 0 deletions src/basic/type/boolean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 불리언
19 changes: 19 additions & 0 deletions src/basic/type/char.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 문자

CHAR= 대소문자 구분
CHAR-EQUAL 대소문자 구분 x


| Numeric Analog | Case-Sensitive | Case-Insensitive |
| -------------- | -------------- | ----------------- |
| = | CHAR= | CHAR-EQUAL |
| /= | CHAR/= | CHAR-NOT-EQUAL |
| < | CHAR< | CHAR-LESSP |
| > | CHAR> | CHAR-GREATERP |
| <= | CHAR<= | CHAR-NOT-GREATERP |
| >= | CHAR>= | CHAR-NOT-LESSP |


## Ref

- [Practical Common Lisp - 10. Numbers, Characters, and Strings](https://gigamonkeys.com/book/numbers-characters-and-strings.html)
1 change: 1 addition & 0 deletions src/basic/type/hashtable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 해시테이블
96 changes: 96 additions & 0 deletions src/basic/type/number.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# 숫자

Integers
Ratios 분수
Floating-Point Numbers
Complex Numbers

integer
fixnum
bignum
ratio
ratio, rational, real, number, t



float
#C(a b)
#\char


most-positive-fixnum
most-negative-fixnum

| 진법 | | |
| ------ | --- | -------------------- |
| 2진법 | #b | `b`inary |
| 8진법 | #o | `o`ctal |
| 16진법 | #x | he`x`adecimal |
| N진법 | #Nr | 여기서 N은 임의의 수 |

| 부동 소수점 | |
| ----------- | -------------- |
| s | `s`hort-float |
| f | single-`f`loat |
| d | `d`ouble-float |
| l | `l`ong-float |

## 복소수

`a + bi == (complex a b) == #C(a b)`

``` lisp
(type-of #C(1 2))
;;=> (COMPLEX (INTEGER 1 2))
(typep #C(1 2) 'complex)
;;=> T
(complex 1 2)
;;=> #C(1 2)
(* #C(1 2) #C(1 2))
;;=> #C(-3 4)
(complexp #C(1 2))
;;=> T
```

1+
1-
incf
decf
min
max
minusp / zerop / plusp
evenp / oddp

LOG
EXP
EXPT
SIN/COS/TAN
ASIN/ACOS/ATAN
쌍곡선 함수: SINH, COSH, 및 TANH
ASINH, ACOSH, 및 ATANH.



FLOOR
CEILING
TRUNCATE
ROUND
MOD
REM


isqrt, which returns the greatest integer less than or equal to the exact positive square root of natural.
gcd `G`reatest `C`ommon `D`enominator
lcm `L`east `C`ommon `M`ultiple.


## Ref

- [The Common Lisp Cookbook – Numbers](https://lispcookbook.github.io/cl-cookbook/numbers.html)
- [Common Lisp the Language, 2nd Edition - 2.1. Numbers](https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node16.html#SECTION00610000000000000000)
- [Practical Common Lisp - 10. Numbers, Characters, and Strings](https://gigamonkeys.com/book/numbers-characters-and-strings.html)

19 changes: 19 additions & 0 deletions src/basic/type/string.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 문자열


| Numeric Analog | Case-Sensitive | Case-Insensitive |
| -------------- | -------------- | ------------------- |
| = | STRING= | STRING-EQUAL |
| /= | STRING/= | STRING-NOT-EQUAL |
| < | STRING< | STRING-LESSP |
| > | STRING> | STRING-GREATERP |
| <= | STRING<= | STRING-NOT-GREATERP |
| >= | STRING>= | STRING-NOT-LESSP |


:start1
:end1
:start2
:end2

(string= "foobarbaz" "quuxbarfoo" :start1 3 :end1 6 :start2 4 :end2 7)
17 changes: 17 additions & 0 deletions src/basic/type/structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 구조체


``` lisp
(defstruct Hello
a
b)
(make-Hello :a 1 :b 2)
```

;; :conc-name

## 짚고 넘어가기

- defstruct
- make-Blabla
Loading

0 comments on commit 0015e42

Please sign in to comment.