Document the LSL reserved words print and event - #124
Conversation
| tooltip: if / else block\nif (<condition>) {\n...\n[} else [if (<condition>) {\n...]]\n} | ||
| jump: | ||
| tooltip: jump statement\njump <label> | ||
| print: |
There was a problem hiding this comment.
I tried to put print in the functions section, since it is, but, encountered several problems doing so:
- Numerous places in the code require all functions to start with
ll, and this one doesn't. - This function (probably) doesn't have a
func-id, and the validator requires one. - It's argument has a totally unique typing: it accepts any argument type without error (string, integer, float, list, vector, quaternion, key). No other LSL function behaves that way, and the schema has no way to indicate this.
- This function doesn't exist in SLua
Therefore, I assumed this is probably a compiler builtin of some sort, gave up, and moved it to the controls section. I did not try to check any lsl compiler source code to validate this assumption.
There was a problem hiding this comment.
print(ll.print) -- nilFor a code example, see: https://feedback.secondlife.com/slua-alpha/p/undocumented-lsl-print-function-works-differently-under-lsl-2025-vm
There was a problem hiding this comment.
Since it sounds like Harold intentionally improved print (https://feedback.secondlife.com/slua-alpha/p/undocumented-lsl-print-function-works-differently-under-lsl-2025-vm), I could move it from controls to functions as part of the keywords.xml generator (similarly to the alternate proposal in #123 (comment)). Though, that might cause trouble for non-viewer consumers of keywords.xml
| <key>deprecated</key> | ||
| <boolean>true</boolean> | ||
| <key>tooltip</key> | ||
| <string>Prints text to stdout on the server. For internal use only.</string> |
There was a problem hiding this comment.
It's not really just reserved for internal use any more, but it's only meaningful under VM 2025 or Lua
| <key>print</key> | ||
| <map> | ||
| <key>deprecated</key> | ||
| <boolean>true</boolean> |
Add the lsl reserved words
printandeventto the controls section, marked asdeprecated.I did not mark them as
privatebecause they currently cause unexplained syntax errors if you use them as variable names. Therefore, it's preferable hilight them a funny color and give them a tooltip with some context.eventnow renders like this in the viewer. Marking itdeprecatedcolors it pink, even though this was a previously unused code path forcontrolskeywords in the viewer.:See also: