Giter VIP home page Giter VIP logo

Comments (7)

eddelbuettel avatar eddelbuettel commented on July 17, 2024

Sounds very promising -- thanks for that. Am in the middle of something at work and making dinner with kiddo 1 but will get back to this later.

Dirk

from rcpp-gallery.

eddelbuettel avatar eddelbuettel commented on July 17, 2024

It taste like C. Don't we want it more C++-ish? Part of our mantra was that "you can leave C behind". I feel we should keep that story.

from rcpp-gallery.

kevinushey avatar kevinushey commented on July 17, 2024

I thought about it a little harder, and it seems that all we really need (?) is the TYPEOF macro from the R API as well as the internal RTYPEs. I cleaned it up and wrote a cleaner, more C++ solution (wrap to List initially, use list iterator, but still switch and wrap depending on the result of TYPEOF)

Thanks for the comments -- take a look and let me know!

from rcpp-gallery.

kevinushey avatar kevinushey commented on July 17, 2024

I made some more mods (added a check for factors; make sure it gives sensible output when we have character vecs / factors in the list)

I'm not quite sure what you mean re: the default case, can you expand a bit?

from rcpp-gallery.

eddelbuettel avatar eddelbuettel commented on July 17, 2024

Sorry, not "the" default case. Meant to say that we need a fallback "default" case in the switch statement in order to catch errors caused by users submitting a char, or complex, or raw, or environment, or ... SEXP can be anything beyond int, double or another list.

from rcpp-gallery.

kevinushey avatar kevinushey commented on July 17, 2024

Gotcha. I added a default case that just throws a simple exception with stop if a non-REALSXP or non-INTSXP is encountered. I also added a bit more exposition, re: what's going on. Thanks!

from rcpp-gallery.

eddelbuettel avatar eddelbuettel commented on July 17, 2024

This is done now, parallel comment threads and all.

from rcpp-gallery.

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.