Skip to content

Kotlin port #107

@elect86

Description

@elect86

Hi,

yesterday I (finished to) port exp4j to kotlin

it features a couple of things like:

  • automatic build inside Expression constructor, no more ExpressionBuilder
  • setting variables and function directly by passing them in the Expression constructor
  • builtin variables x, y, z and w
  • functions signatures compatible with others numbers other than Double (Int and Long to mention)
  • added factorial to the builtin operators
  • added postfix property to the operator class
  • possibility to add/remove from builtin functions
  • using gradle

the only downside is that is not possible to use functions with varargs arguments (right now you can define up to 9 arguments)

I ported all the tests + some of the open issues

Right now it's shaped around Kotlin, but if you are interested, I can modify it to make easier to use it from java (ie: by switching to functional interfaces) and create a PR

Interested?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions