Humble Little Ruby Book/Translation
Humble Little Ruby Book ÀÇ ¹ø¿ª°ü·Ã ÆäÀÌÁö ÀÔ´Ï´Ù. ¶
¹ø¿ª ¿ë¾î ¶
¿À·ù ¶µåµð¾î ¹ø¿ª ÇÁ·ÎÁ§Æ®°¡ ½ÃÀ۵Ǿú±º¿ä. Àá±ñ 0Àå°ú 1ÀåÀ» ÈȾ¾Ò½À´Ï´Ù. ÀúÀںв²¼ Ã¥À» ¹«Ã´ Àç¹ÌÀÖ°Ô ¾²¼Ì³×¿ä. Àдٺ¸´Ï Ã¥¿¡ ÀÖ´Â ¿À·ù¸¦ ¹ß°ßÇÏ¿´½À´Ï´Ù. 12 ÆäÀÌÁö¿¡ ¹Ø¿¡ ±×¸²ÀÌ 2°³ Àִµ¥ µÎ ±×¸² ¸ðµÎ 0ºÎÅÍ ½ÃÀÛÇÏ´Â °ÍÀÌ ¾Æ´Ï°í 1ºÎÅÍ ½ÃÀÛÇØ¾ß µÇ°Ú³×¿ä. ¹Ø¿¡ ÂïÈù ÆäÀÌÁö´Â 12 ÆäÀÌÁöÀÌ°í PDF ÆÄÀÏ¿¡¼´Â 28ÆäÀÌÁöÀÇ À§Ä¡ÀÔ´Ï´Ù. -- only2sea 2007-01-16 22:04:30
2Àå¿¡ 28ÆäÀÌÁö °¡¿îµ¥ Âë¿¡
While we are on the subject of convention, there are other conventions that pertain to the name of methods. Firstly, if it is querying an attribute, it should end in a question mark; for example, if you were to write a method to get the number of French military victories, you could do something like France.has_military_victories?. This would, of course, return false.¿Í °°Àº ºÎºÐÀÌ Àִµ¥, À¯¸Ó·¯½ºÇÑ ºÎºÐÀº ¾ÆÁÖ Àç¹ÌÀÖ°í ÁÁÀºµ¥ ³»¿ëÀÌ Á» ÀÌ»óÇÏÁö ¾Ê³ª¿ä? ÇÁ¶û½º ±ºÀÌ ½Â¸®ÇÑ È¸¼ö¸¦ ±¸ÇÏ´Â °ÍÀε¥, ¸Þ¼Òµå À̸§ÀÌ has_military_victories? °¡ µÇ°í, °á°ú°ªÀÌ false¶ó´Â °ÍÀε¥, ¾Æ¹«·¡µµ the number of French military victories°¡ ¾Æ´Ï¶ó ÇÁ¶û½º ±ºÀÌ ½Â¸®Çß´ÂÁöÀÇ ¿©ºÎ¸¦ ¾ò°íÀÚ ÇÑ´Ù°í °íÃÄ¾ß µÇ°Ú³×¿ä. »ç¼ÒÇÑ ¿À·ùÁö¸¸ Ȥ½Ã³ª Á¦°¡ À߸ø ÀÌÇØÇÏ°í ÀÖ´Â °ÍÀΰ¡ Çؼ ¿©Â޾´Ï´Ù. -- only2sea 2007-01-17 01:01:59 ¾Æ¸¶ ÀúÈñ°¡ À¯·´ ¿ª»ç¿¡ ´ëÇÑ ÀÌÇØ°¡ ¸¹ÀÌ ºÎÁ·Çؼ ±×·± °Í °°½À´Ï´Ù. ¾Æ¸¶µµ ÀÛ°¡´Â ±ÛÀÇ ³»¿ëÀ» ÅëÇØ ºñ²¿´Â ¹®ÀåÀ» ½èÀ» °¡´É¼ºÀÌ ³ô½À´Ï´Ù. -- jachin
¾Æ¹«·¡µµ has_french_victories?´Â number°¡ ¾Æ´Ï¶ó true/false¸¦ ¹ÝȯÇÏ´Â ¸Þ¼Òµå¶ó°í »ý°¢ÇÏ¿© ¹ø¿ª¹®¿¡´Â ¿Ã¹Ù·Î °íÃƽÀ´Ï´Ù. Á¦ ¹ø¿ª¿¡¼ Ʋ¸° Á¡ÀÌ ÀÖ´Ù¸é ¸»¾¸ÇØÁÖ¼¼¿ä.
Àúµµ jachin´Ô ÀÇ°ß¿¡ µ¿ÀÇÇÕ´Ï´Ù. of course¶ó°í °Á¶ÇÑ °É º¸¾Æ¼´Â ÀúÀÚ°¡ ÀǵµÀûÀ¸·Î (±»ÀÌ Á¤¼öÇüÀ» ¸®ÅÏÇÒ ÇÊ¿ä°¡ ¾øÀ» °ÍÀ̶ó°í) Ç¥ÇöÇÑ °Íó·³ ´À²¸Áö³×¿ä.. -- pastime
1Àå¿¡ pastime´Ô²²¼ ¹ø¿ªÇϽŠºÎºÐÀ» ºÃ´Âµ¥ syntactic sugar¶ó´Â °ÍÀ» ¹«¾ùÀ¸·Î ¹ø¿ªÇϸé ÁÁÀ»±î¿ä? Á¦ °³ÀÎÀûÀ¸·Î´Â "Æí¸®ÇÑ ¹®¹ý" ºñ½ÁÇÑ °ÍÀ¸·Î »ý°¢ÇÏ°í Àִµ¥, ±×·¯´Ï±î ¾ð¾î¿¡¼ ÇʼöÀûÀ¸·Î ÇÊ¿äÇÑ °ÍÀº ¾Æ´ÏÁö¸¸ ÆíÀǸ¦ À§ÇÏ¿© ÀÌ·¸°Ôµµ ¾µ ¼ö ÀÖ°í Àú·¸°Ôµµ ¾µ ¼ö ÀÖµµ·Ï ¸¸µé¾î ³õÀº °ÍÀ» ¸»Çϴµ¥ "¹®¹ý ¼³ÅÁ"À̶ó°í ¹ø¿ªÇØ ³õÀº °÷µµ ÀÖ°í, "´ÞÄÞÇÑ ¹®¹ý"À̶ó°í ¹ø¿ªÇÑ °÷µµ ÀÖ´õ¶ó±¸¿ä. HLRBÀÇ 1Àå¿¡¼ ¹è¿ÀÇ ¸Ç µÚ¿¡ ¿ø¼Ò¸¦ Ãß°¡ÇÏ´Â °ÍÀ» push¸¦ ½á¼ ÇÒ ¼öµµ ÀÖ°í << ¿¬»êÀÚ¸¦ ½á¼ ÇÒ ¼öµµ Àִµ¥ ±×·± °ÍÀ» ÀǹÌÇÏ´Â °Í °°Àºµ¥ ±×¿¡ °É¸Â´Â ¸ÚÁø ¹ø¿ª¾î°¡ ¾øÀ»±î¿ä? -- only2sea 2007-01-17 00:19:39
ÀÚÀ¯ÀÚÀç·Î ¹®¹ýÀ» ±¸»çÇؼ ½±°Ô Äڵ带 ÀÛ¼ºÇÒ ¼ö Àֱ⠶§¹®¿¡, '»çÅÁ ¸ÔµíÀÌ ½¬¿î °Í' À» ÀǹÌÇÏ´Â ³»¿ëÀÏ °Í °°½À´Ï´Ù. '´©¿ö¼ ¶±¸Ô±â'¿Í °°Àº ºÎºÐÀ̶ö±î¿ä? ±×·± °÷¿¡´Â ¿ø¾î´ë·Î ½á³õ°í ÁÖ¼®À» ´Þ¾Æ³õÀ¸½Ã´Â °ÍÀÌ Àд ºÐµé¿¡°Ô µµ¿òÀÌ µÉ °Í °°½À´Ï´Ù. ¿ë¾î Á¤¸®´Â Å»°íÇÏ´Â ºÎºÐ¿¡¼ »ìÆ캸µµ·Ï ÇÏÁö¿ä. -- jachin 2007-01-19 09:07:55
Syntactic sugar¶ó´Â °ÍÀº Á¦°¡ ¸»¾¸µå¸°´ë·Î ¿©ºÐÀÇ ¹®¹ý°ú °°Àº °ÍÀÔ´Ï´Ù. Áï, ¾ø´Ù°í Çؼ ¹®Á¦°¡ µÇ´Â °ÍÀº ¾Æ´ÏÁö¸¸ Àΰ£ÀÇ ÆíÀǸ¦ À§Çؼ Ãß°¡ÀûÀ¸·Î Çã¿ëÇÏ´Â ¹®¹ýÀÔ´Ï´Ù. ´Ü¼øÈ÷ "¹®¹ýÀûÀÎ »çÇ×"À̶ó´Â ¶æÀº ¾Æ´Õ´Ï´Ù. http://en.wikipedia.org/wiki/Syntactic_sugar ÁÖ·Î Àú´Â ÀÌ°ÍÀ» "Æí¸®ÇÑ ¹®¹ý(Syntactic sugar)"Á¤µµ·Î ¹ø¿ªÇÏ°í ÀÖ¾ú½À´Ï´Ù. ¾î¶² ºÐÀº "¹®¹ý ¼³ÅÁ"À̶ó°í ¹ø¿ªÇϱ⵵ ÇÏ½Ã°í ¾î¶² ºÐÀº "´ÞÄÞÇÑ ¹®¹ý"À̶ó°í ¹ø¿ªÇϱ⵵ ÇÕ´Ï´Ù. ±×·¡¼ ÁÁÀº ¹ø¿ª¾î¸¦ ã°í ÀÖ¾ú´ø °ÍÀÔ´Ï´Ù. -- only2sea 2007-01-20 00:46:39
±×·¸±º¿ä. ¸»¾¸ÇϽŠ³»¿ëÀ» ¹ÌÁÖ·Î ¼³Á¤Çϼż ¾²½Ã´Â °ÍÀÌ ÁÁÀ»°Í °°½À´Ï´Ù. ¹ø¿ª¾î¸¦ ã´Â °Íº¸´Ù ¹®¼¸¦ ÀÐÀ» ¼ö ÀÖµµ·Ï ¸¸µå´Â °ÍÀÌ ´õ ¿ì¼±µÉ ³»¿ëÀ̴ϱî¿ä. -- jachin 2007-01-20 23:08:00
¾Æ´Õ´Ï´Ù. ¹ø¿ª ÇÒ ºÐ·®ÀÌ ³Ê¹« ¸¹±âµµ ÇÏ°í Çؼ Á¦ ¹ø¿ªÀÌ ´õ¿í ¾û¸ÁÀÔ´Ï´Ù. pastime´Ô²²¼ ¹ø¿ªÇϽŠ´Ù¸¥ ¹®¼µéµµ °¨»çÈ÷ Àß Àаí ÀÖ½À´Ï´Ù. -- only2sea 2007-01-22 21:30:30
°¨»çÇÕ´Ï´Ù. ¸¹Àº Á¶»ç¸¦ ¸øÇغ¸°í ±×³É ½±°Ô½±°Ô ³Ñ¾î°¡·Á´Ùº¸´Ï;; Àǹ̰¡ ¾à°£ À߸øµÇ¾î¹ö¸° °Í °°³×¿ä.. ¼ö°íÇØ ÁֽŠonly2sea´Ô²² °¨»çµå¸³´Ï´Ù. -- pastime
Åð°í ¶º»¹®À» º¸½Ã¸é Ruby¶ó°í ³ÀµÐ °÷ÀÌ ÀÖ°í ·çºñ¶ó°í À½À» Çѱ۷ΠÀûÀº ºÎºÐÀÌ Àִµ¥ µÑÁß ¾î´À°É·Î ÅëÀÏÇÏ´Â°Ô ÁÁÀ»±î¿ä?? -- Mind$torm
·çºñ¶ó°í Çѱ۷Π¾²´Â °ÍÀÌ ³´´Ù°í »ý°¢ÇÕ´Ï´Ù. ¸¸¾à¿¡ ·çºñ¸¦ ½ÇÇàÇϱâ À§ÇÏ¿© "Ruby"¶ó°í Á÷Á¢ ÀÔ·ÂÇØ¾ß ÇѴٰųª ÇÏ´Â »óȲ¿¡¼´Â "Ruby"¸¦ ±×´ë·Î µÎ¾î¾ß°ÚÁö¿ä. ¸¶Âù°¡Áö·Î Object¸¦ °´Ã¼¶ó°í ¾µ ¶§µµ ÀÖ°í, Object¶ó°í ÇÏ´Â ÃÖ»óÀ§ Ŭ·¡½º¸¦ ¸»ÇÒ ¶§¿¡´Â Object¸¦ °´Ã¼¶ó°í ¹ø¿ªÇÏÁö ¾Ê°í, ±×´ë·Î ½á¾ß°ÚÁö¿ä. -- only2sea 2007-01-22 21:30:30
0 Àå ¶°ËÅäÇÑ ³»¿ëÀ» Àû¾îµÎ¾ú½À´Ï´Ù. °³ÀÎÀûÀÎ ÀÇ°ßÀ̹ǷΠÂü°í¸¸ ÇØÁֽñæ.. -- pastime
|
You will be given a post of trust and responsibility. |