根据标题,假设我有以下内容:
proc squared(n: int64): int64 = n * n
现在假设我想调用这个过程 squared 但我对结果不感兴趣。
squared
如果我只是写:
squared(15)
我得到了一个错误:
Error: expression 'squared(15)' is of type 'int64' and has to be discarded
我理解这种类型的代码是一种糟糕的实践,我应该明确地忽略结果。 因此,如何显式地忽略结果?
只写
discard squared(15)