From 39281366705fbb8b822ad05461a5d4f8fe7d125d Mon Sep 17 00:00:00 2001 From: Calvin Rose Date: Mon, 8 Jul 2019 18:15:14 -0500 Subject: [PATCH] Begin update to 1.1.0. --- CHANGELOG.md | 6 +++++- appveyor.yml | 2 +- janet-installer.nsi | 2 +- meson.build | 2 +- src/conf/janetconf.h | 4 ++-- src/core/table.c | 12 ++++++++++++ test/suite7.janet | 8 ++++++++ 7 files changed, 30 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c44d4b8f..b7b36744 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/appveyor.yml b/appveyor.yml index fdb40f2a..51af81eb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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: diff --git a/janet-installer.nsi b/janet-installer.nsi index 517f18b4..8a8a4a64 100644 --- a/janet-installer.nsi +++ b/janet-installer.nsi @@ -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}" diff --git a/meson.build b/meson.build index 6d1cb69a..8f018b3c 100644 --- a/meson.build +++ b/meson.build @@ -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') diff --git a/src/conf/janetconf.h b/src/conf/janetconf.h index 4db17718..7ff48ca1 100644 --- a/src/conf/janetconf.h +++ b/src/conf/janetconf.h @@ -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" */ diff --git a/src/core/table.c b/src/core/table.c index f37eee0e..f4d674ba 100644 --- a/src/core/table.c +++ b/src/core/table.c @@ -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} }; diff --git a/test/suite7.janet b/test/suite7.janet index 30849237..5c2146a7 100644 --- a/test/suite7.janet +++ b/test/suite7.janet @@ -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)