Skip to content

Commit

Permalink
Begin update to 1.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpakin committed Jul 8, 2019
1 parent 0dcae6c commit 3928136
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion janet-installer.nsi
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions src/conf/janetconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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" */

Expand Down
12 changes: 12 additions & 0 deletions src/core/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}
};

Expand Down
8 changes: 8 additions & 0 deletions test/suite7.janet
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3928136

Please sign in to comment.