Skip to content

Commit

Permalink
adding documentation for draw_data and list() (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-henz authored Sep 7, 2019
1 parent 33f9d96 commit e965250
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/README_2.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ a learning environment that uses SICP JS and Source, comes with the following
## What can you do in Source §2?

You can use all features of
<a href="../Source §1/">Source §1</a> and all
<a href="../source_1/">Source §1</a> and all
features that are introduced in
<a href="https://sicp.comp.nus.edu.sg/chapters/23">chapter 2</a> of the
textbook.
Expand Down
2 changes: 1 addition & 1 deletion doc/README_3.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ a learning environment that uses SICP JS and Source, comes with the following
## What can you do in Source §3?

You can use all features of
<a href="../Source §2/">Source §2</a> and all
<a href="../source_2/">Source §2</a> and all
features that are introduced in
<a href="https://sicp.comp.nus.edu.sg/chapters/47">chapter 3</a> of the
textbook.
Expand Down
18 changes: 18 additions & 0 deletions doc/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,24 @@ function is_list(xs) {
return is_null(xs) || (is_pair(xs) && is_list(tail(xs)));
}

/**
* Given <CODE>n</CODE> values, returns a list of length <CODE>n</CODE>.
* The elements of the list are the given values in the given order.
* @param {number} value1,value2,...,value_n - given values
* @returns {list} list containing all values
*/
function list(value1, value2, ...values ) {}

/**
* visualizes <CODE>x</CODE> in a separate drawing
* area in the Source Academy using a box-and-pointer diagram; time, space:
* O(n), where n is the number of data structures such as
* pairs in <CODE>x</CODE>.
* @param {value} x - given value
* @returns {value} given <CODE>x</CODE>
*/
function draw_data(x) {}

/**
* Returns <CODE>true</CODE> if both
* have the same structure with respect to <CODE>pair</CODE>,
Expand Down

0 comments on commit e965250

Please sign in to comment.