| °è±Þ :: °è¾à Ŭ·¡½º :: °è¾àÀº Perl Ŭ·¡½º¿¡ ½±°Ô °è¾àÀ» Ãß°¡ÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
°è±Þ :: °è¾à ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Ian Langworth
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~ian/
°è±Þ :: °è¾à ű×
°è±Þ :: °è¾à ¼³¸í
Class :: °è¾àÀº Perl Ŭ·¡½º¿¡ ½±°Ô °è¾àÀ» Ãß°¡ÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù. Class :: °è¾àÀº Perl Ŭ·¡½º¿¡ °è¾àÀ» ½±°Ô Ãß°¡ÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù. Synopsis ÆÐÅ°Áö SomeClass; Ŭ·¡½º :: °è¾à; # ±âº» 'Ŭ·¡½º :: ¾×¼¼¼'¶Ç´Â 'class :: methodmaker', # ¶Ç´Â ÀڽŸ¸ÀÇ ·Ñ : »õ·Î¿î {...} ºÒº¯ {³» ($ self) = @_; $ self-> count> 0; }; Precondition add_a_positive => sub {my ($ self, $ value) = @_; ¹Ýȯ ($ value> = 0); }; ÇÏÀ§ add_a_positive {my ($ self, $ value) = @_; ...} Sub Choose_Word {My ($ self, $ value) = @_; ...} Postcondition CONLET_WORD => SUB {RETURN (RETURN); }; ÀÇÁ¸Àû ÀÎ Áõ°¡ _foo => sub {my ($ self, $ makal) = @_; ³» $ old_foo = $ self-> foo; ¹Ýȯ ÇÏÀ§ {³» ($ self, $ makal) = @_; ¹Ýȯ ($ old_foo <$ self-> get_foo); }}; Sub Coreate_foo {My ($ self, $ make) = @_; $ self-> set_foo ($ self-> get_foo + $ malue); } Ŭ·¡½º :: °è¾àÀº Perl5¿¡ ´ëÇÑ Çൿ °è¾àÀ» ±¸ÇöÇÏ´Â °ÍÀÔ´Ï´Ù. ÀÌ ¸ðµâÀ» »ç¿ëÇÏ¸é ½Å±Ô ¶Ç´Â ±âÁ¸ Perl Ŭ·¡½º¿¡ »çÀü ¹× »çÈÄ Á¶°ÇÀ» ½±°Ô Ãß°¡ ÇÒ ¼ö ÀÖ½À´Ï´Ù.ÀÌ ¸ðµâÀº Á¾¼Ó °è¾à°ú °°Àº °è¾à, °íÂ÷¿ø ±â´ÉÀÇ °è¾à ¹× »ç¹°ÀÌ ½ÇÆÐ ÇÒ ¶§ À¯ÀÍÇÑ ¸Þ½ÃÁö¸¦ Á¦°øÇÕ´Ï´Ù. : °è¾à ºÎÁ· ±¸¼º ¿ä¼Ò°¡ ¿Ã¹Ù¸£°Ô ºñ³ÇÏ´Â µÎ °³ÀÇ °è¾à ±¸Çö Áß ÇϳªÀÔ´Ï´Ù. ( "°´Ã¼ ÁöÇâ ÇÁ·Î±×·¡¹Ö ¾ð¾î´Â http://citeseer.ist.psu.edu/findler01objectoriented.html.html.html.html.html.html.html.html.htmusing¿¡¼"°´Ã¼ ÁöÇâ ÇÁ·Î±×·¡¹Ö ¾ð¾î°¡ ÇÊ¿äÇÕ´Ï´Ù. µû¶ó¼ Äڵ带 °ÈÇÏ°í ÀÌÀü¿¡ ¹ö±×¸¦ ¹ß°ß ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¡¤ Perl ¿ä±¸ »çÇ× : ¡¤ Perl.
°è±Þ :: °è¾à °ü·Ã ¼ÒÇÁÆ®¿þ¾î