Skip to content

Typedefs

A type definition is a .d.lis file that describes a Go package in Lisette syntax.

func Atoi(s string) (int, error)
Go function signature
strconv.go
pub fn Atoi(s: string) -> Result<int, error>
Lisette equivalent
strconv.d.lis

Typedefs are written by the compiler, never by hand.

  • Go stdlib typedefs are built into the compiler.
  • For third-party dependencies, lis add writes typedefs to target/.lisette/typedefs in your project.

To inspect a typedef in your IDE, use Go to Definition on any imported Go symbol.

Typedefs describe many Go types identically in Lisette:

GoLisette
stringstring
boolbool
error interfaceerror interface
int, int8, int16, etc.int, int8, int16, etc.
uint, uint8, uint16, etc.uint, uint8, uint16, etc.
float32, float64float32, float64
complex64, complex128complex64, complex128

Other Go types are described differently:

GoLisette
(T, error)Result<T, error>
error as the only returnResult<(), error>
(T, bool)Option<T> or (T, bool)
*TRef<T> or Option<Ref<T>>
any, interface{}Unknown
[]TSlice<T>
[N]TArray<T, N>
map[K]VMap<K, V>
...TVarArgs<T>
chan TChannel<T>
type X int64pub struct X(int64)

See the bindings generator for the complete list.