Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

terminating statement #143

Closed
1 task done
dakeshi opened this issue Dec 18, 2017 · 4 comments
Closed
1 task done

terminating statement #143

dakeshi opened this issue Dec 18, 2017 · 4 comments

Comments

@dakeshi
Copy link
Contributor

dakeshi commented Dec 18, 2017

체크리스트

Issue 설명

terminating statement 에 적합한 번역 용어를 찾기 위한 토론입니다. 적합한 번역 용어가 있으면 제안해주시고 공감하는 의견에 의사표시를 해주시길 바랍니다.

원문 (제목, 링크)

terminating statement

A terminating statement is one of the following

기존 번역

종결문

번역 제안 및 토론

  • 유한문 @jhonghee
    Terminating이라는 수식어는 결국 구문이 무한이 지속되지 않고 언젠가는 끝난다는 뜻에 동감하실 겁니다. 종결문이든 유한문이든 크게 의미 전달에는 문제가 없는 것 같아요. 제가 유한문이라는 번역을 생각한 이유는 종결문 자체가 종결문을 속에 가질 수 있기 때문에 실행의 끝이 있는 구문이다라는 의미를 전달하기 위해서 제안한 것입니다.

  • 종결문 또는 완결문 @ezaurum
    저는 terminating statements 가 어떤 블록(구문목록)이 있을 때, "여기서 끝납니다."를 표시하는 거라고 해석했거든요. 그러니 구문을 유한하게 "만드는" 구문이라 종결문이 더 어울린다고 생각합니다.
    아니면 완결문이라든가, 여튼 상태를 나타내는 것 보다는 행동이나 목적을 나타내는 말이 어울린다고 봅니다.

  • 종결문 @dakeshi
    종결문 안에 종결문이 가능하기 때문에 오해의 소지가 있어보이지만 딱히 좋은 용어가 아직은 떠오르지 않네요. 유한문은 finite 쪽에 가까워보입니다. 완결문은 complete 에 가까운 의미로 보입니다.

@jhonghee
Copy link
Contributor

원문의 "Terminating"도 끝나는, 종결하는, 뜻 외 "영원히 계속되지 않는" 뜻을 함축하고 있어서 overloaded 표현이라는 생각이 드네요. 그럼에도 불구하고 사용상 아무 문제가 없는 건 이미 그 단어로 이런 함축적인 의미를 전달하도록 공적 합의가 있다는 생각입니다.

그래서 이 경우는 단어의 번역에 충실한 "종결문"을 사용하고 함축된 의미에 대해서는 전체 내용의 충실한 번역을 통해서 Go 스펙의 독자들의 이해를 돕는게 좋겠습니다.

@ezaurum
Copy link
Collaborator

ezaurum commented Dec 18, 2017

for문의 종결문 조건 번역( loop condition is absent)과 관련해 무한 루프쪽이 terminating statement 가 맞아보입니다.

A "for" statement in which:

  • there are no "break" statements referring to the "for" statement, and
  • the loop condition is absent.

종결문 이해를 위한 예제

스펙 문서의 함수 선언 을 참조하면,

If the function's signature declares result parameters, the function body's statement list must end in a terminating statement.

함수의 시그니처가 결과 파라마터를 선언하고 있으면, 함수 본문의 구문 목록은 종결문(terminating statement)으로 끝나야 한다.

종결문으로 끝난 예제
이걸 보시면 return 이 없어도 컴파일, 실행에 에러가 없습니다. for 무한루프라 playground에서 하지 마시고 커맨드라인에서 하셔야 할 겁니다.

종결문으로 끝나지 않은 예제
하지만 loop 에 조건이 붙은 이 링크는 컴파일에서 에러가 나지요.

@ezaurum ezaurum mentioned this issue Dec 18, 2017
2 tasks
@dakeshi
Copy link
Contributor Author

dakeshi commented Dec 18, 2017

for문의 종결문 조건 번역( loop condition is absent)과 관련한 @jhonghee 님 의견

for 문이 종결문이 되려면 두 조건을 모두 만족시켜야 합니다. 첫째는 break 문이 없어야 합니다. break 문이 없다는 얘기만 있으면 무한 루프가 생길 가능성이 있는 거지요. 하지만 두번째 조건이 무한루프를 허용하지 않습니다. 결국 for 문이 종결문이기 위해서는 break 구문의 도움없이, 무한 루프의 조건을 갖지 않는 제한된 수의 반복을 하고 끝나는 구문 리스트를 의미하는 겁니다.

@dakeshi
Copy link
Contributor Author

dakeshi commented Dec 18, 2017

for문의 종결문 조건 번역( loop condition is absent)과 관련하여 griesemer는 golang issue에서 다음과 같이 언급하고 있습니다.

The function must end in a terminating statement since it declares a result; and
The final non-empty statement is the for loop which neither has a loop condition nor a break statement and thus is terminating.

또한, Go 1.1 release note 에는 terminating statement를 아래와 같이 정의하고 있습니다.

It introduces the concept of a terminating statement, a statement that is guaranteed to be the last one a function executes

이에 따라 이 issue에 대한 토론은 다음과 같이 결론을 내리고자 합니다.

  • terminating statement : 종결문으로 번역
  • for문의 종결문 조건 번역( loop condition is absent)
    반복(loop)에 관한 조건이 없는 for 문

추가적으로 terminating statement 를 용어집에 추가하고 a statement that is guaranteed to be the last one a function executes. 이 내용을 번역해서 용어집에 함께 추가하도록 하겠습니다.

참고 자료:

golang/go#11698
golang/go#14537
golang/go#14422
golang/go@b5ddbb9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants