@calcit/procs 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  var _a;
2
2
  // CALCIT VERSION
3
- export const calcit_version = "0.7.0";
3
+ export const calcit_version = "0.7.2";
4
4
  import { parse } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
6
6
  import { CalcitSymbol, CalcitTag, CalcitRef, CalcitRecur, newTag, refsRegistry, toString, getStringName, _$n__$e_, hashFunction, } from "./calcit-data.mjs";
@@ -253,9 +253,18 @@ export let _$n_tuple_$o_count = function (xs) {
253
253
  };
254
254
  export let _$n_tuple_$o_class = function (x) {
255
255
  if (arguments.length !== 1)
256
- throw new Error("&tuple:class takes 1 arguments");
256
+ throw new Error("&tuple:class takes 1 argument");
257
257
  return x.klass;
258
258
  };
259
+ export let _$n_tuple_$o_with_class = function (x, y) {
260
+ if (arguments.length !== 2)
261
+ throw new Error("&tuple:with-class takes 2 arguments");
262
+ if (!(x instanceof CalcitTuple))
263
+ throw new Error("&tuple:with-class expects a tuple");
264
+ if (!(y instanceof CalcitRecord))
265
+ throw new Error("&tuple:with-class expects second argument in record");
266
+ return new CalcitTuple(x.tag, x.extra, y);
267
+ };
259
268
  export let _$n_record_$o_get = function (xs, k) {
260
269
  if (arguments.length !== 2) {
261
270
  throw new Error("record &get takes 2 arguments");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calcit/procs",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "main": "./lib/calcit.procs.mjs",
5
5
  "devDependencies": {
6
6
  "@types/node": "^20.2.5",
@@ -1,5 +1,5 @@
1
1
  // CALCIT VERSION
2
- export const calcit_version = "0.7.0";
2
+ export const calcit_version = "0.7.2";
3
3
 
4
4
  import { parse, ICirruNode } from "@cirru/parser.ts";
5
5
  import { writeCirruCode } from "@cirru/writer.ts";
@@ -299,10 +299,17 @@ export let _$n_tuple_$o_count = function (xs: CalcitValue) {
299
299
  };
300
300
 
301
301
  export let _$n_tuple_$o_class = function (x: CalcitTuple) {
302
- if (arguments.length !== 1) throw new Error("&tuple:class takes 1 arguments");
302
+ if (arguments.length !== 1) throw new Error("&tuple:class takes 1 argument");
303
303
  return x.klass;
304
304
  };
305
305
 
306
+ export let _$n_tuple_$o_with_class = function (x: CalcitTuple, y: CalcitRecord) {
307
+ if (arguments.length !== 2) throw new Error("&tuple:with-class takes 2 arguments");
308
+ if (!(x instanceof CalcitTuple)) throw new Error("&tuple:with-class expects a tuple");
309
+ if (!(y instanceof CalcitRecord)) throw new Error("&tuple:with-class expects second argument in record");
310
+ return new CalcitTuple(x.tag, x.extra, y);
311
+ };
312
+
306
313
  export let _$n_record_$o_get = function (xs: CalcitValue, k: CalcitTag) {
307
314
  if (arguments.length !== 2) {
308
315
  throw new Error("record &get takes 2 arguments");