Go to the first, previous, next, last section, table of contents.


Definition Commands

@deffn ¸í·É°ú ±× ¿ÜÀÇ Á¤ÀÇ ¸í·É¾î·Î ÇÔ¼ö, º¯¼ö, ¸ÅÅ©·Î, ¸í·É¾î, ¿É¼Ç, Ư¼öÇüÅÂ, ±×¸®°í ±× ¿ÜÀÇ artifact¸¦ ÀÏ°üµÈ ÇüÅ·Π³ªÅ¸³¾ ¼ö ÀÖ´Ù.

Info ÆÄÀÏ¿¡¼­, Á¤ÀÇ´Â entity category---`ÇÔ¼ö', `º¯¼ö', ȤÀº ¹«¾ùÀÌµç °£¿¡---±× Á¤ÀÇÀÇ Ã¹¹ø° ÁÙ¿¡ ³ªÅ¸³ª°í, ±× ´ÙÀ½¿¡ ±× entityÀÇ À̸§°ú ÀÎÀÚ°¡ ¿Â´Ù. ÀμâµÈ ¸Å´º¾óÀÇ °æ¿ì, ÀÌ ¸í·É¾î´Â TeXÀÌ ±× entityÀÇ À̸§°ú ±× ÀÎÀÚ¸¦ ¿ÞÂÊ °ø¹é¿¡ Ãâ·ÂÇÏ°í, ±× category¸¦ ¿À¸¥ÂÊ margin¿¡ Ãâ·ÂÇϵµ·Ï ÇÑ´Ù. µÎ°³ÀÇ Ãâ·Â Çü½Ä ¸ðµÎ¿¡¼­, Á¤ÀÇÀÇ body´Â µé¿©¾²±â µÈ´Ù. ¶Ç, entityÀÇ À̸§Àº Àû´çÇÑ »öÀο¡ µé¾î°¡°Ô µÈ´Ù: @deffnÀº ±× À̸§À» ÇÔ¼ö »öÀο¡ ³Ö°í, @defvrÀº º¯¼ö »öÀο¡ ³Ö´Â °Í µî°ú °°ÀÌ ÇÑ´Ù.

ÇÑ°³ÀÇ ¸Å´º¾ó¿¡¼­ ÇÑ°³ÀÇ ÁÖ¾îÁø À̸§¿¡ ´ëÇØ ÇÑ°³ ÀÌ»óÀÇ Á¤ÀÇ°¡ ÀÖÀ» ÇÊ¿äµµ ¾ø°í, À־µµ ¾È µÈ´Ù. ¿ä¾àÀÌ µé¾î ÀÖ´Â ºÎ·ÏÀº ¸í·É¾î Á¤ÀǺ¸´Ù´Â @tableÀ» »ç¿ëÇØ¾ß ÇÑ´Ù.

The Template for a Definition

@deffn ¸í·ÉÀº ÇÔ¼ö¿Í °°Àº entity¸¦ Á¤ÀÇÇÏ´Â µ¥ ¾´´Ù. @deffn ¸í·ÉÀ¸·Î Á¤ÀǸ¦ ÇÏ·Á¸é, @deffn ¸í·ÉÀ» ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, °°Àº ÁÙ¿¡ ±× entityÀÇ category, ±× entity ÀÚüÀÇ À̸§, ±×¸®°í (ÀÖ´Ù¸é) ±× ÀÎÀÚ¸¦ ¾´´Ù. ±× ´ÙÀ½¿¡ °è¼ÓµÇ´Â ÁÙ¿¡ Á¤ÀÇÀÇ body¸¦ ¾´´Ù. (±× body¿¡ ¿¹Á¦¸¦ Æ÷ÇÔ½Ãų ¼öµµ ÀÖ´Ù.) ³¡À¸·Î, @end deffn ¸í·ÉÀ» ÇÑÁÙ¿¡ ´Üµ¶À¸·Î ½á¼­ Á¤ÀǸ¦ ³¡³½´Ù. (±× ¿ÜÀÇ Á¤ÀÇ ¸í·Éµµ °°Àº Çü½ÄÀ¸·Î ¾´´Ù.)

Á¤ÀÇÀÇ templateÀº ´ÙÀ½°ú °°´Ù:

@deffn category name arguments...
body-of-definition
@end deffn

¿¹¸¦ µé¾î,

@deffn Command forward-word count
This command moves point forward @var{count} words
(or backward if @var{count} is negative). ...
@end deffn

Àº ´ÙÀ½À» ¸¸µç´Ù.

Command: forward-word count
This function moves point forward count words (or backward if count is negative). ...

categoryÀÇ À̸§À» titleó·³ ´ë¹®ÀÚ·Î ½ÃÀÛÇÏ°Ô ÇÑ´Ù. `Interactive Command'ó·³ category À̸§¿¡ °ø¹éÀÌ µé¾î°¡¸é, ±× ÁÖÀ§¿¡ Áß°ýÈ£¸¦ ¾´´Ù. ¿¹¸¦ µé¾î:

@deffn {Interactive Command} isearch-forward
...
@end deffn

±×·¸Áö ¾ÊÀ¸¸é µÎ¹ø° ´Ü¾î°¡ ±× entityÀÇ À̸§À¸·Î À߸ø ¹Þ¾Æµé¿©Áú °ÍÀÌ´Ù.

¸î¸î Á¤ÀÇ ¸í·ÉÀº ´Ù¸¥ °Íµéº¸´Ù ´õ ÀϹÝÀûÀÌ´Ù. ¿¹¸¦ µé¾î, @deffn ¸í·ÉÀº ÇÔ¼ö¿Í °°Àº °Íµé---ÀÎÀÚ¸¦ ¹Þ¾ÆµéÀÌ´Â entity---¿¡ ¾²ÀÌ´Â ÀϹÝÀûÀÎ ¸í·É¾îÀÌ´Ù. ÀÌ ¸í·ÉÀ» ¾µ ¶§, ±× entity°¡ ¼ÓÇØ ÀÖ´Â category¸¦ ÁöÁ¤ÇÑ´Ù. @deffn ¸í·ÉÀº ¼¼°³ÀÇ º¯ÇüµÈ ¸í·ÉÀÌ ¹Ì¸® Á¤ÀǵǾî ÀÖ´Ù. ±×°ÍÀº @defun, @defmac, ±×¸®°í @defspecÀ¸·Î, ÀÌ ¸í·É¾îµéÀº category¸¦ ¾Ë¾Æ¼­ ÁöÁ¤ÇØ ÁØ´Ù: °¢°¢ "ÇÔ¼ö", "¸ÅÅ©·Î", ±×¸®°í "Special Form"ÀÌ´Ù. (Lisp¿¡¼­, special formÀº ÇÔ¼ö¿Í ¸Å¿ì ºñ½ÁÇÑ entityÀÌ´Ù.) @defvr ¸í·Éµµ ƯÁ¤ Á¾·ùÀÇ º¯¼ö¸¦ ¾²±â À§ÇØ ¸î°³ÀÇ º¯ÇüÀÌ ¹Ì¸® ÁöÁ¤µÇ¾î ÀÖ´Ù.

@defunó·³, specialized Á¤ÀÇ¿¡ ¾²ÀÌ´Â templateÀº category¸¦ ÁöÁ¤ÇÒ ÇÊ¿ä°¡ ¾ø´Ù´Â °ÍÀ» »©¸é ÀϹÝÀûÀÎ Á¤ÀÇ¿¡ ¾²ÀÌ´Â template°ú °°´Ù.

@defun name arguments...
body-of-definition
@end defun

Áï,

@defun buffer-end flag
This function returns @code{(point-min)} if @var{flag}
is less than 1, @code{(point-max)} otherwise.
...
@end defun

Àº ´ÙÀ½À» ¸¸µç´Ù.

Function: buffer-end flag
This function returns (point-min) if flag is less than 1, (point-max) otherwise. ...

Á¤ÀÇ ³»¿¡ @exampleÀ» »ç¿ëÇÏ´Â µî, ÇÔ¼ö Á¤ÀÇÀÇ ´õ ÀÚ¼¼ÇÑ ¿¹¸¦ º¸·Á¸é, See section A Sample Function Definition.

±× ¿ÜÀÇ specialized ¸í·ÉÀº @defunó·³ µ¿ÀÛÇÑ´Ù.

Optional and Repeated Arguments

¾î¶² entity´Â ¼±Åà °¡´ÉÇϰųª, ¹Ýº¹µÇ´Â ÀÎÀÚ¸¦ ¹Þ¾ÆµéÀ̴µ¥, ÀÌ ÀÎÀÚ´Â square bracket°ú ¸»ÁÙÀÓÇ¥°°Àº ±âÈ£·Î ±¸ºÐÇؼ­ ÁöÁ¤ÇÒ ¼ö ÀÖ´Ù. ¿¹¸¦ µé¾î, special formÀº º¸Åë ÇÔ¼öº¸´Ù ´õ º¹ÀâÇÑ ¹æ¹ýÀ¸·Î, ±× ÀÎÀÚ ¸®½ºÆ®¸¦ ¿©·¯°³ÀÇ ÀÎÀÚ·Î ³ª´«´Ù.

square bracket¿¡ µÑ·¯½×ÀÎ ÀÎÀÚ´Â ¼±Åð¡´ÉÇÏ´Ù. Áï, `[optional-arg]'´Â optional-arg°¡ ¼±Åà °¡´ÉÀ̶ó´Â ¶æÀÌ´Ù. µÚ¿¡ ¸» ÁÙÀÓÇ¥°¡ ºÙÀº ÀÎÀÚ´Â ¼±Åà °¡´ÉÇÏ°í, Çѹø ÀÌ»ó ¹Ýº¹µÉ ¼ö ÀÖ´Ù. Áï, `repeated-args...'´Â 0°³ ȤÀº ±× ÀÌ»óÀÇ ÀÎÀÚ¸¦ ¶æÇÑ´Ù. °ýÈ£´Â Lisp¿¡¼­, ÀÎÀÚµéÀ» ¸î°³ÀÇ ¸®½ºÆ® ±¸Á¶·Î ÇÑ´Ü°è ´õ ÀÎÀÚµéÀ» ±¸ºÐ ÁöÀ» ¶§ ¾´´Ù.

´ÙÀ½Àº °¡»óÀÇ special formÀÇ ¿¹·Î @defspec ¸í·ÉÀÌ µé¾î ÀÖ´Â ÁÙÀÌ´Ù.

Special Form: foobar (var [from to [inc]]) body...

ÀÌ ¿¹¿¡¼­, ÀÎÀÚ from°ú to´Â ¼±Åà °¡´ÉÇÏÁö¸¸, µÎ°³´Ù Àְųª, µÎ°³ ´Ù ¾ø°Å³ª ÇØ¾ß ÇÑ´Ù. ÀÎÀÚ°¡ ÀÖÀ¸¸é, incµµ ¼±Åà °¡´ÉÇÏ´Ù. ÀÌ ÀÎÀÚµéÀº var ÀÎÀÚ¿Í ÇÔ²² ¸®½ºÆ® ¾È¿¡ µé¾î À־, ÀÌ formÀÇ ³ª¸ÓÁö element°¡ ¸ðµÎ µé¾î ÀÖ´Â body¿Í ±¸ºÐÇÑ´Ù.

Texinfo ¼Ò½º ÆÄÀÏ¿¡¼­, @defspec ÁÙÀº ´ÙÀ½°ú °°ÀÌ ¾´´Ù (´ÙÀ½ ¿¹¿¡¼­Ã³·³, µÎ ÁÙ¿¡ °ÉÃÄ ³ª´²ÁöÁö ¾Ê´Â´Ù).

@defspec foobar (@var{var} [@var{from} @var{to}
     [@var{inc}]]) @var{body}@dots{}

ÀÌ ÇÔ¼ö´Â `foobar'·Î `ÇÔ¼ö¿Í º¯¼ö »öÀÎ'¿¡ ¿­°ÅµÇ¾î ÀÖ´Ù.

Two or More `First' Lines

Á¤ÀÇ¿¡¼­ µÎ°³ ÀÌ»óÀÇ `ù¹ø°' ȤÀº ¸Ó¸´ÁÙÀ» ¾²·Á¸é, ù¹ø° @deffn ÁÙ ´ÙÀ½¿¡ @deffnx·Î ½ÃÀÛÇÏ´Â ÁÙÀ» ¾´´Ù. @deffnx ¸í·ÉÀº ¾ÕÁÙ°úÀÇ »çÀÌ¿¡ ¼öÁ÷À¸·Î °ø¹éÀ» ³ÖÁö ¾Ê´Â ´Ù´Â °ÍÀ» Á¦¿ÜÇϸé @deffn¿Í ¿ÏÀüÈ÷ ¶È°°ÀÌ µ¿ÀÛÇÑ´Ù.

¿¹¸¦ µé¾î,

@deffn {Interactive Command} isearch-forward
@deffnx {Interactive Command} isearch-backward
These two search commands are similar except ...
@end deffn

´Â ´ÙÀ½À» ¸¸µç´Ù.

Interactive Command: isearch-forward
Interactive Command: isearch-backward
These two search commands are similar except ...

±× ¿ÜÀÇ Á¤ÀÇ ¸í·Éµµ °¢°¢ `x' ÇüÅ°¡ ÀÖ´Ù: @defunx, @defvrx, @deftypefunx µî.

`x' ÇüÅ´ @itemx¿Í ºñ½ÁÇÏ´Ù; section @itemx.

The Definition Commands

Texinfo´Â ¼ö½Ê°³ÀÇ Á¤ÀÇ ¸í·ÉÀ» Á¦°øÇÏ°í, ÀÌ ¸í·É¾î¸¦ ¸ðµÎ ÀÌ Àý¿¡¼­ ¼³¸íÇÑ´Ù.

Á¤ÀÇ ¸í·ÉÀº ÀÚµ¿À¸·Î ±× entityÀÇ À̸§À» Àû´çÇÑ »öÀο¡ ³Ö´Â´Ù: ¿¹¸¦ µé¾î, @deffn, @defun, ±×¸®°í @defmacÀº ÇÔ¼ö À̸§À» ÇÔ¼ö »öÀο¡ ³Ö´Â´Ù; @defvr°ú @defvarÀº º¯¼ö À̸§À» º¯¼ö »öÀο¡ ³Ö´Â´Ù.

´ÙÀ½¿¡ ³ª¿Ã ¿¹µéÀº ´ëºÎºÐ LispÀÇ ¿¹ÀÌÁö¸¸, ÀÌ ¸í·ÉµéÀº ´Ù¸¥ ÇÁ·Î±×·¡¹Ö ¾ð¾î¿¡µµ »ç¿ëµÉ ¼ö ÀÖ´Ù.

Functions and Similar Entities

ÀÌ ÀýÀº ÇÔ¼ö, ±×¸®°í ÇÔ¼ö¿Í ºñ½ÁÇÑ entityµéÀ» Á¤ÀÇÇÏ´Â ¸í·É¾îµéÀ» ¼³¸íÇÑ´Ù:

@deffn category name arguments...
@deffn ¸í·ÉÀº ÇÔ¼ö, interactive commands, ±×¸®°í ±× ¿Ü¿¡ ÀÎÀÚ¸¦ ¹Þ¾ÆµéÀÌ´Â ºñ½ÁÇÑ entityµéÀ» ÀϹÝÀûÀ¸·Î Á¤ÀÇÇÏ´Â ¸í·ÉÀÌ´Ù. Á¤ÀÇÇÏ´Â entityÀÇ category¸¦ ³ªÅ¸³»´Â ¿ë¾î´Â Á÷Á¢ °áÁ¤ÇØ¾ß ÇÑ´Ù; ¿¹¸¦ µé¾î, "ÇÔ¼ö"´Â ±× entity°¡ ÇÔ¼öÀ϶§ ¾µ ¼ö ÀÖÀ» °ÍÀÌ´Ù. @deffn ¸í·ÉÀº ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, °°Àº ÁÙ¿¡ °è¼Ó entityÀÇ catogory, ÀÌ entityÀÇ À̸§, ±×¸®°í Àμö°¡ ÀÖ´Ù¸é ±× Àμö¸¦ ¾´´Ù. ÀÌ Á¤ÀÇ´Â @end deffn ¸í·ÉÀ» ÇÑÁÙ¿¡ ´Üµ¶À¸·Î ½á¼­ ³¡³½´Ù. ¿¹¸¦ µé¾î, ´ÙÀ½¿¡ Á¤ÀÇ°¡ ÀÖ´Ù.
@deffn Command forward-char nchars
Move point forward @var{nchars} characters.
@end deffn
ÀÌ ¿¹´Â nchars¶ó´Â ÇÑ°³ÀÇ ÀÎÀÚ¸¦ °¡Áø forward-char¶ó´Â À̸§ÀÇ "¸í·É¾î"¸¦ °£´ÜÈ÷ Á¤ÀÇÇß´Ù. @deffnÀº nchars¿Í °°Àº ÀÎÀÚÀÇ À̸§À» @var°¡ »ç¿ëµÈ °æ¿ì¿Í °°ÀÌ ÀÌÅŸ¯Ã¼ ȤÀº ´ë¹®ÀڷΠǥ½ÃÇÑ´Ù. ¿Ö³ÄÇϸé, ¿ì¸®´Â ÀÌ À̸§À» metasyntactic º¯¼ö·Î »ý°¢Çϱ⠶§¹®ÀÌ´Ù---ÀÌ ÀÎÀÚµéÀº ½ÇÁ¦ ÀÎÀÚÀÇ °ªÀ» ³ªÅ¸³½´Ù. ¿©±â ¼³¸íÇÏ´Â ÅؽºÆ® ³»¿¡¼­, ÀÌ ÀÎÀÚÀÇ °ªÀ» ÂüÁ¶ÇÏ·Á¸é @var¸¦ ºÐ¸íÈ÷ ½á¼­ ÀÎÀÚ À̸§À» ¾´´Ù. À§ÀÇ ¿¹¿¡¼­, ÀÌ·± ¹æ¹ýÀ¸·Î `@var{nchars}'¸¦ ½è´Ù. @deffnÀÇ templateÀº:
@deffn category name arguments...
body-of-definition
@end deffn
@defun name arguments...
@defun ¸í·ÉÀº ÇÔ¼ö¸¦ Á¤ÀÇÇÏ´Â ¸í·É¾îÀÌ´Ù. @defunÀº `@deffn Function ...'¿Í °°´Ù. ¿¹¸¦ µé¾î,
@defun set symbol new-value
Change the value of the symbol @var{symbol}
to @var{new-value}.
@end defun
Àº ÀÎÀÚ°¡ symbol°ú new-valueÀÎ ÇÔ¼ö setÀ» °£´ÜÈ÷ ¼³¸íÇÑ´Ù. @defun ÁÙÀÇ ÀÎÀÚ À̸§Àº ¸¶Ä¡ @var ¾È¿¡ ¾´ °Íó·³ ÀÚµ¿À¸·Î ÀÌÅŸ¯Ã¼ ȤÀº ´ë¹®ÀÚ·Î ¾²¿©Áø´Ù. ÀÌ Á¤ÀÇ´Â ÇÑÁÙ¿¡ ´Üµ¶À¸·Î @end defunÀ» ½á¼­ ³¡³½´Ù. templateÀº:
@defun function-name arguments...
body-of-definition
@end defun
@defunÀº ÇÔ¼ö »öÀο¡ Ç׸ñÀ» ¸¸µç´Ù.
@defmac name arguments...
@defmac ¸í·ÉÀº ¸ÅÅ©·Î¸¦ Á¤ÀÇÇÏ´Â ¸í·É¾îÀÌ´Ù. @defmacÀº `deffn Macro ...'¿Í µ¿ÀÏÇÏ°í, @defun°ú ºñ½ÁÇÏ°Ô µ¿ÀÛÇÑ´Ù.
@defspec name arguments...
@defspec ¸í·ÉÀº special form¿¡ ´ëÇÑ Á¤ÀÇ ¸í·É¾îÀÌ´Ù. (Lisp¿¡¼­, special formÀº function°ú ¸Å¿ì ºñ½ÁÇÑ entityÀÌ´Ù. see section `Special Forms' in GNU Emacs Lisp Reference Manual.) @defspecÀº `@deffn {Special Form} ...'¿Í µ¿ÀÏÇÏ°í, @defun°ú ºñ½ÁÇÏ°Ô µ¿ÀÛÇÑ´Ù.

Variables and Similar Entities

´ÙÀ½Àº º¯¼ö¿Í º¯¼ö¿Í ºñ½ÁÇÑ entity¸¦ Á¤ÀÇÇÏ´Â ¸í·ÉÀÌ´Ù:

@defvr category name
@defvr ¸í·ÉÀº º¯¼ö¿Í ºñ½ÁÇÑ ¹«¾ð°¡---¾î¶² °ªÀ» ÀúÀåÇÏ°í ÀÖ´Â entity---¸¦ ÀϹÝÀûÀ¸·Î Á¤ÀÇÇÏ´Â ¸í·É¾îÀÌ´Ù. Á¤ÀÇµÉ entityÀÇ category¸¦ ¼³¸íÇÏ´Â ¿ë¾î¸¦ ÁöÁ¤ÇØ¾ß ÇÑ´Ù; ¿¹¸¦ µé¾î, "Variable"Àº ±× entity°¡ º¯¼öÀÏ ¶§ ¾µ ¼ö ÀÖ´Ù. @defvr ¸í·ÉÀ» ÁÙÀÌ ½ÃÀÛÇÒ ¶§¾²°í, °°Àº ÁÙ¿¡ ±× entityÀÇ category¿Í ±× entityÀÇ À̸§À» ¾´´Ù. category À̸§À» titleó·³ ´ë¹®ÀÚ·Î ½ÃÀÛÇÏ°Ô ÇÑ´Ù. category À̸§ÀÌ "User Option"ó·³ °ø¹é¹®ÀÚ¸¦ Æ÷ÇÔÇϸé, Áß°ýÈ£·Î µÑ·¯½Ñ´Ù. ±×·¸Áö ¾ÊÀ¸¸é µÎ¹ø° ´Ü¾î°¡ entityÀÇ À̸§À¸·Î À߸ø µé¾î°¥ °ÍÀÌ´Ù. ¿¹¸¦ µé¾î,
@defvr {User Option} fill-column
This buffer-local variable specifies
the maximum width of filled lines.
...
@end defvr
ÀÌ Á¤ÀÇ´Â @end defvrÀ» ÇÑ ÁÙ¿¡ ´Üµ¶À¸·Î ½á¼­ ³¡³½´Ù. templateÀº:
@defvr category name
body-of-definition
@end defvr
@defvrÀº name¿¡ ´ëÇÑ Ç׸ñÀ» º¯¼ö »öÀο¡ ¸¸µç´Ù.
@defvar name
@defvar ¸í·É¾î´Â º¯¼ö¸¦ Á¤ÀÇÇÏ´Â ¸í·É¾îÀÌ´Ù. @defvarÀº `@defvr Variable ...'¿Í µ¿ÀÏÇÏ´Ù. ¿¹¸¦ µé¾î:
@defvar kill-ring
...
@end defvar
±âº» ƲÀº:
@defvar name
body-of-definition
@end defvar
@defvarÀº name¿¡ ´ëÇÑ Ç׸ñÀ» º¯¼ö »öÀο¡ ¸¸µç´Ù.
@defopt name
@defopt ¸í·ÉÀº user options¿¡ ´ëÇØ Á¤ÀÇÇÏ´Â ¸í·É¾îÀÌ´Ù. user optionÀº »ç¿ëÀÚ°¡ ¿øÇÏ´Â ´ë·Î ¹Ù²Ü ¼ö ÀÖ´Â º¯¼öÀÌ´Ù; Emacs¿¡´Â ±×·¯ÇÑ °ÍÀÌ ¸¹´Ù (see section `Variables' in The GNU Emacs Manual). @defopt´Â `@defvr {User Option} ...'¿Í °°°í, @defvar¿Í °°ÀÌ µ¿ÀÛÇÑ´Ù.

Functions in Typed Languages

@deftypefn ¸í·É°ú ±×ÀÇ º¯ÇüÀº C¿Í C++ó·³ º¯¼ö¿Í ÇÔ¼öÀÇ Å¸ÀÔÀ» ¼±¾ðÇØ¾ß ÇÏ´Â ¾ð¾î¿¡¼­ ÇÔ¼ö¸¦ ¼³¸íÇÏ´Â µ¥ ¾²ÀδÙ.

@deftypefn category data-type name arguments...
@deftypefn ¸í·ÉÀº ÀÎÀÚ¸¦ ¹Þ¾ÆµéÀÌ°í, ŸÀÔÀÌ ÀÖ´Â ÇÔ¼ö ¹× ±×¿Í ºñ½ÁÇÑ entity¸¦ Á¤ÀÇÇÏ´Â ÀϹÝÀûÀÎ ¸í·É¾îÀÌ´Ù. @deftypefn ¸í·ÉÀº ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, °°Àº ÁÙ¿¡ ¼³¸íÇÒ entityÀÇ category¸¦ ¾²°í, return °ªÀÇ Å¸ÀÔ, ÀÌ entityÀÇ À̸§, ±×¸®°í ÀÎÀÚ°¡ ÀÖ´Ù¸é ±× ÀÎÀÚµéÀ» ¾´´Ù. ¿¹¸¦ µé¾î,
@deftypefn {Library Function} int foobar
   (int @var{foo}, float @var{bar})
...
@end deftypefn
("..." ¾ÕÀÇ ÅؽºÆ®¿¡¼­, À§¿¡¼­´Â µÎÁÙ·Î ³ªÅ¸³µÁö¸¸, ½ÇÁ¦·Î´Â Texinfo ÆÄÀÏ¿¡¼­´Â ÇÑ ÁÙÀÌ´Ù) ÀÌ°ÍÀº Info¿¡¼­ ´ÙÀ½À» ¸¸µç´Ù:
-- Library Function: int foobar (int FOO, float BAR)
...
ÀμâµÈ ¸Å´º¾ó¿¡¼­, ´ÙÀ½À» ¸¸µç´Ù:

Library Function: int foobar (int foo, float bar)
...
ÀÌ Àǹ̴ foobar°¡ int¸¦ ¸®ÅÏÇÏ°í, ±× ÀÎÀÚ°¡ foo(int ŸÀÔ)°ú bar(float ŸÀÔ)ÀÎ "¶óÀ̺귯¸® ÇÔ¼ö"¶ó´Â ¶æÀÌ´Ù. @deftypefn ¾È¿¡ ¾²´Â ÀÎÀÚÀÇ À̸§Àº @var°¡ ÀÚµ¿À¸·Î ºÙÁö ¾Ê´Â´Ù---¿Ö³ÄÇϸé @deftypefn ³»ÀÇ ½ÇÁ¦ ÀÎÀÚÀÇ À̸§Àº ´ëºÎºÐ µ¥ÀÌŸ ŸÀÔÀÇ À̸§°ú, Å°¿öµå·Î ±¸ºÐµÇ±â ¶§¹®ÀÌ´Ù. Texinfo´Â ÀÚµ¿À¸·Î ÀÌ°É Ã£¾Æ³»Áö ¸øÇÑ´Ù. ±× ´ë½Å¿¡ ÀÎÀÚÀÇ À̸§ ÁÖÀ§¿¡ Á÷Á¢ @var¸¦ ½á¾ß ÇÑ´Ù. À§ÀÇ ¿¹¿¡¼­, ÀÎÀÚÀÇ À̸§Àº `foo'¿Í `bar'ÀÌ´Ù. @deftypefnÀÇ templateÀº ´ÙÀ½°ú °°´Ù:
@deftypefn category data-type name arguments ...
body-of-description
@end deftypefn
¸¸¾à category³ª data typeÀÌ ÇÑ ´Ü¾îº¸´Ù ¸¹À»¶§ ÇÑ°³ÀÇ ÀÎÀÚ·Î ¸¸µé·Á¸é Áß°ýÈ£·Î ¹­¾î¾ß ÇÑ´Ù. Ada¿Í °°Àº package°¡ ÀÖ´Â ¾ð¾î ³»ÀÇ ÇÁ·Î½ÃÀú¸¦ ¼³¸íÇÏ·Á ÇÒ¶§, deftypefnÀ» ¾ÕÀÇ ¹®´Ü¿¡¼­ ¼³¸íÇÑ ¿øÄ¢°ú´Â Á» ´Ù¸¥ ¸ð¾çÀ¸·Î ½áµµ µÈ´Ù. ¿¹¸¦ µé¾î:
@deftypefn stacks private push
        (@var{s}:in out stack;
        @var{n}:in integer)
...
@end deftypefn
(@deftypefnÀÇ ÀÎÀÚ´Â ¼¼ ÁÙ¿¡ ³ª´²Á®¼­ º¸ÀÌÁö¸¸, ½ÇÁ¦ Texinfo ÆÄÀÏ¿¡¼­´Â ÇÑ ÁÙÀ̾î¾ß ÇÑ´Ù.) ÀÌ ¿¹¿¡¼­, ÇÁ·Î½ÃÀú´Â ÇÁ·Î½ÃÀú·Î ±¸ºÐµÇÁö ¾Ê°í stacks¶ó´Â ÆÐÅ°Áö¿¡ ¼ÓÇÑ °ÍÀ¸·Î ºÐ·ùµÇ¾ú°í, ±× µ¥ÀÌŸ ŸÀÔÀº privateÀÌ´Ù. (ÇÁ·Î½ÃÀúÀÇ À̸§Àº pushÀÌ°í, ±× ÀÎÀÚ´Â s¿Í nÀÌ´Ù.) @deftypefnÀº name¿¡ ´ëÇÑ Ç׸ñÀ» ÇÔ¼ö »öÀÎ ¾È¿¡ ¸¸µç´Ù.
@deftypefun data-type name arguments...
@deftypefun ¸í·ÉÀº ŸÀÔÀÌ ÀÖ´Â ¾ð¾î ³»ÀÇ ÇÔ¼ö¿¡ ¾²À̵µ·Ï ƯȭµÈ Á¤ÀÇ ¸í·ÉÀÌ´Ù. ÀÌ ¸í·ÉÀº `@deftypefn Function ...'¿Í µ¿ÀÏÇÏ´Ù. Áï,
@deftypefun int foobar (int @var{foo}, float @var{bar})
...
@end deftypefun
Àº Info¿¡¼­ ´ÙÀ½°ú °°ÀÌ ¸¸µç´Ù:
-- Function: int foobar (int FOO, float BAR)
...
±×¸®°í ´ÙÀ½Àº ÀμâµÈ ¸Å´º¾óÀÌ´Ù:

Function: int foobar (int foo, float bar)
...
±× templateÀº:
@deftypefun type name arguments...
body-of-description
@end deftypefun
@deftypefunÀº name¿¡ ´ëÇÑ Ç׸ñÀ» ÇÔ¼ö »öÀο¡ ³Ö´Â´Ù.
@deftypemethod class data-type method-name arguments...
@deftypemethod ¸í·ÉÀº C++À̳ª Java¿Í °°Àº object-oriented typed language ³»ÀÇ method¿¡ ´ëÇÑ Á¤ÀÇ ¸í·ÉÀÌ´Ù. ÀÌ ¸í·ÉÀº @deftypefn¿¡ ÀÌ method¸¦ Æ÷ÇÔÇϴ Ŭ·¡½º¸¦ Á¤ÀÇÇÏ´Â class ÀÎÀÚ¸¦ µ¡ºÙÀÎ °Í°ú ºñ½ÁÇÏ´Ù.

Variables in Typed Languages

¸í·ÉÀº ŸÀÔÀÌ ÀÖ´Â ¾ð¾î º¯¼ö´Â ŸÀÔÀÌ ÀÖ´Â ÇÔ¼ö¿Í ºñ½ÁÇÏ°Ô Ã³¸®µÈ´Ù. See section Functions in Typed Languages. ÀϹÝÀûÀÎ Á¤ÀÇ ¸í·ÉÀÎ @deftypevrÀº @deftypefn°ú ´ëÀÀµÇ°í, ƯȭµÈ Á¤ÀÇ ¸í·ÉÀÎ @deftypevarÀº @deftypefun°ú ´ëÀÀµÈ´Ù.

@deftypevr category data-type name
@deftypevr ¸í·ÉÀº ŸÀÔÀÌ ÀÖ´Â ¾ð¾î ³»ÀÇ º¯¼ö¿Í °°Àº °Í(¾î¶² °ªÀ» ±â·ÏÇÏ´Â entity)À» Á¤ÀÇÇÏ´Â ¸í·ÉÀÌ´Ù. Á¤ÀÇÇÒ entityÀÇ category¸¦ ¼³¸íÇÏ´Â ¸»À» Á÷Á¢ °áÁ¤ÇØ¾ß ÇÑ´Ù; ¿¹¸¦ µé¾î, ±× entity°¡ º¯¼öÀÏ ¶§ "º¯¼ö"°¡ »ç¿ëµÉ ¼ö ÀÖ´Ù. @deftypevr ¸í·ÉÀº ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, °°Àº ÁÙ¿¡ ¼³¸íÇÒ entityÀÇ category¸¦ ¾²°í, µ¥ÀÌŸ ŸÀÔ, ±×¸®°í ÀÌ entityÀÇ À̸§À» ¾´´Ù. ¿¹¸¦ µé¾î:
@deftypevr {Global Flag} int enable
...
@end deftypevr
Àº Info¿¡¼­ ´ÙÀ½À» ¸¸µç´Ù:
-- Global Flag: int enable
...
±×¸®°í ´ÙÀ½Àº ÀμâµÈ ¸Å´º¾ó¿¡¼­ÀÌ´Ù:

Global Flag: int enable
...
template˼:
@deftypevr category data-type name
body-of-description
@end deftypevr
@deftypevrÀº name¿¡ ´ëÇÑ Ç׸ñÀ» º¯¼ö »öÀο¡ ³Ö´Â´Ù.
@deftypevar data-type name
@deftypevar ¸í·ÉÀº ŸÀÔÀÌ ÀÖ´Â ¾ð¾î¿¡¼­ º¯¼ö¸¦ ¼±¾ðÇÏ´Â µ¥ ¾²´Â ƯȭµÈ Á¤ÀÇ ¸í·ÉÀÌ´Ù. @deftypevarÀº `@deftypevr Variable ...'¿Í °°´Ù. ¿¹¸¦ µé¾î:
@deftypevar int fubar
...
@end deftypevar
Àº Info¿¡¼­ ´ÙÀ½À» ¸¸µç´Ù:
-- Variable: int fubar
...
±×¸®°í ´ÙÀ½Àº ÀμâµÈ ¸Å´º¾óÀÌ´Ù:

Variable: int fubar
...
templateÀº ´ÙÀ½°ú °°´Ù:
@deftypevar data-type name
body-of-description
@end deftypevar
@deftypevarÀº name¿¡ ´ëÇÑ Ç׸ñÀ» º¯¼ö »öÀο¡ ³Ö´Â´Ù.

Object-Oriented Programming

´ÙÀ½Àº object-oriented programming¿¡ »ç¿ëµÇ´Â abstract object ¼³¸íÀ» Æ÷¸ËÆÃÇÏ´Â ¸í·ÉÀÌ´Ù. Ŭ·¡½º´Â abstract object¸¦ Á¤ÀÇÇϴ ŸÀÔÀÌ´Ù. Ŭ·¡½ºÀÇ instance´Â ±× Ŭ·¡½ºÀÇ Å¸ÀÔÀ» °¡Áø ƯÁ¤ÇÑ objectÀÌ´Ù. instance variableÀº ÀÌ Å¬·¡½º¿¡ ¼ÓÇÏ´Â º¯¼öÀ̸鼭 °¢°¢ÀÇ instance´Â °¢°¢ÀÇ °ªÀ» °¡Áø´Ù.

Á¤ÀÇ ³»¿¡¼­ Ŭ·¡½ºÀÇ À̸§ÀÌ ¾î¶² ÇÁ·Î±×·¡¹Ö ½Ã½ºÅÛ ³»¿¡¼­ ¾î¶² Ŭ·¡½º¸¦ Á¤ÀÇÇÏ´Â À̸§À̶ó¸é, ±× ÁÖÀ§¿¡ @code¸¦ ½á¾ß ÇÑ´Ù. ±×·¸Áö ¾ÊÀ¸¸é Ŭ·¡½º À̸§Àº º¸Åë ÅؽºÆ® ÆùÆ®·Î ÀμâµÈ´Ù.

@defcv category class name
@defcv ¸í·ÉÀº object-oriented programming¿¡¼­ Ŭ·¡½º¿¡ ¼ÓÇÑ º¯¼ö¸¦ Á¤ÀÇÇÏ´Â ÀϹÝÀûÀÎ Á¤ÀÇ ¸í·ÁÀÌ´Ù. @defcv ¸í·É ´ÙÀ½¿¡´Â ¼¼°³ÀÇ ÀÎÀÚ°¡ ¿Â´Ù; Á¤ÀÇÇÒ º¯¼öÀÇ category, ¼ÓÇØ Àִ Ŭ·¡½º, ±×¸®°í ±× À̸§ÀÌ´Ù. Áï,
@defcv {Class Option} Window border-pattern
...
@end defcv
À§ÀÇ ¿¹´Â Window Ŭ·¡½ºÀÇ border-pattern Ŭ·¡½º ¿É¼ÇÀ» Á¤ÀÇÇÒ ¶§ ±× ù¹ø° ÁÙÀ» ¾î¶»°Ô ¾µÁö º¸¿©ÁØ´Ù. templateÀº
@defcv category class name
...
@end defcv
@defcv´Â º¯¼ö »öÀο¡ Ç׸ñÀ» ¸¸µç´Ù.
@defivar class name
@defivar ¸í·ÉÀº object-oriented programming ³»ÀÇ instance º¯¼ö¸¦ Á¤ÀÇÇÏ´Â ¸í·ÉÀÌ´Ù. @defivar´Â `@defcv {Instance Variable} ...'¿Í µ¿ÀÏÇÏ´Ù. templateÀº:
@defivar class instance-variable-name
body-of-definition
@end defivar
@defivar´Â º¯¼ö »öÀο¡ Ç׸ñÀ» Çϳª ¸¸µç´Ù.
@defop category class name arguments...
@defop ¸í·ÉÀº object-oriented programming¿¡¼­ method¿Í °°Àº entity¸¦ Á¤ÀÇÇÏ´Â µ¥ ¾²´Â ÀϹÝÀûÀÎ ¸í·ÉÀÌ´Ù. ÀÌ entity´Â ÇÔ¼ö¿Í °°ÀÌ ÀÎÀÚ¸¦ ¹ÞÁö¸¸, ÀÌ enity´Â ƯÁ¤ Ŭ·¡½º¿Í ¿¬°üµÇ¾î ÀÖ´Ù. ¿¹¸¦ µé¾î, wrapper¶ó°í ºÎ¸£´Â ½Ã½ºÅÛÀÌ ÀÖ´Ù. ÀÌ ½Ã½ºÅÛÀº method¿Í ¸¶Âù°¡Áö·Î Ŭ·¡½º¿Í ¿¬°üµÇ¾î ÀÖÁö¸¸, ÇÔ¼ö¶ó±â º¸´Ù´Â ¸ÅÅ©·Îó¸§ µ¿ÀÛÇÑ´Ù. wrapper¸¦ Á¤ÀÇÇÒ ¶§ @defop Wrapper¶ó°í ¾µ ¼ö ÀÖ´Ù. ¾î¶² °æ¿ì¿¡´Â method¿Í operationÀ» ±¸ºÐÇÏ´Â °ÍÀÌ ÁÁ´Ù. ¾î¶² operationÀº ¾î¶² method¿¡ ´ëÇÑ specificationÀ̶ó°í »ý°¢ÇÒ ¼ö ÀÖ´Ù. Áï, ¾î¶² À©µµ¿ì ½Ã½ºÅÛÀº ¸ðµç À©µµ¿ì Ŭ·¡½º¿¡ expose¶ó´Â À̸§ÀÇ method¸¦ ¸¸µé ¼ö ÀÖ´Ù; ¿ì¸®´Â ÀϹÝÀûÀ¸·Î ÀÌ À©µµ¿ì ½Ã½ºÅÛÀÌ expose operationÀ» Á¤ÀÇ Çß´Ù°í ¸»ÇÒ ¼ö ÀÖ´Ù. º¸Åë, operationÀº À̸§À» °®°í ÀÖ°í, ÀÎÀÚÀÇ ÆÐÅÏÀ» ÁöÁ¤Çϱ⵵ ÇÑ´Ù; ÀÌ operationÀ» implementÇÏ´Â ¸ðµç method´Â °°Àº ÀÎÀÚ¸¦ ¹Þ´Â´Ù, ¿Ö³ÄÇϸé ÀÌ operationÀ» »ç¿ëÇÏ´Â applicationÀº ¾î¶² method°¡ ÀÌ operationÀ» implementÇÒ Áö ¾ËÁö ¾Ê°íµµ ÀÌ operationÀ» »ç¿ëÇÒ ¼ö Àֱ⠶§¹®ÀÌ´Ù. º¸Åë methodº¸´Ù´Â operationÀ» ¹®¼­È­ ÇÏ´Â °ÍÀÌ ´õ ¾Ë±â ½±´Ù. ¿¹¸¦ µé¾î, À©µµ¿ì application °³¹ßÀÚ´Â expose operation¿¡ ´ëÇؼ­ ¾Ë¾Æ¾ß ÇÏÁö¸¸, ÁÖ¾îÁø À©µµ¿ìÀÇ Å¬·¡½º°¡ ÀÌ operationÀ» implementÇÏ´Â method¸¦ °®°í ÀÖ´ÂÁö ½Å°æ¾µ ÇÊ¿ä°¡ ¾ø´Ù. ÀÌ operationÀ» Á¤ÀÇÇÏ·Á¸é, ´ÙÀ½°ú °°ÀÌ ¾µ °ÍÀÌ´Ù:
@defop Operation windows expose
@defop ¸í·ÉÀº ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, °°Àº ÁÙ¿¡ operationÀÇ category À̸§, ÀÌ operationÀÇ Å¬·¡½º À̸§, ÀÌ operationÀÇ À̸§, ±×¸®°í ±× ÀÎÀÚ°¡ ÀÖ´Ù¸é ÀÎÀÚµéÀ» ¾´´Ù. templateÀº:
@defop category class name arguments...
body-of-definition
@end defop
@defop creates an entry, such as `expose on windows', in the index of functions.
@defmethod class name arguments...
@defmethodd ¸í·ÉÀº object-oriented programming¿¡¼­ method¸¦ Á¤ÀÇÇÏ´Â ¸í·ÉÀÌ´Ù. method´Â ÀÏÁ¾ÀÇ ÇÔ¼ö·Î ƯÁ¤ÇÑ objectÀÇ Å¬·¡½º¿Í ±× ¼­ºêŬ·¡½º¿¡ ´ëÇÑ operationÀ» implementÇÑ´Ù. Lisp machine¿¡¼­, method´Â ½ÇÁ¦·Î ÇÔ¼öÀÌÁö¸¸, º¸Åë defmethod·Î Á¤ÀǵȴÙ. @defmethod´Â `@defop Method ...'¿Í °°´Ù. ÀÌ ¸í·ÉÀº ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, ±× ´ÙÀ½¿¡ ±× methodÀÇ Å¬·¡½ºÀÇ À̸§, ±× methodÀÇ À̸§, ±×¸®°í ÀÎÀÚ°¡ ÀÖ´Ù¸é ÀÎÀڵ鸦 ¾´´Ù. ¿¹¸¦ µé¾î,
@defmethod bar-class bar-method argument
...
@end defmethod
À§ÀÇ ¿¹´Â bar-class Ŭ·¡½ºÀÇ bar-method¶ó´Â method¸¦ Á¤ÀÇÇÑ´Ù. ÀÌ method´Â ÇÑ°³ÀÇ ÀÎÀÚ¸¦ ¹Þ´Â´Ù. templateÀº:
@defmethod class method-name arguments...
body-of-definition
@end defmethod
@defmethod´Â `bar-method on bar-class¿Í °°Àº Ç׸ñÀ» ÇÔ¼ö »öÀο¡ ¸¸µç´Ù.
@deftypemethod class data-type name arguments...
@deftypemethod ¸í·ÉÀº C++À̳ª Java¿Í °°Àº object-oriented typed language¿¡¼­ method¸¦ Á¤ÀÇÇÏ´Â ¸í·É¾îÀÌ´Ù. ÀÌ°ÍÀº @defmethod ¸í·É¿¡ data-typeÀÇ ÀÎÀÚ¸¦ ´õÇؼ­ ±× methodÀÇ return typeÀ» ÁöÁ¤ÇÑ´Ù.

Data Types

´ÙÀ½Àº data type¿¡ ´ëÇÑ ¸í·É¾îÀÌ´Ù:

@deftp category name attributes...
@deftp ¸í·ÉÀº data typeÀ» Á¤ÀÇÇÏ´Â ÀϹÝÀûÀÎ ¸í·É¾îÀÌ´Ù. ÀÌ ¸í·ÉÀº ÁÙÀÌ ½ÃÀÛÇÒ ¶§ ¾²°í, °°Àº ÁÙ¿¡ category, ŸÀÔÀÇ À̸§(int³ª float¿Í °°Àº ´Ü¾î), ±×¸®°í ±× ŸÀÔÀÇ objectÀÇ attribute À̸§µéÀ» ¾´´Ù. Áï, int³ª float¸¦ ±â¼úÇϱâ À§ÇØ ÀÌ ¸í·ÉÀ» »ç¿ëÇÒ ¼öµµ ÀÖ°í, ÀÌ °æ¿ì¿¡ data typeÀ» category·Î »ç¿ëÇÑ´Ù. (data typeÀº ¾î¶² objectµéÀÇ categoryÀÌ°í, ÀÌ category´Â ÀÌ objectµé¿¡ ´ëÇØ ¾î¶² operationÀÌ °¡´ÉÇÑÁö °áÁ¤ÇÏ´Â µ¥ ¾²ÀδÙ.) ¿¹¸¦ µé¾î, Lisp¿¡¼­ pair´Â ƯÁ¤ data typeÀÇ À̸§ÀÌ°í, ÀÌ typeÀÇ object´Â CAR¿Í CDRÀ̶ó´Â µÎ°³ÀÇ slotÀÌ ÀÖ´Ù. ´ÙÀ½Àº ¾î¶»°Ô pair¸¦ ±â¼úÇϴ ù¹ø° ÁÙÀÇ ¿¹ÀÌ´Ù.
@deftp {Data type} pair car cdr
...
@end deftp
templateÀº ´ÙÀ½°ú °°´Ù:
@deftp category name-of-type attributes...
body-of-definition
@end deftp
@deftp´Â data type »öÀο¡ Ç׸ñÀ» Ãß°¡ÇÑ´Ù.

Conventions for Writing Definitions

@deffn, @defun, ¶Ç´Â ±× ¿ÜÀÇ Á¤ÀÇ ¸í·ÉÀ» »ç¿ëÇؼ­ Á¤ÀǸ¦ ¾µ ¶§, ÀÌ ÀÎÀÚ´Â ±× Á¤ÀÇÀÇ Àǹ̸¦ ³ªÅ¸³»´Âµ¥, forward-word ±â´É¿¡ count¸¦ »ç¿ëÇؼ­ ÁÖÀÇÇؼ­ ¾²±â ¹Ù¶õ´Ù. ¶Ç, ¾î¶² ÀÎÀÚ°¡ integer¿Í °°Àº ŸÀÔÀÇ À̸§ÀÎ °æ¿ì, ½ÇÁ¦ ±× ÀÎÀÚ°¡ ±× typeÀÎÁö ÁÖÀÇÇ϶ó.

A Sample Function Definition

¾î¶² ÇÔ¼öÀÇ Á¤ÀÇ°¡ @defun°ú @end defun ¸í·ÉÀ» »ç¿ëÇÑ´Ù. ÀÌ ÇÔ¼öÀÇ À̸§Àº @defun ¸í·É ´ÙÀ½¿¡ ¿À°í, °°Àº ÁÙ¿¡ °è¼ÓÇؼ­ ÀμöÀÇ ¸®½ºÆ®°¡ ¿Â´Ù.

´ÙÀ½Àº see section `Calling Functions' in The GNU Emacs Lisp Reference Manual¿¡¼­ ÀοëÇÑ Á¤ÀÇÀÌ´Ù.

Function: apply function &rest arguments
apply calls function with arguments, just like funcall but with one difference: the last of arguments is a list of arguments to give to function, rather than a single argument. We also say that this list is appended to the other arguments.

apply returns the result of calling function. As with funcall, function must either be a Lisp function or a primitive function; special forms and macros do not make sense in apply.

(setq f 'list)
     => list
(apply f 'x 'y 'z)
error--> Wrong type argument: listp, z
(apply '+ 1 2 '(3 4))
     => 10
(apply '+ '(1 2 3 4))
     => 10

(apply 'append '((a b c) nil (x y z) nil))
     => (a b c x y z)

An interesting example of using apply is found in the description of mapcar.

Texinfo ¼Ò½º ÆÄÀÏ¿¡¼­, ÀÌ ¿¹´Â ´ÙÀ½°ú °°ÀÌ º¸ÀδÙ.

@defun apply function &rest arguments

@code{apply} calls @var{function} with
@var{arguments}, just like @code{funcall} but with one
difference: the last of @var{arguments} is a list of
arguments to give to @var{function}, rather than a single
argument.  We also say that this list is @dfn{appended}
to the other arguments.

@code{apply} returns the result of calling
@var{function}.  As with @code{funcall},
@var{function} must either be a Lisp function or a
primitive function; special forms and macros do not make
sense in @code{apply}.

@example
(setq f 'list)
     @result{} list
(apply f 'x 'y 'z)
@error{} Wrong type argument: listp, z
(apply '+ 1 2 '(3 4))
     @result{} 10
(apply '+ '(1 2 3 4))
     @result{} 10

(apply 'append '((a b c) nil (x y z) nil))
     @result{} (a b c x y z)
@end example

An interesting example of using @code{apply} is found
in the description of @code{mapcar}.@refill
@end defun

ÀÌ ¸Å´º¾ó¿¡¼­, ÀÌ ÇÔ¼ö´Â apply ¶ó´Â À̸§À¸·Î ¸í·É¾î¿Í º¯¼ö »öÀο¡ µé¾î ÀÖ´Ù.

ÀϹÝÀûÀÎ º¯¼ö¿Í user optionÀº ÇÔ¼ö¿Í °°Àº Çü½ÄÀ» »ç¿ëÇؼ­ ±â¼úµÈ´Ù. ´Ü º¯¼ö´Â ÀÎÀÚ¸¦ ¹ÞÁö ¾Ê´Â´Ù.


Go to the first, previous, next, last section, table of contents.