| AI-Prolog documentation | Contained in the AI-Prolog distribution. |
AI::Prolog::TermList::Primitive - Perl implementation of Prolog primitives.
No user serviceable parts inside. You should never be seeing this.
See AI::Prolog for more information. If you must know more, there are plenty of comments sprinkled through the code.
Note that primitives are generally not implemented in terms of Prolog
predicates, but in terms of internal features that Prolog cannot handle
efficiently (or cannot handle at all). Thus, every primitive has an ID
associated with it. This ID identifies the internal code that makes it
work.
AI::Prolog::Introduction
AI::Prolog::Builtins
W-Prolog: http://goanna.cs.rmit.edu.au/~winikoff/wp/
X-Prolog: http://www.iro.umontreal.ca/~vaucher/XProlog/
Roman Bart&225;k's online guide to programming Prolog: http://kti.ms.mff.cuni.cz/~bartak/prolog/index.html
Curtis "Ovid" Poe, <moc tod oohay ta eop_divo_sitruc>
Reverse the name to email me.
Copyright 2005 by Curtis "Ovid" Poe
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
| AI-Prolog documentation | Contained in the AI-Prolog distribution. |
package AI::Prolog::TermList::Primitive; $REVISION = '$Id: Primitive.pm,v 1.2 2005/02/20 18:27:55 ovid Exp $'; $VERSION = '0.1'; @ISA = 'AI::Prolog::TermList'; use strict; use warnings; use Scalar::Util qw/looks_like_number/; sub new { my ($class, $number) = @_; my $self = $class->SUPER::new; # correct? $self->{ID} = looks_like_number($number) ? $number : 0; return $self; } sub ID { shift->{ID} } sub to_string { " <".shift->{ID}."> " } 1; __END__