; Tests for 2019 CS340d class, Lab 2 supplement ; These tests assume that your have implemented the functions given in ; ``lab2-function.lisp''. ; Below are some things that you can try. (assign reg0 (make-lst 1000)) (assign reg1 (rev (rev (rev (rev reg0))))) (equal (@ reg0) (@ reg1)) ; Instead of parsing input, such as above, I recommend you make it ; simple: call your routines directly. For instance, to exercise ; my implementation I would create the following input: vs_push_integer( 1000 ); ; Push the constant 1000 on the value stack vs_make_lst(); ; Call the function ``make_lst'' vs_assign( 0 ); ; Save the answer in Register 0, and pop stack vs_push_register( 0 ); ; Push (pointer to) value just stored vs_rev(); vs_rev(); vs_rev(); vs_rev(); vs_assign( 1 ); ; Save answer vs_push_register( 0 ); vs_push_register( 1 ); vs_equal(); vs_print(); ; To make things simpler, one may replace NIL with 0 everywhere in the ; given definitions. This way, one may assume that there are only two ; kinds of objects: CONS elements and integers. Of course, this will ; also require that ``(null x)'' is replaced by (eq x 0) in the ; function ``alstp''; that is, we require association lists to have a ; final, right-most 0. If you do make this simplification, then 0 ; will represent NIL and any other number will represent T. ; There are many other tests that can be run. Just make sure that ; your test causes several (more than 2) garbage collections.