Coder Social home page Coder Social logo

handle_setopt() that takes list about curl HOT 7 CLOSED

jeroen avatar jeroen commented on September 24, 2024
handle_setopt() that takes list

from curl.

Comments (7)

jeroen avatar jeroen commented on September 24, 2024

It does support multiple options already. You mean something that would do: do.call(handle_setopt, list()) ?

from curl.

hadley avatar hadley commented on September 24, 2024

Yeah, exactly

from curl.

jeroen avatar jeroen commented on September 24, 2024

Okay makes sense. Prefer a separate function or overloading curl_setopt?

from curl.

hadley avatar hadley commented on September 24, 2024

Similarly for handle_setform().

I quite like the handle_setopt(x, ..., .list) form

from curl.

hadley avatar hadley commented on September 24, 2024

I wonder if it would also be possible to have a convention for calling setform from within the options list?

opts <- list(setform = list(a = 1, b = form_file("abc.txt"))
handle_setopts(h, .list = opts)

What do you think? It would make my life easier to have a unified interface, but it's not a big deal.

from curl.

jeroen avatar jeroen commented on September 24, 2024

I don't feel strongly about it, the handle_setopt(x, ..., .list) form is fine. The only thing is that it is ambiguous what has to happen when an argument appears both in ... and .list.

from curl.

hadley avatar hadley commented on September 24, 2024

I think the last argument should always win:

handle_setopt(x = 1, x = 2) # x = 2
handle_setopt(x = 1, .list = list(x = 2)) # x = 2
handle_setopt(.list = list(x = 1, x = 2)) # x = 2

etc

from curl.

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.