Skip to content

Commit

Permalink
max/min also compare strings; tag 0.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Nov 14, 2021
1 parent f2cb9a9 commit 7a4245a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 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.5.6"
version = "0.5.7"
authors = ["jiyinyiyong <jiyinyiyong@gmail.com>"]
edition = "2018"
license = "MIT"
Expand Down
2 changes: 2 additions & 0 deletions calcit/test-list.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,8 @@
.max ([] 1 2 3 4)
assert= 1
.min ([] 1 2 3 4)
assert= |1
.min ([] |1 |2 |3 |4)

assert= :b
.nth ([] :a :b :c :d) 1
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.5.6",
"version": "0.5.7",
"main": "./lib/calcit.procs.js",
"devDependencies": {
"@types/node": "^16.11.6",
Expand Down
8 changes: 6 additions & 2 deletions src/cirru/calcit-core.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,16 @@

|&max $ quote
defn &max (a b)
assert "|expects numbers for &max" $ if (number? a) (number? b) false
assert "|expects numbers for &max"
if (number? a) (number? b)
if (string? a) (string? b) false
if (&> a b) a b

|&min $ quote
defn &min (a b)
assert "|expects numbers for &min" $ if (number? a) (number? b) false
assert "|expects numbers for &min"
if (number? a) (number? b)
if (string? a) (string? b) false
if (&< a b) a b

|&list:max $ quote
Expand Down
2 changes: 1 addition & 1 deletion 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.5.6";
export const calcit_version = "0.5.7";

import { overwriteComparator, initTernaryTreeMap } from "@calcit/ternary-tree";
import { parse, ICirruNode } from "@cirru/parser.ts";
Expand Down

0 comments on commit 7a4245a

Please sign in to comment.