| AI :: FreeHal :: Class. Ç¥ÁØ "³»ºÎ ¾Æ¿ô"Ŭ·¡½º ¸¸µé±â Áö¿ø |
Áö±Ý ´Ù¿î·Îµå |
AI :: FreeHal :: Class. ¼øÀ§ ¹× ¿ä¾à
- ƯÇã:
- Perl Artistic License
- °Ô½ÃÀÚ À̸§:
- Tobias Schulz
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://search.cpan.org/~tschulz/
AI :: FreeHal :: Class. ű×
AI :: FreeHal :: Class. ¼³¸í
Ç¥ÁØ "³»ºÎ ¾Æ¿ô"Ŭ·¡½º ¸¸µé±â Áö¿ø AI :: FreeHal :: Class´Â Ç¥ÁØ "inside-out"Ŭ·¡½º¸¦ ¸¸µå´Â Áö¿øÀ» Á¦°øÇÏ´Â Perl ¸ðµâÀÔ´Ï´Ù .Synopsis ÆÐÅ°Áö MyClass; AI :: FreeHal :: Class; # °³Ã¼ ¼Ó¼º¿¡ ´ëÇÑ ÀúÀå¼Ò ¸¸µé±â ... % À̸§ : attr; ³» % ¼øÀ§ : attr; ³» % snum : attr; ³» % public_data : attr; #ÀÌ Å¬·¡½ºÀÇ °´Ã¼ÀÇ Ãʱâȸ¦ ó¸® ... ÇÏÀ§ ºôµå {My ($ self, $ obj_id, $ arg_ref) = @_; $ name {$ obj_id} = check_name ($ arg_ref -> {name}); $ RANK {$ obj_id} = check_rank ($ arg_ref -> {¼øÀ§}); $ snum {$ obj_id} = _gen_uniq_serial_num (); } #ÀÌ Å¬·¡½ºÀÇ °´Ã¼ÀÇ Á¤¸®¸¦ ó¸®ÇϽʽÿÀ ... ÇÏÀ§ Æı« {³» ($ self, $ obj_id) = @_; _recycle_serial_num ($ snum {$ obj_id}); } # ¾Ë ¼ö¾ø´Â ¸Þ¼µå È£ÃâÀ» ó¸® ... ÇÏÀ§ Automethod {My ($ self, $ obj_id, @other_args) = @_; # °ø¿ë µ¥ÀÌÅ͸¦ ¹ÝȯÇϽʽÿÀ ... (m / a get _ (. *) /) {# my $ get_what = $ 1¿¡ Àü´Þ µÈ °æ¿ì; ¸®ÅÏ ÇÏÀ§ {$ public_data {$ obj_id} {$ get_id} {$ get_id} }} °æ°í "´Â"ref $ self, "object"¿¡¼ $ method_nameÀ» È£Ãâ ÇÒ ¼ö ¾ø½À´Ï´Ù. ¹ÝÇ°; # È£ÃâÀº ÇÏÀ§ ref}¸¦ ¹ÝȯÇÏÁö ¾ÊÀ½À¸·Î½á °ÅºÎµË´Ï´Ù. c) O'Reilly Media, Inc.¿¡¼ 2005 ³â. ¿ä±¸ »çÇ× : ¡¤ Perl.
AI :: FreeHal :: Class. °ü·Ã ¼ÒÇÁÆ®¿þ¾î