# Reserved words

> The words you cannot use as a bare name — and the many places where you still can.

Source: https://www.sendlang.com/docs/reference/reserved-words
Section: Reference

Both lists below are `ReservedWords()` from the parsers, dumped at build time.

## The rule

A reserved word may not be used as a **bare name**. There are exactly three bare
name positions in the languages:

- an **event name** — `count(open ...)`
- a **property name** inside a `where` — `where url contains "..."`
- an **aggregate field name** — `sum(amount of ...)`

That is all. Everywhere else, names are either **qualified** (`attr.x`,
`activity.x`) or **quoted** (`"onboarding"`), and neither can be confused with a
keyword — so neither is restricted.

This is why all of the following are perfectly legal:

```sendql
attr.count = 5 and in list "segment"
```

```sendflow reserved.flow
workflow "Reserved words are fine when quoted" v1 {
  enter on segment "trial-started"

  // A topic called "timeout" is a string, so it cannot collide with anything.
  send "welcome" via topic "timeout"
}
```

And why this is not:

**Rejected — the parser refuses this:**

```sendql
exists(within within 7d)
```

> `"within" is a reserved word and cannot be used as an event name`

The parser cannot tell whether that first `within` is an event called `within` or
the start of a window. So it is rejected, and the error says exactly why.

## SendQL

```
all and avg between contains count ends exists false first from has in is known last list max min not now of opted or out segment starts subscribed sum suppressed to true unknown unsubscribed where with within
```

## SendFlow

SendFlow reserves everything SendQL does, plus its own workflow keywords.

```
add after all and avg before between cap contact contains count else ends enroll enter event every existing exists exit false first forward frequency from has hold if in is known last list max min not now occurrence of off on once opted or out per reentry rematch repeat segment send set since split starts subscribed sum suppressed timeout timezone to topic transactional true unknown unsubscribed until up via wait when where window with within workflow
```

## Two words that are not reserved

`attr` and `activity` are **not** reserved words. They are qualifiers, and they
are only meaningful directly before a `.`.

Which is exactly why `attr.count` works: `count` is reserved, but the name being
parsed there is not a bare `count` — it is the property half of a qualified
reference, and the qualifier has already told the parser what to expect.
