Tobias C. Rittweiler | 19 Aug 2007 17:21
Picon

[PATCH] nicer arglist for ADSF:OOS


The attached patch makes the arglist of ASDF:OOS a bit more useful when
used in combination with Slime's autodoc feature.

  -T.

Attachment (asdf-oos-arglist.diff): text/x-diff, 677 bytes
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
cclan-list mailing list
cclan-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cclan-list
Gary King | 20 Aug 2007 21:46
Favicon
Gravatar

Re: [PATCH] nicer arglist for ADSF:OOS

(AIA if this is a duplicate but...)

Hi Tobias,

This seems like a win to me. Unless someone says otherwise, I'd be
happy to commit. (ping me if you don't here back by the end of this
week).


On Aug 19, 2007, at 11:21 AM, Tobias C. Rittweiler wrote:


The attached patch makes the arglist of ASDF:OOS a bit more useful when
used in combination with Slime's autodoc feature.

  -T.

Index: asdf.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/contrib/asdf/asdf.lisp,v
retrieving revision 1.24
diff -u -r1.24 asdf.lisp
--- asdf.lisp 7 Nov 2006 10:51:42 -0000 1.24
+++ asdf.lisp 19 Aug 2007 15:18:04 -0000
<at> <at> -900,9 +900,10 <at> <at>
                           (get-universal-time))
                     (return)))))))))

 

-(defun oos (&rest args)
+(defun oos (operation system &rest args &key force (verbose t) version)
   "Alias of OPERATE function"
-  (apply #'operate args))
+  (declare (ignore force verbose version))
+  (apply #'operate operation system args))

 

 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; syntax
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
cclan-list mailing list

--
Gary Warren King, metabang.com 
Cell: (413) 885 9127
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
cclan-list mailing list
cclan-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cclan-list
Robert P. Goldman | 20 Aug 2007 22:07

Re: [PATCH] nicer arglist for ADSF:OOS

Gary King wrote:
> (AIA if this is a duplicate but...)
> 
> Hi Tobias,
> 
> This seems like a win to me. Unless someone says otherwise, I'd be
> happy to commit. (ping me if you don't here back by the end of this
> week).

How about going one step further and adding a more extensive 
documentation string to OOS?  E.g., add a docstring to say what the 
types of the force (boolean) and version (specially-formatted string?) 
arguments are, and what they mean?  I think, for example, that version 
is version >=, but can't swear to it (sorry, I'm away from the machine 
with ASDF on it), and force has somewhat odd semantics...

R

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Gary King | 21 Aug 2007 19:44
Favicon
Gravatar

Re: [PATCH] nicer arglist for ADSF:OOS

Hi Robert,

I like docstrings but I don't like duplicating what is in the  
reference guide...

On Aug 20, 2007, at 4:07 PM, Robert P. Goldman wrote:

> Gary King wrote:
>> (AIA if this is a duplicate but...)
>> Hi Tobias,
>> This seems like a win to me. Unless someone says otherwise, I'd be
>> happy to commit. (ping me if you don't here back by the end of this
>> week).
>
> How about going one step further and adding a more extensive  
> documentation string to OOS?  E.g., add a docstring to say what the  
> types of the force (boolean) and version (specially-formatted  
> string?) arguments are, and what they mean?  I think, for example,  
> that version is version >=, but can't swear to it (sorry, I'm away  
> from the machine with ASDF on it), and force has somewhat odd  
> semantics...
>
> R

--
Gary Warren King, metabang.com
Cell: (413) 885 9127
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Gary King | 21 Aug 2007 19:45
Favicon
Gravatar

Re: [PATCH] nicer arglist for ADSF:OOS

Whoopts, sent that last one too quickly.

When I add Tobias's patch, I'll try to extend the docstrings a bit too.

On Aug 20, 2007, at 4:07 PM, Robert P. Goldman wrote:

> Gary King wrote:
>> (AIA if this is a duplicate but...)
>> Hi Tobias,
>> This seems like a win to me. Unless someone says otherwise, I'd be
>> happy to commit. (ping me if you don't here back by the end of this
>> week).
>
> How about going one step further and adding a more extensive  
> documentation string to OOS?  E.g., add a docstring to say what the  
> types of the force (boolean) and version (specially-formatted  
> string?) arguments are, and what they mean?  I think, for example,  
> that version is version >=, but can't swear to it (sorry, I'm away  
> from the machine with ASDF on it), and force has somewhat odd  
> semantics...
>
> R

--
Gary Warren King, metabang.com
Cell: (413) 885 9127
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Gary King | 30 Aug 2007 15:47
Favicon
Gravatar

Re: [PATCH] nicer arglist for ADSF:OOS

Here is my version of Tobias's patch with included docstring goodness. Please holler if you don't like it. Otherwise, I'll commit it soon.


Index: asdf.lisp
===================================================================
RCS file: /cvsroot/cclan/asdf/asdf.lisp,v
retrieving revision 1.109
diff -u -w -u -r1.109 asdf.lisp
--- asdf.lisp   27 Jul 2007 02:58:19 -0000      1.109
+++ asdf.lisp   30 Aug 2007 13:46:22 -0000
<at> <at> -899,6 +899,20 <at> <at>
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; invoking operations
 
+(defvar *operate-docstring* 
+  "Operate does three things:
+
+1. It creates an instance of `operation-class` using any keyword parameters 
+as initargs. 
+2. It finds the  asdf-system specified by `system` (possibly loading 
+it from disk).
+3. It then calls `traverse` with the operation and system as arguments
+
+The traverse operation is wrapped in `with-compilation-unit` and error  
+handling code. If a `version` argument is supplied, then operate also 
+ensures that the system found satisfies it using the `version-satisfies`
+method.")
+
 (defun operate (operation-class system &rest args &key (verbose t) version 
                                 &allow-other-keys)
   (let* ((op (apply #'make-instance operation-class
<at> <at> -932,9 +946,17 <at> <at>
                          (get-universal-time))
                    (return)))))))))
 
-(defun oos (&rest args)
-  "Alias of OPERATE function"
-  (apply #'operate args))
+(setf (documentation 'operate 'function)
+      *operate-docstring*)
+
+(defun oos (operation-class system &rest args &key force (verbose t) version)
+  (declare (ignore force verbose version))
+  (apply #'operate operation-class system args))
+
+(setf (documentation 'oos 'function)
+      (format nil 
+             "Short for _operate on system_ and an alias for the `operate` function. ~&~&~a"
+      *operate-docstring*))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; syntax--
Gary Warren King, metabang.com 
Cell: (413) 559 8738
Fax: (206) 338-4052
gwkkwg on Skype * garethsan on AIM




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
cclan-list mailing list
cclan-list <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cclan-list
Zach Beane | 30 Aug 2007 16:32
Gravatar

Re: [PATCH] nicer arglist for ADSF:OOS

Gary King <gwking <at> metabang.com> writes:

> Here is my version of Tobias's patch with included docstring goodness. Please
> holler if you don't like it. Otherwise, I'll commit it soon.

Why do you create a special variable for the docstring instead of
putting it in the docstring position of the function?

Zach

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Robert P. Goldman | 30 Aug 2007 16:54

Re: [PATCH] nicer arglist for ADSF:OOS

Gary King wrote:
> Here is my version of Tobias's patch with included docstring goodness. 
> Please holler if you don't like it. Otherwise, I'll commit it soon.
> 

Just random suggestion:  since the *operate-docstring* is not going to 
change, shouldn't it be defined as a constant instead of a variable?

Cheers,
R

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Gary King | 31 Aug 2007 00:02
Favicon
Gravatar

Re: [PATCH] nicer arglist for ADSF:OOS

Because I use it for the docstring of two functions: operate and oos.

On Aug 30, 2007, at 10:32 AM, Zach Beane wrote:

> Gary King <gwking <at> metabang.com> writes:
>
>> Here is my version of Tobias's patch with included docstring  
>> goodness. Please
>> holler if you don't like it. Otherwise, I'll commit it soon.
>
> Why do you create a special variable for the docstring instead of
> putting it in the docstring position of the function?
>
> Zach
>
>
> ---------------------------------------------------------------------- 
> ---
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a  
> browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> cclan-list mailing list
> cclan-list <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/cclan-list

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Gary King | 31 Aug 2007 21:12
Favicon
Gravatar

(no subject)

Consider a typical ASDF-Install interaction wherein the user does not  
have the packager's public key:

> ;;; ASDF-INSTALL: Downloading 8516 bytes from http://boinkor.net/ 
> lisp/asdf-dependency-grovel/asdf-dependency-grovel-0.6.3.tar.gz to / 
> Users/gwking/asdf-install-0.asdf-install-tmp ...
> ;;; ASDF-INSTALL: Downloading 186 bytes from http://boinkor.net/ 
> lisp/asdf-dependency-grovel/asdf-dependency-grovel-0.6.3.tar.gz.asc  
> to /Users/gwking/asdf-install-1.asdf-install-tmp ...
>
> "[GNUPG:] ERRSIG B9C0C05804D7F45F 17 2 00 1169384172 9"
> "[GNUPG:] NO_PUBKEY B9C0C05804D7F45F"
> Error:
> No key found for key id 0xB9C0C05804D7F45F.
> Try some command like
>   gpg  --recv-keys 0xB9C0C05804D7F45F
>   [condition type: key-not-found]
>
> Restart actions (select using :continue):
>  0: Don't check GPG signature for this package
>  1: Retry GPG check (e.g., after downloading the key)
>  2: Return to Top Level (an "abort" restart).
>  3: Abort entirely from this (lisp) process.
> [1] cl-user(3): :cont 1

The error message suggests calling 'gpg'. Is there a good reason to  
not include a restart that offers to call it for the user?

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

Gmane