# Future Features

This section covers future features of the OneScript language.

## Type Inference

Instead of using a specific declaration type for a variable it will be possible to use the `var` keyword if the type of the variable can be inferred by its use.

```csharp
var a = "This is a string";
var b;
var c = 1;
b = c + 23;
```

The example above show a direct inference for the variable `a` and a deferred inference for the variable `b`. As long as the inference can be made the compilation will be successful.

## Collection Improvements

### Iterators

All arrays will support the `foreach` statement block.

### Dictionaries

Dictionaries support an indexed array for fast searching.

## Class Improvements

### Properties

Support for properties like many other languages.

```csharp
class Animal {
    private string name;
    public string Name {
        get { return name; }
        set { name = value; }
    }
}
```

In the above example there are a number of new keywords to denote the getter and setter of a property. For a setter the value keyword is automatically given the inbound value.

### Abstract Classes

The ability to create a template class that can be inherited by other classes to support the idea of refactoring code.

```csharp
abstract class Animal {
    public string Name;
    public void SayName();
}
```

In the above example it is possible to define methods with no block. These have to be fulfilled in the classes that inherit it.

### Inheritance

Class Inheritance supported in many other languages improves refactoring of code.

```csharp
class Horse : Animal {
    public void SayName() {
        Console.Write(base.Name);
    }
}   
```

the above example introduces the new keyword `base`. This refers to the base class that is inherited.

### Interfaces

It is possible to define an interface listing the public properties and methods. This can be inherited by a class and then used as the template for that class. It's real benefit is the adoption of an interface by multiple classes so they can all be handled in a common way.

## Asynchronous Programming

Whilst libraries used with OneScript support asynchronous programming the language itself does not. Methods can be made asynchronous with the `async` keyword and asynchronous methods can be called asynchronously with the `await`keyword.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.onescript.org/onescript-overview/future-features.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
