PKT233
PKT233

Reputation: 173

Is there are something like Python's 'pass' statement in Nim

I am a newer to Nim programing language. when I use Python, I can use the 'pass' to skip the defination detail of a function and class.

def foo():
    pass # skip detail

class Bar():
    pass

Is there are something like this in Nim?

Upvotes: 17

Views: 1709

Answers (1)

def-
def-

Reputation: 5393

discard does the same in Nim:

proc foo =
  discard # skip detail

type Bar = object

For objects it's not even necessary, but possible, to specify discard

Upvotes: 16

Related Questions