NAME

Math::Farnsworth - A Turing Complete Language for Mathematics

SYNOPSIS

  use Math::Farnsworth;
  
  my $hubert = Math::Farnsworth->new();

  my $result = $hubert->runString("10 km -> miles");

  my $result = $hubert->runFile("file.frns");

  print $result;

DESCRIPTION

THIS IS A BETA RELEASE! There are typos in the error messages and in the POD. There are also probably plenty of bugs. It is being released early because there have been a number of people who have shown interest in having it released. Not every feature is documented yet and a future release will have that cleaned up along with some of the hairier parts of the internal API. Math::Farnsworth is a programming language originally inspired by Frink (see http://futureboy.homeip.net/frinkdocs/ ). However due to certain difficulties during the creation of it, the syntax has changed slightly and the capabilities are also different. Some things Math::Farnsworth can do a little better than Frink, other areas Math::Farnsworth lacks.

PREREQUISITS

Modules and Libraries you need before this will work

METHODS

ALL of the methods here call die whenever something doesn't go right. This means that unless you want bad input to them to cause your program to fail you should wrap any calls to them with eval {}. When they call die they will give you back a message explaining what went wrong, this is useful for telling a user what they have done.

runString

This method takes a string (or multiple strings) and executes them as Math::Farnsworth expressions. For more information on making Math::Farnsworth expressions, see Math::Farnsworth::Docs::Syntax.

runFile

This takes a file name and executes the entire file as a single Math::Farnsworth expression.

prettyOut

This takes a Math::Farnsworth::Value and turns it into a string for perl to be able to display. This method WILL disappear in a future version.

EXPORT

None by default.

KNOWN BUGS

At the moment all known bugs are related to badly formatted output, this will be rectified in a future release.

MISSING FEATURES

The following features are currently missing and WILL be implemented in a future version of Math::Farnsworth

  • Better control over the output

    • Adjustable precision of numbers

    • Better defaults for certain types of output

  • Passing arguments by reference

  • Syntax tree introspection inside the language itself

  • Better Documentation

SEE ALSO

Math::Farnsworth::Docs::Syntax Math::Farnsworth::Docs::Functions

There is also an RT tracker for the module (this may change) setup at http://farnsworth.sexypenguins.com/, you can also reach the tracker by sending an email to <farnsworth.rt@gmail.com>

AUTHOR

Ryan Voots <simcop@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 by Ryan Voots

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.