Is it possible, with Ada, to implement the following JSON containing a function declaration x: integer (float(x))?
Example_JSON = "Integer": lambda x: integer (float(x))}
If so, how? I've tried to find a method in GNATCOLL.JSON without success.
Is it possible, with Ada, to implement the following JSON containing a function declaration x: integer (float(x))?
Example_JSON = "Integer": lambda x: integer (float(x))}
If so, how? I've tried to find a method in GNATCOLL.JSON without success.
It is impossible because a JSON value, according to RFC 8259 can only be one of the following:
You can put the function's source code into a string, and then parse that string at the receiving end, e.g. {"integer": "lambda x: integer(float(x))"}, but there's no direct way for a function to be a value in an object.