Skip to content

Commit 76bb6f8

Browse files
committed
Remove js implementations of structs and map update
1 parent db2f827 commit 76bb6f8

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

src/javascript/lib/core/functions.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -64,42 +64,6 @@ function get_global() {
6464
throw new Error('No global state found');
6565
}
6666

67-
function defstruct(defaults) {
68-
return class {
69-
constructor(update = {}) {
70-
const the_values = Object.assign(defaults, update);
71-
Object.assign(this, the_values);
72-
}
73-
74-
static create(updates = {}) {
75-
const x = new this(updates);
76-
return Object.freeze(x);
77-
}
78-
};
79-
}
80-
81-
function defexception(defaults) {
82-
return class extends Error {
83-
constructor(update = {}) {
84-
const message = update.message || '';
85-
super(message);
86-
87-
const the_values = Object.assign(defaults, update);
88-
Object.assign(this, the_values);
89-
90-
this.name = this.constructor.name;
91-
this.message = message;
92-
this[Symbol.for('__exception__')] = true;
93-
Error.captureStackTrace(this, this.constructor.name);
94-
}
95-
96-
static create(updates = {}) {
97-
const x = new this(updates);
98-
return Object.freeze(x);
99-
}
100-
};
101-
}
102-
10367
function defprotocol(spec) {
10468
return new Protocol(spec);
10569
}
@@ -134,8 +98,6 @@ function build_namespace(ns, ns_string) {
13498
export default {
13599
call_property,
136100
get_global,
137-
defstruct,
138-
defexception,
139101
defprotocol,
140102
defimpl,
141103
build_namespace,

src/javascript/lib/core/special_forms.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ function cond(clauses) {
1414
throw new Error();
1515
}
1616

17-
function map_update(map, values) {
18-
return Object.freeze(
19-
Object.assign(Object.create(map.constructor.prototype), map, values),
20-
);
21-
}
22-
2317
function _for(expression, generators, collectable_protocol, into = []) {
2418
let [result, fun] = collectable_protocol.into(into);
2519

0 commit comments

Comments
 (0)