It is really similar to the python version (e.g. a lot of similar features and 
syntax). Sequence pattern matching is more feature-full, with support for 
things like `all`/`none`/`any` \- closely matching templates from `sequtils` 
module (namely `allIt` and `anyIt`), so you should be able to write things like
    
    
    case someInputJson:
      of [all @elem is JString()]:
        echo "all ok"
      of [any @elem is JString()]:
       echo "that's worse, but we can deal with it")
      else:
        raiseAssert("Expected at least some elements to be json strings !")
    
    Run

Reply via email to