집

집

보통

지침

동요 'This is the House that Jack Built'를 암송해요.

어떤 구나 절을 또 다른 구나 절 안에 넣는 과정을 내포라고 해요. 재귀와 내포 과정을 거치면 유한한 수의 형태(단어와 구)를 가지고 무한한 수의 표현을 만들어 낼 수 있어요. 게다가 내포를 이용하면 적어도 이론상으로는 무한히 긴 구조도 만들 수 있어요.

동요는 다음과 같아요.

This is the house that Jack built.

This is the malt
that lay in the house that Jack built.

This is the rat
that ate the malt
that lay in the house that Jack built.

This is the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the rooster that crowed in the morn
that woke the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the farmer sowing his corn
that kept the rooster that crowed in the morn
that woke the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

This is the horse and the hound and the horn
that belonged to the farmer sowing his corn
that kept the rooster that crowed in the morn
that woke the priest all shaven and shorn
that married the man all tattered and torn
that kissed the maiden all forlorn
that milked the cow with the crumpled horn
that tossed the dog
that worried the cat
that killed the rat
that ate the malt
that lay in the house that Jack built.

출처

영국 동요링크가 새 창이나 탭에서 열려요
GitHub에서 편집 링크가 새 창이나 탭에서 열려요
Vim script Exercism

집 문제를 시작해 볼 준비가 됐나요?

Exercism에 가입하고 Vim script 트랙을 연습 문제 89개, 그리고 실제 사람의 멘토링과 함께 배우고 익혀 보세요. 모두 무료예요.