Author image Salvador Fandiño García

NAME

Language::Prolog::Types::Factory - Perl extension to construct Prolog types

SYNOPSIS

  use Language::Prolog::Types::Factory;
  print prolog_functor("hello",2,3,4);
  print prolog_list(3,4,5);

  etc.

ABSTRACT

Factory module for Prolog terms.

Implements a pluggable interface that lets the constructor functions be changed to use different implementations for the actual prolog terms.

This module should be rarely used, only when interfacing Perl with a different Prolog system if the default representations for Prolog terms are not adecuate.

DESCRIPTION

This module implements a set of constructor functions for Prolog terms.

Internally the module use a factory object implementing new_nil, new_list, new_ulist, new_functor and new_variable. Look at Language::Prolog::Types::Internal for a real implementation of the factory interface.

There is also some intelligency added to the consructors to automatically promote types to others more adecuate. i.e. a '.'/2 functor to a list or [] to nil.

Constructor functions are reexported from Language::Prolog::Types and you should use that module instead of this one.

EXPORT

prolog_nil()

returns nil term.

prolog_list(@terms)

returns a prolog list containing terms <@terms>.

prolog_ulist(@terms, $tail)

returns an unfinished list with terms @terms and tail $tail.

prolog_functor($name, @terms)

returns a functor with name $name and arguments @terms.

prolog_variable($name) =item prolog_var($name)

return a new varaible with name $name

prolog_atom($atom)

Is not a contructor but converts any perl construct $atom to an atom.

prolog_string($string)

returns a prolog list formed by the ASCII values of $string.

SEE ALSO

Language::Prolog::Types, Language::Prolog::Types::Internal and Language::Prolog::Types::Abstract.

AUTHOR

Salvador Fandiño, <sfandino@yahoo.com>

COPYRIGHT AND LICENSE

Copyright 2002 by Salvador Fandiño

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 183:

Non-ASCII character seen before =encoding in 'Fandiño,'. Assuming ISO8859-1