Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
HanweeeeLee authored Nov 14, 2021
1 parent a0b897c commit 00e371b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions 06. 함수형 프로그래밍/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class Squint {
(swap! counter inc) ; counter를 안전하게 증가시킨다.
```
> 이 코드에서 counter변수는 atom으로 정의되었다. 클로저에서 atom은 특수한 형태의 변수로, 값을 변경하려면 반드시 swap! 함수를 사용해야한다. swap! 함수는 2개의 파라미터를 받는다. 하나는 변경할 atom변수, 또 하나는 저장할 새로운 값을 계산할 함수.
atom 기능은 간단한 애플리케이션엔 적합하지만 여러 변수가 상호 의존하는 상황에서는 동시업데이트와 교착상태 문제로부터 완벽히 보호해 주지는 못한다.
말하려는 요지는, **애플리케이션을 제대로 구조화하려면 변수를 변경하는 컴포넌트와 변경하지 않는 컴포넌트를 분리해야한다.**

Expand Down

0 comments on commit 00e371b

Please sign in to comment.