Skip to content

Document the LSL reserved words print and event - #124

Merged
HaroldCindy merged 5 commits into
secondlife:mainfrom
tapple:lsl-print
May 12, 2026
Merged

Document the LSL reserved words print and event#124
HaroldCindy merged 5 commits into
secondlife:mainfrom
tapple:lsl-print

Conversation

@tapple

@tapple tapple commented May 9, 2026

Copy link
Copy Markdown
Contributor

Add the lsl reserved words print and event to the controls section, marked as deprecated.

I did not mark them as private because 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.

event now renders like this in the viewer. Marking it deprecated colors it pink, even though this was a previously unused code path for controls keywords in the viewer.:
lsl-event

See also:

Comment thread lsl_definitions.yaml
tooltip: if / else block\nif (<condition>) {\n...\n[} else [if (<condition>) {\n...]]\n}
jump:
tooltip: jump statement\njump <label>
print:

@tapple tapple May 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to put print in the functions section, since it is, but, encountered several problems doing so:

  1. Numerous places in the code require all functions to start with ll, and this one doesn't.
  2. This function (probably) doesn't have a func-id, and the validator requires one.
  3. 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.
  4. 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.

@tapple tapple May 9, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tapple tapple May 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread generated/lsl_keywords_pretty.xml Outdated
<key>deprecated</key>
<boolean>true</boolean>
<key>tooltip</key>
<string>Prints text to stdout on the server. For internal use only.</string>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really just reserved for internal use any more, but it's only meaningful under VM 2025 or Lua

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated tooltip

Comment thread generated/lsl_keywords_pretty.xml Outdated
<key>print</key>
<map>
<key>deprecated</key>
<boolean>true</boolean>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not deprecated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@HaroldCindy
HaroldCindy merged commit a4940e2 into secondlife:main May 12, 2026
5 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants