public
Description: The Nu programming language.
Homepage: http://programming.nu
Clone URL: git://github.com/timburks/nu.git
Added tests for car/cdr first/rest head/tail.

These three pairs are just different names for the same thing.

If car and cdr don't work, nutest probably won't work either.
timburks (author)
Sat Mar 29 13:22:27 -0700 2008
commit  81af97297a14addea47dee1e5d19d76b1ed45a58
tree    fca612c6f29dcb14362bed200fc7c4de9fbfa80b
parent  93d03fb3d2457e37b6c9e07ff4df593125a2e504
...
15
16
17
18
 
19
20
21
...
15
16
17
 
18
19
20
21
0
@@ -15,7 +15,7 @@
0
 ;; See the License for the specific language governing permissions and
0
 ;; limitations under the License.
0
 
0
-(global first (do (my-list) (car my-list)))
0
+;; Warning! I want to deprecate these.
0
 (global second (do (my-list) (car (cdr my-list))))
0
 (global third (do (my-list) (car (cdr (cdr my-list)))))
0
 (global fourth (do (my-list) (car (cdr (cdr (cdr my-list))))))
...
26
27
28
 
 
 
 
 
 
 
 
29
30
31
...
26
27
28
29
30
31
32
33
34
35
36
37
38
39
0
@@ -26,6 +26,14 @@
0
         (assert_equal 3 ('(1 2 3) objectAtIndex:2))
0
         (assert_equal nil ('(1 2 3) objectAtIndex:3)))
0
      
0
+ (- testBasicOperators is
0
+ (assert_equal 1 (car '(1 2 3)))
0
+ (assert_equal '(2 3) (cdr '(1 2 3)))
0
+ (assert_equal 1 (first '(1 2 3)))
0
+ (assert_equal '(2 3) (rest '(1 2 3)))
0
+ (assert_equal 1 (head '(1 2 3)))
0
+ (assert_equal '(2 3) (tail '(1 2 3))))
0
+
0
      (- testIndexing is
0
         (set mylist '(1 2 3))
0
         (assert_equal 1 (mylist 0))

Comments

    No one has commented yet.