Sugar exposes a JOI’s configured pronouns as ordinary values. This keeps identity-aware text readable without making you repeat gender checks throughout a creation.
Read pronouns from a JOI
Every Joi value has five direct pronoun properties:
ACTOR.they
ACTOR.them
ACTOR.their
ACTOR.theirs
ACTOR.themselves
They return the correct words for that JOI. For example, ACTOR.they may return "she", "he", or "they".
Use the properties anywhere you have a Joi, including a selected input or a Session seat:
text "{opponent.name} raises {opponent.their} shield.";
text "{SELF.joi.name} spends {SELF.joi.their} final mana.";
The properties are direct on the JOI so common text stays short; there is no extra .pronouns path.
Reuse a Pronoun value
When one program needs several forms, get one Pronoun object and reuse it:
let p: Pronoun = Pronoun::of(2);
text "@1 gives the map to @2 so {p.they} can keep it with {p.them}.";
Pronoun::of() accepts a participant number, a Joi, or a Session Seat:
let actorWords = Pronoun::of(ACTOR);
let seatWords = Pronoun::of(SELF);
Use Pronoun::fromGender() when the words belong to a narrator or character that is not represented by a JOI:
let narrator = Pronoun::fromGender("NON_BINARY");
The accepted genders are "WOMAN", "MAN", and "NON_BINARY".
Make verbs agree
Pronouns affect verbs as well as nouns:
- she is, he is, they are
- she has, he has, they have
- she does, he does, they do
Sugar provides the common agreement words directly:
text "{p.they} {p.is} ready.";
text "{p.they} {p.has} found the key.";
text "{p.they} {p.does} remember the route.";
text "Yesterday, {p.they} {p.was} waiting here.";
For any other verb, use agree(singular, pluralAgreement):
let movement = p.agree("walks", "walk");
text "{p.they} {movement} toward the door.";
The first value is used with she and he. The second is used with singular they. Sugar does not try to conjugate arbitrary words automatically, so your wording stays explicit.
The same agreement properties and agree() method are available directly on Joi values:
text "{ACTOR.name} says {ACTOR.they} {ACTOR.is} ready.";
Keep the short participant helpers
When you only need one word for a numbered participant, the original helpers remain concise:
they(2)
them(2)
their(2)
theirs(2)
themselves(2)
text "@1 takes @2's hand and pulls {} closer." with them(2);
Use direct JOI properties when you already have a Joi, Pronoun::of() when several words or agreement forms belong together, and the standalone helpers for a quick numbered-participant lookup.
The next lesson introduces match, which selects one result from several clearly labeled patterns.