Comment 4 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 08:55 AM, Joachim Haga wrote:
> Means:
>
> 1/ Allow ':' as part of symbol name in parsing, so that "std::max" is
> parsed as a single token instead of ["std", "max"]
>
> 2/ Don't consider symbols with "::" in them as variables.
>
> The purpose is to allow the use of namespace qualifiers in expressions.
> 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. The
problem is to keep the possibilities to

   Expression("something")

concise and not too powerful. As the number of extra magic things we
_could_ put in there easily can explode.

Your:

- "pow", "sqrt", "ceil", "fabs", "floor", "fmod"]
+ "pow", "sqrt", "ceil", "fabs", "floor", "fmod",
+ "min", "max"]

will fix your original problem, right?

Johan

>
> -j.
>
>
> On 11 June 2012 08:18, Johan Hake<email address hidden> wrote:
>
>> What do you mean with:
>>
>> "Also, it makes symbols like "std::min" ignored, so that if functions
>> that are not
>> treated specially are needed, they can be accessed through the
>> namespace."
>>
>> --
>> You received this bug notification because you are a member of DOLFIN
>> Team, which is subscribed to DOLFIN.
>> https://bugs.launchpad.net/bugs/1010865
>>
>> Title:
>> Allow min,max,std::* in Expressions
>>
>> Status in DOLFIN:
>> New
>>
>> Bug description:
>> The attached patch makes it possible to use min(x,y) and max(x,y) in
>> compiled expressions.
>>
>> Also, it makes symbols like "std::min" ignored, so that if functions
>> that are not treated specially are needed, they can be accessed
>> through the namespace.
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/dolfin/+bug/1010865/+subscriptions
>>
>