Changeset 7365 in project


Ignore:
Timestamp:
01/16/08 11:13:54 (12 years ago)
Author:
Mario Domenech Goulart
Message:

bug fix. Dependencies between parameters (eggs and repository-data) was causing buggy behaviour when the parameters were used together.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • salmonella/trunk/salmonella.scm

    r6950 r7365  
    2929    (print "  " (string-concatenate (map ->string msg)))))
    3030
    31 (define repository-data
    32   (make-parameter
    33    (let ((data '()))
    34      (lambda ()
    35        (let ((repo "http://www.call-with-current-continuation.org/eggs/repository"))
    36          (when (null? data)
    37            (set! data (with-input-from-string
    38                           (http:GET repo)
    39                         read)))
    40          data)))))
    41 
    42 (define eggs
    43   (make-parameter
    44    (lambda ()
    45      (show "Downloading eggs list...")
    46      (map (compose ->string car) ((repository-data))))))
    47 
    48 (define egg-dependencies
    49   (let ((eggs/deps '()))
    50     (lambda arg
    51       (when (null? eggs/deps)
    52         (set! eggs/deps (map (lambda (egg-data)
    53                                (cons (car egg-data) (drop egg-data 3)))
    54                              ((repository-data)))))
    55       (if (null? arg)
    56           eggs/deps
    57           (let ((egg (car arg)))
    58             (alist-ref (if (string? egg)
    59                            (string->symbol egg)
    60                            egg)
    61                        eggs/deps))))))
     31(define repository-data (make-parameter (lambda () #f)))
     32
     33(define eggs (make-parameter (lambda () #f)))
    6234
    6335(define (under-test-chicken-version)
     
    217189        (load (car args))
    218190        (for-each eval (with-input-from-string (string-intersperse args) read-file)))
     191
     192    (unless ((eggs))
     193      (eggs (lambda ()
     194              (show "Downloading eggs list...")
     195              (map (compose ->string car) ((repository-data))))))
     196
     197    (unless ((repository-data))
     198      (repository-data
     199       (let ((data '()))
     200         (lambda ()
     201           (let ((repo "http://www.call-with-current-continuation.org/eggs/repository"))
     202             (when (null? data)
     203               (set! data (with-input-from-string
     204                              (http:GET repo)
     205                            read)))
     206             data)))))
     207   
     208    (define egg-dependencies
     209      (let ((eggs/deps '()))
     210        (lambda arg
     211          (when (null? eggs/deps)
     212            (set! eggs/deps (map (lambda (egg-data)
     213                                   (cons (car egg-data) (drop egg-data 3)))
     214                                 ((repository-data)))))
     215          (if (null? arg)
     216              eggs/deps
     217              (let ((egg (car arg)))
     218                (alist-ref (if (string? egg)
     219                               (string->symbol egg)
     220                               egg)
     221                           eggs/deps))))))
    219222
    220223    (when (->html)
Note: See TracChangeset for help on using the changeset viewer.