Comparing version 0.3.2 to 1.0.0
@@ -15,12 +15,12 @@ "use strict"; | ||
const attrForms = { | ||
"has-attr": new _SpecialForm.default((env, [obj, name]) => { | ||
has: new _SpecialForm.default((env, [obj, name]) => { | ||
return (0, _evaluate.evaluateExpression)(name, env) in (0, _evaluate.evaluateExpression)(obj, env); | ||
}), | ||
"del-attr": new _SpecialForm.default((env, [obj, name]) => { | ||
delete: new _SpecialForm.default((env, [obj, name]) => { | ||
delete (0, _evaluate.evaluateExpression)(obj, env)[(0, _evaluate.evaluateExpression)(name, env)]; | ||
}), | ||
"get-attr": new _SpecialForm.default((env, [obj, name]) => { | ||
get: new _SpecialForm.default((env, [obj, name]) => { | ||
return (0, _evaluate.evaluateExpression)(obj, env)[(0, _evaluate.evaluateExpression)(name, env)]; | ||
}), | ||
"set-attr": new _SpecialForm.default((env, [obj, name, value]) => { | ||
set: new _SpecialForm.default((env, [obj, name, value]) => { | ||
(0, _evaluate.evaluateExpression)(obj, env)[(0, _evaluate.evaluateExpression)(name, env)] = (0, _evaluate.evaluateExpression)(value, env); | ||
@@ -31,2 +31,2 @@ }) | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ldmFsdWF0b3Ivc3BlY2lhbEZvcm1zL2F0dHJzLmpzIl0sIm5hbWVzIjpbImF0dHJGb3JtcyIsIlNwZWNpYWxGb3JtIiwiZW52Iiwib2JqIiwibmFtZSIsInZhbHVlIl0sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQUE7O0FBQ0E7Ozs7QUFFQSxNQUFNQSxTQUFTLEdBQUc7QUFDaEIsY0FBWSxJQUFJQyxvQkFBSixDQUFnQixDQUFDQyxHQUFELEVBQU0sQ0FBQ0MsR0FBRCxFQUFNQyxJQUFOLENBQU4sS0FBc0I7QUFDaEQsV0FBTyxrQ0FBbUJBLElBQW5CLEVBQXlCRixHQUF6QixLQUFpQ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== |
@@ -17,5 +17,3 @@ "use strict"; | ||
const logicalForms = { | ||
cond: new _SpecialForm.default((env, args, strict) => { | ||
const pairs = (0, _lodash.chunk)(args, 2); | ||
cond: new _SpecialForm.default((env, pairs, strict) => { | ||
for (const pair of pairs) { | ||
@@ -38,2 +36,2 @@ if ((0, _lodash.size)(pair) === 1) { | ||
exports.default = _default; | ||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9ldmFsdWF0b3Ivc3BlY2lhbEZvcm1zL2xvZ2ljYWwuanMiXSwibmFtZXMiOlsibG9naWNhbEZvcm1zIiwiY29uZCIsIlNwZWNpYWxGb3JtIiwiZW52IiwiYXJncyIsInN0cmljdCIsInBhaXJzIiwicGFpciIsImV4cHIiLCJ1bmRlZmluZWQiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTs7QUFDQTs7QUFDQTs7OztBQUVBLE1BQU1BLFlBQVksR0FBRztBQUNuQkMsRUFBQUEsSUFBSSxFQUFFLElBQUlDLG9CQUFKLENBQWdCLENBQUNDLEdBQUQsRUFBTUMsSUFBTixFQUFZQyxNQUFaLEtBQXVCO0FBQzNDLFVBQU1DLEtBQUssR0FBRyxtQkFBTUYsSUFBTixFQUFZLENBQVosQ0FBZDs7QUFDQSxTQUFLLE1BQU1HLElBQVgsSUFBbUJELEtBQW5CLEVBQTBCO0FBQ3hCLFVBQUksa0JBQUtDLElBQUwsTUFBZSxDQUFuQixFQUFzQjtBQUNwQixlQUFPLGtDQUFtQixrQkFBS0EsSUFBTCxDQUFuQixFQUErQkosR0FBL0IsRUFBb0NFLE1BQXBDLENBQVA7QUFDRDs7QUFDRCxZQUFNLENBQUNKLElBQUQsRUFBT08sSUFBUCxJQUFlRCxJQUFyQjs7QUFDQSxVQUFJLGtDQUFtQk4sSUFBbkIsRUFBeUJFLEdBQXpCLEVBQThCLElBQTlCLENBQUosRUFBeUM7QUFDdkM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lY2lhbEZvcm1cIjtcclxuaW1wb3J0IHsgZXZhbHVhdGVFeHByZXNzaW9uIH0gZnJvbSBcIi4uL2V2YWx1YXRlXCI7XHJcblxyXG5jb25zdCBsb2dpY2FsRm9ybXMgPSB7XHJcbiAgY29uZDogbmV3IFNwZWNpYWxGb3JtKChlbnYsIHBhaXJzLCBzdHJpY3QpID0+IHtcclxuICAgIGZvciAoY29uc3QgcGFpciBvZiBwYWlycykge1xyXG4gICAgICBpZiAoc2l6ZShwYWlyKSA9PT0gMSkge1xyXG4gICAgICAgIHJldHVybiBldmFsdWF0ZUV4cHJlc3Npb24oaGVhZChwYWlyKSwgZW52LCBzdHJpY3QpO1xyXG4gICAgICB9XHJcbiAgICAgIGNvbnN0IFtjb25kLCBleHByXSA9IHBhaXI7XHJcbiAgICAgIGlmIChldmFsdWF0ZUV4cHJlc3Npb24oY29uZCwgZW52LCB0cnVlKSkge1xyXG4gICAgICAgIHJldHVybiBldmFsdWF0ZUV4cHJlc3Npb24oZXhwciwgZW52LCBzdHJpY3QpO1xyXG4gICAgICB9XHJcbiAgICB9XHJcbiAgICByZXR1cm4gdW5kZWZpbmVkO1xyXG4gIH0pXHJcbn07XHJcblxyXG5leHBvcnQgZGVmYXVsdCBsb2dpY2FsRm9ybXM7XHJcbiJdfQ== |
{ | ||
"name": "iamlisp", | ||
"version": "0.3.2", | ||
"version": "1.0.0", | ||
"description": "Another one LISP interpreter.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -5,12 +5,12 @@ import SpecialForm from "../../types/SpecialForm"; | ||
const attrForms = { | ||
"has-attr": new SpecialForm((env, [obj, name]) => { | ||
has: new SpecialForm((env, [obj, name]) => { | ||
return evaluateExpression(name, env) in evaluateExpression(obj, env); | ||
}), | ||
"del-attr": new SpecialForm((env, [obj, name]) => { | ||
delete: new SpecialForm((env, [obj, name]) => { | ||
delete evaluateExpression(obj, env)[evaluateExpression(name, env)]; | ||
}), | ||
"get-attr": new SpecialForm((env, [obj, name]) => { | ||
get: new SpecialForm((env, [obj, name]) => { | ||
return evaluateExpression(obj, env)[evaluateExpression(name, env)]; | ||
}), | ||
"set-attr": new SpecialForm((env, [obj, name, value]) => { | ||
set: new SpecialForm((env, [obj, name, value]) => { | ||
evaluateExpression(obj, env)[ | ||
@@ -17,0 +17,0 @@ evaluateExpression(name, env) |
@@ -1,2 +0,2 @@ | ||
import { chunk, size, head } from "lodash"; | ||
import { size, head } from "lodash"; | ||
import SpecialForm from "../../types/SpecialForm"; | ||
@@ -6,4 +6,3 @@ import { evaluateExpression } from "../evaluate"; | ||
const logicalForms = { | ||
cond: new SpecialForm((env, args, strict) => { | ||
const pairs = chunk(args, 2); | ||
cond: new SpecialForm((env, pairs, strict) => { | ||
for (const pair of pairs) { | ||
@@ -10,0 +9,0 @@ if (size(pair) === 1) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
223806
115
1
2803