Example code for the expression problem in The Dart Programming Language.
《Dart编程语言》中的'表达式问题'的源代码。
执行文件:
bin/main.dart
源文件:
lib
|- dynamic 动态版本(不使用类型)
|_ typed 使用类型版本
|_ generic 使用泛型版本
The expression problem is a term used in discussing strengths and weaknesses of various programming paradigms and programming languages.
Philip Wadler coined the term[1] in response to a discussion with Rice University's Programming Languages Team (PLT):
The expression problem is a new name for an old problem.[2][3] The goal is to define a datatype by cases, where one can add new cases to the datatype and new functions over the datatype, without recompiling existing code, and while retaining static type safety (e.g., no casts).