mirror of
https://github.com/janet-lang/janet
synced 2025-01-11 16:10:27 +00:00
Add errorf to core.
This commit is contained in:
parent
1add0c7d43
commit
535ab8302b
@ -2,6 +2,7 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## Unreleased - ???
|
## Unreleased - ???
|
||||||
|
- Add `errorf` to core.
|
||||||
- Add `lenprefix` combinator to PEGs.
|
- Add `lenprefix` combinator to PEGs.
|
||||||
- Add `%M`, `%m`, `%N`, and `%n` formatters to formatting functions. These are the
|
- Add `%M`, `%m`, `%N`, and `%n` formatters to formatting functions. These are the
|
||||||
same as `%Q`, `%q`, `%P`, and `%p`, but will not truncate long values.
|
same as `%Q`, `%q`, `%P`, and `%p`, but will not truncate long values.
|
||||||
|
@ -141,6 +141,11 @@
|
|||||||
[x &opt err]
|
[x &opt err]
|
||||||
(if x x (error (if err err "assert failure"))))
|
(if x x (error (if err err "assert failure"))))
|
||||||
|
|
||||||
|
(defn errorf
|
||||||
|
"A combination of error and string/format. Equivalent to (error (string/format fmt ;args))"
|
||||||
|
[fmt & args]
|
||||||
|
(error (string/format fmt ;args)))
|
||||||
|
|
||||||
(defmacro default
|
(defmacro default
|
||||||
"Define a default value for an optional argument.
|
"Define a default value for an optional argument.
|
||||||
Expands to (def sym (if (= nil sym) val sym))"
|
Expands to (def sym (if (= nil sym) val sym))"
|
||||||
|
Loading…
Reference in New Issue
Block a user