mirror of
https://github.com/janet-lang/janet
synced 2025-01-12 08:30:26 +00:00
1.9.0 Release.
Fix up some documentation as well.
This commit is contained in:
parent
e8b3587946
commit
235605bfa4
@ -1,7 +1,8 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
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 - ???
|
## 1.9.0 - 2020-05-10
|
||||||
|
- Add `:ldflags` option to many jpm declare functions.
|
||||||
- Add `errorf` to core.
|
- 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
|
||||||
@ -29,7 +30,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
- Add os/umask
|
- Add os/umask
|
||||||
- Add os/perm-int
|
- Add os/perm-int
|
||||||
- Add os/perm-string
|
- Add os/perm-string
|
||||||
- Add :octal-permissions option for os/stat.
|
- Add :int-permissions option for os/stat.
|
||||||
- Add `jpm repl` subcommand, as well as `post-deps` macro in project.janet files.
|
- Add `jpm repl` subcommand, as well as `post-deps` macro in project.janet files.
|
||||||
- Various bug fixes.
|
- Various bug fixes.
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
project('janet', 'c',
|
project('janet', 'c',
|
||||||
default_options : ['c_std=c99', 'b_lundef=false', 'default_library=both'],
|
default_options : ['c_std=c99', 'b_lundef=false', 'default_library=both'],
|
||||||
version : '1.9.0-dev')
|
version : '1.9.0')
|
||||||
|
|
||||||
# Global settings
|
# Global settings
|
||||||
janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet')
|
janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet')
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#define JANET_VERSION_MINOR 9
|
#define JANET_VERSION_MINOR 9
|
||||||
#define JANET_VERSION_PATCH 0
|
#define JANET_VERSION_PATCH 0
|
||||||
#define JANET_VERSION_EXTRA ""
|
#define JANET_VERSION_EXTRA ""
|
||||||
#define JANET_VERSION "1.9.0-dev"
|
#define JANET_VERSION "1.9.0"
|
||||||
|
|
||||||
/* #define JANET_BUILD "local" */
|
/* #define JANET_BUILD "local" */
|
||||||
|
|
||||||
|
@ -964,7 +964,7 @@ static const JanetReg asm_cfuns[] = {
|
|||||||
"asm", cfun_asm,
|
"asm", cfun_asm,
|
||||||
JDOC("(asm assembly)\n\n"
|
JDOC("(asm assembly)\n\n"
|
||||||
"Returns a new function that is the compiled result of the assembly.\n"
|
"Returns a new function that is the compiled result of the assembly.\n"
|
||||||
"The syntax for the assembly can be found on the janet wiki. Will throw an\n"
|
"The syntax for the assembly can be found on the Janet website. Will throw an\n"
|
||||||
"error on invalid assembly.")
|
"error on invalid assembly.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -855,10 +855,10 @@ static const JanetReg compile_cfuns[] = {
|
|||||||
{
|
{
|
||||||
"compile", cfun,
|
"compile", cfun,
|
||||||
JDOC("(compile ast &opt env source)\n\n"
|
JDOC("(compile ast &opt env source)\n\n"
|
||||||
"Compiles an Abstract Syntax Tree (ast) into a janet function. "
|
"Compiles an Abstract Syntax Tree (ast) into a function. "
|
||||||
"Pair the compile function with parsing functionality to implement "
|
"Pair the compile function with parsing functionality to implement "
|
||||||
"eval. Returns a janet function and does not modify ast. Throws an "
|
"eval. Returns a new function and does not modify ast. Returns an error "
|
||||||
"error if the ast cannot be compiled.")
|
"struct with keys :line, :column, and :error if compilation fails.")
|
||||||
},
|
},
|
||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -643,8 +643,8 @@ static const JanetReg corelib_cfuns[] = {
|
|||||||
{
|
{
|
||||||
"hash", janet_core_hash,
|
"hash", janet_core_hash,
|
||||||
JDOC("(hash value)\n\n"
|
JDOC("(hash value)\n\n"
|
||||||
"Gets a hash value for any janet value. The hash is an integer can be used "
|
"Gets a hash for any value. The hash is an integer can be used "
|
||||||
"as a cheap hash function for all janet objects. If two values are strictly equal, "
|
"as a cheap hash function for all values. If two values are strictly equal, "
|
||||||
"then they will have the same hash value.")
|
"then they will have the same hash value.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -685,7 +685,7 @@ static const JanetReg corelib_cfuns[] = {
|
|||||||
"\t:all:\tthe value of path verbatim\n"
|
"\t:all:\tthe value of path verbatim\n"
|
||||||
"\t:cur:\tthe current file, or (dyn :current-file)\n"
|
"\t:cur:\tthe current file, or (dyn :current-file)\n"
|
||||||
"\t:dir:\tthe directory containing the current file\n"
|
"\t:dir:\tthe directory containing the current file\n"
|
||||||
"\t:name:\tthe filename component of path, with extension if given\n"
|
"\t:name:\tthe name component of path, with extension if given\n"
|
||||||
"\t:native:\tthe extension used to load natives, .so or .dll\n"
|
"\t:native:\tthe extension used to load natives, .so or .dll\n"
|
||||||
"\t:sys:\tthe system path, or (syn :syspath)")
|
"\t:sys:\tthe system path, or (syn :syspath)")
|
||||||
},
|
},
|
||||||
@ -742,7 +742,7 @@ static void janet_quick_asm(
|
|||||||
janet_def(env, name, janet_wrap_function(janet_thunk(def)), doc);
|
janet_def(env, name, janet_wrap_function(janet_thunk(def)), doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Macros for easier inline janet assembly */
|
/* Macros for easier inline assembly */
|
||||||
#define SSS(op, a, b, c) ((op) | ((a) << 8) | ((b) << 16) | ((c) << 24))
|
#define SSS(op, a, b, c) ((op) | ((a) << 8) | ((b) << 16) | ((c) << 24))
|
||||||
#define SS(op, a, b) ((op) | ((a) << 8) | ((b) << 16))
|
#define SS(op, a, b) ((op) | ((a) << 8) | ((b) << 16))
|
||||||
#define SSI(op, a, b, I) ((op) | ((a) << 8) | ((b) << 16) | ((uint32_t)(I) << 24))
|
#define SSI(op, a, b, I) ((op) | ((a) << 8) | ((b) << 16) | ((uint32_t)(I) << 24))
|
||||||
@ -1024,7 +1024,7 @@ JanetTable *janet_core_env(JanetTable *replacements) {
|
|||||||
janet_quick_asm(env, JANET_FUN_NEXT,
|
janet_quick_asm(env, JANET_FUN_NEXT,
|
||||||
"next", 2, 1, 2, 2, next_asm, sizeof(next_asm),
|
"next", 2, 1, 2, 2, next_asm, sizeof(next_asm),
|
||||||
JDOC("(next ds &opt key)\n\n"
|
JDOC("(next ds &opt key)\n\n"
|
||||||
"Gets the next key in a datastructure. Can be used to iterate through "
|
"Gets the next key in a data structure. Can be used to iterate through "
|
||||||
"the keys of a data structure in an unspecified order. Keys are guaranteed "
|
"the keys of a data structure in an unspecified order. Keys are guaranteed "
|
||||||
"to be seen only once per iteration if they data structure is not mutated "
|
"to be seen only once per iteration if they data structure is not mutated "
|
||||||
"during iteration. If key is nil, next returns the first key. If next "
|
"during iteration. If key is nil, next returns the first key. If next "
|
||||||
@ -1035,7 +1035,8 @@ JanetTable *janet_core_env(JanetTable *replacements) {
|
|||||||
"Propagate a signal from a fiber to the current fiber. The resulting "
|
"Propagate a signal from a fiber to the current fiber. The resulting "
|
||||||
"stack trace from the current fiber will include frames from fiber. If "
|
"stack trace from the current fiber will include frames from fiber. If "
|
||||||
"fiber is in a state that can be resumed, resuming the current fiber will "
|
"fiber is in a state that can be resumed, resuming the current fiber will "
|
||||||
"first resume fiber."));
|
"first resume fiber. This function can be used to re-raise an error without "
|
||||||
|
"losing the original stack trace."));
|
||||||
janet_quick_asm(env, JANET_FUN_DEBUG,
|
janet_quick_asm(env, JANET_FUN_DEBUG,
|
||||||
"debug", 1, 0, 1, 1, debug_asm, sizeof(debug_asm),
|
"debug", 1, 0, 1, 1, debug_asm, sizeof(debug_asm),
|
||||||
JDOC("(debug &opt x)\n\n"
|
JDOC("(debug &opt x)\n\n"
|
||||||
@ -1107,7 +1108,7 @@ JanetTable *janet_core_env(JanetTable *replacements) {
|
|||||||
JDOC("(/ & xs)\n\n"
|
JDOC("(/ & xs)\n\n"
|
||||||
"Returns the quotient of xs. If xs is empty, returns 1. If xs has one value x, returns "
|
"Returns the quotient of xs. If xs is empty, returns 1. If xs has one value x, returns "
|
||||||
"the reciprocal of x. Otherwise return the first value of xs repeatedly divided by the remaining "
|
"the reciprocal of x. Otherwise return the first value of xs repeatedly divided by the remaining "
|
||||||
"values. Division by two integers uses truncating division."));
|
"values."));
|
||||||
templatize_varop(env, JANET_FUN_BAND, "band", -1, -1, JOP_BAND,
|
templatize_varop(env, JANET_FUN_BAND, "band", -1, -1, JOP_BAND,
|
||||||
JDOC("(band & xs)\n\n"
|
JDOC("(band & xs)\n\n"
|
||||||
"Returns the bit-wise and of all values in xs. Each x in xs must be an integer."));
|
"Returns the bit-wise and of all values in xs. Each x in xs must be an integer."));
|
||||||
|
@ -1417,17 +1417,17 @@ static const JanetReg marsh_cfuns[] = {
|
|||||||
{
|
{
|
||||||
"marshal", cfun_marshal,
|
"marshal", cfun_marshal,
|
||||||
JDOC("(marshal x &opt reverse-lookup buffer)\n\n"
|
JDOC("(marshal x &opt reverse-lookup buffer)\n\n"
|
||||||
"Marshal a janet value into a buffer and return the buffer. The buffer "
|
"Marshal a value into a buffer and return the buffer. The buffer "
|
||||||
"can the later be unmarshalled to reconstruct the initial value. "
|
"can the later be unmarshalled to reconstruct the initial value. "
|
||||||
"Optionally, one can pass in a reverse lookup table to not marshal "
|
"Optionally, one can pass in a reverse lookup table to not marshal "
|
||||||
"aliased values that are found in the table. Then a forward"
|
"aliased values that are found in the table. Then a forward"
|
||||||
"lookup table can be used to recover the original janet value when "
|
"lookup table can be used to recover the original value when "
|
||||||
"unmarshalling.")
|
"unmarshalling.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"unmarshal", cfun_unmarshal,
|
"unmarshal", cfun_unmarshal,
|
||||||
JDOC("(unmarshal buffer &opt lookup)\n\n"
|
JDOC("(unmarshal buffer &opt lookup)\n\n"
|
||||||
"Unmarshal a janet value from a buffer. An optional lookup table "
|
"Unmarshal a value from a buffer. An optional lookup table "
|
||||||
"can be provided to allow for aliases to be resolved. Returns the value "
|
"can be provided to allow for aliases to be resolved. Returns the value "
|
||||||
"unmarshalled from the buffer.")
|
"unmarshalled from the buffer.")
|
||||||
},
|
},
|
||||||
|
@ -480,7 +480,7 @@ static const JanetReg math_cfuns[] = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"math/next", janet_nextafter,
|
"math/next", janet_nextafter,
|
||||||
JDOC("(math/next y)\n\n"
|
JDOC("(math/next x y)\n\n"
|
||||||
"Returns the next representable floating point value after x in the direction of y.")
|
"Returns the next representable floating point value after x in the direction of y.")
|
||||||
},
|
},
|
||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
|
@ -1263,7 +1263,8 @@ static const JanetReg os_cfuns[] = {
|
|||||||
"\t:freebsd\n"
|
"\t:freebsd\n"
|
||||||
"\t:openbsd\n"
|
"\t:openbsd\n"
|
||||||
"\t:netbsd\n"
|
"\t:netbsd\n"
|
||||||
"\t:posix - A POSIX compatible system (default)")
|
"\t:posix - A POSIX compatible system (default)\n\n"
|
||||||
|
"May also return a custom keyword specified at build time.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"os/arch", os_arch,
|
"os/arch", os_arch,
|
||||||
@ -1292,7 +1293,7 @@ static const JanetReg os_cfuns[] = {
|
|||||||
"os/dir", os_dir,
|
"os/dir", os_dir,
|
||||||
JDOC("(os/dir dir &opt array)\n\n"
|
JDOC("(os/dir dir &opt array)\n\n"
|
||||||
"Iterate over files and subdirectories in a directory. Returns an array of paths parts, "
|
"Iterate over files and subdirectories in a directory. Returns an array of paths parts, "
|
||||||
"with only the filename or directory name and no prefix.")
|
"with only the file name or directory name and no prefix.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"os/stat", os_stat,
|
"os/stat", os_stat,
|
||||||
@ -1311,7 +1312,7 @@ static const JanetReg os_cfuns[] = {
|
|||||||
"\t:blocks - number of blocks in file. 0 on windows\n"
|
"\t:blocks - number of blocks in file. 0 on windows\n"
|
||||||
"\t:blocksize - size of blocks in file. 0 on windows\n"
|
"\t:blocksize - size of blocks in file. 0 on windows\n"
|
||||||
"\t:accessed - timestamp when file last accessed\n"
|
"\t:accessed - timestamp when file last accessed\n"
|
||||||
"\t:changed - timestamp when file last chnaged (permissions changed)\n"
|
"\t:changed - timestamp when file last changed (permissions changed)\n"
|
||||||
"\t:modified - timestamp when file last modified (content changed)\n")
|
"\t:modified - timestamp when file last modified (content changed)\n")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1139,7 +1139,7 @@ static const JanetReg parse_cfuns[] = {
|
|||||||
"parser/new", cfun_parse_parser,
|
"parser/new", cfun_parse_parser,
|
||||||
JDOC("(parser/new)\n\n"
|
JDOC("(parser/new)\n\n"
|
||||||
"Creates and returns a new parser object. Parsers are state machines "
|
"Creates and returns a new parser object. Parsers are state machines "
|
||||||
"that can receive bytes, and generate a stream of janet values.")
|
"that can receive bytes, and generate a stream of values.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"parser/clone", cfun_parse_clone,
|
"parser/clone", cfun_parse_clone,
|
||||||
|
@ -1320,8 +1320,7 @@ static const JanetReg peg_cfuns[] = {
|
|||||||
"peg/match", cfun_peg_match,
|
"peg/match", cfun_peg_match,
|
||||||
JDOC("(peg/match peg text &opt start & args)\n\n"
|
JDOC("(peg/match peg text &opt start & args)\n\n"
|
||||||
"Match a Parsing Expression Grammar to a byte string and return an array of captured values. "
|
"Match a Parsing Expression Grammar to a byte string and return an array of captured values. "
|
||||||
"Returns nil if text does not match the language defined by peg. The syntax of PEGs are very "
|
"Returns nil if text does not match the language defined by peg. The syntax of PEGs is documented on the Janet website.")
|
||||||
"similar to those defined by LPeg, and have similar capabilities.")
|
|
||||||
},
|
},
|
||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -542,7 +542,7 @@ static const JanetReg string_cfuns[] = {
|
|||||||
{
|
{
|
||||||
"string/from-bytes", cfun_string_frombytes,
|
"string/from-bytes", cfun_string_frombytes,
|
||||||
JDOC("(string/from-bytes & byte-vals)\n\n"
|
JDOC("(string/from-bytes & byte-vals)\n\n"
|
||||||
"Creates a string from integer params with byte values. All integers "
|
"Creates a string from integer parameters with byte values. All integers "
|
||||||
"will be coerced to the range of 1 byte 0-255.")
|
"will be coerced to the range of 1 byte 0-255.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -627,7 +627,7 @@ static const JanetReg string_cfuns[] = {
|
|||||||
{
|
{
|
||||||
"string/format", cfun_string_format,
|
"string/format", cfun_string_format,
|
||||||
JDOC("(string/format format & values)\n\n"
|
JDOC("(string/format format & values)\n\n"
|
||||||
"Similar to snprintf, but specialized for operating with janet. Returns "
|
"Similar to snprintf, but specialized for operating with Janet values. Returns "
|
||||||
"a new string.")
|
"a new string.")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user