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

class chain {#class-chain}

A chain is a linear single-linked list of objects. Chains form the common way to represent collections of objects in PCE. Chains are also used to represent multiple-valued slots. Examples are device <-graphicals',class <-sub_classes`, etc.

PCE chains form the natural counterpart of Prolog lists. For this reason the PCE/Prolog interface defines predicates to transform Prolog lists to PCE chains and visa-versa. Note however that in many cases it is not necessary to convert a PCE chain to a Prolog list; PCE defines many operations on chains. Before you consider converting a PCE chain to a Prolog list, first check whether it is not easier to do the job inside PCE. Notably look at ->member, ->empty,. ->for_all, ->for_some, <-find, <-find_all and <-map.

@see class vector @see class table @see class hash_table

Instance variables {#class-chain-instvars}

Send methods {#class-chain-send}

Get methods {#class-chain-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.