Macros are vulnerable to a problem called variable capture.

매크로는 변수 캡처라는 문제에 취약합니다.

Variable capture occurs when macroexpansion causes a name clash: when some symbol ends up referring to a variable from another context.

변수 확장은 매크로 확장으로 인해 이름 충돌이 발생하는 경우 발생합니다.

일부 심볼이 다른 컨텍스트의 변수를 참조함 이러면 문제댐.

Inadvertent variable capture can cause extremely subtle bugs.

실수로 변수를 캡처하면 매우 미묘한 버그가 발생할 수 있습니다.

This chapter is about how to foresee and avoid them.

이 장은 그것들을 예측하고 피하는 방법에 관한 것입니다.

However, intentional variable capture is a useful programming technique, and Chapter 14 is full of macros which rely on it.

그러나 의도적인 변수 캡처는 유용한 프로그래밍 기술이며, 14장에는 이를 사용하는 매크로가 가득합니다.

9.1 Macro Argument Capture

A macro vulnerable to unintended variable capture is a macro with a bug.

의도하지 않은 변수 캡처에 취약한 매크로는 버그가있는 매크로입니다.

To avoid writing such macros, we must know precisely when capture can occur.

이러한 매크로를 작성하지 않으려면 캡처가 언제 발생할 수 있는지 정확하게 알아야합니다.

Instances of variable capture can be traced to one of two situations: macro argument capture and free symbol capture.

변수 캡처의 인스턴스는 매크로 인수 캡처(macro argument capture)와 자유 심볼 캡처(free symbol capture)의 두 가지 상황 중 하나로 추적 될 수 있습니다.

In argument capture, a symbol passed as an argument in the macro call inadvertently refers to a variable established by the macro expansion itself.