GOLF(2gg)
π GOLF(2gg) π
ok so bestie, welcome to the GOLF(2gg) page, living under Development in section 2gg π this one's about the delete-tree fam and it's honestly so useful, no cap.
β¨ NAME β¨
delete-tree β like, the tree one? π«Ά (that's literally what the original says: "delete-tree - (tree)", so yes, it's giving tree energy)
π― PURPOSE π―
Delete a node from a tree. that's it. that's the whole vibe. π
πΈ SYNTAX πΈ
delete-tree <tree> key <key> \
[ status <status> ] \
[ value <value> ] \
π DESCRIPTION π
ok so delete-tree will go search <tree> for the string <key>, and if it finds it? it deletes that node (and yes, the key inside it comes along too, bye bye π), sets <value> (that's the one in the "value" clause) to the node's value, and sets the <status> number (the one in the "status" clause) to GG_OKAY. slay.
but listen, if <key> is not found, then <status> is gonna be GG_ERR_EXIST π like the key just wasn't there bestie.
and the important little caveat: if <status> is not GG_OKAY, then <value> is unchanged. so don't be out here reading <value> expecting fresh data when the status said no. π that's the rule, periodt.
π¦ EXAMPLES π¦
delete a node with key "123", and get its value back:
set-string k = "123"
delete-tree mytree key k value val status st
if-true st not-equal GG_OKAY
@Could not find key <<print-out k>>
exit-handler
end-if
// display key/value deleted
@Deleted key <<print-out k>> with value <<print-out val>>
// delete the original value
delete-string val
see how it checks st first before trusting val? that's the whole point, main character behavior fr fr. π₯
π SEE ALSO π
- Tree π³
delete-treeget-treenew-treepurge-treeread-treeuse-cursorwrite-tree- See all documentation
π little reminder bestie: this whole thing lives in the GOLF(2gg) manual, under Development, and it's sourced from$DATE/$VERSIONβ that's the version stamp, iykyk. go delete some tree nodes, you got this πβ¨π
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms