GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ‘‘ GOLF(2gg) β€” okay bestie, let's talk output-statement

Welcome to the manual page for GOLF(2gg) β€” the development docs, the ones you actually need. Sit down, grab a boba, we're doing this. πŸ’–


✨ NAME ✨

output-statement β€” (output) β€” the statement that puts text on the screen, fr fr.


🎯 PURPOSE 🎯

Output text. That's it. That's the whole job description. Iconic, honestly. πŸ’…


🧚 SYNTAX 🧚

@<text>

!<verbatim text>

Two moods, both slay. 🌸


πŸ’œ DESCRIPTION πŸ’œ

So here's the vibe: you want to output some free form text? You start the line with @ or !. That's the whole entry fee. The text gets output unencoded, and a new line gets appended to it. Periodt.

With the @ statement, any inline-code executes, and whatever output comes out of those statements gets output too. It's giving main character energy β€” everything runs. πŸ”₯

With the ! statement, all text is output verbatim, and any inline code is not executed. Super useful when the text you're printing should not be checked for any inline-code. Sometimes you just wanna say the thing without the thing doing anything, yk? 🫢

Okay now the fine print, and I need you to actually read this part:

  • All trailing whitespaces are trimmed from each source code line. 😭
  • If you need to write trailing whitespaces, with the @ statement you can use print-out as inline-code. Workaround queen. πŸ‘‘
  • Maximum line length is 8KB β€” and that's the source code line length. The actual run-time output length is unlimited. So breathe, bestie, your output can be as long as it wants. 🌈
⚠️ Note that all characters are output as they are written, including the escape character (\). If you wish to output characters requiring an escape character, such as new line and tab (as is done in C by using \n, \t etc.), use print-out as inline-code. No cap β€” the backslash is not doing magic tricks for you here. πŸ’€

🌟 EXAMPLES 🌟

πŸ“ Outputting "Hello there"

@Hello there

Simple. Clean. Ate. ✨


πŸ¦‹ Mixing in other Golf statements

You can use other Golf statements inlined and mixed with the text you are outputting:

set-string weatherType="sunny"
@Today's weather is <<print-out weatherType>>

which would output

Today's weather is sunny

Look at that. The inline-code ran and everything. We love a collab. πŸ’–


πŸŽ€ The ! statement doing the same thing

With the ! statement, the text is also output, and this example produces the same "Hello there" output as @:

!Hello there

Same energy, different font. 🌸


πŸ™ˆ But here's the contrast

In contrast to @, the ! statement outputs all texts verbatim and does not execute any inline code:

set-string weatherType="sunny"
!Today's weather is <<print-out weatherType>>

which would output

Today's weather is <<print-out weatherType>>

Not me showing you the raw text just sitting there untouched. That's the whole point though β€” nothing got executed. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

  • Output
  • finish-output
  • flush-output
  • output-statement
  • print-format
  • print-out
  • print-path
  • See all documentation

Okay that's the whole page, you're officially a Golf output-statement girlie now. Go forth and print things. πŸ¦‹

This edition was brought to you by version $VERSION on $DATE β€” from the GOLF(2gg) development era. Stay slay, stay documented, mwah. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from