# Question out of curiousity: homograph of & (and operators in general)

**URL:** https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815
**Category:** General
**Created:** [October 10, 2026, 3:06pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815 "2026-10-10T15:06:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![BlueAlmost](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bluealmost/32/953_2.png) [@BlueAlmost](https://forum.ada-lang.io/u/BlueAlmost)
#### Post date: [October 10, 2026, 3:06pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815/1 "2026-10-10T15:06:45Z")

</div>

While experimenting, I came across the “homograph clash issue”, which brought a question. An concrete example: first snippet works fine, the second give compile error.

```ada
with Ada.Containers; use Ada.Containers;
with Ada.Containers.Vectors;
procedure Q_good is
  package Int_Vectors is new Ada.Containers.Vectors (Positive, Integer);
  use Int_Vectors;
    V : Vector := 1 & 11 & 111;
begin
  null;
end Q_good;

```

However, removing `use Int_Vectors` and using the dot notation produces compile error (below):

```ada
with Ada.Containers; use Ada.Containers;
with Ada.Containers.Vectors;

procedure Q_bad is
    package Int_Vectors is new Ada.Containers.Vectors (Positive, Integer);
    V : Int_Vectors.Vector := 1 & 11 & 111;
begin
  null;
end Q_bad;

```

`gcc -c q_bad.adb q_bad.adb:6:33: error: invalid operands for concatenation q_bad.adb:6:33: error: maybe "and" was meant gnatmake: "q_bad.adb" compilation error`

In this example the compiler is interpreting the `&` as a homograph for **and** , which explains the need for “use” clause ,

But, this makes me wonder: How would one signify that the ampersand should be associated with the package Int\_Vectors ? I tried variations on `Int_Vectors.&` etc. with no luck.

---

<div class="post-metadata">

### Author: ![AdaOrbit](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/adaorbit/32/879_2.png) [@AdaOrbit](https://forum.ada-lang.io/u/AdaOrbit)
#### Post date: [October 10, 2026, 3:40pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815/2 "2026-10-10T15:40:45Z")

</div>

```ada
with Ada.Containers; use Ada.Containers;
with Ada.Containers.Vectors;

procedure Q_bad is
    package Int_Vectors is new Ada.Containers.Vectors (Positive, Integer);
    V : Int_Vectors.Vector := Int_Vectors."&" (Int_Vectors."&" (1, 11), 111);
begin
  null;
end Q_bad;

```

If you look into the definition of Ada.Containers.Vectors, the “&” operator is defined there. Specifically [http://www.ada-auth.org/standards/22rm/html/RM-A-18-2.html](http://www.ada-auth.org/standards/22rm/html/RM-A-18-2.html) Line 15/5 and following

---

<div class="post-metadata">

### Author: ![dmitry-kazakov](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/dmitry-kazakov/32/522_2.png) [@dmitry-kazakov](https://forum.ada-lang.io/u/dmitry-kazakov)
#### Post date: [October 10, 2026, 3:48pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815/3 "2026-10-10T15:48:57Z")

</div>

> [@BlueAlmost](#):
>
> I tried variations on `Int_Vectors.&` etc. with no luck.

Operator name is quoted when used as a name, i.e. `Int_Vectors."&"`. (The relevant RM part is 4.1 where _operator\_symbol_ defined as _string\_literal_.)

Then instead of a full use clause you can try `use type Int_Vectors.Vector` to make _&_ and other operations on Vector visible.

---

<div class="post-metadata">

### Author: ![BlueAlmost](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bluealmost/32/953_2.png) [@BlueAlmost](https://forum.ada-lang.io/u/BlueAlmost)
#### Post date: [October 10, 2026, 5:19pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815/4 "2026-10-10T17:19:32Z")

</div>

Thank you for both replies. I had totally forgotten to check the Ada Reference Manual.

Sorry about that. But, my embarrassment will serve to remind me to do this in the future!

---

<div class="post-metadata">

### Author: ![OneWingedShark](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/onewingedshark/32/305_2.png) [@OneWingedShark](https://forum.ada-lang.io/u/OneWingedShark)
#### Post date: [October 10, 2026, 6:50pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815/5 "2026-10-10T18:50:27Z")

</div>

> [@BlueAlmost](#):
>
> In this example the compiler is interpreting the `&` as a homograph for **and** , which explains the need for “use” clause

Nope: `&` and `and` are two different operators.  
(Yes, `renames` can be used [by the type’s author] to make them the same, but this is not _necessarily_ the case.)

---

<div class="post-metadata">

### Author: ![BlueAlmost](https://forum.ada-lang.io/user_avatar/forum.ada-lang.io/bluealmost/32/953_2.png) [@BlueAlmost](https://forum.ada-lang.io/u/BlueAlmost)
#### Post date: [October 10, 2026, 7:03pm UTC](https://forum.ada-lang.io/t/question-out-of-curiousity-homograph-of-and-operators-in-general/4815/6 "2026-10-10T19:03:52Z")

</div>

Yes, you are right, I was confusing the error message about `maybe "and" was meant`.
