This shows how Ruby's method_missing and Blocks are used to allow for some very compact code creating a component tree consisting of a menu_bar holding a menu with one menu_item.
这段示例代码则向我们展示了如何使用Ruby的method_missing和Block来使得我们可以使用非常精炼的代码,创建出一个菜单栏,上面包含了拥有一个菜单项的菜单。
Prefer compact code and let the compiler infer the type for a constant or variable.
保持代码紧凑,然后让编译器推断变量跟常量的类型。
To do this, the optimizer USES the RTL to create fast or more compact code (or both, when possible).
为此,优化器使用RTL创建快速的或紧凑的代码(或者两者兼顾)。
And this starts to make our code more readable, more elegant, just a little more compact.
这个使我们的代码变得更易读,更优雅,更简洁紧凑一点。
应用推荐