2017-09-08 33 views

Répondre

5

De retour void signifie que la fonction ne renvoie rien:

proc saySomething(): void = 
    echo "something" 

Les supports vides ainsi que les : void sont facultatifs:

proc saySomething = 
    echo "something" 

Annoter une fonction avec noReturn signifie que la fonction ne reviendra pas du tout :

proc killTheProgram {.noReturn.} = 
    quit(0) 

proc raiseSomething {.noReturn.} = 
    raise newException(ValueError, "Something")