GOLF(2gg)
π GOLF(2gg) β the new-message page, bestie edition π
okay so we're in the GOLF manual, section 2gg, and this one's filed under Development. it's a whole lil baby page about making messages. slay. let's go π
β¨ NAME β¨
new-message β (messages)
πΈ PURPOSE πΈ
create a new message. that's it. that's the job. iconic behavior honestly π
π¦ SYNTAX π¦
new-message <message> [ from <string> ]
π DESCRIPTION π
so new-message is gonna create a new <message> object. brand new. fresh out the box. no cap.
now here's the tea β β if you pass a <string> (that's the "from" clause, bestie), then it gets used to build the <message> out of it. and important: that <string> has to be in SEMI format. it could come from the request's input, from get-message, from reading a file, wherever β all valid sources, we're not picky about the origin story. BUT β and this is the plot twist β in that case, <message> can only be read from, using read-message. that's it. that's the whole vibe. you can't write to it, you read it. periodt.
if you run new-message without the "from" clause? then you're in build-it-yourself mode, and you can add data to <message> with write-message. so cute, so DIY, we love a craft project π§
π EXAMPLES π
okay here's the moment you've all been waiting for, the main character energy example β¨
begin-handler /msg public
new-message msg
write-message msg key "weather" value "nice"
write-message msg key "distance" value "near"
start-loop
read-message msg key k value v status s
if-true s not-equal GG_OKAY
break-loop
end-if
@Key is <<print-out k>> and value is <<print-out v>>
end-loop
end-handler
like?? look at her go. weather is "nice", distance is "near", and she just loops through printing keys and values like the absolute queen she is π
π«Ά SEE ALSO π«Ά
Messagesget-messagenew-messageread-messageSEMIwrite-message- See all documentation
k bye ily, go make some messages π
this lil page was served to you by version $VERSION, dated $DATE, straight outta the GOLF(2gg) manual. mwah π
π¦ 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