diff options
-rw-r--r-- | share/txr/stdlib/conv.tl | 12 | ||||
-rw-r--r-- | txr.1 | 16 |
2 files changed, 27 insertions, 1 deletions
diff --git a/share/txr/stdlib/conv.tl b/share/txr/stdlib/conv.tl index 546b8759..9a25f8c5 100644 --- a/share/txr/stdlib/conv.tl +++ b/share/txr/stdlib/conv.tl @@ -33,7 +33,17 @@ (b (arg) (toint arg 2)) (r (arg) - (tofloat arg))) + (tofloat arg)) + (iz (arg : radix) + (tointz arg radix)) + (oz (arg) + (tointz arg 8)) + (xz (arg) + (tointz arg 16)) + (bz (arg) + (tointz arg 2)) + (rz (arg) + (tofloatz arg))) ,*body)) (defun sys:do-conv (lfl mfl tfl nm list) @@ -39104,6 +39104,22 @@ the floating-point value which it denotes. The expression .code "(r str)" is equivalent to .codn "(tofloat str)" . +.ccIP @, iz @, oz @, xz @ bz and @ rz +Conversion similar to +.codn i , +.codn o , +.codn x , +.code b +and +.codn r , +but using +.code tointz +and +.codn tofloatz . +Thus fields which are non-numeric strings or the object +.code nil +get converted to 0, or 0.0 in the case of +.codn rz . .RE .SS* Environment Variables and Command Line |