Search code examples
linuxswiftswift3nsexpression

Evaluating Expressions on Server-side Swift


What is the equivalent of NSExpression to evaluate numeric expressions on the server using Swift ? Is there a library that enable that ?

I'm getting this error when trying to use NSExpression on Linux:

fatal error: init(format:_:) is not yet implemented: file Foundation/NSExpression.swift, line 140


Solution

  • NSExpression does not provide an initializer that just takes a format. Maybe you were going for

    init(format: String, argumentArray: [Any])

    or

    init(format: String, arguments: CVaListPointer)

    EDITED

    As of 2016.12.27, most methods in NSExpression - including the init methods - have not yet been implemented.