# Discussion Towards: Incremental Coding/ Native Query Language in Julia

**URL:** <https://discourse.julialang.org/t/discussion-towards-incremental-coding-native-query-language-in-julia/125873>\
**Category:** General Usage\
**Created:** [February 13, 2025, 6:05pm UTC](https://discourse.julialang.org/t/discussion-towards-incremental-coding-native-query-language-in-julia/125873 "2025-02-13T18:05:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [February 13, 2025, 6:14pm UTC](https://discourse.julialang.org/t/discussion-towards-incremental-coding-native-query-language-in-julia/125873/2 "2025-02-13T18:14:46Z")

</div>

> [@GeekyPeas](#):
>
> I imagine to be able to declare only the type of a variable and not assign it any value.

Variables indeed can have declared types without assigned values. Access without a value errors, and so does assignment of values that can’t be converted to the declared type. Note that the `local`/`global` keywords are necessary because `x::Int` already means type assertion of the instance assigned to a variable.

```julia
julia> module TypedDemo
         global x::Int
         function foo(z)
           local y::Int
           y = z
         end
       end
Main.TypedDemo

julia> TypedDemo.x
ERROR: UndefVarError: `x` not defined in `Main.TypedDemo`
Suggestion: add an appropriate import or assignment. This global was declared but not assigned.
Stacktrace:
...

julia> TypedDemo.x = "one"
ERROR: MethodError: Cannot `convert` an object of type String to an object of type Int64
...

julia> TypedDemo.foo("one")
ERROR: MethodError: Cannot `convert` an object of type String to an object of type Int64
...

```

That alone doesn’t come close to the things discussed here, but maybe it can be useful.

---

_[View the full topic](https://discourse.julialang.org/t/discussion-towards-incremental-coding-native-query-language-in-julia/125873)._
