# `syntax.logical_operator`

Logical operator written in another language's form.

Area 3, [Logic](../topics/logic.md); not declinable; the next step is usually the agent's.

Logical operators are the words `and`, `or` and `not`, for `&&`, `||` and `!`, and SQL's `AND`, `OR` and `NOT`.

```jadpo
type Open = Bool {}

type Paid = Bool {}

type Done = Bool {}

function done(open: Open, paid: Paid) -> Done {
    return Done(open && paid)
}
```

```text
error: Jadpo writes `and`, not `&&`
 --> main.jadpo:8:22
  |
8 |     return Done(open && paid)
  |                      ^^ write `and`
  reason: `&&`, `||` and `!` are the logical operators of JavaScript, Rust, Go, Java, C#, Kotlin and Swift; Jadpo writes them as words: `and`, `or` and `not`.
  next: Use `and` instead of `&&` (agent)
  rule: syntax.logical_operator
  help: https://jadpo.dev/docs/errors/syntax.logical_operator

check failed: 1 error, 1 file
```
