#!/usr/bin/perl

	$# = "%.6g";   # Set default printing format

	$_definitions = "";

	while(<>)
	{
		if(m/^#/)       # look for declaration lines that start with #
		{
			s/^#\s*//;    # remove leading whitespace
			s/\s*$//;    # remove trailing whitespace
			eval($_);
			#$_definitions = $_definitions . $_ . ";";   # append to master list
		}
		else
		{
			# Look for {} expressions

			while (m/{/)
			{
				# Remove and print the portion of the line before the {
				s/^[^{]*{//;   # Remove upto and including the bracket
				$_s = $&;
				chop $_s;
				print $_s;   # Print everything except the bracket

				if(m/}/)
				{
					s/^[^}]*}//;     # Chop off everything until the }
					$_expression = $&;
					chop $_expression;
				}
				else
				{
					$_expression = $_;
					chop $_expression;
					$_ = "\n";
				}

				# Process the expression
				#print eval($_definitions . $_expression);
				print eval($_expression);


			}
			print;   # Print the rest of the line
		}

	}



