diff --git a/README.rst b/README.rst index 734ace6..970ff17 100644 --- a/README.rst +++ b/README.rst @@ -15,18 +15,18 @@ In general, we want each example to be one file (if possible). TODO ---- -* ``fasta``, ``pidigits``, ``spellcheck``, ``takfp``, ``wc`` and ``wordfreq`` +* ``fasta``, ``pidigits``, ``spellcheck``, ``wc`` and ``wordfreq`` have to be converted from GD supported single-file format to a dual-file format compilable under OpenDylan. * ``binary-trees``, ``fannkuch``, ``fasta``, ``fibonacci``, ``harmonic``, - ``mandelbrot``, ``nestedloop`` and ``strcat`` should provide a default - command line argument value. + ``mandelbrot``, ``nestedloop``, ``strcat`` and ``takfp`` should provide a + default command line argument value. * ``nsieve`` provides an invalid default and should check for valid argument. * ``nsieve`` and ``sieve`` benchmarks don't seem to work properly. * ``fasta`` benchmark generates invalid output. -* ``k-nucleotide``, ``n-body`` and ``spectralnorm`` benchmarks don't provide exactly - expected output, due to lack of precision configuration support in the - control-string of ``format-out``. +* ``k-nucleotide``, ``n-body``, ``spectralnorm`` and ``takfp`` benchmarks + don't provide exactly expected output, due to lack of precision + configuration support in the control-string of ``format-out``. * ``moments`` benchmark doesn't work due to lack of support for ``string-to-float``. * ``pidigits`` benchmark doesn't work due to lack of extended integer support. * Many benchmarks can still be optimized. diff --git a/takfp.dylan b/takfp.dylan index 0e7c815..6d43b63 100644 --- a/takfp.dylan +++ b/takfp.dylan @@ -1,5 +1,15 @@ module: takfp +define library takfp + use common-dylan; + use io; +end library; + +define module takfp + use common-dylan, exclude: { format-to-string }; + use format-out; +end module; + define constant = ; begin @@ -13,6 +23,9 @@ begin end method; let n = application-arguments()[0].string-to-integer; - format-out("%.1f\n", tak(3.0s0 * n, 2.0s0 * n, 1.0s0 * n)); + // FIXME: "%.1f" is not supported as control-string, as a result 7 decimal + // digits are printed instead of 1. + //format-out("%.1f\n", tak(3.0s0 * n, 2.0s0 * n, 1.0s0 * n)); + format-out("%=\n", tak(3.0s0 * n, 2.0s0 * n, 1.0s0 * n)); end; diff --git a/takfp.lid b/takfp.lid new file mode 100644 index 0000000..e0dac38 --- /dev/null +++ b/takfp.lid @@ -0,0 +1,3 @@ +library: takfp +executable: takfp +files: takfp