Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced function API #11

Open
TomLottermann opened this issue Jun 3, 2015 · 8 comments
Open

Advanced function API #11

TomLottermann opened this issue Jun 3, 2015 · 8 comments
Assignees
Milestone

Comments

@TomLottermann
Copy link
Contributor

Functions are currently split into Simple functions and ordinary VData which acts as a function. These VData types should be encapsulated somehow. We need ways to specify if this function applys to all engines or just some input/output engines.

@TomLottermann TomLottermann added this to the v0.2 milestone Jun 3, 2015
@TomLottermann
Copy link
Contributor Author

The current state is that I added the generic evaluation logic.

The missing parts are translating the existing complex functions to become generic functions.

See 1532ccc for details

@TomLottermann
Copy link
Contributor Author

In order for OBJECT() to work we still need key-word arguments.

In Python this works:

>>> def test2(a, b="BLA", *c, **kwargs):
...     print a + b
... 
>>> test2("asasdas", "asdasd", "asdasd", be="asds")
asasdasasdasd

@TomLottermann TomLottermann self-assigned this Jul 17, 2015
@TomLottermann
Copy link
Contributor Author

The grammar simplification in the functions_api branch break OBJECT() because complex field names are no longer allowed. This is in no way acceptable!
However the approach taken is somehow wrong this way.

We need to fix this. One way would be going back to using "Output path" as the name of attributes.

This still need a lot of work!

@TomLottermann
Copy link
Contributor Author

Still working on it. The test cases must finished before I can really test the new functionality and make all old functions work again.

@TomLottermann
Copy link
Contributor Author

My new idea is to just allow resolved argument names for kwargs. They won't be used for the other arguments anyway. This would enable us to still set the default values if they are missing and check for presence of non-optional arguments.

@TomLottermann
Copy link
Contributor Author

A much better idea: Add a special kind of parameter: resolved ones! => args, vargs, kwargs and resargs

Checks might be specifically disabled for methods with resolved parameters.

Still have to think this through.

@TomLottermann
Copy link
Contributor Author

Since resolved argument names will always lead to issues with automated checking and default paramters, I think it is necessary to introduce two kinds of functions: CheckedFunctions and UncheckedFunctions.

CheckedFunctions feature complete argument checks and automated default argument introduction. They however simply do not allow any resolved argument names.

UncheckedFunctions allow resolved argument names but are not checked in any way.

TomLottermann added a commit that referenced this issue Jul 20, 2015
This is related to #11
@TomLottermann
Copy link
Contributor Author

Yet another idea would be completely automated evaluation of the arguments.
This is by far not easy.

We could evaluate all names and VData argument by argument and in case there are duplicate results: branch (this is done in ObjectVData).

We must confirm that this is the desired behavior for all functions!

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

No branches or pull requests

1 participant