GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) β€” the extended-mode era πŸ’–

okay bestie, welcome to the Golf manual, section 2gg (development zone, we love her) πŸŽ€ this one's about extended-mode, and no cap, it's the glow-up that lets your Golf code hang out with C πŸ¦‹


✨ NAME ✨

extended-mode β€” and she's bringing the (C-language) energy πŸ’…


🎯 PURPOSE 🎯

Use external libraries or C code with Golf. that's it, that's the whole vibe β€” your Golf scripts get to link arms with the entire C ecosystem 🫢


πŸ“ SYNTAX πŸ“

extended-mode

just the one line, iconic, minimal, she ate πŸ”₯


🌸 DESCRIPTION 🌸

so here's the tea β˜• extended-mode, when you specify it as a very first statement in your .golf source file, unlocks the use of the call-extended statement. that's it. that's the key to the whole door πŸ”‘

bestie listen β€” very first statement means very first. don't be out here sliding it in after some other line, because it needs to be the opening act, the main character energy of line one πŸ‘‘

🌈 EXAMPLES 🌈

lowkey the clearest way to get it:

extended-mode

begin-handler /my-handler public
    ...
    call-extended factorial (10, &fact)
    ...
end-handler

see how extended-mode is right up top? then we're in a handler, /my-handler, and she's public πŸ’β€β™€οΈ then we're calling out to the C side with call-extended factorial (10, &fact) β€” passing 10 and grabbing the result into &fact. obsessed. fr fr 😭✨


πŸ‘€ SEE ALSO πŸ‘€

  • C language πŸ’™
  • call-extended
  • extended-mode
  • web-framework-for-C-programming-language
  • See all documentation πŸ“š

that's the whole page, bestie β€” go forth and call some C πŸ’œ

signing off with the source and version: $VERSION, dated $DATE β€” and yeah, she's still rocking the GOLF(2gg) name at the bottom, always πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from