File tree Expand file tree Collapse file tree 4 files changed +73
-1
lines changed Expand file tree Collapse file tree 4 files changed +73
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ To build,
2020.. code-block ::
2121
2222 $ git clone https://github.com/source-academy/js-slang.git
23- $ cd slang
23+ $ cd js- slang
2424 $ yarn
2525 $ yarn build
2626
@@ -37,6 +37,20 @@ or alternatively, install js-slang and run
3737 $ npm -g install js-slang # Install js-slang
3838 $ js-slang [chapter] # default: 1
3939
40+ Documentation
41+ -------------
42+
43+ Source is documented here: https://sicp.comp.nus.edu.sg/source/
44+
45+ To build the documentation, run
46+
47+ .. code-block ::
48+
49+ $ git clone https://github.com/source-academy/js-slang.git
50+ $ cd js-slang
51+ $ npm install # If additional permissions are required, run sudo npm install
52+ $ make # to make the PDF documents using LaTeX
53+ $ yarn run jsdoc # to make the web pages in js-slang/doc/source
4054
4155 Error messages
4256--------------
Original file line number Diff line number Diff line change 1+ /**
2+ * returns
3+ * the current length of array <CODE>x</CODE>, which is 1 plus the
4+ * highest index that has been used so far in an array assignment on
5+ * <CODE>x</CODE>. Here literal array expressions are counted too: The
6+ * array <CODE>[10, 20, 30]</CODE> has a length of 3.
7+ * @param {array } x - given array
8+ * @returns {number } current length of array
9+ */
10+ function array_length ( x ) { }
11+
12+ /**
13+ * returns <CODE>true</CODE> if <CODE>x</CODE>
14+ * is an array, and <CODE>false</CODE> if it is not.
15+ * @param {value } x - given value
16+ * @returns {boolean } whether <CODE>x</CODE> is an array
17+ */
18+ function is_array ( x ) { }
19+
Original file line number Diff line number Diff line change 1+ /**
2+ * returns the parse tree that results from parsing
3+ * the string `str` as a Source program. The format
4+ * of the parse tree is described in chapter 4 of
5+ * the textbook
6+ * in <a href="https://sicp.comp.nus.edu.sg/">Structure and
7+ * Interpretation of Computer Programs, JavaScript Adaptation</a> (SICP).
8+ * @param {string } x - given program as a string
9+ * @returns {value } parse tree
10+ */
11+ function parse ( str ) { }
12+
13+ /**
14+ * calls the function `f`
15+ * with arguments given in list `xs`. For example: <PRE><CODE>function times(x, y) {
16+ * return x * y;
17+ * }
18+ * apply_in_underlying_javascript(times, list(2, 3)); // returns 6</CODE></PRE>
19+ * @param {function } f - function to be applied
20+ * @param {list } xs - arguments given in list
21+ * @returns {boolean } whatever `f` returns
22+ */
23+ function apply_in_underlying_javascript ( f , xs ) { }
24+
Original file line number Diff line number Diff line change 1+ /**
2+ * changes the pair <CODE>p</CODE> such that its head is <CODE>x</CODE>.
3+ * @param {pair } p - given pair
4+ * @param {value } x - given value
5+ * @returns {undefined } undefined
6+ */
7+ function set_head ( p , x ) { }
8+
9+ /**
10+ * changes the pair <CODE>p</CODE> such that its tail is <CODE>x</CODE>.
11+ * @param {pair } p - given pair
12+ * @param {value } x - given value
13+ * @returns {undefined } undefined
14+ */
15+ function set_tail ( p , x ) { }
You can’t perform that action at this time.
0 commit comments