Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

constructors cint, cshort, clong, etc #6530

Closed
WestleyArgentum opened this issue Apr 15, 2014 · 5 comments
Closed

constructors cint, cshort, clong, etc #6530

WestleyArgentum opened this issue Apr 15, 2014 · 5 comments

Comments

@WestleyArgentum
Copy link
Member

It would be really nice to have these, imo.

Does anyone know of a clever way to programmatically determine which constructor to use based on just type info? Right now I've got some hacky stuff like this:

if Cint == Int32
    global cint = int32
elseif Cint == Int64
    global cint = int64
end
@WestleyArgentum
Copy link
Member Author

Oh! I'm retarded, it can just be a convert call.

Well, now I know how to write it, would people be open to these?

@quinnj
Copy link
Member

quinnj commented Apr 15, 2014

Basically a dup of #1470. You can also call oftype(Cint,x).

@WestleyArgentum
Copy link
Member Author

Ah, I see. It looks like this could be handled in your latest proposal over there, I'll wait to see how that plays out.

@vtjnash
Copy link
Sponsor Member

vtjnash commented Apr 17, 2014

the Cint types are typically intended to be used in the context of ccall, which calls convert automatically

@stevengj
Copy link
Member

Implemented by #8712

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants