Skip to content

Commit

Permalink
refine conj arguments; bump 0.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Jul 15, 2021
1 parent 039d61a commit 0455429
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "calcit_runner"
version = "0.4.9"
version = "0.4.10"
authors = ["jiyinyiyong <jiyinyiyong@gmail.com>"]
edition = "2018"
license = "MIT"
Expand Down
3 changes: 2 additions & 1 deletion calcit/snapshots/test-list.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
assert= (prepend a 4) $ [] 4 1 2 3
assert= (append a 4) $ [] 1 2 3 4
assert= (conj a 4) $ [] 1 2 3 4
assert= (conj a 4 5 6 7) $ [] 1 2 3 4 5 6 7
assert= 1 (first a)
assert= 3 (last a)
assert-detect nil? (first $ [])
Expand Down Expand Up @@ -44,7 +45,7 @@
assert "|concat lists" $ =
concat ([] 1 2) ([] 4 5) ([] 7 8)
[] 1 2 4 5 7 8

assert=
[] 3 4 5 2 3
&list:concat
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@calcit/procs",
"version": "0.4.9",
"version": "0.4.10",
"main": "./lib/calcit.procs.js",
"devDependencies": {
"@types/node": "^15.12.2",
Expand Down
7 changes: 5 additions & 2 deletions src/cirru/calcit-core.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -1153,8 +1153,11 @@
&map:dissoc acc k

|conj $ quote
defn conj (xs a)
append xs a
defn conj (xs y0 & ys)
if (empty? ys) (append xs y0)
recur
append xs y0
, & ys

|turn-str $ quote
defn turn-str (x) (turn-string x)
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/emit_js/snippets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub fn tmpl_fn_wrapper(body: String) -> String {
pub fn tmpl_args_fewer_than(args_count: usize) -> String {
format!(
"
if (arguments.length < {}) throw new Error('too few arguments')",
if (arguments.length < {}) throw new Error('too few arguments');",
args_count
)
}
Expand Down
3 changes: 1 addition & 2 deletions ts-src/calcit.procs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// CALCIT VERSION
export const calcit_version = "0.4.9";
export const calcit_version = "0.4.10";

import { overwriteComparator, initTernaryTreeMap } from "@calcit/ternary-tree";
import { parse } from "@cirru/parser.ts";
Expand Down Expand Up @@ -1446,7 +1446,6 @@ export let _$n_list_$o_distinct = (xs: CalcitList): CalcitList => {

// special procs have to be defined manually
export let reduce = foldl;
export let conj = append;

let unavailableProc = (...xs: []) => {
console.warn("NOT available for calcit-js");
Expand Down

0 comments on commit 0455429

Please sign in to comment.