Skip to content

Commit

Permalink
update: lesson_11.md
Browse files Browse the repository at this point in the history
  • Loading branch information
netpyoung committed Jan 27, 2024
1 parent 6837c2a commit 9e7135f
Showing 1 changed file with 68 additions and 60 deletions.
128 changes: 68 additions & 60 deletions src/ch03/lesson_11.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

## READ๋Š” ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ๋ฅผ ๋ฐ›๋Š”๋‹ค.

๋ ˆ์Šจ 10์—์„œ ๋ดค๋˜๊ฒƒ์ฒ˜๋Ÿผ, `read`๋Š” ๋ฌธ์ž๋ฅผ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ๋กœ ๋ณ€ํ™˜์‹œํ‚ต๋‹ˆ๋‹ค. ์ด์ œ๊นŒ์ง€, ์šฐ๋ฆฌ๋“ค์€ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ ์—ฌ๋Ÿฌ ์ถœ๋ ฅ ๊ฐ’๋“ค์„ ๋ณด์•˜์Šต๋‹ˆ๋‹ค:
[๋ ˆ์Šจ 10](./lesson_10.md)์—์„œ ๋ดค๋˜๊ฒƒ์ฒ˜๋Ÿผ, `read`๋Š” ๋ฌธ์ž๋ฅผ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ๋กœ ๋ณ€ํ™˜์‹œํ‚ต๋‹ˆ๋‹ค. ์ด์ œ๊นŒ์ง€, ์šฐ๋ฆฌ๋“ค์€ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ ์—ฌ๋Ÿฌ ์ถœ๋ ฅ ๊ฐ’๋“ค์„ ์‚ดํŽด ๋ณด์•˜์Šต๋‹ˆ๋‹ค:

- ์‹ฌ๋ณผ๊ณผ ์ˆซ์ž
- ๋ฌธ์ž, ๋ฌธ์ž์—ด, ๋ฆฌ์ŠคํŠธ, ๋ฐฐ์—ด, ๋ฐฑํ„ฐ, ๊ตฌ์กฐ์ฒด
- ํ•ด์‰ฌํƒœ์ด๋ธ”

๋ฆฌ์Šคํ”„ ๋ฆฌ๋”๋Š” ๋ฌธ์ž์˜ ๋ถ„๋ฅ˜๋ฒ•(classifications)๋ฅผ ๋”ฐ๋ผ ์ผ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํ‘œ์ค€ ๋ถ„๋ฅ˜๋ฒ•์€ ์•„๋ž˜์— ๋‚˜์™€์žˆ์Šต๋‹ˆ๋‹ค. ๋ ˆ์Šจ 12์—์„œ ๋ณด๊ฒŒ๋  ๊ฒƒ์ฒ˜๋Ÿผ, ์—ฌ๋Ÿฌ๋ถ„์€ ํ•„์š”์— ๋”ฐ๋ผ ์ด๋Ÿฌํ•œ ๋ถ„๋ฅ˜๋ฒ•์„ ๋ฐ”๊ฟ€ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.
๋ฆฌ์Šคํ”„ ๋ฆฌ๋”(reader)๋Š” ๋ฌธ์ž ๋ถ„๋ฅ˜๋ฒ•(classifications)๋ฅผ ๋”ฐ๋ผ ์ด์™€ ๊ฐ™์€ ์ผ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํ‘œ์ค€ ๋ถ„๋ฅ˜๋ฒ•์€ ์•„๋ž˜์— ๋‚˜์™€์žˆ์Šต๋‹ˆ๋‹ค. [๋ ˆ์Šจ 12](./lesson_12.md)์—์„œ ๋ณด๊ฒŒ๋  ๊ฒƒ์ฒ˜๋Ÿผ, ์—ฌ๋Ÿฌ๋ถ„์€ ํ•„์š”์— ๋”ฐ๋ผ ์ด๋Ÿฌํ•œ ๋ถ„๋ฅ˜๋ฒ•์„ ๋ฐ”๊ฟ€ ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

``` txt
ํ‘œ์ค€ ๊ตฌ์„ฑ ๋ฌธ์ž(Standard Constituent Characters)
Expand All @@ -25,20 +25,20 @@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
ํ‘œ์ค€ ์ข…๋ฃŒ ๋งคํฌ๋กœ ๋ฌธ์ž(Standard Terminating Macro Characters)
-------------------------------------
" โ€™ ( ) , ; โ€˜
" ' ( ) , ; โ€˜
ํ‘œ์ค€ ๋น„-์ข…๋ฃŒ ๋งคํฌ๋กœ ๋ฌธ์ž(Standard Non-Terminating Macro Characters)
-----------------------------------------
#
ํ‘œ์ค€ ๋‹จ์ผ ์˜ˆ์™ธ ๋ฌธ์ž(Standard Single Escape Characters)
ํ‘œ์ค€ ๋‹จ์ผ ์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž(Standard Single Escape Characters)
---------------------------------
\
ํ‘œ์ค€ ๋‹ค์ˆ˜ ์˜ˆ์™ธ ๋ฌธ์ž(Standard Multiple Escape Characters)
ํ‘œ์ค€ ๋‹ค์ˆ˜ ์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž(Standard Multiple Escape Characters)
-----------------------------------
|
Expand All @@ -48,72 +48,79 @@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
<tab> <space> <page> <newline> <return> <linefeed>
```

`READ`๊ฐ€ ๊ตฌ์„ฑ๋ฌธ์ž(constituent character)๋กœ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด, ์ด๋Š” ์‹ฌ๋ณผ์ด๋‚˜ ์ˆซ์ž๋ฅผ ์ถ•์ ํ•ฉ๋‹ˆ๋‹ค. `READ`๊ฐ€ ์ข…๋ฃŒ ๋งคํฌ๋กœ ๋ฌธ์ž(terminating macro character)๋‚˜ ๊ณต๋ฐฑ ๋ฌธ์ž(whitespace character)๋ฅผ ๋งŒ๋‚˜๋ฉด, ์ด๋Š” ๋ชจ์•„์ง„ ๊ตฌ์„ฑ๋ฌธ์ž๋ฅผ ์šฐ์„  ์ˆซ์ž๋กœ, ๊ทธ ๋‹ค์Œ symbol๋กœ ์ดํ•ดinterpretํ•˜๋ ค ์‹œ๋„ํ•ฉ๋‹ˆ๋‹ค. ์ˆ˜์น˜ํ™” ํ•ด์„์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด, `READ`๋Š” ์ˆซ์ž๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด, `READ`๋Š” ์˜๋ฌธ์ž๋ฅผ standard case(๋ณดํ†ต์€ ๋Œ€๋ฌธ์ž)๋กœ ๋ฐ”๊พธ์–ด, ์‹ฌ๋ณผ๋กœ์จ ์ด๋ฆ„์„ internํ•˜์—ฌ, ์‹ฌ๋ณผ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
`READ`๊ฐ€ ๊ตฌ์„ฑ๋ฌธ์ž(constituent character)๋กœ ์‹œ์ž‘๋œ๋‹ค๋ฉด, ์ด๋Š” ์‹ฌ๋ณผ์ด๋‚˜ ์ˆซ์ž๋ฅผ ์ถ•์ ํ•˜๊ธฐ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. `READ`๊ฐ€ ์ข…๋ฃŒ ๋งคํฌ๋กœ ๋ฌธ์ž(terminating macro character)๋‚˜ ๊ณต๋ฐฑ ๋ฌธ์ž(whitespace character)๋ฅผ ๋งŒ๋‚˜๋ฉด, ์ด๋Š” ๋ชจ์•„์ง„ ๊ตฌ์„ฑ๋ฌธ์ž๋ฅผ ์šฐ์„  ์ˆซ์ž๋กœ, ๊ทธ ๋‹ค์Œ ์‹ฌ๋ณผ๋กœ ํ•ด์„ํ•˜๊ธฐ ์‹œ์ž‘ํ•ฉ๋‹ˆ๋‹ค. ์ˆซ์ž๋กœ ํ•ด์„์ด ๊ฐ€๋Šฅํ•˜๋‹ค๋ฉด `READ`๋Š” ์ˆซ์ž๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด, `READ`๋Š” ์˜๋ฌธ์ž๋ฅผ ํ‘œ์ค€๋ฌธ์ž(standard case (๋ณดํ†ต์€ ๋Œ€๋ฌธ์ž))๋กœ ๋ฐ”๊พธ์–ด, ์‹ฌ๋ณผ๋กœ์จ ์ด๋ฆ„์„ ์ธํ„ด(intern)ํ•˜์—ฌ ์‹ฌ๋ณผ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

์˜ˆ์™ธ๋ฌธ์ž(Escape characters)๋Š” ํŠน๋ณ„ํ•œ ์—ญํ™œ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํ•˜๋‚˜์˜ ์˜ˆ์™ธ๋ฌธ์ž๋Š” ๋‹ค์Œ์— ๋‚˜์˜ค๋Š” ๋ฌธ์ž๋ฅผ ๋งˆ์น˜ constituent character์ฒ˜๋Ÿผ ๋‹ค๋ฃจ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ๋ณดํ†ต ๊ณต๋ฐฑ์ด๋‚˜ ์ข…๋ฃŒ๋งคํฌ๋กœ๋ฌธ์ž๋กœ ์ทจ๊ธ‰๋˜๋Š” ๋ฌธ์ž๋Š” ์‹ฌ๋ณผ์˜ ์ผ๋ถ€๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. READ๊ฐ€ escape character๋ฅผ ๋งŒ๋‚˜๋ฉด, ์ˆซ์ž๋“ค๋กœ๋งŒ ๋œ๊ฒƒ์ด escape๋ ์ง€๋ผ๋„, constituents ๊ฒฐ๊ณผ๋ฅผ ์ˆซ์ž๋กœ interpret ํ•˜๋ ค ํ•˜์ง€ ์•Š์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค
์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž(Escape characters)๋Š” ํŠน๋ณ„ํ•œ ์—ญํ™œ์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํ•˜๋‚˜์˜ ์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž๋Š” ๋‹ค์Œ์— ๋‚˜์˜ค๋Š” ๋ฌธ์ž๋ฅผ ๋งˆ์น˜ ๊ตฌ์„ฑ๋ฌธ์ž(constituent character)์ฒ˜๋Ÿผ ๋‹ค๋ฃจ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. ๋ณดํ†ต ๊ณต๋ฐฑ์ด๋‚˜ ์ข…๋ฃŒ ๋งคํฌ๋กœ ๋ฌธ์ž๋กœ ์ทจ๊ธ‰๋˜๋Š” ๋ฌธ์ž๋Š” ์‹ฌ๋ณผ์˜ ์ผ๋ถ€๊ฐ€ ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด์Šค์ผ€์ดํ”„๋œ ๊ฒƒ์ด ์ˆซ์ž์ผ ์ง€๋ผ๋„, `READ`๊ฐ€ ์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž๋ฅผ ๋งŒ๋‚˜๋ฉด ๊ฒฐ๊ณผ๋ฅผ ์ˆซ์ž๋กœ ํ•ด์„ํ•˜๋ ค ํ•˜์ง€ ์•Š์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค

`READ`์‹œ ๋งคํฌ๋กœ ๋ฌธ์ž(macro character)๋กœ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด, ๋ฌธ์ž๋Š” ๋‹ค์Œ ๊ฒฝ์šฐ๋ฅผ ํŒ๋ณ„ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.
`READ`์‹œ ๋งคํฌ๋กœ ๋ฌธ์ž(macro character)๋กœ ์‹œ์ž‘ํ•œ๋‹ค๋ฉด, ์•„๋ž˜์˜ ๋ฌธ์ž๋“ค์ด ๋‹ค์Œ ๋‹จ๊ณ„๋ฅผ ๊ฒฐ์ •ํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค:

| ๋ฌธ์ž | ์„ค๋ช… |
| ---- | ----------------------------------------------- |
| " | ๋ฌธ์ž์—ด์„ ์ฝ๋Š”๋‹ค. |
| โ€™ | ํผ์„ ์ฝ๋Š”๋‹ค. |
| ' | ํผ์„ ์ฝ๋Š”๋‹ค. |
| ( | ๋ฆฌ์ŠคํŠธ๋ฅผ ์ฝ๋Š”๋‹ค. |
| ; | ์ƒˆ๋กœ์šด ๋ผ์ธ์„ ๋งŒ๋‚˜๊ธฐ ์ „๊นŒ์ง€ ๋ชจ๋“  ๊ฒƒ์„ ๋ฌด์‹œํ•œ๋‹ค. |
| # | ๋‹ค์Œ ๋‚˜์˜ค๋Š” ๋ฌธ์ž์— ๊ธฐ๋ฐ˜ํ•˜์—ฌ ๋ฌด์—‡์ธ์ง€ ๊ฒฐ์ •ํ•œ๋‹ค. |

๋งˆ์ง€๋ง‰์œผ๋กœ, ๋ช‡๋ช‡ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ๋Š” ์ฝ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, ํ•ด์‰ฌํ…Œ์ด๋ธ”์ด ์ถœ๋ ฅ๋˜์–ด ๋ณด์—ฌ์ง€๋Š” ๊ฒƒ์€ `#<HASH-TABLE>`์™€ ๊ฐ™์ด ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค. `#<` ๋ฌธ์ž๋กœ ์‹œ์ž‘ํ•˜๋Š” ์–ด๋– ํ•œ ๊ฒƒ์„ ์ฝ์œผ๋ คํ• ๋•Œ READ๋Š” ์—๋Ÿฌ๋ฅผ ๋‚ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
๋งˆ์ง€๋ง‰์œผ๋กœ, ๋ช‡๋ช‡ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ๋Š” ์ฝ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด, ํ•ด์‰ฌํ…Œ์ด๋ธ”์˜ ์ถœ๋ ฅ๊ฒฐ๊ณผ๋Š” `#<HASH-TABLE>`์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. `#<` ๋ฌธ์ž๋กœ ์‹œ์ž‘ํ•˜๋Š” ์–ด๋– ํ•œ ๊ฒƒ์„ ์ฝ์œผ๋ คํ• ๋•Œ `READ`๋Š” ์—๋Ÿฌ๋ฅผ ๋ฑ‰์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค.


## PRINT writes Lisp data for you and for READ
## PRINT๋Š” ์—ฌ๋Ÿฌ๋ถ„์„ ๊ทธ๋ฆฌ๊ณ  READ๋ฅผ ์œ„ํ•œ ๋ฆฌ์Šคํ”„ ๋ฐ์ดํ„ฐ๋ฅผ ์ž‘์„ฑํ•œ๋‹ค.

`print` ํ•จ์ˆ˜๋Š” ๋ฆฌ์Šคํ”„ ์˜ค๋ธŒ์ ํŠธ๋ฅผ, READ๊ฐ€ ์ด๋ฅผ ์žฌ๊ตฌ์„ฑํ•ด์•ผ๋งŒ ํ•˜๋Š”, ๋ฌธ์ž์—ด(sequence of characters)๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค:
`print` ํ•จ์ˆ˜๋Š” ๋ฆฌ์Šคํ”„ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ๋ฌธ์ž ์‹œํ€€์Šค(sequence of characters)๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค. ์ด ๋ฌธ์ž ์‹œํ€€์Šค๋Š” `READ`์—์„œ ์žฌ๊ตฌ์„ฑํ•˜๋Š” ๋ฐ ํ•„์š”๋กœ ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค:

``` lisp
(print โ€™abc)
= \newline ABC \space
(print 'abc)
;;>> โŽ
;;>> ABCโŒด
;;=> ABC
(print (list 1 2 3))
= \newline (1 2 3) \space
;;>> โŽ
;;>> (1 2 3)โŒด
;;=> (1 2 3)
(print "A String")
= \newline "A string" \space
;;>> โŽ
;;>> "A string"โŒด
;;=> "A string"
(print 387.9532)
= \newline 387.9532 \space
;;>> โŽ
;;>> 387.9532โŒด
;;=> 387.9532
(print (make-hash-table))
= \newline #<HASH-TABLE> \space
;;>> โŽ
;;>> #<HASH-TABLE>โŒด
;;=> #<HASH-TABLE>
```

`PRINT`๋Š” ๊ฐœํ–‰๋ฌธ์ž(`\newline`)๋กœ ์‹œ์ž‘ํ•˜๊ณ  ๋„์–ด์“ฐ๊ธฐ(`\space`)์œผ๋กœ ๋๋‚˜๋Š” ๊ฒฐ๊ณผ๋ฌผ์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๊ฐœํ–‰๊ณผ ๋„์–ด์“ฐ๊ธฐ ๋ชจ๋‘ ๊ณต๋ฐฑ(whitespace)์œผ๋กœ ์ทจ๊ธ‰๋˜๋ฏ€๋กœ, (escape๊ฐ€ ์•„๋‹Œ)๋ฆฌ์Šคํ”„ ์˜ค๋ธŒ์ ํŠธ๊ฐ€ ์ถœ๋ ฅ๋œ ํ‘œํ˜„์˜ ์ผ๋ถ€๊ฐ€ ๋ ์ˆ˜ ์—†๊ธฐ์—, ์ด๋Š” PRINT ๊ฒฐ๊ณผ๋ฌผ์ด ๋‹ค๋ฅธ ๊ฒฐ๊ณผ๋ฌผ๊ณผ๋Š” ๋‹ค๋ฅด๋‹ค๋Š” ๊ฒƒ์„ ๋ณด์ฆํ•ฉ๋‹ˆ๋‹ค.
`PRINT`๋Š” ๊ฐœํ–‰(โŽ)์œผ๋กœ ์‹œ์ž‘ํ•˜๊ณ  ๋„์–ด์“ฐ๊ธฐ(โŒด)์œผ๋กœ ๋๋‚˜๋Š” ๊ฒฐ๊ณผ๋ฌผ์„ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” `PRINT` ์ถœ๋ ฅ์ด ๋‹ค๋ฅธ ์ถœ๋ ฅ๋“ค๊ณผ ๊ตฌ๋ณ„๋˜๋„๋ก ๋งŒ๋“ค์–ด ์ค๋‹ˆ๋‹ค. ๊ฐœํ–‰๊ณผ ๋„์–ด์“ฐ๊ธฐ ๋ชจ๋‘ ๊ณต๋ฐฑ(whitespace)์œผ๋กœ ์ทจ๊ธ‰๋˜๋ฉฐ, ์ด๋Š” (์ด์Šค์ผ€์ดํ”„๋˜์ง€ ์•Š๋Š” ํ•œ) ๋ฆฌ์Šคํ”„ ์˜ค๋ธŒ์ ํŠธ๋ฅผ ์ถœ๋ ฅํ•˜๋Š”๋ฐ ํ•˜๋Š”๋ฐ ํฌํ•จ๋  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.

`PRINT`์˜ ๋‹ค๋ฅธ ๋ณ€์ข…๋“ค์€ ๋‹ค์–‘ํ•œ ์“ฐ์ž„์„ธ๋ฅผ ์ง€๋…”์Šต๋‹ˆ๋‹ค. `PRIN1`์€ `PRINT`์ฒ˜๋Ÿผ ํ–‰๋™ํ•˜์ง€๋งŒ, whitespace๋กœ ๊ฐ์‹ธ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด ์—ฐ์ด์€ ์กฐ๊ฐ๋“ค๋กœ๋ถ€ํ„ฐ ์ด๋ฆ„์„ ๋งŒ๋“ค๊ณ ์ž ํ• ๋•Œ, ์ด๋Š” ์œ ์šฉํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. PRINC๋Š” PRIN1์ฒ˜๋Ÿผ ํ–‰๋™ํ•˜์ง€๋งŒ, ๋ณด์—ฌ๋Š”๊ฒƒ ๋ณด๋‹จ READ๋ฅผ ์œ„ํ•œ ๊ฒฐ๊ณผ๋ฌผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค; ์˜ˆ๋ฅผ๋“ค์–ด, PRINC๋Š” ๋ฌธ์ž์—ด์„ ๋‘˜๋Ÿฌ์‹ธ๋Š” ์Œ๋”ฐ์˜ดํ‘œ(quotes)๋ฅผ ์ƒ๋žตํ•˜๋ฉฐ, escape character๋ฅผ ์ถœ๋ ฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.
`PRINT`์™€ ๋น„์Šทํ•œ ๋‹ค์–‘ํ•œ ์“ฐ์ž„์„ธ๋ฅผ ์ง€๋‹Œ ๋‹ค๋ฅธ ๋ณ€์ข…๋“ค์ด ์žˆ์Šต๋‹ˆ๋‹ค. `PRIN1`์€ `PRINT`์™€ ๋น„์Šทํ•˜๊ฒŒ ํ–‰๋™ํ•˜์ง€๋งŒ, ๊ณต๋ฐฑ์œผ๋ก  ๊ฐ์‹ธ์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ๋“ค์–ด ์—ฌ๋Ÿฌ ์กฐ๊ฐ๋“ค๋กœ ์ด๋ฆ„์„ ๋งŒ๋“ค๊ณ ์ž ํ• ๋•Œ ์œ ์šฉํ•˜๊ฒŒ ์“ฐ์ผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. `PRINC`๋Š” `PRIN1`์ฒ˜๋Ÿผ ํ–‰๋™ํ•˜์ง€๋งŒ `READ`๋ฅผ ์œ„ํ•˜๊ธฐ ๋ณด๋‹จ, ์œ ์ €์—๊ฒŒ ๋ณด์—ฌ์ง€๋Š”๊ฒƒ์„ ์œ„ํ•œ ๊ฒฐ๊ณผ๋ฌผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค; ์˜ˆ๋ฅผ๋“ค์–ด, `PRINC`๋Š” ๋ฌธ์ž์—ด์„ ๋‘˜๋Ÿฌ์‹ธ๋Š” ์Œ๋”ฐ์˜ดํ‘œ๋ฅผ ์ƒ๋žตํ•˜๋ฉฐ, ์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž ์—ญ์‹œ ์ถœ๋ ฅํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค.

``` lisp
(print โ€™a\ bc)
;;>> \newline |A BC| \space
(print 'a\ bc)
;;>> โŽ
;;>> |A BC|โŒด
;;=> |A BC|
(prin1 โ€™a\ bc)
(prin1 'a\ bc)
;;>> |A BC|
;;=> |A BC|
(princ โ€™|A BC|)
;;>> \newline A BC \space
(princ '|A BC|)
;;>> โŽ
;;>> A BCโŒด
;;=> |A BC|
```

## OPEN๊ณผ CLOSE๋Š” ํŒŒ์ผ์„ ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๊ฒŒ ํ•œ๋‹ค.

๋ณดํ†ต, `READ`๋Š” ํ‚ค๋ณด๋“œ๋ฅผ ์ฝ๊ณ  `PRINT`๋Š” ํ™”๋ฉด์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ํ•จ์ˆ˜ ๋ชจ๋‘ ์˜ต์…”๋„(optional) ์ธ์ž๋ฅผ ์ทจํ•ฉ๋‹ˆ๋‹ค; ์ธ์ž๋Š” `READ`๋ฅผ ์œ„ํ•œ ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ๊ณผ `PRINT`๋ฅผ ์œ„ํ•œ ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์ŠคํŠธ๋ฆผ(stream)์€ ๋ฌด์—‡์ผ๊นŒ์š”? ์ŠคํŠธ๋ฆผ์€ ๋ฐ์ดํ„ฐ์˜ ๊ทผ์›(source)์ด์ž ๋ฐ‘๋ฐ”๋‹ฅ(sink)์ด๋ฉฐ, ๋ณดํ†ต (๊ทธ์น˜๋งŒ ์ ˆ๋Œ€์ ์ด์ง€๋Š” ์•Š์€) ๋ฌธ์ž(characters)์ž…๋‹ˆ๋‹ค. ์ด์ œ๋ถ€ํ„ฐ, ์ €ํฌ๋Š” tex file์ด ์–ด๋–ป๊ฒŒ ๋ฌธ์ž stream์˜ source๋‚˜ sink๊ฐ€ ๋  ์ˆ˜ ์žˆ๋Š”์ง€๋ฅผ ์‚ดํŽด๋ณผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. 19์žฅ [p 183]์—์„œ ์ €ํฌ๋Š” ๋ช‡๋ช‡ ๋‹ค๋ฅธ ๊ฐ€๋Šฅ์„ฑ๋“ค์„ ์‚ดํŽด๋ณผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.
๋ณดํ†ต, `READ`๋Š” ํ‚ค๋ณด๋“œ๋ฅผ ์ฝ๊ณ  `PRINT`๋Š” ํ™”๋ฉด์— ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ํ•จ์ˆ˜ ๋ชจ๋‘ ์˜ต์…”๋„(optional) ์ธ์ˆ˜๋ฅผ ์ทจํ•ฉ๋‹ˆ๋‹ค; ์ธ์ˆ˜๋กœ `READ`๋ฅผ ์œ„ํ•œ ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ๊ณผ `PRINT`๋ฅผ ์œ„ํ•œ ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ์ŠคํŠธ๋ฆผ(stream)์€ ๋ฌด์—‡์ผ๊นŒ์š”? ์ŠคํŠธ๋ฆผ์€ ๋ฐ์ดํ„ฐ์˜ ์†Œ์Šค(source)์ด์ž ๋ฐ‘๋ฐ”๋‹ฅ(sink)์ด๋ฉฐ, ๋ณดํ†ต์€ (๊ทธ์น˜๋งŒ ์ ˆ๋Œ€์ ์ด์ง€๋Š” ์•Š์€) ๋ฌธ์ž๋“ค(characters)์ž…๋‹ˆ๋‹ค. ์ด์ œ๋ถ€ํ„ฐ, ์ €ํฌ๋Š” ํ…์ŠคํŠธ ํŒŒ์ผ์ด ์–ด๋–ป๊ฒŒ ๋ฌธ์ž ์ŠคํŠธ๋ฆผ์˜ ์†Œ์Šค๊ฐ€ ๋  ์ˆ˜ ์žˆ๋Š”์ง€๋ฅผ ์‚ดํŽด๋ณผ ๊ฒƒ์ž…๋‹ˆ๋‹ค. 19์žฅ [p 183]์—์„œ ์ €ํฌ๋Š” ๋ช‡๋ช‡ ๋‹ค๋ฅธ ๊ฐ€๋Šฅ์„ฑ๋“ค์„ ์‚ดํŽด๋ณผ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ๋ถ„์€, ํŒŒ์ผ ์ด๋ฆ„์„ ์ธ์ž๋กœ ์ทจํ•˜๊ณ  ์ŠคํŠธ๋ฆผ์˜ ๋ฐฉํ–ฅ(์ž…๋ ฅ๊ณผ ์ถœ๋ ฅ)์„ ๊ฒฐ์ •ํ•˜๋Š” ํ‚ค์›Œ๋“œ ์ธ์ž๋ฅผ ์ทจํ•˜๋Š”, `OPEN` ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜์—ฌ ์ŠคํŠธ๋ฆผ์„ ํŒŒ์ผ๋กœ ๋ถ™์ผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ŠคํŠธ๋ฆผ์— ๊ด€ํ•œ ์ž‘์—…์„ ์ข…๋ฃŒํ•˜๊ณ  ๊ด€๋ จ๋œ ํŒŒ์ผ์„ ๋‹ซ๊ธฐ ์œ„ํ•ด์„ , `CLOSE` ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.
ํŒŒ์ผ ์ด๋ฆ„์„ ์ธ์ˆ˜๋กœ ์ทจํ•˜๊ณ  ์ŠคํŠธ๋ฆผ์˜ ๋ฐฉํ–ฅ(์ž…๋ ฅ๊ณผ ์ถœ๋ ฅ)์„ ๊ฒฐ์ •ํ•˜๋Š” ํ‚ค์›Œ๋“œ ์ธ์ˆ˜๋ฅผ ์ทจํ•˜๋Š”, `OPEN` ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜์—ฌ ์ŠคํŠธ๋ฆผ์„ ํŒŒ์ผ๋กœ ์—ฐ๊ฒฐ ์‹œํ‚ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ŠคํŠธ๋ฆผ์— ๋Œ€ํ•œ ์ž‘์—…์„ ๋๋‚ด๊ณ  ์—ฐ๊ฒฐ๋œ ํŒŒ์ผ์„ ๋‹ซ๊ธฐ ์œ„ํ•ด์„  `CLOSE` ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

``` lisp
(setq out-stream (open "my-temp-file" :direction :output))
Expand All @@ -135,35 +142,35 @@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
;;=> T
```

์ด ์˜ˆ์ œ์—์„œ, ์ €ํฌ๋Š” `my-temp-file`์— ๋Œ€ํ•œ ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ์„ ๋งŒ๋“ค๊ณ , ์‹ฌ๋ณผ `ABC`๋ฅผ ๊ทธ ์ŠคํŠธ๋ฆผ์— ์ถœ๋ ฅํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์ธ์ž๋Š” ํ‰์ƒ์‹œ์ฒ˜๋Ÿผ ๋ฐ˜ํ™˜ํ•˜์ง€๋งŒ ์ถœ๋ ฅ์„ ํ•˜์ง€ ์•Š๋Š” ๋‹ค๋Š” ๊ฒƒ์„ ์ฃผ๋ชฉํ•˜์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค - ๋Œ€์‹ , ์ถœ๋ ฅ๋œ ๊ฒฐ๊ณผ๋Š” ํŒŒ์ผ๋กœ ๊ฐ‘๋‹ˆ๋‹ค.
์ด ์˜ˆ์ œ์—์„œ, ์ €ํฌ๋Š” `my-temp-file`์— ๋Œ€ํ•œ ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ์„ ๋งŒ๋“ค์—ˆ์œผ๋ฉฐ, ์‹ฌ๋ณผ `ABC`๋ฅผ ๊ทธ ์ŠคํŠธ๋ฆผ์— ์ถœ๋ ฅํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์—ฌ๋Š๋•Œ์™€ ๊ฐ™์ด ์ธ์ž๋ฅผ ๋ฐ˜ํ™˜ํ•˜์ง€๋งŒ, ์ถœ๋ ฅ์€ ํ•˜์ง€์•Š์•˜๋‹ค๋Š” ์ ์„ ์ฃผ๋ชฉํ•ด์ฃผ์‹œ๊ธธ ๋ฐ”๋ž๋‹ˆ๋‹ค - ์ถœ๋ ฅ๋œ ๊ฒฐ๊ณผ๋Š” ํŒŒ์ผ๋กœ ๊ฐ”์Šต๋‹ˆ๋‹ค.

๋‹ค์Œ์œผ๋กœ, ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ์„ ๋‹ซ๊ณ  ๋™์ผํ•œ ํŒŒ์ผ์— ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ์„ ์—ด์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ์ €ํฌ๊ฐ€ ํŒŒ์ผ์— ์ถœ๋ ฅํ•œ ์‹ฌ๋ณผ์„ ์ฝ์–ด์˜จ ๋‹ค์Œ, ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ์„ ๋‹ซ์Œ์œผ๋กœ์จ ๋์„ ๋งบ์Šต๋‹ˆ๋‹ค.
๋‹ค์Œ์œผ๋กœ, ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ์„ ๋‹ซ๊ณ  ๋™์ผํ•œ ํŒŒ์ผ๋กœ ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ์„ ์—ด์—ˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋Ÿฐ ๋‹ค์Œ ์ €ํฌ๊ฐ€ ํŒŒ์ผ์— ์ถœ๋ ฅํ•œ ์‹ฌ๋ณผ์„ ์ฝ์–ด์˜จ ๋‹ค์Œ, ์ž…๋ ฅ ์ŠคํŠธ๋ฆผ์„ ๋‹ซ์Œ์œผ๋กœ์จ ๋์„ ๋งบ์—ˆ์Šต๋‹ˆ๋‹ค.


## Variations on a PRINT theme
## PRINT์˜ ์—ฌ๋Ÿฌ๊ฐ€์ง€ ๋ณ€์ข… ํƒœ๋งˆ

๋ฆฌ์Šคํ”„๋Š” ๋˜ํ•œ, ์ด๋Ÿฌํ•œ ์˜ต์…˜์„ ์ œ์–ดํ•˜๋Š” ํ‚ค์›Œ๋“œ ์ธ์ž๋ฅผ ์ด์šฉํ•˜์—ฌ, ์—ฌ๋Ÿฌ๋ถ„์—๊ฒŒ ์ถœ๋ ฅ์— ๋Œ€ํ•ด ๋”์šฑ ์„ธ๋ถ€์ ์ธ ๊ฒƒ์— ๊ด€ํ•œ ์ œ์–ด๊ถŒ์„ ์ฃผ๋Š” `WRITE` ํ•จ์ˆ˜๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค:
๋ฆฌ์Šคํ”„๋Š” ๋˜ํ•œ ์ด๋Ÿฌํ•œ ์˜ต์…˜์„ ์ œ์–ดํ•˜๋Š” ํ‚ค์›Œ๋“œ ์ธ์ž๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ, ์ถœ๋ ฅ์„ ๋”์šฑ ์„ธ๋ถ€์ ์œผ๋กœ ์ œ์–ดํ•  ์ˆ˜ ์žˆ๋Š” `WRITE`๋ผ๋Š” ํ•จ์ˆ˜๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค:

| Keyword Argument | Default Value | Action |
| ํ‚ค์›Œ๋“œ ์ธ์ž | ๊ธฐ๋ณธ ๊ฐ’ | ํ–‰๋™ |
| ---------------- | ------------------------- | ------------------------------ |
| :stream | `t` | set output stream |
| :escape | `*print-escape*` | include escape characters |
| :radix | `*print-radix*` | include radix (base) prefix |
| :base | `*print-base*` | set number base (rationals) |
| :circle | `*print-circle*` | print circular structures |
| :pretty | `*print-pretty*` | add whitespace for readability |
| :level | `*print-level*` | limit nesting depth |
| :length | `*print-length*` | limit items per nesting level |
| :case | `*print-case*` | :upper, :lower, or :mixed |
| :gensym | `*print-gensym*` | prefix uninterned symbols |
| :array | `*print-array*` | print arrays readably |
| :readably | `*print-readably*` | force printing to be readable |
| :right-margin | `*print-right-margin*` | controls pretty-printing |
| :miser-width | `*print-miser-width*` | " |
| :lines | `*print-lines*` | " |
| :pprint-dispatch | `*print-pprint-dispatch*` | " |

์šฐ์—ฐํ•˜๊ฒŒ๋„, ์œ„์— ํ‚ค์›Œ๋“œ ์ธ์ž์˜ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ๋‚˜์˜จ ๋ณ€์ˆ˜๋“ค์€ ๋˜ํ•œ `PRINT`์˜ ์—ฐ์‚ฐ์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ๋ถ„์€, `PRIN1`์„ ๊ฐ์‹ธ๋Š” `LET` ํผ์—์„œ ์ด๋Ÿฌํ•œ ๋ณ€์ˆ˜๋“ค์„ ๋ฐ”์ธ๋”ฉ ํ•จ์œผ๋กœ์จ, non-default ํ‚ค์›Œ๋“œ ์ธ์ž๋กœ `WRITE`์˜ ํšจ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
| :stream | `t` | ์ถœ๋ ฅ ์ŠคํŠธ๋ฆผ ์„ค์ • |
| :escape | `*print-escape*` | ์ด์Šค์ผ€์ดํ”„ ๋ฌธ์ž ํฌํ•จ |
| :radix | `*print-radix*` | ์ง„๋ฒ•(radix (base)) ํ”„๋ฆฌํ”ฝ์Šค |
| :base | `*print-base*` | ์ˆซ์ž๊ฐ€ ๋ช‡ ์ง„๋ฒ•์„ ์‚ฌ์šฉํ• ์ง€ ์„ค์ • |
| :circle | `*print-circle*` | ์ˆœํ™˜(circular) ๊ตฌ์กฐ๋ฌผ ์ถœ๋ ฅ |
| :pretty | `*print-pretty*` | ๊ฐ€๋…์„ฑ์„ ์œ„ํ•œ ๊ณต๋ฐฑ ์ถ”๊ฐ€ |
| :level | `*print-level*` | ์ค‘์ฒฉ ๋‹จ๊ณ„ ํ•œ๊ณ„ |
| :length | `*print-length*` | ์ค‘์ฒฉ ๋‹จ๊ณ„๋‹น ์•„์ดํ…œ์˜ ํ•œ๊ณ„ |
| :case | `*print-case*` | :upper, :lower, ํ˜น์€ :mixed |
| :gensym | `*print-gensym*` | uninterned ์‹ฌ๋ณผ์˜ ์ ‘๋‘์‚ฌ |
| :array | `*print-array*` | ๊ฐ€๋…์„ฑ ์žˆ๊ฒŒ ๋ฐฐ์—ด ์ถœ๋ ฅ |
| :readably | `*print-readably*` | ๊ฐ•์ œ๋กœ ๊ฐ€๋…์„ฑ์žˆ๊ฒŒ |
| :right-margin | `*print-right-margin*` | ๊ฐ€๋…์„ฑ์žˆ๊ฒŒ ์ถœ๋ ฅํ•˜๋Š” ์˜ต์…˜ |
| :miser-width | `*print-miser-width*` | '' |
| :lines | `*print-lines*` | '' |
| :pprint-dispatch | `*print-pprint-dispatch*` | '' |

์šฐ์—ฐํ•˜๊ฒŒ๋„, ์œ„์— ํ‚ค์›Œ๋“œ ์ธ์ž์˜ ๊ธฐ๋ณธ๊ฐ’์œผ๋กœ ๋‚˜์˜จ ๋ณ€์ˆ˜๋“ค์€ ๋˜ํ•œ `PRINT`์˜ ์—ฐ์‚ฐ์„ ์ œ์–ดํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๋Ÿฌ๋ถ„์€, ํ‚ค์›Œ๋“œ ์ธ์ž๋ฅผ ์“ฐ์ง€ ์•Š๊ณ  `LET` ํผ์—์„œ ์ด๋Ÿฌํ•œ ๋ณ€์ˆ˜์— ๋ฐ”์ธ๋”ฉ ํ•˜๊ณ  `PRIN1`๋ฅผ ๊ฐ์‹ธ๋ฉด `WRITE`๊ณผ ๋™์ผํ•œ ํšจ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:


``` lisp
Expand All @@ -179,31 +186,32 @@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
(prin1 foo))
```

`PRINT`๊ฐ€ ์ถ”๊ฐ€ํ•˜๋Š” ์•ž์— newline์ด ์žˆ๊ณ  ๋’ค์— ๋นˆ์นธ(blank)์ด ์˜ค๋Š”๊ฑธ ์›์น˜ ์•Š๊ธฐ์—, `print`๊ฐ€ ์•„๋‹Œ `prin1`๋ฅผ ์‚ฌ์šฉํ•˜์˜€์Šต๋‹ˆ๋‹ค.
`print`๊ฐ€ ์•„๋‹Œ `prin1`๋ฅผ ์‚ฌ์šฉํ–ˆ๋Š”๋ฐ, `PRINT`๋Š” ์•ž์— ๊ฐœํ–‰(โŽ) ์žˆ๊ณ  ๋’ค์— ๋นˆ์นธ(โŒด)์ด ์˜ค๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ๋ถ„์˜ ํ”„๋กœ๊ทธ๋žจ์ด `*PRINT-...*` ๋ณ€์ˆ˜๋ฅผ ๋ฐ”๊พธ์ง€๋งŒ, ํ”„๋กœ๊ทธ๋žจ์˜ ์–ด๋Š ์ง€์ ์—์„œ ๊ธฐ๋ณธ ๊ฐ’(default value)์„ ์“ฐ๊ณ ์ž ํ•œ๋‹ค๋ฉด, `with-standard-io-syntax` ํผ์œผ๋กœ ํ”„๋กœ๊ทธ๋žจ์˜ ์ผ๋ถ€๋ฅผ ๊ฐ์Œ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
`*PRINT-...*`๋ฅ˜์˜ ๋ณ€์ˆ˜๋ฅผ ๋ฐ”๊ฟจ๋‹ค๊ฐ€, ํ”„๋กœ๊ทธ๋žจ์˜ ์–ด๋Š ์ง€์ ์—์„œ ๋‹ค์‹œ ๊ธฐ๋ณธ ๊ฐ’(default value)์„ ์“ฐ๊ณ ์ž ํ•œ๋‹ค๋ฉด, `with-standard-io-syntax` ํผ์œผ๋กœ ๊ฐ์Œ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

``` lisp
;;ํ”„๋กœ๊ทธ๋žจ์˜ printer control์„ ์ •์˜ํ•œ๋‹ค.
;; ํ”„๋กœ๊ทธ๋žจ์˜ ์ถœ๋ ฅ ์ œ์–ด๋ฅผ ์ •์˜ํ•œ๋‹ค.
(setq *print-circle* t)
(setq *print-array* nil)
(setq *print-escape* nil)
...
;;์œ„์—์„œ ์„ค์ •ํ•œ ๊ฑธ ์ถœ๋ ฅํ•œ๋‹ค.
;; ์œ„์—์„œ ์„ค์ •ํ•œ ๊ฑธ ์ถœ๋ ฅํ•œ๋‹ค.
(print ...)
...
;;default printer control ์„ค์ •์œผ๋กœ ๋˜๋Œ๋ฆฐ๋‹ค.
;; ์›๋ž˜์˜ ์ถœ๋ ฅ ์ œ์–ด ์„ค์ •์œผ๋กœ ๋˜๋Œ๋ฆฐ๋‹ค.
(with-standard-io-syntax
...
; standard setting์œผ๋กœ ์ถœ๋ ฅํ•œ๋‹ค์Œ,
; ์œ„์—์„œ ์„ค์ •ํ•œ ์ด๋Ÿฌํ•œ ๊ฒƒ๋“ค์„ ๋ฎ์–ด์“ด๋‹ค.
;; ๊ธฐ๋ณธ ์„ค์ •์œผ๋กœ ์ถœ๋ ฅํ•œ๋‹ค์Œ,
;; ์œ„์—์„œ ์„ค์ •ํ•œ ๊ฒƒ๋“ค์„ ๋ฎ์–ด๋ฒ„๋ฆฐ๋‹ค.
(print ...)
...)
;; WITH-STANDARD-IO-SYNTAX form ๋ฐ–์—์„ ,
;; ์˜ˆ์ œ ์ƒ๋‹จ์— ์žˆ๋Š” SETQ ํผ์— ์˜ํ•ด
;; ๊ตฌ์ถ•establish๋œ print ์„ค์ •์„ ๋˜ ๋‹ค์‹œ ํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค.
;; WITH-STANDARD-IO-SYNTAX ํผ ๋ฐ–์—์„ ,
;; ์˜ˆ์ œ ์ƒ๋‹จ์— ์žˆ๋Š” SETQ ํผ์— ์˜ํ•ด ์„ค์ •๋œ
;; print์˜ ์„ค์ •์„ ๋˜ ๋‹ค์‹œ ํ•ด์•ผํ•œ๋‹ค.
```


Expand Down

0 comments on commit 9e7135f

Please sign in to comment.