discrepancy in Filling out a Template tutorial #107

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

Originally created by @ghyatzo on GitHub (Mar 5, 2024).

hello,

In the amending tutorial, in the nestedAmend.pkl example
there is the extract

woodPigeon {
  name = "Common wood pigeon"
  diet = "Seeds"
  taxonomy {
    species = "Columba palumbus"
  }
}

stockPigeon = (woodPigeon) {
  name = "Stock pigeon"
  taxonomy { 
    species = "Columba oenas"
  }
}

dodo = (stockPigeon) { 
  name = "Dodo"
  extinct = true 
  taxonomy {
    species = "Raphus cucullatus"
  }
}

and in the description there is a clear reference to the taxonomy field in the bird example previously treated

In this example, bird.taxonomy has kingdom, clade, order and species

but the bird.taxonomy object has no `species property in the example

bird {
  name = "Pigeon"
  diet = "Seeds"
  taxonomy {
    kingdom = "Animalia"
    clade = "Dinosauria"
    order = "Columbiformes"
  }
}

It seems like woodPidgeon is amending bird but that doesn't seem true in the code.
It may be very confusing (and it was) the first time ones reads about it.
I've refrained from doing a PR directly since I don't know which narration you'd prefer to have here.

Originally created by @ghyatzo on GitHub (Mar 5, 2024). hello, In the amending tutorial, in the `nestedAmend.pkl` example there is the extract ``` woodPigeon { name = "Common wood pigeon" diet = "Seeds" taxonomy { species = "Columba palumbus" } } stockPigeon = (woodPigeon) { name = "Stock pigeon" taxonomy { species = "Columba oenas" } } dodo = (stockPigeon) { name = "Dodo" extinct = true taxonomy { species = "Raphus cucullatus" } } ``` and in the description there is a clear reference to the taxonomy field in the bird example previously treated >In this example, `bird.taxonomy` has` kingdom`, `clade`, `order` and `species` but the `bird.taxonomy` object has no `species property in the example ``` bird { name = "Pigeon" diet = "Seeds" taxonomy { kingdom = "Animalia" clade = "Dinosauria" order = "Columbiformes" } } ``` It seems like `woodPidgeon` is amending `bird` but that doesn't seem true in the code. It may be very confusing (and it was) the first time ones reads about it. I've refrained from doing a PR directly since I don't know which narration you'd prefer to have here.
Author
Owner

@StefMa commented on GitHub (Mar 5, 2024):

It seems like woodPidgeon is amending bird but that doesn't seem true in the code.

I guess you're right here.
woodPigeon is a completely new property and has nothing to do with the previously defined bird.
Otherwise it should be used like

woodPigeon = (bird) {

😉 Like also the first examples describe.

So the sentences In this example, bird.taxonomy has kingdom, clade, order and species is wrong for this example, but might be worth to move to the first example...

See also https://pkl-playground.vercel.app/?share=longer-drew-call

@StefMa commented on GitHub (Mar 5, 2024): > It seems like woodPidgeon is amending bird but that doesn't seem true in the code. I guess you're right here. `woodPigeon` is a completely new property and has nothing to do with the previously defined `bird`. Otherwise it should be used like ``` woodPigeon = (bird) { ``` 😉 Like also the first examples describe. So the sentences `In this example, bird.taxonomy has kingdom, clade, order and species` is wrong for this example, but might be worth to move to the first example... See also https://pkl-playground.vercel.app/?share=longer-drew-call
Author
Owner

@ghyatzo commented on GitHub (Mar 5, 2024):

Ahah thanks for confirming I am not mad, at first it confused me quite a bit.
Thanks for the clarification.

If I may, separating the two examples using slightly different objects might seem confusing, I don't know if that was deliberate or not but while working through it, it made things clearer just having woodPidgeon amend bird to begin with.

But it's just a minor feedback from a pkl noob so take it as it is 😁 I might be missing the point completely.

@ghyatzo commented on GitHub (Mar 5, 2024): Ahah thanks for confirming I am not mad, at first it confused me quite a bit. Thanks for the clarification. If I may, separating the two examples using slightly different objects might seem confusing, I don't know if that was deliberate or not but while working through it, it made things clearer just having `woodPidgeon` amend bird to begin with. But it's just a minor feedback from a pkl noob so take it as it is 😁 I might be missing the point completely.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#107