0

As per title, assume I have the following:

proc squared(n: int64): int64 = n * n

Now let's assume I want to call the procedure squared but I am not interested in the result.

If I just write:

squared(15)

I get an error:

Error: expression 'squared(15)' is of type 'int64' and has to be discarded

I understand that this type of code is a bad practice, and I should explicitly ignore the result. Hence, how do I explicitly ignore the result?

norok2
  • 25,683
  • 4
  • 73
  • 99

1 Answers1

3

Just write

discard squared(15)
norok2
  • 25,683
  • 4
  • 73
  • 99
Andrew Penkrat
  • 447
  • 4
  • 11