aboutsummaryrefslogtreecommitdiff
path: root/elymas/lib/txt.ey
blob: 847b04598ef1f634da6f0a6b05b2d8726b102df6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<
  <
    # 0 -> string
    # 0 <- leading digits converted to int (0, if none)
    { "^(\\d*)" regex -- ==n
      [ n { 48 sub } each ] reverse 10 math .unbase
    } /u deffd
  > /consume defvd

  <
    # 0 -> positive integer
    # 0 <- decimal representation as string
    {
      [ -01 10 math .base reverse "0123456789" each ] str .fromArray
    } /u deffd
  > /produce defvd
> /txt defvd

# vim: syn=elymas