Skip to content

Cannot pass builtin to std.makeArray #511

Description

@sparkprime
dcunnin@dcunnin7:~$ jsonnet -e 'std.makeArray(10, std.sqrt)'
Segmentation fault (core dumped)
dcunnin@dcunnin7:~$ go-jsonnet -e 'std.makeArray(10, std.sqrt)'
[
   0,
   1,
   1.4142135623730951,
   1.7320508075688772,
   2,
   2.2360679774997898,
   2.4494897427831779,
   2.6457513110645907,
   2.8284271247461903,
   3
]

A simple workaround is to use eta expansion std.makeArray(10, function(x)std.sqrt(x))'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions