Math::SymbolicX::Calculator::Interface::Shell - A Calculator Shell
# simplest form of usage: use Math::SymbolicX::Calculator::Interface::Shell; my $shell = Math::SymbolicX::Calculator::Interface::Shell->new(); $shell->run();
This module implements a shell interface to the Math::SymbolicX::Calculator.
Returns a new shell application object. Call the
run() method on it to run the application.
Optional parameters: (default in parenthesis)
calc => a Math::SymbolicX::Calculator object to use input_handle => a file handle to read from (\*STDIN) prompt => the prompt string to use ('~> ') continued_prompt => prompt string to use for continued lines ('>> ') app_name => the name of the application ('Symbolic Calculator Shell')
Runs the main loop of the shell.
Returns the Calculator object of this Shell.
Call this before stopping the shell. It runs all cleanup actions such as those needed for a possible persistance.
This method doesn't actually kill your script, but returns after doing the cleanup.
Used to issue a warning to the user. First argument must be an error message to display.
Reads a new expression from the input handle. An expression ends in a semicolon followed by a newline.
Used internally by the run loop. Probably not that useful outside of that.
Returns the expression or the empty list on error.
Parses generic commands such as exit and print.
This might change. (Name and implementation)
First argument: Expression to parse.
FIXME: Document what this does or refactor
Generic output routine: Print Formulas and messages alike
FIXME: Subject to change and refactoring.
Steffen Müller, <firstname.lastname@example.org>
Copyright (C) 2007 by Steffen Müller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.