diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | RELNOTES | 36 | ||||
-rw-r--r-- | txr.1 | 50 |
3 files changed, 90 insertions, 2 deletions
@@ -1,5 +1,11 @@ 2012-03-23 Kaz Kylheku <kaz@kylheku.com> + * RELNOTES: Updated. + + * txr.1: Describe floating-point constants. + +2012-03-23 Kaz Kylheku <kaz@kylheku.com> + * Makefile (TXR_ARGS): Pass new file to tests/009/json.txr test. * tests/009/json.expected: Updated. @@ -1,3 +1,39 @@ + TXR 62 + 2011-03-23 + + + Features + + - Floating-point support has been added. + - TXR programs can specify floating-point constants. + - Printing floting points is supported in the format function. + - New specifiers: ~f and ~e. + - Arithmetic on floating points, with implicit + conversion. + - New / function which produces a floating-point result. + - New functions like sin, cos, exp, and log. + - Functions for converting between floating and integer, + and parsing a float from a string. + + - New combinators for easier programming with higher order functions: chain, + andf, orf, iff. + + - url_decode and url_encode functions take an optional parameter which + determines whether + is used as the code for space, distinguishing + URL encoding from percent encoding. Separate named filters are + introduced: :frompercent, :topercent distinct from :fromurl and :tourl. + + Bugs + + - Buggy quicksort routine repaired. This is a recently + added feature which allows vectors and strings to be sorted. + List sorting, done by merge sort, is unaffected. + + - Breakpoints can now be set by line number and file name, allowing + breakpoints in loaded modules, not just the main module. + + + TXR 61 2011-03-15 @@ -1075,8 +1075,54 @@ the TXR pattern language when the quasiliteral occurs in the pattern language. .SS Numbers -A number is made up of digits 0 through 9, optionally preceded by a + or - -sign. +TXR supports integers and floating-point numbers. + +An integer constant is made up of digits 0 through 9, optionally preceded by a ++ or - sign. + +Examples: + + 123 + -34 + +0 + -0 + +234483527304983792384729384723234 + +A floating-point constant is marked by the inclusion of a decimal point, the +exponential "e notation", or both. It is an optional sign, followed +by a mantissa consisting of digits, a decimal point, more digits, and then an +optional exponential notation consisting of the letter "e" or "E", an optional +"+" or "-" sign, and then digits indicating the exponent value. +In the mantissa, the digits are not optional. At least one digit must either +precede the decimal point or follow. That is to say, a decimal point by itself +is not a floating-point constant. + +Examples: + + .123 + 123. + 1E-3 + 20E40 + .9E1 + 9.E19 + -.5 + +3E+3 + +Examples which are not floating-point constant tokens: + + . (consing dot) + 123E (the symbol 123E) + 1.0E- (floating point 1.0 followed by symbol E-) + .e (consing dot followed by symbol e) + +In TXR there is a special "dotdot" token consisting of two consecutive periods. +An integer constant followed immediately by dotdot is recognized as such; it is +not treated as a floating constant followed by a dot. That is to say, +123.. does not mean 123. . (floating point 123.0 value followed by dot token). +It means 123 .. (integer 123 followed by .. token). + +Dialect note: unlike in Common Lisp, 123. is not an integer, but the same as +123.0. .SS Comments |