docs icon indicating copy to clipboard operation
docs copied to clipboard

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

Open hiiamboris opened this issue 3 years ago • 3 comments

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!.

hiiamboris avatar Feb 03 '22 18:02 hiiamboris

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.

dockimbel avatar Feb 03 '22 18:02 dockimbel

Where is the best place to doc that?

greggirwin avatar Feb 03 '22 18:02 greggirwin

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

dockimbel avatar Feb 03 '22 18:02 dockimbel