我刚刚发现了 Chapel 的配置变量修改器,对于命令行操作非常有用。是否有其他语言或框架可以模仿此功能,以便我不必每次都编写过滤器?
我刚刚发现了 Chapel 的配置变量修改器,对于命令行操作非常有用。是否有其他语言或框架可以模仿此功能,以便我不必每次都编写过滤器?
配置
的宽度确实是无与伦比的:config var VAR = 1; // --VAR=10 sets other value from cmdline
// --VAR 20 sets other value too
config const RHO = 1.23456; // --RHO=0.123456 sets other value from cmdline
// --RHO 0.2468 sets other value too
// --RHO=0.39*VAR sets other value for COMPILER
// based on VAR
config param DBG = false; // -s DBG=true sets other value from cmdline
config type B = uint(8); // -sB='uint(16)' sets other value from cmdline
// -sB='if DBG then uint(32) else uint(16)'
// sets other value for COMPILER
// based on DBG