å ¨ã¦ãå¼ã«ãªãï¼å ¨ã¦ãæ¨ã«ãªãï¼å ¨ã¦ãå¼æ¨ã«ãªã
é¢æ°åããã°ã©ãã¯ããã°ã©ã ãæ¨ã ã¨æã£ã¦ããããï¼ãã
ããã£ã yhara ããã®ã¨ããããï¼
é¢æ°åããã°ã©ãã¯ããã°ã©ã ãæ¨ã ã¨æã£ã¦ãããã
gauche.nightã§åºã話é¡ã ãã©ãé¢æ°åããã°ã©ãã¯ããã°ã©ã ãæ¨ã ã¨æã£ã¦ããããã
(car (string-split (string-reverse (string-upcase str)) "\n"))ãããããã¯æ¨ã ã
head $ lines $ reverse $ upcase strHaskellã 㨠$ ãããããè¦ãç®ã¯ãã¹ããã¦ãªããã©ãå®éã«ã¯é¢æ°ã«é¢æ°ã®è¿ãå¤ã渡ãã¦ããã
ãããé¢æ°åããã°ã©ãã¯é¢æ°å¼ã³åºãã®ä¸ã«é¢æ°ãæ¸ããã¨ã«æµæããªããã§ãCè¨èªã¨ãã ã¨ããé¢æ°å¼ã³åºãã®ä¸ã«é¢æ°ã£ã¦æ¸ããªãããããæ®éããããçããã¤ãé¤ãã°ãã ãããä¸æ¦å¤æ°ã«ä»£å ¥ããã§ããã
ãã®ã¸ãã®éããé¢æ°åè¨èªãå¦ã¶ã¨ãã®æµæã«ãªã£ã¦ãã®ããªãã¨æã£ãã
ããããç®ã§è¦ãã°ãRubyã®ã¡ã½ãããã§ã¼ã³ã¯ãæ¨æ§é ã使ããã«é¢æ°çãªå¦çãæ¸ãããã®çºæãã£ã¦ãã風ã«è¦ãã¦ãã¾ãããï¼
ãã®è¦ç¹ã¯ãããªãï¼
å®ã¯ C++ ã®ã¹ããªã¼ã æ¼ç®åã¯é¢æ°ã«é¢æ°ã®è¿ãå¤ã渡ãã¹ã¿ã¤ã«ï¼ã§ããã£ã±ã大å¤æ°ã®ããã°ã©ãã«ã¨ã£ã¦ï¼é¢æ°å¼ã³åºãã¯é¢æ°å¼ã³åºãã ãï¼å¤æ°ä»£å
¥ã¯å¤æ°ä»£å
¥ï¼ã¹ããªã¼ã æ¼ç®åã¯ã¹ããªã¼ã æ¼ç®åï¼ã¿ãããªæèã®å£ãããï¼
C# ã¨æ¨
C# ã¯ã©ãã ããï¼
åºçºç¹ã¨ãã¦ãããªã®ãèãã¦ã¿ãï¼
A(B(C(a), b, D(E(c), d, e)));
ããï¼ããã¯æ¨ã ï¼
- A
- B
- C
- a
- b
- D
- E
- c
- d
- e
- E
- C
- B
ãããæ¨ã§ãããã¨èªä½ã¯æªããªããçãããããªãï¼ããã C# ã«ã¯ C++ ããåãç¶ãã é¢æ°ãªã¼ãã¼ãã¼ããã¸ã§ããªãã¯ã¡ã½ããã®åæ¨è«ï¼ããã« C++ ã«ã¯ç¡ãã¸ã§ããªãã¯ã®å¶ç´ã¨ããä»çµã¿ãããï¼é¢æ°å½¢ã§æ¸ãã¡ãªããã¯å¤§ããï¼
ä¸æ¹ã§ C/C++ ããåãç¶ãã æ¬è½ã«ããï¼ A( B( C(a), b, D( E(c), d, e ) ) ); ã¨ãã表è¨ã«ã¯æããããæµææãããï¼ã¨ãããæ¬å¼§å¤ããã ããï¼ããã§çã奴ãæ··ãã¦é£²ã¿ããããã¦ã¿ãï¼ããï¼Extension Methodsï¼
Extension Methods
A(B(C(a), b, D(E(c), d, e)));
// â
a.C().B(b, c.E().D(d, e)).A();
ã ãã¶é£²ã¿ããããªã£ãï¼æ¬å¼§ã®ãã¹ãã¬ãã«ãæããã«æ¸ã£ã¦ããï¼ã§ãæå³ããã¨ããã®æ¨ã¯æåã®ã¾ã¾ï¼ãªã¼ãã¼ãã¼ããã¸ã§ããªãã¯ã¡ã½ããã®åæ¨è«ã¯ã¾ãã¾ã温åããã¦ããï¼IntelliSense ã絶好調ï¼ããããæ¨æ§é ã使ããã«é¢æ°çãªå¦çãæ¸ãããã®çºæãã¨è¨ã£ã¦è¯ãã§ãããï¼è±ä¸¸ï¼
ã§ãããã ãã ã¨ãã£ãããªãï¼æ¨ã«ã¯ããããªãã®ãæ¥ãæ¨ã§ããã¯ãï¼ãã£ã¨èãã¦ã¿ãï¼
Anonymous Types, Member Initializers, Collection Initializers
æ°ãã追å ããè¦ç´ ãæ¥ãæ¨ã§ããããã«ã¯æ¡ä»¶ãããï¼æ¡ä»¶ã¨ã¯ï¼ãããå¼ã§ãããã¨ï¼ä¾ãã°ãã®æ¨ã«ï¼ãåå®ç¾©ãã®å¼ãæ¥ãæ¨ã§ããããã«ãã¦ã¿ããï¼
a.C().B(new {Name="hauhau", Age=666}, c.E().D(d, e)).A();
- A
- B
- C
- a
- new AnonymousType<string,int>
- "hauhau"
- 666
- D
- E
- c
- d
- e
- E
- C
- B
å®éã«ã¯ï¼ãåå®ç¾©ãã®é¨åã ãå¤ã«åãåºããã¦ï¼æ®ãã®ã¯ã³ã³ã¹ãã©ã¯ã¿ã®å¼ã³åºãã ãï¼æ®ãã®ã¯ãã£ã±ãæ¨ã ï¼
ãã£ã¨æ¥ãæ¨ãã¦ã¿ãï¼ä¾ãã°ã³ã³ã¹ãã©ã¯ã¿å¼ã³åºãç´å¾ã®å®åçãªããããã£ã»ããï¼
a.C().B(new {Name="hauhau", Age=666}, c.E().D(new MyClass() { ID = 123 }, e)).A();
- A
- B
- C
- a
- new AnonymousType<string,int>
- "hauhau"
- 666
- D
- E
- c
- MemberInit
- new MyClass()
- set_ID
- 123
- e
- E
- C
- B
ããããã£ã¸ã®ã»ããã¯ï¼ä»ã¾ã§é¢æ°å¼ã³åºãã®å¼æ°ã«ã¯æ¸ããªãã£ã*1ï¼ãï¼ãã¯ãããã¯å¶éã§ã¯ãªãï¼
ã ãã¶é·ããªã£ã¦ããã®ã§ããã§ã¡ãã£ã¨ã³ã¼ããæ´å½¢ï¼æ¬å¼§ã®ãã¹ãã¬ãã«ãä¸ãã£ã¦ããã®ã§ï¼æããã¯æ¥½ãªã¯ãï¼
a.C() .B(new {Name="hauhau", Age=666}, c.E().D(new MyClass() { ID = 123 }, e)) .A();
ããã²ã¨ã¤ã ã足ãã¦ã¿ããï¼ã³ã¬ã¯ã·ã§ã³ã¸ã®è¦ç´ ã®è¿½å ï¼
a.C() .B(new {Name="hauhau", Age=666}, c.E().D(new MyClass() { ID = 123 }, new Dictionary<string, string>() { {"Hello", "World"} })) .A();
- A
- B
- C
- a
- new AnonymousType<string,int>
- "hauhau"
- 666
- D
- E
- c
- MemberInit
- new MyClass()
- set_ID(int)
- 123
- new MyClass()
- ListInit
- new Dictionary
- ElementInit
- Add(string, string)
- "Hello"
- "World"
- Add(string, string)
- new Dictionary
- E
- C
- B
ããã§ã¾ãã²ã¨ã¤å®åå¦çãæ¨ã«çµã¿è¾¼ããï¼
ããã§æããã®ã¯é ã« Anonymous Typesï¼Member Initializersï¼Collection Initializers ã¨å¼ã°ãã C# 3.0 ã®æ°æ©è½ï¼ããã¤ãå
¨ã¦ãå¼ãªã®ã¯å¶ç¶ã§ã¯ãªãæå³çãªãã®ï¼ã¨ä¸ã®äººãè¨ã£ã¦ããï¼
ã§ãå®ã¯ãããæå¾ãããªãï¼C/C++ ã®åªç¸ãå¼ããã£ã¦ããéãï¼ãããã¨æ¬å¼§ãã¤ãã¦åãï¼ããããã¼ã¯ã¼ãã¨ãã¯ã¤ãã¹ãã¼ã¹ã®ãã¿ã¼ã³ã«ç½®ãæãã¦ï¼ããããæ°ããä¸çã«æ
ç«ã¨ãï¼ããã¦ããã«ã¡ã¯ã¯ã¨ãªå¼ï¼
ã¯ã¨ãªå¼
from i in Enumerable.Range(0, 100) select i;
ãã®ç¹å¥çã奴ãã¯ã¨ãªå¼ï¼å®éã«ã¯ãã㯠Extension Methods ã¸ã®å¤æã¨ãã¦å®ç¾©ããã¦ããï¼å¤æãã¦ã¿ãï¼
Enumerable.Range(0, 100).Select( i => i );
Extension Methods ããã ã®çã奴ãªã®ã§ããã«å ã«æ»ãï¼
Enumerable.Select( Enumerable.Range(0, 100), i => i );
çµå±ï¼ã¯ã¨ãªå¼ã¯ãã®æ¨ã®è¡¨ç¾å½¢å¼ã®æ°ç¨®ï¼Extension Methods ã®å¤æã«ã¼ã«ãåç´ã ã£ãã®ã¨éãï¼ã¯ã¨ãªå¼ã®å¤æã«ã¼ã«ã¯ãã¼ã¯ã¼ããã¨ã«çµæ§ãããããã£ããããï¼ãã¨ããããè¤éãªã®ãæ··ãã£ã¦ããï¼
ããã§åºæ¬ãããä¸åº¦ããããï¼ãã¤ã³ã1ï¼C# 3.0 ã§ãé¢æ°è©ä¾¡æ¦ç¥ã¯å¤ãããªãï¼ã ããæ¨ã¯çµ¶å¯¾ä½ãããï¼CPU ããã·ã³èªã§åãããã«ï¼ã³ã³ãã¤ã©ã¯çµ¶å¯¾ã«æ¨ãä½ãï¼ã©ã®ããã«è©ä¾¡ããããã¯æ¨ã§æ±ºã¾ãï¼
ãã¤ã³ã2ï¼ç¢ºãã«ã½ã¼ã¹ã³ã¼ãã«æ¨ã¯ç´æ¸ãã§ããï¼ã§ã大ããªæ¨ã¯æ¸ãã«ããããå¤æ°ä½¿ããã㨠C/C++ ããã°ã©ãã¯è¨ã£ãï¼ä¸æ¹ C# ã¯å¤æã«ã¼ã«ãå
¥ãã¦ã¿ãï¼Extension Methods ã®ãããªåç´ãªç½®ãæãã«ã¼ã«ã§ãï¼ã½ã¼ã¹ã³ã¼ãã®è¦ãç®ã¯ãããã¨å¤ãã£ãï¼ã§ãç½®ãæã㧠How ã¯å¤ãã£ã¦ãªãï¼ãï¼How ã®æ¨ãçã§è¦ãããã¨ã¯ãããªã«éè¦ãããªãã£ãã®ãã*2ï¼ã¨ï¼ããéè¦ï¼
ãã¤ã³ã3ï¼ãã£ããç½®ãæãããªãä½ãããããã«æ³¨ç®ããææ³ã®æ¹ãè¯ãããï¼ ãã¯ãã¡æ©æ¢°ãããªããï¼
ãããã¡ãã£ã¨æ¯ã¹ã¦ã¿ã¦ã¿ã¾ãããï¼
ã¯ã¨ãªå¼1
var checkingTypes = new[] { new {DisplayName = "short", Type = typeof(short), Priority = 10}, new {DisplayName = "ushort", Type = typeof(ushort), Priority = 10}, new {DisplayName = "void", Type = typeof(void), Priority = 1}, }; from method in typeof(string).GetMethods() join check in checkingTypes on method.ReturnType equals check.Type select new { Method = method, CheckingType = check };
ããã¯ä¸ã®å¼ã¨ç価ï¼
typeof(string).GetMethods().Join( checkingTypes, method => method.ReturnType, check => check.Type, (method, check) => new { Method = method, CheckingType = check });
ãï¼ å ¨ç¶æ²æ¨ãããªãï¼ ã¾ãããããï¼
ã¯ã¨ãªå¼2
from x in Enumerable.Range(0, 100) from y in Enumerable.Range(0, x) select new { X = x, Y = y };
ããã¯ä¸ã®å¼ã¨ç価ï¼
Enumerable.Range(0, 100) .SelectMany(x => Enumerable.Range(0, x), (x, y) => new { X = x, Y = y });
ã¯ã¨ãªå¼2'
ãã¹ãããä¸åå¢ããï¼
from x in Enumerable.Range(0, 100) from y in Enumerable.Range(0, x) from z in Enumerable.Range(y, 100) select new { X = x, Y = y, Z = z }
ããã¯ä¸ã®å¼ã¨ç価ï¼
Enumerable.Range(0, 100) .SelectMany(x => Enumerable.Range(0, x), (x, y) => new { x = x, y = y }) .SelectMany(s => Enumerable.Range(s.y, 100), (s, z) => new { X = s.x, Y = s.y, Z = z });
ããã«ããã¯ä¸ã®å¼ã¨ç価ï¼ã¾ãæ¸ããªãããï¼
Enumerable.SelectMany( Enumerable.SelectMany( Enumerable.Range(0, 100), Enumerable.SelectMany(x => Enumerable.Range(0, x), (x, y) => new { x = x, y = y })), s => Enumerable.Range(s.y, 100), (s, z) => new { X = s.x, Y = s.y, Z = z } );
ã¯ã¨ãªå¼3
ä¸é¨ã®å¤§ããªãåéã大好ã㪠let ã使ã£ã¦ã¿ãï¼
from x in Enumerable.Range(1, 100) let fizz = x % 3 == 0 ? "Fizz" : "" let buzz = x % 5 == 0 ? "Buzz" : "" let num = (x % 3 != 0 && x % 5 != 0) ? x.ToString() : "" select fizz + buzz + num;
ããã¯ä¸ã®å¼ã¨ç価ï¼
Enumerable.Range(1, 100) .Select(x => new {x = x, fizz = (x % 3) == 0 ? "Fizz" : ""}) .Select(local0 => new {local0, buzz = local0.x % 5 == 0 ? "Buzz" : ""}) .Select(local1 => new {local1, num = local1.local0.x % 3 != 0 && local1.local0.x % 5 != 0 ? local1.local0.x.ToString() : ""}) .Select(local2 => local2.local1.local0.fizz + local2.local1.buzz + local2.num);
ãããå¤å ¸çãªææ³ã§æ¸ãã®ã¯ããã¨ããï¼æãããï¼
ä¸æ¦å¤æ°ã«ä»£å ¥ããï¼ã¨ç価ãªæ¨
ä½ã¨ãªãã¾ã¨ãï¼ã¾ãã¯ã¨ãªå¼ãããªãæ¹ããï¼ãã®æç¹ã§ç¢ºãã«ãããï¼ä½ããããã£ã¦ï¼ãä¸æ¦å¤æ°ã«ä»£å ¥ãããã¨ããè¡çºããªãã¨ãªãæ¨ã®ä¸ã«åç¾ã§ãã¦ãããã¨ï¼Anonymous Types ãå¼ãªã®ã¯ä¼éãããªãï¼ã¤ã¾ãï¼
å¤æ°å®£è¨ & ä»£å ¥; å¤æ°å®£è¨ & ä»£å ¥; é¢æ°å¼ã³åºã;
ã¨ããæã®ä¸¦ã³ã¯ï¼ã²ã¨ã¤ã®æ¨ã«å¤æã§ããï¼ããã¦å®éã«ä½ãèµ·ãããã¯ï¼æ¨ãè¦ãã°åããï¼æ¨ã¯ How ãå
¨ã¦å«ãã§ããããï¼
ã§ãå¼±ç¹ãä½ã¨ãªãåãã£ã¦ããï¼è¦ãæãã©ããã¯ã¨ãªå¼ãããªã奴ã¯é·æèæ§ãç¡ãï¼Extension Methods ã®åãæã£ã¦ãã¦ãããã¾ã§ãï¼ã¨ï¼å¤æ° (ãã©ã) ãå¢ãããã¨ã«ãã£ã¦ How ã®æ¨ãè¤éã«ãªãã®ã¯ä»æ¹ããªãã«ãã¦ãï¼ãã®è¤éããã½ã¼ã¹ã³ã¼ãããã®ã¾ã¾åæ ãã¦ãã¾ã£ã¦ããæãï¼ããããåãè¨å·ãããããåºã¦ãã¦ããï¼ã©ã ãå¼ãç®ç«ã¡ããï¼å¿µã®ããã¡ã¼ã«ã¢ãã¬ã¹ã¯äºåå
¥åãã¦ä¸ããï¼ãããªããã ããï¼ãããé·æãæ¸ãããã«ã¯å¼±ç¹ï¼
ã²ãããã£ã¦ã¯ã¨ãªå¼ï¼ããã¤ã¯ç¢ºãã« SQL ããã¤ã³ã¹ãã¤ã¢ãããææ³ãããããªããã©ï¼é·æèæ§ã¨ããæå³ã§ã¯çµæ§ã¤ã±ã¦ããï¼ã¯ã¨ãªå¼ã®è¯ãã¨ããã¯ï¼å®åçãªãã¿ã¼ã³ã§åºã¦ããé¨åæ¨ã®ç¶ºéºãªå§ç¸®è¡¨ç¾ã«ãªã£ã¦ããã¨ããï¼ã¤ãã§ã«ï¼ãã¯ã¤ãã¹ãã¼ã¹ã¨ãã¼ã¯ã¼ãã§åºåãããææ³ãªã®ã§ï¼æ¬å¼§ã¨ãããã¨ç¢å°ãæ¿æ¸ï¼
ãã¡ããï¼ã¯ã¨ãªå¼ãé·æåãã¨ãããã¨ãï¼Anders ãæ¬æ¥æå³ãã¦ãããã®ã¨ãã£ã¦ãããã¯ããªãæªããï¼ã¨ãããæªããã§ããã¦æ¬²ããï¼æ¬äººã«ç´æ¥èããããã§ã¯ãªãããã§ï¼ããã㯠C# ã§ã§ããæ¨ãæ¸ãã¨ãã Anders ç¥ã®ãåãï¼ãï¼ã¨é»æ³¢ããª3ã§åä¿¡ããã®ã¯ãã ã®å¦æ³ã§ï¼ãã®çµæã¿ã¼ããã¯å±±ã§åã¤ãã«ï¼ã¾ã¼ã¡ããã¯å·ã§å£ãã¦ãã¾ã£ã¦ãã大å¤ï¼ãããããªãï¼åã ãã©ï¼
ã§ãã¾ãé·æåãã®ææ³ã¯ï¼ä½ããããããåé¢ã«åºãè¯ãææ³ã ãï¼ã¨ããã¨æ¬å½ã£ã½ãèãããåãªã®ãï¼åã£ã½ãçå®ãªã®ãï¼SQL ã®ææ³ãï¼ãæªããªããã¨ã¯æããã§ããã©ãï¼ãªãã¨ãªãï¼ã¬ã´ã¿ããã«ãã¡ããã¡ããã£ã¤ãã¦ãã£ãã¨ãï¼çµå¶ç ´ç¶»ããä¸éé¡ãçµæ§å¼ãä¸ããããæããã¨ãããï¼
ã¯ã¨ãªå¼ã¨ãã¹ã㨠let ã¨ããã
ã¡ãã£ã¨ã ã Extra Stage ã追è¨ï¼
ã¯ã¨ãªå¼ã¯æ§é 表ç¾ã«è¨å·ã使ããªãã®ã§è¦ãç®ã¨ã¦ããã©ããï¼è¦æ
£ããæ³¢æ¬å¼§ããªãï¼ã»ãã³ãã³ã¯ã²ã¨ã¤ã ãï¼ã§ãå®ã¯ç°¡åã«ãã¹ãã§ããï¼
ä¾ãã°ããï¼ã2000å¹´ãã2009å¹´ã¾ã§ã®13æ¥ã®éææ¥ã¯ï¼ã
var ft13 = from year in Enumerable.Range(2000, 10) from date in from month in Enumerable.Range(1, 12) let numDays = DateTime.DaysInMonth(year, month) from day in Enumerable.Range(1, numDays) select new DateTime(year, month, day) // â month, numDays, day ã®ã¹ã³ã¼ãããã¾ã§ where date.Day == 13 && date.DayOfWeek == DayOfWeek.Friday select date;
let ã使ãã¨ãä¸æ¦å¤æ°ã«ä»£å ¥ããå¯è½ï¼
var ft13 = from year in Enumerable.Range(2000, 10) let daysInThisYear = from month in Enumerable.Range(1, 12) let numDays = DateTime.DaysInMonth(year, month) from day in Enumerable.Range(1, numDays) select new DateTime(year, month, day) from date in daysInThisYear // â ããã§ã¯ month ã numDays ã day ãè¦ããªã where date.Day == 13 && date.DayOfWeek == DayOfWeek.Friday select date;
ãã㧠let daysInThisYear ã«æ³¨ç®ï¼å³è¾ºã¯ã¯ã¨ãªå¼ã»ãã³ãã³æãã¨ããå
¸åçãªå
¥ãåæ§é ï¼ãã㦠daysInThisYear ã®å®ç¾©ã§ä½¿ã£ãå¤æ°éï¼month ã« numDays ã« day ã®ã¹ã³ã¼ãã¯ï¼ã»ãã³ãã³ãç¡ãã¦ããã¡ãã¨éããï¼begin ã end ã§å²ãè¨èªãç¥ã£ã¦ããã°ããã¯ããã¾ã§ä¸æè°ãããªãï¼begin ã end ã from ã select x ã«ç½®ãæããã°åããã¯ãï¼
ã¤ã³ãã³ãã¯ãèªç±ã«ï¼ç½ãæªéã¯å±
ãªãã®ã§ï¼ã¤ã³ãã³ããã¦ãããªãã¦ãã¹ã³ã¼ãã¯å¤åãªãï¼
ããããªãã¨ããã©ãã§ãè¿ãï¼æ¨ã§æ¸ãããä¸æ¦å¤æ°ã«ä»£å
¥ããããããã¹ã¿ã¼ããï¼ç¹æ®ãªå¤æã«ã¼ã«ã«ãã£ã¦æ¨æ§é ãæ¨ã¦ï¼ããã«ã¯ã¨ãªå¼ã¨ããå¤æã«ã¼ã«ãå°å
¥ãï¼ãã©ãçããå
ã§ã¾ãåã話ï¼ã¡ãªã¿ã«ã¯ã¨ãªå¼ã®èªã¿ãããã® 9 å²ã¯ï¼ç¡ç¾ãªã¤ã³ãã³ãã§ã§ããã®ã§ããã®ã¨ãããããï¼
ãã¡ããä»ããè¨ãã¾ã§ããªããã¨ã ãã©ï¼ã¯ã¨ãªå¼ã®æ¨ã¨ï¼æåã«æ¨ã¦ãå®éã«è©ä¾¡ãããçã®æ¨ã¯å
¨ãã®å¥ç©ï¼éã«äºåãå¤æå
¥ã£ã¦ãã*3ï¼ããã¦åãæ©ãã«ãã¦ãã¯ã¨ãªå¼ã®æ¨ã®æ¹ãèããããããï¼ä¸çã¯ã«ã¼ããã¦ããããã§ï¼çå®ã«åã«é²ãã§ããï¼ã¯ãï¼æ³¢æ¬å¼§ã¨ãããã¯æ¶ãã¦ããã¦æ£è§£ã§ããï¼
ãããã¦ï¼ã¯ã¨ãªå¼ã®é·æèæ§ã¯ãã¹ãã«ãã£ã¦ããã«å»¶é·ããã¾ããã¨ãï¼
ã¾ã¨ã
ã¨ããããã§æ¬å½ã«ã¾ã¨ãï¼
- C# 3.0 ã§å ¥ã£ãå¤ãªææ³ã¯ããè¦ãã°å¼ï¼ããã¯å ¨ããã£ã¦æå³çã¨ã®ãã¨ï¼
- ã§ããæ¨ãç°¡åã«ä½ãããã©ããã¯ï¼è¨èªã®ææ³ã«å¤§ããä¾åãã¦ããï¼çæãããæ¨ã大ããããé£ããï¼ã¨ç絡çã«ã¯è¨ããªãï¼
- C# ã®å¾æ¥ã®å¼ã¯ãã©ã®ããã«è©ä¾¡ãããããã®æ¨ã¨è¦ãç®ãç´æ¥å¯¾å¿ãã¦ããï¼Extension Method ã§ã¯è¦ãç®ã¨ã®å¯¾å¿ãè¥å¹²å´©ããï¼ã¯ã¨ãªå¼ã§ã¯ãã¨ãã¨ãå´©ããï¼ã§ãã³ã³ãã¤ã«æã«ã¯å¿ ããã©ã®ããã«è©ä¾¡ãããããã®æ¨ã«å¤æãããï¼
- ã¯ã¨ãªå¼ã¯ãã¹ãã§ããï¼let ã使ãã¨ãä¸æ¦å¤æ°ã«ä»£å ¥ããå¯è½ï¼å¾æ¥ææ³ãããèªç¶ã«ãã¹ããæ¸ããã®ã¯äºé丸ï¼ãã¹ãããã¯ã¨ãªå¼ãèªãã¨ãã¯ï¼ã³ã¼ãã®æå³ã«æ³¨ç®ï¼æ£ããæ¸ããã¦ããã°ï¼ç価ãªãã©ã®ããã«è©ä¾¡ãããããã®æ¨ãçæãããï¼
ã§ã¯ã¾ãçæ§æ¥½ãã C# ã® night life ãï¼
åè
- 26.7.1 クエリ式の変換
- ã¯ã¨ãªå¼ãã Extension Methods è¨æ³ã®å¼ã¸ã®å¤æã«ã¼ã«ã¯ä¸åç®ãéãã¦ããã¨åï¼å®éæ¸ãã¨ãã«æèããå¿ è¦ã¯ãªãã§ããã©ï¼ã¾ãæé¤ã¿ãããªãã®ã¨ãã¦ï¼
- ã·ã§ã«ã®ãªãã¤ã¬ã¯ãããããããã®ãªããã¨ãããããå®å
¨ã«ç解ããã - æªå±±æ£å¹¸ã®ããã¤ã©é£¼è²è¨
- ä»£å ¥ã§ç¤ºããæ¹ãåããããããªããã¨ãããï¼ã¨ãã話ï¼ããããï¼
- Taking LINQ to Objects to Extremes: A fully LINQified RayTracer
- ã¯ã¨ãªå¼ = æ¨ãä½ç¾ããä½ãï¼ã¾ãè¦ãã°åãããã¸ã¥ã¢ã«ç³»ãµã³ãã«ã³ã¼ãï¼