aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elymas/lib/txt.ey6
1 files changed, 6 insertions, 0 deletions
diff --git a/elymas/lib/txt.ey b/elymas/lib/txt.ey
index 2a51f28..9366112 100644
--- a/elymas/lib/txt.ey
+++ b/elymas/lib/txt.ey
@@ -33,6 +33,12 @@
{
_ { [ -01 16 math .base reverse "0123456789ABCDEF" each ] str .fromArray } { -- "0" } ? *
} [ 0 ] [ 0 ] '' /hu deffd
+
+ # 0 -> integer
+ # 0 <- decimal representation as string
+ {
+ _ 0 lt { neg u "-" -01 cat } |u ? *
+ } [ 0 ] [ 0 ] '' /i deffd
> /produce defvd
> /txt defvd