mixin

Spec

@Js
const mixin Spec : Dict

Xeto data specification.

Spec dict representation:

  • id: Ref "lib:{qname}"
  • spec: Ref "sys::Spec"
  • base: Ref to base type (types only)
  • type: Ref to slot type (slots only)
  • effective meta

methods parent

Parent spec which contains this spec definition and scopes name

lib

Parent library for spec

globals

Get all the effective globals including inherited

isMaybe

Does meta have maybe tag

isMember

Is this a slot or global under a parent

slot

Convenience for slots.get

type

Type of this spec

members

Get a map with all the inherited slots and globals

qname

Return fully qualified name of this spec

member

Convenience for members.get

id

Identifier for a spec is always its qualified name

slotsOwn

Get the declared children slots

isSlot

Is this a slot under a parent

isChoice

Return if this is a spec that inherits from sys::Choice

slotOwn

Convenience for slotsOwn.get

isEnum

Is the base sys::Enum

globalsOwn

Globals declared by this spec

isFunc

Return if this a function spec

isMixin

Is this a top level mixin spec

isType

Is this a top level type spec

enum

Return enum item meta

membersOwn

Get a map with all the declared slots and globals

metaOwn

Get my own declared meta-data

slots

Get the effective inherited children slots

func

Return function specific APIs

isa

Return if this spec inherits from that from a nominal type perspective

meta

Get my effective meta

isGlobal

Is this a global slot under a parent

name

Return simple name scoped by lib or parent

base

Base spec from which this spec directly inherits its meta and slots

eachInherited

Call the given function on this spec and every spec that it inherits from up to sys::Obj

base abstract Spec? base()

Base spec from which this spec directly inherits its meta and slots. Returns null if this is sys::Obj itself.

eachInherited abstract Void eachInherited(|Spec| f)

Call the given function on this spec and every spec that it inherits from up to sys::Obj. Any sys::And compound types are iterated, but not sys::Or types. Note it is possible that the given function may be called on the same spec twice.

enum abstract SpecEnum enum()

Return enum item meta. Raise exception if isEnum is false.

func abstract SpecFunc func()

Return function specific APIs. Raise exception if isFunc is false.

globals abstract SpecMap globals()

Get all the effective globals including inherited. Note that some of the globals may be hidden by slots.

globalsOwn abstract SpecMap globalsOwn()

Globals declared by this spec.

id abstract Ref id()

Identifier for a spec is always its qualified name

isChoice abstract Bool isChoice()

Return if this is a spec that inherits from sys::Choice. If this spec inherits from a choice via a And/Or type then return false. See Namespace.choice to access SpecChoice API.

isEnum abstract Bool isEnum()

Is the base sys::Enum

isFunc abstract Bool isFunc()

Return if this a function spec

isGlobal abstract Bool isGlobal()

Is this a global slot under a parent

isMaybe abstract Bool isMaybe()

Does meta have maybe tag. Maybe slots are optional

isMember abstract Bool isMember()

Is this a slot or global under a parent

isMixin abstract Bool isMixin()

Is this a top level mixin spec

isSlot abstract Bool isSlot()

Is this a slot under a parent

isType abstract Bool isType()

Is this a top level type spec

isa abstract Bool isa(Spec that)

Return if this spec inherits from that from a nominal type perspective. Nonimal typing matches any of the following conditions:

  • if that matches one of this inherited specs via base
  • if this is maybe and that is None
  • if this is And and that matches any this.ofs
  • if this is Or and that matches all this.ofs (common base)
  • if that is Or and this matches any of that.ofs

lib abstract Lib lib()

Parent library for spec

member abstract Spec? member(Str name, Bool checked)

Convenience for members.get.

members abstract SpecMap members()

Get a map with all the inherited slots and globals.

membersOwn abstract SpecMap membersOwn()

Get a map with all the declared slots and globals.

meta abstract Dict meta()

Get my effective meta; this does not include synthesized tags like spec

metaOwn abstract Dict metaOwn()

Get my own declared meta-data

name abstract Str name()

Return simple name scoped by lib or parent.

parent abstract Spec? parent()

Parent spec which contains this spec definition and scopes name. Returns null for top level specs in the library.

qname abstract Str qname()

Return fully qualified name of this spec:

  • Type specs will return "foo.bar::Baz"
  • Global slots will return "foo.bar::baz"
  • Type slots will return "foo.bar::Baz.qux"
  • Derived specs will return "derived123::{name}"

slot abstract Spec? slot(Str name, Bool checked)

Convenience for slots.get.

slotOwn abstract Spec? slotOwn(Str name, Bool checked)

Convenience for slotsOwn.get.

slots abstract SpecMap slots()

Get the effective inherited children slots.

slotsOwn abstract SpecMap slotsOwn()

Get the declared children slots.

type abstract Spec type()

Type of this spec. If this spec is a top level type then return self.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST