[asdf-devel] Slight unportability in %DEFINE-COMPONENT-INLINE-METHODS

Gary King gwking at metabang.com
Sun Sep 6 12:30:11 UTC 2009


Hi all,

One thing I'm confused by is that the current [asdf.lisp][1] (version  
1.361) already seems to have this change in it. (though not the  
additional change to remove the unneeded (and data ...) from the for  
clauses). Where did you get the ASDF without the change?

thanks,

  [1]: http://common-lisp.net/project/asdf/asdf.lisp

On Sep 5, 2009, at 10:47 PM, Daniel Herring wrote:

> On Sat, 5 Sep 2009, Tobias C. Rittweiler wrote:
>> %DEFINE-COMPONENT-INLINE-METHODS contains the following LOOP form:
>>
>> (loop for data = rest then (cddr data)
>>     while data
>>     for key = (first data)
>>     for value = (second data)
>>     ...)
>>
>> However, if you look at LOOP's BNF in the specification, you'll see  
>> that
>> termination clauses *must* appear after :for clauses.
>
> The obvious transform is to move WHILE down and condition the FORs.
>    (loop for name in +asdf-methods+ do
>         (let ((keyword (intern (symbol-name name) :keyword)))
>          (loop for data = rest then (cddr data)
>               for key = (and data (first data))
>               for value = (and data (second data))
>               while data
>               when (eq key keyword) do
>               (destructuring-bind (op qual (o c) &body body) value
>
> The FOR conditions can then be dropped since (nth n nil) = nil
>    (loop for name in +asdf-methods+ do
>         (let ((keyword (intern (symbol-name name) :keyword)))
>          (loop for data = rest then (cddr data)
>               for key = (first data)
>               for value = (second data)
>               while data
>               when (eq key keyword) do
>               (destructuring-bind (op qual (o c) &body body) value
>
> Thus this can be fixed by simply moving the WHILE down two lines.
>
> - Daniel
>
> _______________________________________________
> asdf-devel mailing list
> asdf-devel at common-lisp.net
> http://common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel

--
Gary Warren King, metabang.com
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM * gwking on twitter









More information about the asdf-devel mailing list