New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

liyad

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liyad - npm Package Compare versions

Comparing version 0.0.13 to 0.0.14

2

bin/s-exp/evaluate.js

@@ -166,2 +166,3 @@ "use strict";

// ) ;;
// expr1 ... exprN-1 ;; front
// t-expr ;; tail[2]

@@ -179,2 +180,3 @@ // )

],
...front,
tail[2],

@@ -181,0 +183,0 @@ ];

@@ -153,2 +153,3 @@ // Copyright (c) 2018, Shellyl_N and Authors

// ) ;;
// expr1 ... exprN-1 ;; front
// t-expr ;; tail[2]

@@ -166,2 +167,3 @@ // )

],
...front,
tail[2],

@@ -168,0 +170,0 @@ ];

2

package.json
{
"name": "liyad",
"private": false,
"version": "0.0.13",
"version": "0.0.14",
"description": "Liyad (Lisp yet another DSL interpreter) is very small Lisp interpreter written in JavaScript.",

@@ -6,0 +6,0 @@ "keywords": [

@@ -265,2 +265,81 @@

});
it("optimization", function() {
expect(lisp`
($local ()
($let fib-sub (-> (n a b)
($if (< n 3)
($cond (=== n 2) (+ a b)
(=== n 1) a
true 0)
($self (- n 1) (+ a b) a) ) ))
($capture (fib-sub)
($defun fib (n) (fib-sub n 1 0)) ) )
($map ($range 0 20) (<- fib))
`).toEqual([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765]);
});
it("no optimization", function() {
expect(lisp`
($local (fib-sub)
($set fib-sub (|-> (n a b) use (fib-sub)
($set a (+ a 1))
($if (< n 3)
($cond (=== n 2) (+ a b)
(=== n 1) a
true 0)
(fib-sub (- n 1) (+ a b) a) ) ))
($capture (fib-sub)
($defun fib (n) (fib-sub n 1 0)) ) )
($map ($range 0 20) (<- fib))
`).toEqual([0, 2, 2, 5, 9, 16, 27, 45, 74, 121, 197, 320, 519, 841, 1362, 2205, 3569, 5776, 9347, 15125, 24474]);
});
it("optimization", function() {
expect(lisp`
($local (fib-sub)
($set fib-sub (|-> (n a b) use (fib-sub)
($set a (+ a 1))
($if (< n 3)
($cond (=== n 2) (+ a b)
(=== n 1) a
true 0)
($self (- n 1) (+ a b) a) ) ))
($capture (fib-sub)
($defun fib (n) (fib-sub n 1 0)) ) )
($map ($range 0 20) (<- fib))
`).toEqual([0, 2, 2, 5, 9, 16, 27, 45, 74, 121, 197, 320, 519, 841, 1362, 2205, 3569, 5776, 9347, 15125, 24474]);
});
it("no optimization", function() {
expect(lisp`
($local (fib-sub)
($set fib-sub (|-> (n a b) use (fib-sub)
($set a (+ a 1))
($set b (+ b 1))
($if (< n 3)
($cond (=== n 2) (+ a b)
(=== n 1) a
true 0)
(fib-sub (- n 1) (+ a b) a) ) ))
($capture (fib-sub)
($defun fib (n) (fib-sub n 1 0)) ) )
($map ($range 0 20) (<- fib))
`).toEqual([0, 2, 3, 7, 13, 23, 39, 65, 107, 175, 285, 463, 751, 1217, 1971, 3191, 5165, 8359, 13527, 21889, 35419]);
});
it("optimization", function() {
expect(lisp`
($local (fib-sub)
($set fib-sub (|-> (n a b) use (fib-sub)
($set a (+ a 1))
($set b (+ b 1))
($if (< n 3)
($cond (=== n 2) (+ a b)
(=== n 1) a
true 0)
($self (- n 1) (+ a b) a) ) ))
($capture (fib-sub)
($defun fib (n) (fib-sub n 1 0)) ) )
($map ($range 0 20) (<- fib))
`).toEqual([0, 2, 3, 7, 13, 23, 39, 65, 107, 175, 285, 463, 751, 1217, 1971, 3191, 5165, 8359, 13527, 21889, 35419]);
});
});

@@ -183,2 +183,3 @@ // Copyright (c) 2018, Shellyl_N and Authors

// ) ;;
// expr1 ... exprN-1 ;; front
// t-expr ;; tail[2]

@@ -200,2 +201,3 @@ // )

],
...front,
tail[2],

@@ -202,0 +204,0 @@ ];

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc