Skip to content
Snippets Groups Projects
Unverified Commit 60c47568 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Do not expose Trait and Module by default

This allows custom modules to define types with the name Trait or
Module. To use Trait and Module you just import them from std::trait and
std::module respectively. The module std::module does not define
anything useful at this time, but more useful code will be added to it
in the future.
parent d87be76d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -12,5 +12,3 @@ let Integer = Inko::Integer
let Float = Inko::Float
let Block = Inko::Block
let Array = Inko::Array
let Trait = Inko::Trait
let Module = Inko::Module
Loading
Loading
@@ -35,6 +35,7 @@ import std::process
import std::vm
import std::range::(Range as _Range)
import std::integer::extensions
import std::module
 
# These constants are re-exported so they're available to all modules by
# default. Core types such as String should be exposed in std::globals instead.
Loading
Loading
Loading
Loading
@@ -75,7 +75,8 @@
# particular a mirror has to be allocated every time you need one. As such we
# recommend against using reflection in performance critical code.
import std::fs::path::Path
import std::trait::IMPLEMENTED_TRAITS_ATTRIBUTE
import std::module::Module
import std::trait::(IMPLEMENTED_TRAITS_ATTRIBUTE, Trait)
 
# The default name to use for objects that don't have an explicit name.
let DEFAULT_OBJECT_NAME = 'Object'
Loading
Loading
# Modules of Inko source code.
# A collection of types and methods.
#
# A `Module` is an object created for every module of Inko source code, and
# contains data such as the methods defined in the module.
#
# Modules are permanent objects, and are never garbage collected.
let Module = Inko::Module
# Methods for `Trait` that should be available before defining other types.
 
# The object traits are instances of.
let Trait = Inko::Trait
# The name of the attribute that stores all the implemented traits.
let IMPLEMENTED_TRAITS_ATTRIBUTE = '@_implemented_traits'
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment