Skip to content

Conversation

@musm
Copy link
Collaborator

@musm musm commented Nov 8, 2016

No description provided.

@musm
Copy link
Collaborator Author

musm commented Nov 8, 2016

Shouldn't mwSize be renamed to mxSize? same with mwIndex ? @simonster


function mxarray(s::String)
utf16string = transcode(UInt16, s)
utf16string = transcode(mxChar, s)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? transcode is a julia function and not a MATLAB one so I don't see why this is better.

Copy link
Collaborator Author

@musm musm Nov 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are marshalling it to matlab using _mx_create_char_array in the next line and matlab uses
http://www.mathworks.com/help/matlab/apiref/mxchar.html

also thread: #76

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transcode(UInt16, ...) is the API to decode it as UTF16, not transcode(mxChar, ...). I don't see how any of the links are relevant.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typealias mxChar UInt16 at the top

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

  1. They are the same so why change it?
  2. You are calling julia API defined on UInt16 and documented as so and why confuse the reader about what you are calling using an matlab type alias?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok if you feel that way close this and let's move on. I just want to move on and not create a big issue. I just felt that this was more consistent since it's used below https://github.com/musm/MATLAB.jl/blob/6993d1e50f38ae73ec45a0bf7a4bbe64ac4058ca/src/mxarray.jl#L646

to convert the String back to Julia.

@yuyichao yuyichao closed this Nov 8, 2016
@musm musm mentioned this pull request Nov 11, 2016
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

Successfully merging this pull request may close these issues.

2 participants