kiyokaのブログアーカイブ

Archive of old blog posts

Pythonのlambda

Pythonのlambda - 西尾泰和のはてなダイアリー The fate of reduce() in Python 3000 Why drop lambda? Most Python users are unfamiliar with Lisp or Scheme, so the name is confusing; also, there is a widespread misunderstanding that lambda can do things that a nested function can’t このあたりかな。つまり、まずもって大部分のPython使いはLispに不慣れだし、 「lambdaじゃないとできないことがある」という誤解の元になる(実際にはネ ストした関数を作ればいいだけなのでlambdaは必要ない)のでlambdaを削除し ようとした、ってこと。

そうだったのか。 Pythonはlambda式にマルチステートメントが使えないなど、不備が多いなと思っていた。

それはどうしようもないなあ。

ちなみに、西尾さんの記事にリンクされているドキュメントは良い。後でちゃんと読もう。 言語パターン - 使いやすい言語・ライブラリをデザインする方法 - qwik.jp/lang-pattern