Question in Tutorial docs #74

Open
opened 2025-12-30 01:20:25 +01:00 by adam · 2 comments
Owner

Originally created by @vamsi-98 on GitHub (Feb 17, 2024).

In the example for entries I see that object is used as key. But when I evaluate the example it throws the below error

image

Is the code in the docs correct or am I missing something?

Originally created by @vamsi-98 on GitHub (Feb 17, 2024). In the [example](https://pkl-lang.org/main/current/language-tutorial/01_basic_config.html#entries) for entries I see that object is used as key. But when I evaluate the example it throws the below error <img width="862" alt="image" src="https://github.com/apple/pkl/assets/42208075/cc3958f8-c583-42f4-a844-a245807fa3b8"> Is the code in the docs correct or am I missing something?
Author
Owner

@stackoverflow commented on GitHub (Feb 19, 2024):

Indeed, this example doesn't render properly to json or yaml, just to pcf. Probably a good idea to change it to something that's json renderable.

@stackoverflow commented on GitHub (Feb 19, 2024): Indeed, this example doesn't render properly to `json` or `yaml`, just to `pcf`. Probably a good idea to change it to something that's `json` renderable.
Author
Owner

@vamsi-98 commented on GitHub (May 20, 2025):

I was thinking it can be changed to something like this, not sure if it exactly highlights the purpose of the example for entries.

pigeonShelter {
  ["bird"] {
    name = "Common wood pigeon"
    diet = "Seeds"
    taxonomy {
      species = "Columba palumbus"
    }
  }
  ["address"] = "355 Bird St."
}
count = "value"
birdCount {
  ["value"] = 42
@vamsi-98 commented on GitHub (May 20, 2025): I was thinking it can be changed to something like this, not sure if it exactly highlights the purpose of the example for entries. ``` pigeonShelter { ["bird"] { name = "Common wood pigeon" diet = "Seeds" taxonomy { species = "Columba palumbus" } } ["address"] = "355 Bird St." } count = "value" birdCount { ["value"] = 42 ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#74