From 60c413cfa926bffc79ff298354d42ea1910f36ad Mon Sep 17 00:00:00 2001 From: Roman Bataev Date: Sat, 6 Apr 2019 15:40:01 -0700 Subject: [PATCH] Add joker.strconv. --- core/data/core.joke | 2 +- core/procs.go | 8 + docs/index.html | 9 + docs/joker.repl.html | 39 ++++ docs/joker.strconv.html | 246 +++++++++++++++++++++++++ main.go | 1 + std/generate-std.joke | 2 +- std/strconv.joke | 123 +++++++++++++ std/strconv/a_strconv.go | 381 +++++++++++++++++++++++++++++++++++++++ 9 files changed, 809 insertions(+), 2 deletions(-) create mode 100644 docs/joker.strconv.html create mode 100644 std/strconv.joke create mode 100644 std/strconv/a_strconv.go diff --git a/core/data/core.joke b/core/data/core.joke index 8c11f2f61..af262c1d3 100644 --- a/core/data/core.joke +++ b/core/data/core.joke @@ -3190,7 +3190,7 @@ :doc "A set of symbols representing loaded libs"} *loaded-libs* #{'joker.base64 'joker.core 'joker.html 'joker.http 'joker.json 'joker.math 'joker.os 'joker.string 'joker.time 'joker.url - 'joker.yaml}) + 'joker.yaml 'joker.strconv}) (defonce ^:dynamic ^{:private true diff --git a/core/procs.go b/core/procs.go index f49b6f80f..d82eea585 100644 --- a/core/procs.go +++ b/core/procs.go @@ -112,6 +112,14 @@ func ExtractInt(args []Object, index int) int { return EnsureInt(args, index).I } +func ExtractBoolean(args []Object, index int) bool { + return EnsureBoolean(args, index).B +} + +func ExtractChar(args []Object, index int) rune { + return EnsureChar(args, index).Ch +} + func ExtractTime(args []Object, index int) time.Time { return EnsureTime(args, index).T } diff --git a/docs/index.html b/docs/index.html index feabbdedc..2d510a324 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,6 +34,9 @@

Index

  • joker.set
  • +
  • + joker.strconv +
  • joker.string
  • @@ -115,6 +118,12 @@

    joker.set

    Set operations such as union/intersection.

    details +
  • +

    joker.strconv

    + v1.0 +

    Implements conversions to and from string representations of basic data types.

    + details +
  • joker.string

    v1.0 diff --git a/docs/joker.repl.html b/docs/joker.repl.html index 243614787..0780bef84 100644 --- a/docs/joker.repl.html +++ b/docs/joker.repl.html @@ -10,12 +10,51 @@

    Namespace: joker.repl

    Index