MCPcopy Index your code
hub / github.com/endbasic/endbasic / put_global

Method put_global

core/src/compiler/syms.rs:179–185  ·  view source on GitHub ↗

Creates a new global symbol `key` with `proto`.

(
        &mut self,
        key: SymbolKey,
        proto: SymbolPrototype,
    )

Source from the content-addressed store, hash-verified

177
178 /// Creates a new global symbol `key` with `proto`.
179 pub(crate) fn put_global(
180 &mut self,
181 key: SymbolKey,
182 proto: SymbolPrototype,
183 ) -> Result<Register> {
184 put_var(key, proto, &mut self.globals, Register::global, RegisterScope::Global)
185 }
186
187 /// Returns true if a global variable `key` is already defined.
188 pub(crate) fn contains_global(&self, key: &SymbolKey) -> bool {

Calls 1

put_varFunction · 0.85