☰

clojerl

0.7.0+build.2033.refc431a40

  • Home
  • API Reference

Modules

  • clj_analyzer
  • clj_behaviour
  • clj_cache
  • clj_compiler
  • clj_edn
  • clj_emitter
  • clj_emitter_pattern
  • clj_env
  • clj_hash_collision
  • clj_module
  • clj_multimethod
  • clj_murmur3
  • clj_protocol
  • clj_reader
  • clj_rt
  • clj_scope
  • clj_utils
  • clj_vector
  • clojerl
  • core_eval
  • Basic Types

  • clojerl.BitString
  • clojerl.Boolean
  • clojerl.Float
  • clojerl.Fn
  • clojerl.Integer
  • clojerl.Keyword
  • clojerl.Nil
  • clojerl.String
  • clojerl.Symbol
  • erlang.Fn
  • erlang.Port
  • erlang.Process
  • erlang.Reference
  • erlang.Type
  • erlang.util.Date
  • erlang.util.Regex
  • erlang.util.UUID
  • Namespaces & Vars

  • clojerl.Namespace
  • clojerl.Var
  • Collections & Data Structures

  • clojerl.Cons
  • clojerl.Cycle
  • clojerl.Iterate
  • clojerl.LazySeq
  • clojerl.List
  • clojerl.Map
  • clojerl.Range
  • clojerl.Repeat
  • clojerl.Set
  • clojerl.SortedMap
  • clojerl.SortedSet
  • clojerl.TupleMap
  • clojerl.Vector
  • erlang.List
  • erlang.Map
  • erlang.Tuple
  • Concurrency

  • clojerl.Agent
  • clojerl.Atom
  • clojerl.Delay
  • clojerl.Future
  • clojerl.ProcessVal
  • clojerl.Promise
  • I/O

  • erlang.io.File
  • erlang.io.PushbackReader
  • erlang.io.StringReader
  • erlang.io.StringWriter
  • Errors

  • clojerl.ArityError
  • clojerl.AssertionError
  • clojerl.BadArgumentError
  • clojerl.Error
  • clojerl.ExceptionInfo
  • clojerl.IllegalAccessError
  • Protocols

  • clojerl.IAssociative
  • clojerl.IBlockingDeref
  • clojerl.IChunk
  • clojerl.IChunkedSeq
  • clojerl.IColl
  • clojerl.ICounted
  • clojerl.IDeref
  • clojerl.IEncodeClojure
  • clojerl.IEncodeErlang
  • clojerl.IEquiv
  • clojerl.IError
  • clojerl.IExceptionInfo
  • clojerl.IFn
  • clojerl.IHash
  • clojerl.IIndexed
  • clojerl.IKVReduce
  • clojerl.ILookup
  • clojerl.IMap
  • clojerl.IMeta
  • clojerl.INamed
  • clojerl.IOError
  • clojerl.IPending
  • clojerl.IRecord
  • clojerl.IReduce
  • clojerl.IReference
  • clojerl.IReversible
  • clojerl.ISeq
  • clojerl.ISeqable
  • clojerl.ISequential
  • clojerl.ISet
  • clojerl.ISorted
  • clojerl.IStack
  • clojerl.IStringable
  • clojerl.IType
  • clojerl.IVector
  • erlang.io.ICloseable
  • erlang.io.IPushbackReader
  • erlang.io.IReader
  • erlang.io.IWriter

clj_scope

Nested scopes.

Implements nested scopes through nested maps. This is heavily used in all throughout the compilation process, from the reader to the emitter.

Summary

Types

  • scope()

Functions

  • contains(Key, Scope)
    Checks whether Key is in the current scope.
  • get(Key, Scope)
    Equivalent to get(Key, undefined, Scope).
  • get(Key, Default, Scope)
    Gets a value from the current scope or Default if not found.
  • new()
    Creates a new empty scope.
  • new(Parent)
    Creates a scope with an assigned parent.
  • parent(Scope)
    Returns the parent of the current scope.
  • put(Map, Scope)
    Adds all values in Map to the current scope.
  • put(Key, Value, Scope)
    Adds a value to the current scope.
  • to_map(Fun, Scope)
    Merges all mappings and returns them in a single map.
  • update(Key, Value, Scope)
    Updates the value for Key if it is in the current scope or any of its parent scopes.
  • values(Scope)
    Returns all values in the current scope and all its parent scopes.

Types

scope()
-type scope() :: #{parent => scope() | undefined, mappings => map()}.

Functions

contains(Key, Scope)
-spec contains(any(), scope()) -> boolean().

Checks whether Key is in the current scope.

get(Key, Scope)
-spec get(any(), scope()) -> any().

Equivalent to get(Key, undefined, Scope).

get(Key, Default, Scope)
-spec get(any(), any(), scope()) -> any().

Gets a value from the current scope or Default if not found.

new()
-spec new() -> scope().

Creates a new empty scope.

new(Parent)
-spec new(scope() | undefined) -> scope().

Creates a scope with an assigned parent.

parent(Scope)
-spec parent(scope()) -> scope() | undefined.

Returns the parent of the current scope.

put(Map, Scope)
-spec put(map(), scope()) -> scope().

Adds all values in Map to the current scope.

put(Key, Value, Scope)
-spec put(any(), any(), scope()) -> scope().

Adds a value to the current scope.

to_map(Fun, Scope)
-spec to_map(function(), scope()) -> any().

Merges all mappings and returns them in a single map.

update(Key, Value, Scope)
-spec update(any(), any(), scope()) -> scope() | not_found.

Updates the value for Key if it is in the current scope or any of its parent scopes.

values(Scope)
-spec values(scope()) -> [any()].

Returns all values in the current scope and all its parent scopes.