1
0
mirror of https://github.com/janet-lang/janet synced 2025-01-26 15:16:51 +00:00

Begin update to 1.1.0.

This commit is contained in:
Calvin Rose 2019-07-08 18:15:14 -05:00
parent 0dcae6c3d6
commit 3928136670
7 changed files with 30 additions and 6 deletions

View File

@ -1,8 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.
## Unreleased
## 1.1.0 - 2019-07-08
- Change semantics of `-l` flag to be import rather than dofile.
- Fix compiler regression in top level defs with destructuring.
- Add `table/clone`.
- Improve `jpm` tool with git and dependency capabilities, as well as better
module uninstalls.
## 1.0.0 - 2019-07-01
- Add `with` macro for resource handling.

View File

@ -33,7 +33,7 @@ only_commits:
artifacts:
- path: janet-installer.exe
name: janet-v1.0.0-windows-installer.exe
name: janet-v1.1.0-windows-installer.exe
type: File
deploy:

View File

@ -1,5 +1,5 @@
# Version
!define VERSION "1.0.0"
!define VERSION "1.1.0"
!define PRODUCT_VERSION "${VERSION}.0"
VIProductVersion "${PRODUCT_VERSION}"
VIFileVersion "${PRODUCT_VERSION}"

View File

@ -20,7 +20,7 @@
project('janet', 'c',
default_options : ['c_std=c99', 'b_lundef=false', 'default_library=both'],
version : '1.0.0')
version : '1.1.0')
# Global settings
janet_path = join_paths(get_option('prefix'), get_option('libdir'), 'janet')

View File

@ -27,10 +27,10 @@
#define JANETCONF_H
#define JANET_VERSION_MAJOR 1
#define JANET_VERSION_MINOR 0
#define JANET_VERSION_MINOR 1
#define JANET_VERSION_PATCH 0
#define JANET_VERSION_EXTRA "-dev"
#define JANET_VERSION "1.0.0-dev"
#define JANET_VERSION "1.1.0-dev"
/* #define JANET_BUILD "local" */

View File

@ -280,6 +280,12 @@ static Janet cfun_table_rawget(int32_t argc, Janet *argv) {
return janet_table_rawget(table, argv[1]);
}
static Janet cfun_table_clone(int32_t argc, Janet *argv) {
janet_fixarity(argc, 1);
JanetTable *table = janet_gettable(argv, 0);
return janet_wrap_table(janet_table_clone(table));
}
static const JanetReg table_cfuns[] = {
{
"table/new", cfun_table_new,
@ -313,6 +319,12 @@ static const JanetReg table_cfuns[] = {
"If a table tab does not contain t directly, the function will return "
"nil without checking the prototype. Returns the value in the table.")
},
{
"table/clone", cfun_table_clone,
JDOC("(table/clone tab)\n\n"
"Create a copy of a table. Updates to the new table will not change the old table, "
"and vice versa.")
},
{NULL, NULL, NULL}
};

View File

@ -105,4 +105,12 @@
(def res (resume f))
(assert-error :abc (propagate res f) "propagate 1")
# table/clone
(defn check-table-clone [x msg]
(assert (= (table/to-struct x) (table/to-struct (table/clone x))) msg))
(check-table-clone @{:a 123 :b 34 :c :hello : 945 0 1 2 3 4 5} "table/clone 1")
(check-table-clone @{} "table/clone 1")
(end-suite)