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

R/S docs don't tell which datatype should literal arrays be #271

Open
hiiamboris opened this issue Feb 3, 2022 · 3 comments
Open

R/S docs don't tell which datatype should literal arrays be #271

hiiamboris opened this issue Feb 3, 2022 · 3 comments
Assignees

Comments

@hiiamboris
Copy link
Contributor

When I declare for example:
array: ["ab" "cd" "ef"]
what type should I put into the function spec?

According to the docs it should be pointer! [c-string!] but it's invalid to have pointer to pointer, so it errors out. Empirically found that it's actually int-ptr!.

@dockimbel dockimbel self-assigned this Feb 3, 2022
@dockimbel
Copy link
Member

dockimbel commented Feb 3, 2022

There are no support (yet) for pointer of pointer, so pointer! [integer!] is the only choice for now. c-string! is a pointer type, it's equivalent to pointer! [byte!] with the extra constraint that the buffer is NUL-terminated.

@greggirwin
Copy link
Contributor

Where is the best place to doc that?

@dockimbel
Copy link
Member

I can add a note in the R/S doc.

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

3 participants