STEllAR-GROUP / phylanx

An Asynchronous Distributed C++ Array Processing Toolkit
Boost Software License 1.0
75 stars 76 forks source link

Allow for simple primitive creation #1250

Open hkaiser opened 4 years ago

hkaiser commented 4 years ago

We should add a way that simplifies adding trivial primitives. Often the functionality of a primitive can be expressed by a single function. In this case, a user should be able to say something like:

using namespace phylanx::execution_tree;

primitive_argument_type my_primitive(primitive_arguments_type const args)
{
    // some functionality
}

register_primitive("my_primitive(_1)", "some documentation", &my_primitive);

Which should make my_function invocable in PhySL.