Changeset 27371 in project


Ignore:
Timestamp:
09/03/12 19:10:03 (9 years ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [216.241.35.41]:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/4/dummy-user

    r27370 r27371  
    4242
    4343  (define (test-prog)
    44     (set! my-results (make-queue))
    45     (display "Name: ")
    46     (queue-add! my-results (cons 'name (read-line)))
    47     (display "Age: ")
    48     (queue-add! my-results (cons 'age (read-line)))
    49     (display "Phone: ")
    50     (queue-add! my-results (cons 'phone (read-line)))
    51     (print "OK, thanks!"))
     44    (let ((collected-data (make-queue)))
     45      (display "Name: ")
     46      (queue-add! collected-data (cons 'name (read-line)))
     47      (display "Age: ")
     48      (queue-add! collected-data (cons 'age (read-line)))
     49      (display "Phone: ")
     50      (queue-add! collected-data (cons 'phone (read-line)))
     51      (print "OK, thanks!")
     52      collected-data))
    5253
    5354  (define my-dummy (make-dummy-user '("Jenny" "24" "867-5309")))
     
    6061  (my-dummy 'reset)
    6162
    62   (pp (with-dummy-user my-dummy test-prog (lambda () (queue->list my-results))))
     63  (pp (with-dummy-user
     64        my-dummy
     65        (lambda () (set! my-results (test-prog)))
     66        (lambda () (queue->list my-results))))
    6367 
    6468  ;;; Should print: ((name . "Jenny") (age . "24") (phone . "867-5309"))
Note: See TracChangeset for help on using the changeset viewer.