我尝试了以下内容,但生成的文件仍然是ELF,而不仅仅是部分内容.
$ objcopy --only-section=<name> <infile> <outfile>
Run Code Online (Sandbox Code Playgroud)
我只想要该部分的内容.有没有可以做到这一点的实用工具?有任何想法吗?
我想做点什么(它有效)
var myArray [9][3]int
Run Code Online (Sandbox Code Playgroud)
但是当我这样做的时候
var myArray [someIntVariable][anotherOne]int
Run Code Online (Sandbox Code Playgroud)
它不能使用(我知道为什么,所以我不是要问这个.)但是有没有其他方法可以使这个工作?
对不起,我的英语不好.
鉴于以下内容:
case class Num(value: Double) {
def plus(rhs: Num) = Num(value + rhs.value)
def times(rhs: Num) = Num(value * rhs.value)
}
object TestApp extends App {
// ** maybe do something here
val one = Num(1)
val two = Num(2)
val three = Num(3)
val result = three plus one times two
}
Run Code Online (Sandbox Code Playgroud)
有没有办法重命名plus
的方法/函数Num
来+plus
和times
方法,以*times
在运行时这样result = three +- one *- two
?
在运行时发生这种情况非常重要.如果可能的话,我想避免使用编译器插件.另外,如果适用,我不反对java示例.
我之所以这样做是因为Scala中的默认运算符优先级为three plus one times two
8,而 …