Mail Archives: djgpp/1994/09/16/03:51:54
>1) use an existing language. Thanks to DJ, John Davis and Guarionex Morales
> for suggesting bc, slang and tcl respectively. At first glance slang seems
> to me to offer more: it resembles bc but has many more features; it can be
> embedded easily into a program; like bc what you type is byte compiled, so
> fairly fast. Unlike bc it only has finite precision arithmetic, but for
> me that's an advantage: it's all I want and is faster than infinite
> precision arithmetic. Recursive function definitions aren't allowed,
> unlike bc ( am I right John? ). I haven't looked closely at tcl but John
No. They are allowed. Simply declare the function first:
define factorial ();
define factorial (n)
{
if (n <= 1) return 1;
return n * factorial (n - 1);
}
--John
- Raw text -