GOLF(2gg)
πΈ GOLF(2gg) πΈ
okay bestie, welcome to the Development section of the Golf manual π
this is the inline-code page and it's literally about sneaking Golf code into your output. no cap.
β¨ NAME β¨
inline-code β (language)
π PURPOSE π
Inline Golf code in an output statement. yes, inside it. we're being sneaky and it's iconic π«Ά
π¦ SYNTAX π¦
<<golf code>>
π DESCRIPTION π
So here's the tea β you can write Golf statements right inside an output-statement, you just gotta wrap them up between << and >> delimiters. that's it. that's the whole vibe π
The following statements can be inlined, and yes these six are the only ones invited to the party:
print-outprint-formatcurrent-rownumber-stringstring-lengthcall-handler
π EXAMPLES π
π example one: print-out doing its thing
The print-out statement displays a string, and in the following code it's used to display a result within an output-statement (i.e. within the "@" statement):
run-query ="select firstName, lastName from people" output firstName, lastName
@<tr>
@ <td>
@ First name is <<print-out firstName>>
@ </td>
@ <td>
@ Last name is <<print-out lastName>>
@ </td>
@</tr>
end-query
πΈ example two: call-handler said hello
In the code below, "some_req" is a request handler that outputs some text, and it's used inline to output "Hello world":
@Hello <<call-handler "/some-req">>
call-handler "some-req" would simply output "world":
%% /some-req public
@world
%%
π§ example three: write-string + output = bestie behaviour
A write-string is typically used with output statements; in this case we print the value of another string, resulting in "There is 42 minutes left!":
set-string mins="42"
(( my_string
@There is <<print-out mins>> minutes left!
))
π SEE ALSO π
- Language
inline-codestatements- syntax-highlighting
unused-varvariable-scope- See all documentation
okay that's the whole page, you ate it, go inline something gorgeous πβ¨
sign-off time bestie π this page is version $VERSION, dated $DATE, and it lives in the GOLF(2gg) manual. periodt. π
π¦ 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