1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-20 10:07:45 +03:00
mal/es6/types.js

12 lines
355 B
JavaScript
Raw Normal View History

2015-07-31 05:15:55 +03:00
// Symbols
2015-07-31 06:31:03 +03:00
export class Sym {
2015-07-31 05:15:55 +03:00
constructor(name) { this.name = name; }
toString() { return this.name; }
name() { return this.name; }
}
export function _symbol(name) { return new Sym(name); }
export function _symbol_Q(obj) { return obj instanceof Sym; }
2015-07-31 06:31:03 +03:00
// Lists
export function _list_Q(obj) { return Array.isArray(obj) && !obj.__isvector__; }