These are the stories that have been posted to the software category.
There isn’t anything exciting below but minor tweaks are good for the soul.
Tamas Papp suggested that bind should be able to handle arrays nicely. For example:
(bind ((#(a b) #(1 2)))
(+ a b))
==> 3
I liked the idea and also wanted to see how extensible I had managed to make bind so I added some tests and this method:
(defmethod bind-generate-bindings
((kind array) variable-form value-form
body declarations remaining-bindings)
(let ((array-size (array-total-size variable-form))
(gvalue (gensym "value")))
`((let* ((,gvalue ,value-form)
,@(loop for i below array-size
for var = (row-major-aref variable-form i)
unless (eq var nil) collect
`(,var (row-major-aref ,gvalue ,i))))
,@(bind-macro-helper
remaining-bindings declarations body)))))
A binding is a pair of variable-form and value-form. Skipping some details, the bind-generate-bindings method gets called and dispatches on the kind of binding. In this case, we need to pull apart the array and generate a let* method to hold each inner variable. The (unless (eq var nil) ...) form lets us easily skip over bits of the array (think of using nil in loop destructuring). In practice, a use of it might be
(bind ((#2a((a nil)
(nil b)) my-array))
(format t "~%Sum of the diagonal is: ~a" (+ a b)))
I think it’s handy. Thanks Tamas (and let me know if you have any more ideas!).
Thanks to Dan Muller, Andy Cristina and Attila Lendvai, ASDF-Install should now play more nicely on Windows systems. The change log has the details but here is the summary:
Summarizing: On Windows we will now use *GNU-TAR-PROGRAM* and
*SHELL-SEARCH-PATHS* just like on UNIX. We still assume Cygwin and
still run cygpath on the tar arguments. We no longer use
*CYGWIN-BASH-PROGRAM*, but we still honor *CYGWIN-BIN-DIRECTORY*. Are
these changes 100% backwards compatible? No, some failure cases will
fail differently. But out-of-the-box success, using Cygwin, and
without customization, is more likely.
Because of the magnitude of these changes, I’ve setup an unstable darcs repository. You can get these using
darcs get http://common-lisp.net/project/asdf-install/asdf-install-unstable
there is also a tarball at
http://common-lisp.net/project/asdf-install/asdf-install-unstable/asdf-install.tar.gz
the tarball is signed with my GPG key.
Please enjoy and let me know if anything seems amiss (let me here is it all works for you too so that I can move these changes into the stable repository…).
Thanks,
Thanks to KrewinK for sending in a patch to let moptilities’s copy-template function correctly handle class allocation slots. Thanks to the patch and a few fixes in the actual tests, moptilities now passes all of its tests!
I’ve also updated ASDF-Binary-Locations to version 0.2.5. The only code change is that I’m exporting implementation-specific-directory-name. I’ve also added a user’s guide.
Ilya Perminov pointed out a problem log5 was having in dealing correctly with negated category specs (see the user’s guide if log5 is just so much 2.321928… to you)
Version 0.3.1 fixes the problem but I’m not sure if things are “right”. The question is how to correctly handle negated categories. Suppose, for example, I have these two categories:
(defcategory nc-foo)
(defcategory nc-bar)
and a sender that responds to (and nc-foo (not nc-bar)). What should happen with a log-for statement like:
(log-for (nc-foo) "what?")
One interpretation (the one log5 currently uses) is that an unmentioned category is assumed to be negative. So our sender will output this log statement. An alternative interpretation is that missing values and negative values are separate things and therefore the log statement should be silent. Here’s a test case (using LIFT) that illustrates the issue at hand:
(addtest (test-negated-categories)
start-sender
(let ((string
(with-output-to-string (stream)
(start-sender-fn 'test-negated-categories
'(and nc-foo (not nc-bar)) '(message)
'stream-sender :location stream)
(log-for (nc-foo) "absence is negation?")
(log-for (nc-bar) "no")
(log-for (nc-foo (not nc-bar)) "yes")
(log-for (and (not nc-foo) (not nc-bar)) "no")
)))
(ensure-same string
(format nil "\"absence is negation?\"~&\"yes\"")
:test 'string=)))
The output of the bottom three log-for commands is unobjectionable; that of (log-for (nc-foo) ...) less so. As I said above, log5 treats the absence of a category as negation and so the command outputs the message. It might be better to have a sort-of three-valued logic that incorporated missing-value but it’s not immediately clear to me that this is actually useful or conceptually more simple!
If there are opinions out there, please me know.
Dan Muller has been doing a lot of work on the innards of ASDF-Install to clean up kruft and make life easier for the multi-platform reality in which we live.
Recent patches include:
some nice refactoring of the install function to make it easier to understand, extend, and debug
the elimination of several moribund special variables and the renaming of some others
some cleanup and improvements in the automated test suite.
These changes can be found on the unstable darcs repository. Use
darcs get http://common-lisp.net/project/asdf-install/asdf-install-unstable/
to check it out from darcs or download the tarball.
As promised yesterday, metabang-bind has been bumped to version 0.6.4. The new version includes support for regular expressions (if CL-PPCRE is available) and a few other bug fixes, etc. (Thanks go to Attila Lendvai for some of these last. Thanks!).
All of the tests pass but documentation is lagging. If you have any questions, give me a holler.
Thanks to Russ Tyndall (with additional suggestions from Attila Lendvai), metabang-bind now has binding syntax for both read-only class accessors and read/write class accessors. The latter is implemented using with-accessors and is probably what you usually want so I’ve switched the :accessors binding to use it. The former will give a slight performance boost and is available as :read-only-accessors or :accessors-read-only.
Enjoy.
(Oh, I should add that the user’s guide for bind is a bit messy at this moment because I rebuilt it before I remembered that I was in the middle of rewriting parts of CL-Markdown. That’ll teach me something. I wish I knew what.)
I’ve just pulled down the changes from ASDF-Install-Unstable to ASDF-Install (see here for details). Thanks again to all who have contributed recently.
I’ve also started to replace references in some of my software’s system definitions from index.lml to index.md. This sometimes causes ASDF to spit out warnings about file dates, etc. The former caused asdf to do some extra and unnecessary. So far, I’ve taken care of cl-containers and moptilities but there are many other packages to go… Thanks go to Elliott Johnson for getting me to actually fix this!
This release of ASDF-Binary-Locations includes:
a new test suite,
A new configuration variable: *map-all-source-files*. If true, then all source files will be mapped by ABL. If nil (the default), then only Common Lisp Source Files (i.e., instances of cl-source-file or its subclasses) will be. (Thanks to Cyrus Harmon for the idea).
A fix to make ABL more compatible with SBCL and probe-file (Thanks to Peter Seibel for pointing out the problem and providing a patch).
various minor improvements to the implementation-specific-directory-name function (pulled from Swank).
Enjoy.