[ 
https://issues.apache.org/jira/browse/TINKERPOP-1854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16400113#comment-16400113
 ] 

ASF GitHub Bot commented on TINKERPOP-1854:
-------------------------------------------

Github user FlorianHockmann commented on the issue:

    https://github.com/apache/tinkerpop/pull/792
  
    > Can we make Lambda class static and make the Lambda.Groovy() and 
Lambda.Python() return an ILambda interface?
    
    Sure, making the implementation internal makes perfect sense to me.
    
    But what do you think about the question of whether we want to return a 
general `ILambda` interface vs specific `IFunction` interfaces and so on?
    
    So first approach (basically the current one in this PR):
    ```cs
    public static class Lambda
    {
        public static ILambda Groovy(string expression)
        {
            return new StringBasedLambda(expression, "gremlin-groovy");
        }
    
        public static ILambda Python(string expression)
        {
            return new StringBasedLambda(expression, "gremlin-python");
        }
    }
    ```
    
    alternative approach:
    
    ```cs
    public static class Lambda
    {
        public static string DefaultLanguage { get; set; } = "gremlin-groovy";
    
        public static IFunction Function(string expression, string language)
        {
            return new StringBasedLambda(expression, language);
        }
    
        public static IPredicate Predicate(string expression, string language)
        {
            return new StringBasedLambda(expression, language);
        }
    
        // ...
        
        public static IPredicate Predicate(string expression)
        {
            return Predicate(expression, DefaultLanguage);
        }
    
        // ...
    }
    ```


> Support lambdas in Gremlin.Net
> ------------------------------
>
>                 Key: TINKERPOP-1854
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-1854
>             Project: TinkerPop
>          Issue Type: Improvement
>          Components: dotnet
>    Affects Versions: 3.3.0, 3.2.6
>            Reporter: Florian Hockmann
>            Assignee: Florian Hockmann
>            Priority: Major
>             Fix For: 3.2.8, 3.3.2
>
>
> Gremlin.Net should support lambdas. We already discussed this in [the pull 
> request for TINKERPOP-1752|https://github.com/apache/tinkerpop/pull/712]. 
> Here is what [~spmallette] said over there:
> {quote}
> Any reason we don't support lambdas? Even if .NET can't support them natively 
> for some reason wouldn't we minimally support the ability to pass a 
> python/groovy/etc lambda? it's kinda weird that way, but i think back to the 
> point that kuppitz made on the dev list the other day where he stated that he 
> doesn't always find a way out of using lambdas in production systems he works 
> on - so ultimately users will need that kind of capability i think.
> {quote}
> C# lambdas would require some kind of C# parser on the server side, so at 
> least in the beginning a way to send lambdas from already supported languages 
> in Gremlin.Net should be enough.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to