Third-Party Functions #20
Unanswered
springcomp
asked this question in
JEP
Replies: 1 comment 1 reply
-
@jordemort requested that we also reserve 'x'. I think a couple reservations are reasonable and allows for implementation specific conventions distinguishing 'x' and '_' for functions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Third-Party Functions
Abstract
This JEP proposes a new distinction between reserved function names
and third-party function names. This allows the spec to evolve by
introducing new functions without the fear of clashing with existing
functions from popular third-party implementations.
Motivation
Virtually all the current language implementations of JMESPath support
registering additional "custom" functions that add features to JMESPath.
There is currently no restrictions as to what those function names may be
except that is must match the
unquoted-string
production.This proposal specifically acknowledges that third-party functions may
be used to extend JMESPath and mandates that all third-party function
names should start with a leading underscore character.
Functions whose names starts with a letter – known or future – are
effectively reserved exclusively for use by JMESPath.
Specification
This JEP proposes adding the following text to the specification in the
Function Expressions section:
Rationale
This JEP does not introduce any grammar change.
Although there has been discussions about having a different semantic constructs
for both reserved functions and third-party functions, it has been considered
as an implementation detail. Besides, this would unnecessarily make it more
difficult for library authors to maintain two different logics for evaluating
functions.
History
x_
third-party prefixBeta Was this translation helpful? Give feedback.
All reactions