nicklockwood / Expression

A cross-platform Swift library for evaluating mathematical expressions at runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uppercased expression

sergeymild opened this issue · comments

What about expression like: text="{uppercased('hello')}"?

This should work fine, but I'm guessing based on the syntax in your example that you're asking in the context of using it with Layout?

Expression doesn't have any built-in support for strings, that's provided by the AnyExpression class in Layout.

Layout doesn't currently provide any public API for adding your own functions, so you'd have to modify the library to add an uppercased() method.

I tried add, but AnyExpression not exactly isn't correct name, because it only support Number types.
And i don't see places where i can add this feature. Maybe can you give me a hint where to look?
Yes, i want use in Layout this feature. i.e. i want some method expression to make some strings uppercased.

@sergeymild custom functions are now supported in Layout version 0.6.17. See here for details: https://github.com/schibsted/layout/blob/master/README.md#functions