Types and Classes
These are all of the class and enumeration constants defined at the top-level in GDLisp.
All of the classes defined by Godot are available in GDLisp. Any such classes not listed below are available without modification.
Godot classes that are singletons use the following convention: The
singleton object is available in GDLisp as-is, and the type that
represents it is available preceded with an underscore. So, for
example, Engine is a global constant in GDLisp that refers to the
singleton object whose type is _Engine.
Godot Enumerations
The global enumerations defined in Enumerations
have been included with modifications. The common prefix for each
enumeration type has been removed from the name of the constant and
replaced with an appropriate typename. So, for example, the name
KEY_SHIFT, which refers to the shift key, is referred to in GDLisp
as Key:SHIFT. The following name translations take place
BUTTON_constants belong in theMouseenum.CORNER_constants belong in theCornerenum.ERR_constants (and theOKandFAILEDconstants) belong in theErrenum.HALIGN_constants belong in theHAlignenum.JOY_constants belong in theJoyenum.KEY_constants belong in theKeyenum.KEY_MASK_constants belong in theKeyMaskenum.MARGIN_constants belong in theMarginenum.METHOD_FLAG_constants (and theMETHOD_FLAGS_DEFAULTconstant) belong in theMethodFlagenum.MIDI_MESSAGE_constants belong in theMidiMessageenum.OP_constants belong in theOpenum.PROPERTY_HINT_constants belong in thePropertyHintenum.PROPERTY_USAGE_constants belong in thePropertyUsageenum.TYPE_constants belong in theTypeenum.VALIGN_constants belong in theVAlignenum.HORIZONTALandVERTICALgo in their own enum calledOrientation.
Godot Primitive Types
The 27 Godot primitive types are also available in GDLisp. In GDLisp,
these types are real type objects and can be used as the right-hand
side of an instance? call. Since they are real objects in the
GDLisp ecosystem, they can also be assigned to variables and passed as
function arguments. Additionally, the names of the GDLisp primitive
types are normalized to be consistent with other class names.
Specifically,
Nullrefers to the Godot type whose constant isTYPE_NILand whose only value is the null object().Boolrefers to the Godot typeboolwhose constant isTYPE_BOOL.Intrefers to the Godot typeintwhose constant isTYPE_INT.Floatrefers to the Godot typefloatwhose constant isTYPE_REAL.String,Vector2,Rect2,Vector3,Transform2D,Plane,Quat,AABB,Basis,Transform,Color,NodePath,RID,Object,Dictionary,Array,PoolByteArray,PoolIntArray,PoolStringArray,PoolVector2Array,PoolVector3Array, andPoolColorArrayare available in GDLisp and refer to the Godot primitive types of the same name.
_GDLisp
(defclass _GDLisp (Node)
...)
The class of the singleton GDLisp support object. The behavior of the program is undefined if an attempt is made to construct any additional instances of this type.
Any
(defclass Any (<no-parent>)
...)
The type of all values in GDLisp. Every single value is an value of this type.
AnyRef
(defclass AnyRef (Any)
...)
The type of all object values in GDLisp.
AnyVal
(defclass AnyVal (<no-parent>)
...)
The type of all primitive values in GDLisp. All values which are not
instances of AnyRef are instances of AnyVal.
BaseArray
(defclass BaseArray (AnyVal)
...)
The common supertype of all array types in GDLisp, including Array
itself and the seven strictly-typed pool array types.
Cell
(defclass Cell (Reference)
(defvar contents)
(defn _init (contents)
...))
The type of simple cells containing one single value. Cell has a
single public mutable field, contents, and a constructor of one
argument.
See also Cells.
ConnectFlags
(defenum ConnectFlags
(DEFERRED ...)
(PERSIST ...)
(ONESHOT ...)
(REFERENCE_COUNTED ...))
This enumeration makes global the ConnectFlags enumeration in Godot.
Cons
(defclass Cons (Reference)
(defvar car)
(defvar cdr)
(defn _init (car cdr)
...)
(defn (get caar) ()
...)
(defn (get cadr) ()
...)
(defn (get cdar) ()
...)
(defn (get cddr) ()
...)
(defn (get caaar) ()
...)
(defn (get caadr) ()
...)
(defn (get cadar) ()
...)
(defn (get caddr) ()
...)
(defn (get cdaar) ()
...)
(defn (get cdadr) ()
...)
(defn (get cddar) ()
...)
(defn (get cdddr) ()
...))
The type of pairs, or cons cells, in GDLisp. Cons cells have two
public mutable fields, called car and cdr. Additionally,
getters are defined for various nestings of car and cdr up to
three layers deep. For instance, cons-cell:caddr is equivalent to
cons-cell:car:cdr:cdr.
See also Cons Cells.
Function
(defclass Function (Reference)
...)
The type of GDLisp function objects which have been reified into the
value namespace. These are valid arguments to funcall and
apply.
Nothing
(defclass Nothing (<all-parents>)
...)
The bottom of the type hierarchy. There are not, and never will be, values of this type in GDLisp.
Notification
(defenum Notification
(POSTINITIALIZE ...)
(PREDELETE ...))
An enumeration representing the Godot notification constants defined on Object.
Number
(defclass Number (AnyVal)
...)
The type of numbers in GDLisp. Integers and floating-point numbers are both instances of this type.
Symbol
(defclass Symbol (Reference)
...)
The type of symbols at runtime in GDLisp.