Giter Club home page Giter Club logo

Comments (10)

matthayes avatar matthayes commented on June 2, 2024

You could create two constructors. One constructor has one argument and the other constructor has two arguments.

from datafu.

rjurney avatar rjurney commented on June 2, 2024

I've tried that. There are two problems:

  1. I have to catch an IOException to call call()
  2. I have to return something to call call().

Hmmm I'll try again. Neither of those should block me.

On Sun, Jan 5, 2014 at 12:12 PM, Matt Hayes [email protected]:

You could create two constructors. One constructor has one argument and
the other constructor has two arguments.


Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614088
.

Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com

from datafu.

matthayes avatar matthayes commented on June 2, 2024

Oh I misunderstood I think. I thought you meant the constructor. Are you using SimpleEvalFunc? I don't think it supports this use case of a 2nd optional argument. If you look in the implementation of exec() you see this

// check right number of arguments
if (input.size() != pvec.length)
  throw new IOException(String.format("%s: got %d arguments, expected %d.", _method_signature(), input.size(), pvec.length));

It expects there to be a call() method and it checks that the input tuple has the same number of values as there are arguments in the call() method.

I suggest just using EvalFunc then if you want optional parameters.

from datafu.

rjurney avatar rjurney commented on June 2, 2024

I thnk I made it work as you suggested. Testing now, but need to know how
to run just one test or it takes a half hour.

On Sunday, January 5, 2014, Matt Hayes wrote:

Oh I misunderstood I think. I thought you meant the constructor. Are you
using SimpleEvalFunc? I don't think it supports this use case of a 2nd
optional argument. If you look in the implementation of exec() you see this

// check right number of arguments
if (input.size() != pvec.length)
throw new IOException(String.format("%s: got %d arguments, expected %d.", _method_signature(), input.size(), pvec.length));

It expects there to be a call() method and it checks that the input tuple
has the same number of values as there are arguments in the call() method.

I suggest just using EvalFunc then if you want optional parameters.


Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614362
.

Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com

from datafu.

rjurney avatar rjurney commented on June 2, 2024

Using two constructors doesn't work. I am using SimpleEvalFunc. Ok, I will try using EvalFunc.

from datafu.

rjurney avatar rjurney commented on June 2, 2024

Is there some way to modify SimpleEvalFunc so that I can use two constructors? I like using it.

from datafu.

matthayes avatar matthayes commented on June 2, 2024

I think you should be able to have multiple constructors with SimpleEvalFunc. You just can't have multiple overloaded call implementations. You just need to ensure each calls super(). What is the problem you are having?

from datafu.

rjurney avatar rjurney commented on June 2, 2024

I created call(String input) that calls call(String input, String path)
with default path. It fails with the same error as before: expected 2, got
1.

On Sunday, January 5, 2014, Matt Hayes wrote:

I think you should be able to have multiple constructors with
SimpleEvalFunc. You just can't have multiple overloaded call
implementations. You just need to ensure each calls super(). What is the
problem you are having?


Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614937
.

Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com

from datafu.

matthayes avatar matthayes commented on June 2, 2024

the call method is not a constructor

On Jan 5, 2014, at 1:11 PM, Russell Jurney [email protected] wrote:

I created call(String input) that calls call(String input, String path)
with default path. It fails with the same error as before: expected 2, got
1.

On Sunday, January 5, 2014, Matt Hayes wrote:

I think you should be able to have multiple constructors with
SimpleEvalFunc. You just can't have multiple overloaded call
implementations. You just need to ensure each calls super(). What is the
problem you are having?

�\
Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31614937
.

Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com

Reply to this email directly or view it on GitHub.

from datafu.

rjurney avatar rjurney commented on June 2, 2024

Good call. Lemme take another look.

On Sunday, January 5, 2014, Matt Hayes wrote:

the call method is not a constructor

On Jan 5, 2014, at 1:11 PM, Russell Jurney <[email protected]<javascript:_e({}, 'cvml', '[email protected]');>>
wrote:

I created call(String input) that calls call(String input, String path)
with default path. It fails with the same error as before: expected 2,
got
1.

On Sunday, January 5, 2014, Matt Hayes wrote:

I think you should be able to have multiple constructors with
SimpleEvalFunc. You just can't have multiple overloaded call
implementations. You just need to ensure each calls super(). What is
the
problem you are having?


Reply to this email directly or view it on GitHub<
https://github.com/linkedin/datafu/issues/85#issuecomment-31614937>
.

Russell Jurney twitter.com/rjurney [email protected]<javascript:_e({}, 'cvml', '[email protected]');>
datasyndrome.com

Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHubhttps://github.com//issues/85#issuecomment-31616199
.

Russell Jurney twitter.com/rjurney [email protected] datasyndrome.com

from datafu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.