src/swipl-devel/packages/xpce/man/refmanual/md/create.md

class create {#class-create}

Class create defines a function that creates new instances like the interface predicate new/2. The first argument is either the name of the class to create instances from or a class object. The remaining arguments are packed into the code_vector object <-arguments.

Instances may also be created using class ?:

?- new(CreatePoint, ?(@pce, instance, point)).
?- new(CreatePoint, class(point)? instance).

Class create is more comfortable to write, is faster and does not require the class to exist when the create instance is created.

See <-_execute for a description of the creation process. See also @pce <-instance, class <-instance, @vmi_new and new/2.

Instance variables {#class-create-instvars}

Send methods {#class-create-send}

Get methods {#class-create-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.