Re:The Odin Programming Language
by gingerBill on Friday January 31, 2020 @07:18PM
(#22207407)
You can easily do the same in Odin, if you would like. However, `using` works for a lot more than that just this. `using` allows for many for type system features beyond a basic scope import like Pascal's with. `using` can be applied to procedure parameters, struct field declarations allow for subtype polymorphism (even of pointers), scope imports, and more.
Koltin's approach is limited to purely the same Pascal's `with` allowed.
But if you want to be clear:
{ using entity;
// the fields of "entity" are not usable in this scope
x = 123;
}
entity.x = 123;
Koltin's approach is limited to purely the same Pascal's `with` allowed.
But if you want to be clear: