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

Clarify the array spec #508

Open
judfs opened this issue Apr 17, 2024 · 0 comments
Open

Clarify the array spec #508

judfs opened this issue Apr 17, 2024 · 0 comments

Comments

@judfs
Copy link
Contributor

judfs commented Apr 17, 2024

I find this page surprisingly confusing: http://lcm-proj.github.io/lcm/content/lcm-type-ref.html#arrays

LCM supports multi-dimensional arrays consisting of primitives, structs, or constant declarations.

I am not sure what "constant declarations" could mean. As far as I can tell, nothing like const int32_t foo[2] = {1, 2}; is supported.

...: you cannot encode an LCM type that consists of a variable-dimension array.

This clarification existing is confusing? Like why is it even there? What would that even look like? X-D arrays aren't a type system level thing anywhere? Like I guess the idea is to say int32_t ndim; int32_t dimsizes[ndim]; float ndarrry<dimsizes> is not a thing that is supported. But, why would it? Could be a footnote at the end of the section, but not in the 2nd sentence.

point2d_list_t example: Might be worth spelling out "

struct point2d_list_t_alt
{
    const int32_t values_per_point = 2;
    int32_t npoints;
    double  points[npoints][values_per_point];
}

is essentially the same as point2d_list_t"?

.

Say upfront "LCM uses the C-style <unit_type> <array_name> <array_dimensions>; syntax."?

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

1 participant