Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Streamline custom function syntax for NSExpression #11015

Closed

Description

@1ec5

As of the initial NSExpression implementation in #10726, we rely on the clunky custom function syntax to represent many of the style specification’s expression operators. For example, string concatenation is a common operation by requires all sorts of undiscoverable and error-prone punctuation:

NSExpression(format: "FUNCTION('Old', 'stringByAppendingString:', FUNCTION(' ', 'stringByAppendingString:', 'MacDonald'))")

As previously proposed in #8074 (comment), we should extend the private _NSPredicateUtilities class using the Objective-C runtime:

NSExpression(format: "mgl_join({'Old', ' ', 'MacDonald'})")

This would result in the most natural usage, but it’s also a bit Clever™. We’ll need to tiptoe around a bit to avoid directly using any private APIs, and we’ll need to include safeguards in case the underlying NSExpression implementation changes at any point.

/cc @akitchen @fabian-guerra @jmkiley

Activity

  1. added
    iOS
    macOS
    release blocker
    on Jan 24, 2018
  2. added this to the milestone on Jan 24, 2018
  3. self-assigned this
    on Feb 6, 2018
  4. fabian-guerra commented on Mar 29, 2018

    @fabian-guerra
    Contributor

    Fixed in #11472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

featureiOSmacOSrelease blockerruntime styling

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions