Skip to content

Add (tagged name $) predicate#201

Merged
dstelzer merged 5 commits intomainfrom
tagged-names
Apr 16, 2026
Merged

Add (tagged name $) predicate#201
dstelzer merged 5 commits intomainfrom
tagged-names

Conversation

@dstelzer
Copy link
Copy Markdown
Contributor

This will most often go unused, but allows an equivalent of Inform's "before printing the name of" and "after printing the name of" if needed. If it's not used, the compiler will optimize it out completely.

@dstelzer dstelzer linked an issue Mar 15, 2026 that may be closed by this pull request
@bkirwi
Copy link
Copy Markdown
Contributor

bkirwi commented Mar 17, 2026

Personally this strikes me as ~equivalent to me defining (actual name $) for my objects and setting up my own forwarder... is that right? It appears that the only things that are directly (name $)ed are directions, and it doesn't seem likely that users will want to interpose there.

If so, I'd personally bias towards keeping the library small and having less to document. But I may be missing something - did you find this difficult to handroll otherwise?

@dstelzer
Copy link
Copy Markdown
Contributor Author

dstelzer commented Mar 17, 2026

That is correct! This is equivalent to just defining an (actual name $) predicate for myself.

My rationale for putting it into the library is that Dialog authors are very used to writing (name $) every time they define a new object. Having the library use the awkward predicate name instead of the author minimizes the chance of mistakes there. And if the author doesn't use the feature, it gets optimized to nothing—compare features like fungible objects and choice mode that go unused in most projects.

(This has come up twice for me specifically: once to put the spell adjectives on objects in Wise-Woman's Dog, a second time to put liquid names in front of containers in a TALJ project. Once, I was happy to hand-roll; twice, I started wondering if the library should provide the hook for me.)

If others disagree, though, I'm happy to be outvoted on it.

@dstelzer
Copy link
Copy Markdown
Contributor Author

The poll was absolutely neck and neck, but "add (tagged name $)" won by a hair, so I'm going to merge this in. If someone wants to remove it in the future, though, I won't stand in their way.

@dstelzer dstelzer merged commit 8e63921 into main Apr 16, 2026
4 checks passed
@dstelzer dstelzer deleted the tagged-names branch April 16, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Before/after printing the name of a thing

2 participants