Giter Site home page Giter Site logo

Comments (8)

sebasguts avatar sebasguts commented on September 27, 2024

I would guess this should be an error then. Maybe try to convert it using the conversion function __ConvertedFromJulia_internal? Or would you think this is too implicit?

from gap.jl.

fingolfin avatar fingolfin commented on September 27, 2024

Well, that goes back to the question I had yesterday: Why is ConvertedToJulia called automatically, but ConvertedFromJulia is not? What you are proposing seems to suggest to call that automatically, too.

Personally, I'd rather go the other way: I would not perform any conversion except the bare minimum (i.e. dealing with T_INT / T_FFE when going from GAP to Julia) in both directions; at least in the lowest level code. If automatic conversions are deemed desirable in some or all cases, then this could be implemented in a higher level. This way, at least the user a chance to bypass the automatic conversion in situations where this is beneficial.

from gap.jl.

sebasguts avatar sebasguts commented on September 27, 2024

Yep, this seems reasonable.

from gap.jl.

fingolfin avatar fingolfin commented on September 27, 2024

Ah, to clarify and finish that thought: if the input is a Julia object which is not an MPtr, or an T_FFE wrapper (or perhaps also a machine integer), then there is a choice between producing an error, or automatically wrapping it into a T_JULIA.

I think the latter is harmless and strictly superior to an error, as it is the bare minimum one needs to do.

A third option is to provide two functions: one which produces an error resp. wraps into a T_JULIA; the other automatically calls ConvertedFromJulia, for convenience

from gap.jl.

fingolfin avatar fingolfin commented on September 27, 2024

All in all though, this is just theoretical wanking, it's best to start writing more complex code, and then seeing what one ends up needing. I.e. be ready to revise whatever decision is made now ;-)

from gap.jl.

sebasguts avatar sebasguts commented on September 27, 2024

Currently, this function is really just used in a single case: Calling GAP functions from Julia. I think making the object a T_JULIA is the most sensible option here (just did not think about it beforehand). That way, one can actually somehow pass Julia Objects itself to GAP functions.

from gap.jl.

sebasguts avatar sebasguts commented on September 27, 2024

This also means that we might want to use a different pattern in other places.

from gap.jl.

fingolfin avatar fingolfin commented on September 27, 2024

indeed, and based on that, one can easily write a Julia function which first passes all arguments through ConvertedFromJulia, if so desired.

from gap.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.