Comment 7 for bug 1010865

Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 1010865] Re: Allow min,max,std::* in Expressions

On 06/11/2012 09:52 AM, Martin Sandve Alnæs wrote:
> On 11 June 2012 09:40, Joachim Haga<email address hidden> wrote:
>>>
>>>> Next time I miss something (like min/max in this case), I'll just write
>>>> "std::max" instead of creating a bug report.
>>>
>>> We have intentionally not allowed this, as it will make the interface
>>> more busy. It might be a good idea though, but not fully convinced.
>>>
>>
>> No strong opinion. But if you want to be convinced: The complexity is
>> completely decided by the user. It will not become necessary or usual to
>> use namespace qualifiers. It just makes them work.
>
> I don't see any problem with this.

Me neither, but I wonder if we should expand the functionality while at
it. For now there are only a few hard coded headers available for a
user, <cmath> and surprise surprise <complex>.

Should we make it possible to link other external libraries or home
brewed for that case, to the generation of compiled expressions? This
particular feature has come up a couple of times, in particular request
for the different boost functions.

To be able to make this as powerful as we need we could expose the
relevant instant.build kwargs:

    local_headers=[], system_headers=[],
    include_dirs=['.'], library_dirs=[], libraries=[],

to the Expression interface via:

   configure = dict(
             local_headers=["my_special_func.h"],
             system_headers=["some_system_header.h"],
             include_dirs=["some_obscure_path"],
             library_dirs=["my_library_path"],
             libraries=["my_special_func"])

   Expression(somestr, configure=configure)

Then the user need to provide any non system paths manually.

Johan