// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

void print_array_contents (string name, float f[])
{
    printf ("%s array length %d\n", name, arraylength(f));
    for (int i = 0; i < arraylength(f); ++i)
        printf ("  [%d] = %g\n", i, f[i]);
}

void print_array_contents (string name, vector v[])
{
    printf ("%s array length %d\n", name, arraylength(v));
    for (int i = 0; i < arraylength(v); ++i)
        printf ("  [%d] = (%g)\n", i, v[i]);
}

shader test (float a[] = {0,1,2.3},
             vector b[] = {9, vector(1,2.3,4)},
             vector c[] = {})
{
    print_array_contents ("a", a);
    print_array_contents ("b", b);
    print_array_contents ("c", c);
}
