Code Monkey home page Code Monkey logo

Comments (4)

randy3k avatar randy3k commented on August 18, 2024

I believe there is no problem of using $. With this macro,

macro s_mstr(x)
    quote
        rprint($x)
    end
end

there is no problem in extracting the list element by using $:

julia> s"""
       x = list(a=1,b=2)
       y = x$a
       """
[1] 1

PS: unfortunately, r_mstr is used, so we have to think of something different. I vote for s_mstr.

from rcall.jl.

simonbyrne avatar simonbyrne commented on August 18, 2024

Sorry, what I meant was that it might be difficult to use $ the same way the proposed mat_str macro does, i.e. for copying the corresponding julia variable to R.

from rcall.jl.

simonster avatar simonster commented on August 18, 2024

You could allow only $ followed by parens, e.g. $(a), unless that's actually valid R syntax in some context. I believe you could backslash-escape other cases of $ before passing to the parser. Alternatively, it may be that valid uses of $ for interpolation are never valid R syntax, so there would be no ambiguity. (I don't know R well enough to say if this is the case.)

The hardest part in JuliaInterop/MATLAB.jl#29 was determining whether a variable/expression is assigned or used. This is easier for MATLAB than other languages because the MATLAB parser sucks and can't itself handle cases that would be hard for us to handle, but it still turned out to be non-trivial. However, if you can actually get the AST from R, this might not be too hard.

from rcall.jl.

randy3k avatar randy3k commented on August 18, 2024

This can also be closed by #94.

from rcall.jl.

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.