ããã¯LL Ringã¨ããã¤ãã³ãã®ãããããã2.0ãã«åºå ´ããéã«ãå¤ãã®æ§æã«æ¹è¡ãå¿ é ã§ããPythonã§æ¸ããããããããã¨ã¼ã¸ã§ã³ããã¯ã³ã©ã¤ãã¼ã«ãã¦ãããã¦ã±ãããªãã¨æã£ã¦ã¯ã³ã©ã¤ãã¼åãã¦ããã¨ãã«æ¸ããã¡ã¢ã§ããèªåç¨ã®ã¡ã¢ã®ã¤ããã ã£ãã®ã§æ¸ãæ®´ã£ã¦ããã¾ãããæå¤ã¨äººæ°ã®ãããªã®ã§è¿ããã¡ã«å çãã¾ãã å®ã¯å¾ããæ¸ããè±èªç(How to make oneliner in Python?)ã®æ¹ãæ´çããã¦ããã®ããã å®æããã¯ã³ã©ã¤ãã¼ defæãå¼ã«ãã defã¯æ¹è¡ãè¦æ±ããã®ã§lambdaã«ç½®ãæããå¿ è¦ãããã def foo(x): return x + 1(ããã«æ¹è¡) foo = lambda x: x + 1 globals().__setitem__("foo", lambda x: x + 1) lambdaã¯å¼ããå«ããã¨ãåºæ¥ãªãã®ã§ã
{{#tags}}- {{label}}
{{/tags}}