Re: ASDF commit

"Nikodemus Siivola" <[email protected]> Sun, 11 Jan 2009 13:01:27 +0200
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
On Sat, Jan 10, 2009 at 9:52 PM, Gary King <[email protected]> wrote:
>> 2009-01-10  [email protected]
>>
>>       added make-defined-systems-table (unexported)
>>       (re)applied Luis Oliveria's patch to add a restart for missing
>>       components. This patch works in SBCL but not in Allegro Common
>>       Lisp or CLISP. The problem has to do with the computation of
>>       restarts and I'm still trying to figure it out. Since the
>>       failure doesn't cause any _new_ problems (it just means that
>>       the putative new restart isn't listed), I'm still committing.
>>
>>       * asdf.lisp
>>
>>       tests for the above
>>
>>       (new) test/test-retry-loading-component-1.script
>>       (new) test/try-reloading-1.asd
>>       (new) test/try-reloading-dependency.hidden

Dunno what is the issue, but FWIW, I would structure this differently:
make the first form of RESTART-CASE an ERROR form, so the restart is
associated with the condition, and need for :TEST is eliminated. Not
sure if it would help with the issue or not.

Sketch below:

    (labels ((do-one-dep (required-op required-c required-v)
               (tagbody
                :retry
                  (let* ((dep-c (or (find-component
                                     (component-parent c)
                                     ;; XXX tacky.  really we should build the
                                     ;; in-order-to slot with canonicalized
                                     ;; names instead of coercing this late
                                     (coerce-name required-c) required-v)
                                    (go :error)))
                         (op (make-sub-operation c operation dep-c
required-op)))
                    (return-from do-one-dep (traverse op dep-c)))
                :error
                  (let ((e (if required-v
                               (make-condition 'missing-dependency-of-version
                                               :required-by c
                                               :version required-v
                                               :requires required-c)
                               (make-condition 'missing-dependency
                                               :required-by c
                                               :requires required-c))))
                    (restart-case
                        (error e)
                      (retry ()
                        :report (lambda (s)
                                  (format s "~@<Retry loading component ~S.~@:>"
                                          required-c))
                        (go :retry))))))
    ...

Cheers,

 -- Nikodemus

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB