File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,24 @@ function set_tail(xs,x) {
373373 }
374374}
375375
376+ // take(xs, n) puts the first n elements of xs into a list.
377+ function take ( xs , n ) {
378+ if ( n < 0 ) {
379+ throw new Error ( "take(xs, n) expects a positive integer as " +
380+ "argument n, but encountered " + n ) ;
381+ }
382+ return ( n === 0 ) ? [ ] : pair ( head ( xs ) , take ( tail ( xs ) , n - 1 ) ) ;
383+ }
384+
385+ // drop(xs, n) removes the first n elements from xs and returns the rest (as a list)
386+ function drop ( xs , n ) {
387+ if ( n < 0 ) {
388+ throw new Error ( "drop(xs, n) expects a positive integer as " +
389+ "argument n, but encountered " + n ) ;
390+ }
391+ return ( n === 0 ) ? xs : drop ( tail ( xs ) , n - 1 ) ;
392+ }
393+
376394//function display(str) {
377395// var to_show = str;
378396// if (is_array(str) && str.length > 2) {
Original file line number Diff line number Diff line change 226226 text-align : left ;
227227}
228228
229- md th ,
230- td {
229+ . md th ,
230+ .md td {
231231 text-align : left ;
232232 padding : 8px ;
233233}
234234
235- md tr :nth-child (even ) {
235+ . md tr :nth-child (even ) {
236236 background-color : #f2f2f2 ;
237237}
You can’t perform that action at this time.
0 commit comments