5.4 Advanced output
Committed Output : the output stream, a magical place that queues up each word you write in a rule output.
So, output does two things. It queues up tokens to send to the user, which may be discarded if the rule ultimately fails. And it can call out to various functions. Things those functions may do are permanent, not undone if the rule later fails.
^reuse, ^gambit, ^respond
Output cannot have rules in it :
u: GREETING ( ~emohello )
if ($username) {
Hi $username !
} else {
I don't believe we've met, what's your name?
# a: (_*) So your name is '_0?
}
a: (_*) So your name is '_0?
Formatted double quotes ( Active/Format String ) : The active string ^"xxx" string is a format string. The system will remove the ^ and the quotes and put it out exactly as you have it,
Json Active Strings : ^'{ "test" : "my \"value\" \x" }
Functional Strings :
Loop Construct - loop or ^loop : Allows you to repeat script.
If Construct - if or ^if :
Pattern If : Eg. if (pattern bingo _*1 ~helo ) { ... }
Quoting : '$name will print $name .
Outputting underscores :
Response Controlinput :
Output Macros : Eg. Outputmacro: name (^arg1 ^arg2 ...)
Sharing function definitions :
Save-Restore locals :
Output Macros vs ^reuse() :
System Functions :
Randomized Output Revisited [ ] :