Diksamã®æ§æè¦åã«ããã¦ãé¢æ°å¼ã³åºãã¯ä»¥ä¸ã®ããã«ãªã£ã¦ãã¾ãã
primary_expression LP argument_list RP
ã¤ã¾ããå¼ã®å¾ãã«ãæ¬å¼§ã§å²ãã å¼æ°ä¸¦ã³ãä»ãå ãããã®ãé¢æ°å¼ã³åºãã§ã(LP, RPã¯ããããleft paren, right parenã§ãã(ãã¨ã)ããæå³ãã¾ã)ã
ãããã
IDENTIFIER LP argument_list RP
ã¨ãã¦ããã°ããããç°¡åã ã£ãã®ã§ãããããããé¢æ°å¼ã³åºããæ¼ç®åã¨ããã®ã¯ãå½ç¶ãCã§è¨ãã¨ããã®é¢æ°ãã¤ã³ã¿ã®ãããªãã®ãå®ç¾ãããã£ãããã§ãã
dispatch_table[i](event);
ã®ãããªå¼ã³åºããã§ããã°ããããã便å©ã§ããããç¡åé¢æ°ãããã®å ´æã§ã®ãã¼ã«ã«å¤æ°ãè¦ããã¯ãã¼ã¸ã£ã¾ã§å®ç¾ããã¤ããã¯ä»ã®ã¨ããã¯ããã¾ããã
ãããããã¨ãããã®ã§ããã°ãDiksamã¯éçåä»ãè¨èªãªã®ã§ããé¢æ°åããå¿ è¦ã«ãªãã¾ãã
ãå¼æ°ã¨ãã¦intãåãåããæ»ãå¤ã¨ãã¦doubleãè¿ãé¢æ°ãã示ãåã®å®£è¨ã¨ãã¦ãã¾ããCã®ããã«
double (*func)(int);
ã¨æ¸ãããããã«ããããã
Javaã¯ã¨ããã°ãã¯ãã¼ã¸ã£ãå°å ¥ãããã¨ãã話ãæåã«èããããã«ã¯ã
double(int) func;
ã¨æ¸ããããã¨ãæ³å®ãã¦ããããã§ããã¨ã¯ããJavaã¯æ¤æ»ä¾å¤ãããã®ã§throwsãæ¸ããã°ãªããã
double(int) throws HogeException, PiyoException func;
ã¨æ¸ãã®ãã¨ããããããã§ã¯ææ³ã«ææ§æ§ãåºããã
double(int) throws HogeException | PiyoException func;
ã¨æ¸ããã¨ããããå®éã«ã¯ãããä»ã¯æã§ç¾å¨ã¯ãããªæ¡ãåºã¦ããã¨ãããªãã ãããããããã¨ã«ãªã£ã¦ããããã§ã*1ã
å½åãç§ã¯Javaæµã®è¨æ³ã§ãããã¨æã£ã¦ããã®ã§ããã
double(int) func;
ããã ãã§ãåå¿è ãæ¸æãããã«ã¯ååã§ãããthrowsã¾ã§å ¥ã£ã¦ãããä½ããè¨ãããã§ãã
ãããªããã£ããC#æµã«ã
delegate double Func(int hoge);
ã®ããã«ãã¦å宣è¨ã ããã¦ããæ¹ããªãã¼ããã·ã«æãã¾ãããã¦ã©ããããã®ã*2ã
ã¨ããã§ãDiksamã®å®è£ ã®ã»ãã¯ãç¾å¨ãããªæãã§ãã
- çµã¿è¾¼ã¿ã©ã¤ãã©ãªã¨ãã¦fopen(), fgets(), fputs(), fclose()ããµãã¼ããã¾ããã
- finalã«ããå®æ°ããµãã¼ããã¾ããã
- switch caseããµãã¼ããã¾ããã
- do whileãç¾å¨å®è£ ä¸â¦â¦
switch caseã§ãããCãJavaã®fall throughãªä»æ§ã¯ããããªãã§ã許ããããã§ãããC#ã®ããã«è¦ãç®ã¯ä¼¼ã¦ãã¦åããéãã®ãã©ããã¨æãã¾ãã®ã§ã以ä¸ã®ããã«ãã¾ããã
switch (a) case 1 { // aã1ã®æã«å®è¡ } case 2, 3 { // aã2ã¾ãã¯3ã®æã«å®è¡ } case 4 { // aã4ã®æã«å®è¡ } default { // aã1ã§ã2ã§ã3ã§ã4ã§ããªãã¨ãã«å®è¡ã }
ãã¾ãç¾ãããªãæ°ããã¾ããâ¦â¦
ãªããDiksamã®switch caseã¯ãswitchã®å¼(ä¸è¨ãªãa)ã¨ãcaseã®å¼ã==ã§æ¯è¼ã§ããã°åå使ç¨å¯è½ã§ã(==ã§çºçããåå¤æãèµ·ããªãã¨ããéãã¯ããã¾ãã)ããã£ã¦ãæååçã«ããåå²ãå¯è½ã§ãã