JavaScriptã§èªããã©ã ãè¨ç®åºç¤ææ³æéãã¹ã¿ã¼ã
以åæ¸ãããã©ã ãè¨ç®åºç¤ææ³æéãã¹ã¿ã¼ã(以ä¸ãæéãã¹ã¿ã¼ã)ã¯, äºæ³ä»¥ä¸ã«å¤ãã®äººã«èå³ãæã£ã¦ããããããã§ãã, åæã«é£ããã¦ããããªãã£ãã¨ãã人ãå¤ãã£ãããã§ã. åé¿ããå¯ããã«, æ§æãè¦æ £ãã¦ããªã(ã¨é¯è¦ãã¦ãã¾ã)ãã¨ãç解ã®å¦¨ãã«ãªã£ã¦ããããã«æãã¾ã.
ã©ã ãè¨ç®ã®æ§æã¯, å®éã«ã¯å ¨ãç¹æ®ãªãã®ã§ã¯ããã¾ãã. ãã®ãã¨ããããããããã«, ãæéãã¹ã¿ã¼ãã®ã©ã ãè¨ç®ã®ç°¡ç´ã®ä¾ããã¹ã¦JavaScriptã®æ§æã§æ¸ãã¦ã¿ã¾ãã.
......ã¨ããå 容ã«ãªãã¯ãã§ããã, æ°ãã¤ãããã©ã ãè¨ç®ã®ã¤ã³ã¿ããªã¿ãJavaScriptã§å®è£ ãã¦ãã¾ãã! å®éã«åããããã®ã¯ä¸è¨URLã«ããã¾ã.
https://tarao.github.io/LambdaJS/#js
åä½ç¢ºèªã¨æ¢ç¥ã®åé¡
- Firefox 3.6
- Google Chrome 4.1
- Internet Explorer 8.0
- æå¾ã®ä¾ã®å®è¡é度ã«é£ãã
- Opera 10.51
- ãã¼å ¥åã®ä¸é¨ã«é£ãã
- Safari 4.0
ã¤ã³ã¿ããªã¿ã®ç¹å¾´
- ãã¹ã¦JavaScriptã§å®è£
- ç°¡ç´éç¨ã表示ã§ãã
- è©ä¾¡æ¦ç¥ãåãæ¿ãå¯è½(æåã«ãããã¨ã§æ¬¡ã«ç°¡ç´ããé¨åé ãé¸æå¯è½)
- JavaScriptã®æ§æ, ã©ã ãè¨ç®ã®æ§æ, 両æ¹ã®æ··å¨ã§æ¸ãã
JavaScriptã®æ§æã«ããã©ã ãè¨ç®ã®è¡¨ç¾
ã©ã ãè¨ç®ã«ãããé¢æ°ã®é©ç¨ã¯, JavaScriptã®é¢æ°å¼åºãã«ç¸å½ãã¾ã. ããªãã¡, ã©ã ãè¨ç®ã®((M) N)ã®é ã¯JavaScriptã®(M)(N)ã®å¼ã«ç¸å½ãã¾ã.
åæ§ã«, ã©ã ãè¨ç®ã«ãããæ½è±¡ã¯, JavaScriptã®ç¡åé¢æ°ã«ç¸å½ãã¾ã. ããªãã¡, ã©ã ãè¨ç®ã®Î»x.Mã®é ã¯JavaScriptã®function(x){ return M }ã®å¼ã«ç¸å½ãã¾ã.
JavaScriptã§ã¯
function(x,y,z){ return ... }
ã¯3å¼æ°ã®ç¡åé¢æ°ãæå³ãã¾ãã, ä»åã®ã¤ã³ã¿ããªã¿ã§ã¯, ã©ã ãè¨ç®ã®é«éé¢æ°ã®ç¥è¨ã«åããã¦,
function(x){ return function(y){ return function(z){ return ... } } }
ã®ç¥è¨ã¨è¦ãªãããã«ãªã£ã¦ããã®ã§æ³¨æãã¦ä¸ãã.
ã¾ã, Mozillaã®JavaScript 1.8ã®æ°æ©è½ããµãã¼ããã¦ãããã©ã¦ã¶ä¸ã§å®è¡ããå ´å,
function(x){ return M }
ã®ä»£ããã«
function(x) M
ã¨æ¸ããããã«ãã¦ããã¾ã.
å ·ä½ä¾ã®å®è¡
ã¤ã³ã¿ããªã¿ã®å®æ¼ãã¼ã¸ã§ã¯, ãæéãã¹ã¿ã¼ãã«ç»å ´ããä¾ãå®éã«ã¤ã³ã¿ããªã¿ã§å®è¡ã§ãã¾ã. ãã¼ã¸é ã§åºåå½¢å¼ãé¸æãããã¨ã§, ã©ã ãè¨ç®/JavaScript両æ¹ã®æ§æã§ç°¡ç´éç¨ãè¦ãããããã«ãªã£ã¦ãã¾ã. ããã«, ç°¡ç´ã¹ããããé·ããããæéãã¹ã¿ã¼ãã§ã¯çç¥ããã¦ããYã³ã³ããã¼ã¿ãç¨ããã«ã¼ã(å帰å¼åºã)ã®ä¾ã追å ãã¾ãã.
ã¤ã³ã¿ããªã¿ã®å¶é
æ§æ解æã»æå³è§£æãããªãã¤ã³ãããªã®ã§, æ¸ãééããã¨ãã®ã¨ã©ã¼ã¡ãã»ã¼ã¸ãä¸è¦ªåããããã¾ãã.