JSPM

  • Created
  • Published
  • Downloads 27
  • Score
    100M100P100Q83003F
  • License Apache-2.0

SICP Library

Package Exports

  • sicp

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sicp) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

This JavaScript npm package provides all functions and constants that are assumed to be predeclared in the textbook Structure and Interpretation of Computer Programs, JavaScript Adaptation. This package therefore allows readers of the textbook to run and experiment with all JavaScript programs that appear in the textbook, using Node.js.

Setting up and Using SICP library

Create the file package.json first if you have not by

$ npm init

Add the following line in the package.json file

{
  ...
  "type": "module"
}  

Next, install the package

$ npm i sicp

To use SICP library, you need to import by

import 'sicp';

For example,

import 'sicp';

const p = list("I", "love", "sicp");
display(head(tail(p)));

The documentation of the functions and constants provided by the sicp package is available here.