Skip to content

Commit 48d8a92

Browse files
committed
v1.3.4
1 parent 53756ef commit 48d8a92

22 files changed

+368
-410
lines changed

core/procs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const (
3838
PRINT_IF_NOT_NIL
3939
)
4040

41-
const VERSION = "v1.3.3"
41+
const VERSION = "v1.3.4"
4242

4343
const (
4444
CLJ Dialect = iota

docs/joker.time.html

+13
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ <h2 id="_index">Index</h2>
3737
<li>
3838
<a href="#ansi-c">ansi-c</a>
3939
</li>
40+
<li>
41+
<a href="#day-of-year">day-of-year</a>
42+
</li>
4043
<li>
4144
<a href="#format">format</a>
4245
</li>
@@ -369,6 +372,16 @@ <h3 class="Function" id="add-date">add-date</h3>
369372
<p class="var-docstr">Returns the time t + (years, months, days).</p>
370373

371374

375+
</li>
376+
<li>
377+
<h3 class="Function" id="day-of-year">day-of-year</h3>
378+
<span class="var-kind Function">Function</span>
379+
<span class="var-added">v1.3.4</span>
380+
<pre class="var-usage"><div><code>(day-of-year t)</code></div>
381+
</pre>
382+
<p class="var-docstr">Returns the day of the year specified by t, in the range [1,365] for non-leap years, and [1,366] in leap years.</p>
383+
384+
372385
</li>
373386
<li>
374387
<h3 class="Function" id="format">format</h3>

docs/main.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

std/base64.joke

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
(ns
2-
^{:go-imports []
3-
:doc "Implements base64 encoding as specified by RFC 4648."}
1+
(ns ^{:go-imports []
2+
:doc "Implements base64 encoding as specified by RFC 4648."}
43
base64)
54

65
(defn ^String decode-string
76
"Returns the bytes represented by the base64 string s."
87
{:added "1.0"
9-
:go "decodeString(s)"}
8+
:go "decodeString(s)"}
109
[^String s])
1110

1211
(defn ^String encode-string
1312
"Returns the base64 encoding of s."
1413
{:added "1.0"
15-
:go "encodeString(s)"}
14+
:go "encodeString(s)"}
1615
[^String s])

std/bolt.joke

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
(ns
2-
^{:go-imports []
3-
:doc "Provide API for Bolt embedded database https://github.com/etcd-io/bbolt.
1+
(ns ^{:go-imports []
2+
:doc "Provide API for Bolt embedded database https://github.com/etcd-io/bbolt.
43

54
Example:
65

std/crypto.joke

+11-12
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
1-
(ns
2-
^{:go-imports ["crypto/sha256" "crypto/sha512" "crypto/md5" "crypto/sha1"]
3-
:doc "Implements common cryptographic and hash functions."}
1+
(ns ^{:go-imports ["crypto/sha256" "crypto/sha512" "crypto/md5" "crypto/sha1"]
2+
:doc "Implements common cryptographic and hash functions."}
43
crypto)
54

65
(defn ^String hmac
76
"Returns HMAC signature for message and key using specified algorithm.
87
Algorithm is one of the following: :sha1, :sha224, :sha256, :sha384, :sha512."
98
{:added "1.0"
10-
:go "hmacSum(algorithm, message, key)"}
9+
:go "hmacSum(algorithm, message, key)"}
1110
[^Keyword algorithm ^String message ^String key])
1211

1312
(defn ^String sha256
1413
"Returns the SHA256 checksum of the data."
1514
{:added "1.0"
16-
:go "! t := sha256.Sum256([]byte(data)); _res := string(t[:])"}
15+
:go "! t := sha256.Sum256([]byte(data)); _res := string(t[:])"}
1716
[^String data])
1817

1918
(defn ^String sha224
2019
"Returns the SHA224 checksum of the data."
2120
{:added "1.0"
22-
:go "! t := sha256.Sum224([]byte(data)); _res := string(t[:])"}
21+
:go "! t := sha256.Sum224([]byte(data)); _res := string(t[:])"}
2322
[^String data])
2423

2524
(defn ^String sha384
2625
"Returns the SHA384 checksum of the data."
2726
{:added "1.0"
28-
:go "! t := sha512.Sum384([]byte(data)); _res := string(t[:])"}
27+
:go "! t := sha512.Sum384([]byte(data)); _res := string(t[:])"}
2928
[^String data])
3029

3130
(defn ^String sha512
3231
"Returns the SHA512 checksum of the data."
3332
{:added "1.0"
34-
:go "! t := sha512.Sum512([]byte(data)); _res := string(t[:])"}
33+
:go "! t := sha512.Sum512([]byte(data)); _res := string(t[:])"}
3534
[^String data])
3635

3736
(defn ^String sha512-224
3837
"Returns the SHA512/224 checksum of the data."
3938
{:added "1.0"
40-
:go "! t := sha512.Sum512_224([]byte(data)); _res := string(t[:])"}
39+
:go "! t := sha512.Sum512_224([]byte(data)); _res := string(t[:])"}
4140
[^String data])
4241

4342
(defn ^String sha512-256
4443
"Returns the SHA512/256 checksum of the data."
4544
{:added "1.0"
46-
:go "! t := sha512.Sum512_256([]byte(data)); _res := string(t[:])"}
45+
:go "! t := sha512.Sum512_256([]byte(data)); _res := string(t[:])"}
4746
[^String data])
4847

4948
(defn ^String md5
5049
"Returns the MD5 checksum of the data."
5150
{:added "1.0"
52-
:go "! t := md5.Sum([]byte(data)); _res := string(t[:])"}
51+
:go "! t := md5.Sum([]byte(data)); _res := string(t[:])"}
5352
[^String data])
5453

5554
(defn ^String sha1
5655
"Returns the SHA1 checksum of the data."
5756
{:added "1.0"
58-
:go "! t := sha1.Sum([]byte(data)); _res := string(t[:])"}
57+
:go "! t := sha1.Sum([]byte(data)); _res := string(t[:])"}
5958
[^String data])

std/csv.joke

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
(ns
2-
^{:go-imports []
3-
:doc "Reads and writes comma-separated values (CSV) files as defined in RFC 4180."}
1+
(ns ^{:go-imports []
2+
:doc "Reads and writes comma-separated values (CSV) files as defined in RFC 4180."}
43
csv)
54

65
(defn csv-seq
@@ -34,8 +33,8 @@
3433
This is done even if the field delimiter, comma, is white space.
3534
Default value is false."
3635
{:added "1.0"
37-
:go {1 "csvSeqOpts(rdr, EmptyArrayMap())"
38-
2 "csvSeqOpts(rdr, opts)"}}
36+
:go {1 "csvSeqOpts(rdr, EmptyArrayMap())"
37+
2 "csvSeqOpts(rdr, opts)"}}
3938
([^Object rdr])
4039
([^Object rdr ^Map opts]))
4140

@@ -48,8 +47,8 @@
4847

4948
:use-crlf - if true, uses \\r\\n as the line terminator. Default value is false."
5049
{:added "1.0"
51-
:go {1 "writeString(data, EmptyArrayMap())"
52-
2 "writeString(data, opts)"}}
50+
:go {1 "writeString(data, EmptyArrayMap())"
51+
2 "writeString(data, opts)"}}
5352
([^Seqable data])
5453
([^Seqable data ^Map opts]))
5554

@@ -59,8 +58,8 @@
5958
data must be Seqable, each element of which must be Seqable as well.
6059
opts is as in joker.csv/write-string."
6160
{:added "1.0"
62-
:go {2 "write(f, data, EmptyArrayMap())"
63-
3 "write(f, data, opts)"}}
61+
:go {2 "write(f, data, EmptyArrayMap())"
62+
3 "write(f, data, opts)"}}
6463
([^IOWriter f ^Seqable data])
6564
([^IOWriter f ^Seqable data ^Map opts]))
6665

std/filepath.joke

+29-32
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
(ns
2-
^{:go-imports ["path/filepath"]
3-
:doc "Implements utility routines for manipulating filename paths."}
1+
(ns ^{:go-imports ["path/filepath"]
2+
:doc "Implements utility routines for manipulating filename paths."}
43
filepath)
54

65
(defn file-seq
76
"Returns a seq of maps with info about files or directories under root."
87
{:added "1.0"
9-
:go "fileSeq(root)"}
8+
:go "fileSeq(root)"}
109
[^String root])
1110

1211
(defn ^String abs
@@ -15,15 +14,15 @@
1514
The absolute path name for a given file is not guaranteed to be unique.
1615
Calls clean on the result."
1716
{:added "1.0"
18-
:go "! _res, err := filepath.Abs(path); PanicOnErr(err)"}
17+
:go "! _res, err := filepath.Abs(path); PanicOnErr(err)"}
1918
[^String path])
2019

2120
(defn ^String base
2221
"Returns the last element of path. Trailing path separators are removed before
2322
extracting the last element. If the path is empty, returns \".\". If the path consists
2423
entirely of separators, returns a single separator."
2524
{:added "1.0"
26-
:go "filepath.Base(path)"}
25+
:go "filepath.Base(path)"}
2726
[^String path])
2827

2928
(defn ^String clean
@@ -43,7 +42,7 @@ Finally, any occurrences of slash are replaced by separator.
4342

4443
If the result of this process is an empty string, returns the string \".\"."
4544
{:added "1.0"
46-
:go "filepath.Clean(path)"}
45+
:go "filepath.Clean(path)"}
4746
[^String path])
4847

4948
(defn ^String dir
@@ -52,29 +51,29 @@ If the result of this process is an empty string, returns the string \".\"."
5251
If the path is empty, returns \".\". If the path consists entirely of separators,
5352
returns a single separator. The returned path does not end in a separator unless it is the root directory."
5453
{:added "1.0"
55-
:go "filepath.Dir(path)"}
54+
:go "filepath.Dir(path)"}
5655
[^String path])
5756

5857
(defn ^String eval-symlinks
5958
"Returns the path name after the evaluation of any symbolic links. If path is relative the result will be
6059
relative to the current directory, unless one of the components is an absolute symbolic link.
6160
Calls clean on the result."
6261
{:added "1.0"
63-
:go "! _res, err := filepath.EvalSymlinks(path); PanicOnErr(err)"}
62+
:go "! _res, err := filepath.EvalSymlinks(path); PanicOnErr(err)"}
6463
[^String path])
6564

6665
(defn ^String ext
6766
"Returns the file name extension used by path. The extension is the suffix beginning at the final dot
6867
in the final element of path; it is empty if there is no dot."
6968
{:added "1.0"
70-
:go "filepath.Ext(path)"}
69+
:go "filepath.Ext(path)"}
7170
[^String path])
7271

7372
(defn ^String from-slash
7473
"Returns the result of replacing each slash ('/') character in path with a separator character.
7574
Multiple slashes are replaced by multiple separators."
7675
{:added "1.0"
77-
:go "filepath.FromSlash(path)"}
76+
:go "filepath.FromSlash(path)"}
7877
[^String path])
7978

8079
(defn ^{:tag [String]} glob
@@ -85,21 +84,21 @@ If the result of this process is an empty string, returns the string \".\"."
8584
Ignores file system errors such as I/O errors reading directories.
8685
Throws exception when pattern is malformed."
8786
{:added "1.0"
88-
:go "! _res, err := filepath.Glob(pattern); PanicOnErr(err)"}
87+
:go "! _res, err := filepath.Glob(pattern); PanicOnErr(err)"}
8988
[^String pattern])
9089

9190
(defn ^Boolean abs?
9291
"Reports whether the path is absolute."
9392
{:added "1.0"
94-
:go "filepath.IsAbs(path)"}
93+
:go "filepath.IsAbs(path)"}
9594
[^String path])
9695

9796
(defn ^String join
9897
"Joins any number of path elements into a single path, adding a separator if necessary.
9998
Calls clean on the result; in particular, all empty strings are ignored. On Windows,
10099
the result is a UNC path if and only if the first path element is a UNC path."
101100
{:added "1.0"
102-
:go "filepath.Join(elems...)"}
101+
:go "filepath.Join(elems...)"}
103102
[& ^String elems])
104103

105104
(defn ^Boolean matches?
@@ -108,7 +107,7 @@ If the result of this process is an empty string, returns the string \".\"."
108107
Throws exception if pattern is malformed.
109108
On Windows, escaping is disabled. Instead, '\\' is treated as path separator."
110109
{:added "1.0"
111-
:go "! _res, err := filepath.Match(pattern, name); PanicOnErr(err)"}
110+
:go "! _res, err := filepath.Match(pattern, name); PanicOnErr(err)"}
112111
[^String pattern ^String name])
113112

114113
(defn ^String rel
@@ -118,50 +117,48 @@ If the result of this process is an empty string, returns the string \".\"."
118117
relative to basepath or if knowing the current working directory would be necessary to compute it.
119118
Calls clean on the result."
120119
{:added "1.0"
121-
:go "! _res, err := filepath.Rel(basepath, targpath); PanicOnErr(err)"}
120+
:go "! _res, err := filepath.Rel(basepath, targpath); PanicOnErr(err)"}
122121
[^String basepath ^String targpath])
123122

124123
(defn split
125124
"Splits path immediately following the final separator, separating it into a directory and file name component.
126125
If there is no separator in path, returns an empty dir and file set to path. The returned values have
127126
the property that path = dir+file."
128127
{:added "1.0"
129-
:go "! _dir, _file := filepath.Split(path); _res := NewVectorFrom(MakeString(_dir), MakeString(_file))"}
128+
:go "! _dir, _file := filepath.Split(path); _res := NewVectorFrom(MakeString(_dir), MakeString(_file))"}
130129
[^String path])
131130

132131
(defn ^{:tag [String]} split-list
133132
"Splits a list of paths joined by the OS-specific list-separator, usually found in PATH or GOPATH environment variables.
134133
Returns an empty slice when passed an empty string."
135134
{:added "1.0"
136-
:go "filepath.SplitList(path)"}
135+
:go "filepath.SplitList(path)"}
137136
[^String path])
138137

139138
(defn ^String to-slash
140139
"Returns the result of replacing each separator character in path with a slash ('/') character.
141140
Multiple separators are replaced by multiple slashes."
142141
{:added "1.0"
143-
:go "filepath.ToSlash(path)"}
142+
:go "filepath.ToSlash(path)"}
144143
[^String path])
145144

146145
(defn ^String volume-name
147146
"Returns leading volume name. Given \"C:\\foo\\bar\" it returns \"C:\" on Windows. Given \"\\\\host\\share\\foo\"
148147
returns \"\\\\host\\share\". On other platforms it returns \"\"."
149148
{:added "1.0"
150-
:go "filepath.VolumeName(path)"}
149+
:go "filepath.VolumeName(path)"}
151150
[^String path])
152151

153-
(def
154-
^{:doc "OS-specific path separator."
155-
:added "1.0"
156-
:tag String
157-
:const true
158-
:go "string(filepath.Separator)"}
152+
(def ^{:doc "OS-specific path separator."
153+
:added "1.0"
154+
:tag String
155+
:const true
156+
:go "string(filepath.Separator)"}
159157
separator)
160158

161-
(def
162-
^{:doc "OS-specific path list separator."
163-
:added "1.0"
164-
:tag String
165-
:const true
166-
:go "string(filepath.ListSeparator)"}
159+
(def ^{:doc "OS-specific path list separator."
160+
:added "1.0"
161+
:tag String
162+
:const true
163+
:go "string(filepath.ListSeparator)"}
167164
list-separator)

std/hex.joke

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
(ns
2-
^{:go-imports ["encoding/hex"]
3-
:doc "Implements hexadecimal encoding and decoding."}
1+
(ns ^{:go-imports ["encoding/hex"]
2+
:doc "Implements hexadecimal encoding and decoding."}
43
hex)
54

65
(defn ^String decode-string
76
"Returns the bytes represented by the hexadecimal string s."
87
{:added "1.0"
9-
:go "! t, err := hex.DecodeString(s); PanicOnErr(err); _res := string(t)"}
8+
:go "! t, err := hex.DecodeString(s); PanicOnErr(err); _res := string(t)"}
109
[^String s])
1110

1211
(defn ^String encode-string
1312
"Returns the hexadecimal encoding of s."
1413
{:added "1.0"
15-
:go "hex.EncodeToString([]byte(s))"}
14+
:go "hex.EncodeToString([]byte(s))"}
1615
[^String s])

std/html.joke

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
(ns
2-
^{:go-imports ["html"]
3-
:doc "Provides functions for escaping and unescaping HTML text."}
1+
(ns ^{:go-imports ["html"]
2+
:doc "Provides functions for escaping and unescaping HTML text."}
43
html)
54

65
(defn ^String escape
76
"Escapes special characters like < to become &lt;. It escapes only five such characters: <, >, &, ' and \"."
87
{:added "1.0"
9-
:go "html.EscapeString(s)"}
8+
:go "html.EscapeString(s)"}
109
[^String s])
1110

1211
(defn ^String unescape
1312
"Unescapes entities like &lt; to become <."
1413
{:added "1.0"
15-
:go "html.UnescapeString(s)"}
14+
:go "html.UnescapeString(s)"}
1615
[^String s])

0 commit comments

Comments
 (0)