=..

BAP Online Manuals : Library Reference : Library by Name : =..
Previous: =
Next: \=

6.2.3. =..

converts a list into a struct and vice versa

SYNOPSIS

OPERATOR op(700,xfx,=..).
hello(Arg1,Args) =.. Funct|Arglist

SYNTAX

=..(Struct, List) (x,x)
Struct =.. List  (x,x)

ARGUMENTS

void(Struct) (x) Struct that is described by List
void(Struct) (X) List that is related to the struct

DESCRIPTION

This is a standard prolog built-in. '=..' succeeds, if the List contains the functor of Struct followed by its arguments. It can be used in two basic ways, transforming a List into a Struct or the other way round. Note that if provide the List, its first element must match an atom, since it becomes the functor of the Struct.

EXAMPLE

write("Functor: "),read(F),
write("Arg1: "),read(A1),
write("Arg2: "),read(A2),
Struct =.. [F,A1,A2],
write("Struct = ",Struct).

ERRORS

No runtime errors. Fails if transformation can't be conducted.

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

(none)


BAP Online Manuals : Library Reference : Library by Name : =..
Previous: =
Next: \=