Is it possible to bind new top level functions in GDScript?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By chanon

The documentation here:

shows how to bind methods on a new Object class.

I’m wondering if it is possible to bind new top level functions. For example, if I wanted a new custom print function called myprint that I could use in GDScript like

myprint("some text")
:bust_in_silhouette: Reply From: Calinou

GDScript does not support global variables or functions, but you can create singletons which let you define variables and functions that can be used anywhere. See Singletons (AutoLoad) in the documentation.

It is also possible to load entire scenes (and not just scripts) this way.