tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.24k stars 84 forks source link

manual/modular-configurations.md: add argument to std.string.join #1859

Closed Jasha10 closed 3 months ago

Jasha10 commented 3 months ago

This is another change related to the final example in doc/manual/modular-configurations.md. The std.string.join function takes two arguments.

Before this change:

$ echo '(import "example.ncl") & {inputs = {foo = "Phooey", bar = 123}}' | nickel export
error: non serializable term
   ┌─ <stdlib/internals.ncl>:44:7
   │
44 │ ╭       (
45 │ │         fun x =>
46 │ │           value
47 │ │             (
   · │
52 │ │             )
53 │ │       )
   │ ╰───────^
   │
   = Nickel only supports serializing to and from strings, booleans, numbers, enum tags, `null` (depending on the format), as well as records and arrays of serializable values.
   = Functions and special values (such as contract labels) aren't serializable.
   = If you want serialization to ignore a specific value, please use the `not_exported` metadata.

After this change:

$ echo '(import "example.ncl") & {inputs = {foo = "Phooey", bar = 123}}' | nickel export
{
  "last_option": "values are phooey and 123",
  "other_option": "Hello phooey",
  "some_config_option": 124
}
vkleen commented 3 months ago

I've also backported this to the stable branch just now.