---
title: "Aliasing"
description: "All Dino imports can be aliased. Sometimes this is helpful to save a few keystrokes later, and other times it is downright essential – some types must be aliased on import. Sometimes, as when importi…"
url: "https://support.wheelhousemfg.com/article/w12d2x3cai-aliasing"
category: "Dino Script® Language Reference"
updated_at: "2020-02-04T18:03:29Z"
---

# Aliasing

All Dino imports can be aliased. Sometimes this is helpful to save a few keystrokes later, and other times it is downright essential – some types must be aliased on import. Sometimes, as when importing scripts, the alias radically changes how the imported object is subsequently accessed.

```
// aliased script import
import script 'Other.dino' as Other;

// aliased native type imports
from System import 'Func`2' as F2; // generic delegate type
from System.Collections.Generic import List as GList;
from System import Convert as C;
```

### Importing Generic Types with Aliases

When importing generic types (for example, **SomeType&lt;T&gt;**, **OtherType&lt;K, V&gt;**), you must use a special import mechanism if the generic type name conflicts with a non-generic type name in the same namespace. Dino will be smart about generic types that do not have a name clash. For example, **System.Collections.Generic** contains the **List&lt;T&gt;** class. However, there is no such thing as a **List** class (non-generic version). So, this import statement:

```
from System.Collections.Generic import List;
```

will import the **List&lt;T&gt;** class (since it can infer what you meant), which you would use as follows:

```
var glist = List[string]();
glist.Add('test');
```

However, consider the case of a fictitious namespace called **Foo** that contains the non-generic **Bar** class, and the generic **Bar&lt;T&gt;** class. To import the generic **Bar&lt;T&gt;** class, you would need to use this syntax:

```
from Foo import 'Bar`1' as Bar1;
```

This odd syntax is based on the way that names are maintained internally in the .NET framework: generic classes are named with their class name, a backtick, and then the number of generic arguments. For example, the **Func&lt;Tin, Tout&gt;** delegate would have the name **Func\`2**.

Since the backtick is not an allowable character in a Dino identifier or type name, these types of imports must be aliased.
