GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Handle default arguments for attributes::export · Issue #17 · Rcpp11/attributes

Handle default arguments for attributes::export #17

New issue
Copy link
New issue
Copy link
Open
Open
Handle default arguments for attributes::export#17
Copy link

Description

@kevinushey
kevinushey
opened on Apr 27, 2014
Issue body actions

Eg. Handle things like

// [[attributes::export]]
void foo(int x = 1, NumericVector y = {1, 2, 3}) { ... }

These need to be parsed into an appropriate R default argument for the wrapper R function generated from compileAttributes

Activity

  1. kevinushey
    changed the title [-]Handle default arguments for Rcpp::export[/-] [+]Handle default arguments for attributes::export[/+] on Apr 27, 2014
  2. romainfrancois commented on Apr 27, 2014

    @romainfrancois
    romainfrancois
    on Apr 27, 2014
    Contributor
    More actions

    The way this is handled in Rcpp is to somehow convert the c++ code into R code. I think with a bit more logic (with argument matching), we could let C++ do it's thing. In short, in the R layer, or the intermediate c++ generated layer, we'd have to understand how to call the C++ function, and if no parameter is given, then we let C++ use its own default.

    So if we call foo( 1L ) then the c++ underlying function is called as foo(1), i.e. the default does not come from R but really where it is expressed, in C++.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.