Stas Boukarev | 15 May 22:57
Picon

[Patch]: Fix an example in the docstring of iota.

An example in the docstring of iota was
(iota 4) => (0 1 2 3 4)
while it should've been
(iota 4) => (0 1 2 3).

Attachment (iota.diff): text/x-diff, 750 bytes

--

-- 
With best regards, Stas.
_______________________________________________
alexandria-devel mailing list
alexandria-devel <at> common-lisp.net
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/alexandria-devel
Tobias C Rittweiler | 26 Apr 11:43
Picon

Split up Alexandria into an additional experimental package?


What is a good way to handle new additions to Alexandria that
are not fully fledged out yet?

As Hans noticed himself over this week, it usually takes
an incredible amount of time and effort to come up with
something with complete semantics. Time is a scarce resource,
and even if it was not, only experience and actual usage will
discover edges cases.

Common Lisp itself has been tried out and implemented many
times during the standardization process itself which is one
of the reasons it's engineered as well as it is.

What about providing an :ALEXANDRIA.EXPERIMENTAL
package that uses :ALEXANDRIA? New additions
go into the experimental package which is advertised
not necessarily to be fully backwards compatible.

People can explicitly :IMPORT-FROM that package (which
will continue to work even when the symbol moves from there
into :ALEXANDRIA, assuming no incompatible changes have been
made.)

T
Tobias C Rittweiler | 25 Apr 15:47
Picon

DESTRUCTURE-CLAUSES - alexandria_destruct#9CF676.diff (1/1)

I was pleased to discover that DESTRUCTURING-CASE made it into
Alexandria meanwhile. Very nice! This allows me to share the
little gem that I'm attaching with this posting. It's a handy
macro to make writing macros like DEFPACKAGE, DEFGENERIC of
DEFREADTABLE easy like a breeze.

Happy to be giving back again! :-)

T
diff --git a/macros.lisp b/macros.lisp
index 4450435..0d4b9e9 100644
--- a/macros.lisp
+++ b/macros.lisp
@@ -303,4 +303,76 @@ Example:
   (setf (documentation name 'function) (documentation 'destructuring-case 'function)))

 
+;;; DESTRUCTURE-CLAUSES

+(defmacro destructure-clauses (clauses patterns &body body)
+  "Utility macro to conveniently destructure DEFPACKAGE like clauses.
+
+     clauses  ::= clause*
+     clause   ::= (keyword . list)                  ; e.g. (:FOO 1 :K 2)
+
+     patterns ::= pattern*
+     pattern  ::= (keyword . ordinary-lambda-list)  ; e.g. (:FOO N &KEY K)
+
+The CAR of each clause in CLAUSES will be tried to be matched against
+the CAR of each pattern in PATTERNS. If a match is found, the CDR of
(Continue reading)

Tobias C Rittweiler | 25 Apr 11:15
Picon

EXTREMUM


The cl-utilities library contains one function which cannot be
found in alexandria that necessity pops up every now and then:

  Returning the maximum (or minimum) element in a sequence
  with respect to an arbitrary calculation involving the elements.

I.e.

  (elt (sort (copy-sequence <SEQUENCE>) #'< :key <FUNCTION>) 0) ; or #'>

except doing it more efficiently.

CL-UTILITIES calls this function EXTREMUM. (It also provides a couple
of more functions along the lines to cover some edge cases.)

The code can be found here:

http://common-lisp.net/viewvc/cl-utilities/cl-utilities/extremum.lisp?rev
ision=1.10&view=markup

As the code is Public Domain, it could just be moved as is.

I find no other use of cl-utilities and would like to see it
become entirely obsolete.

T
Robert Smith | 25 Apr 05:03

Some number patches

Hello all:

I've decided I'm going to try to merge in stuff from my QTILITY
library [1] in an attempt to reduce the number of utility libraries
out there -- provided the stuff fits with the goals of Alexandria.
Xach and I decided it's best not to add more utility libraries to
Quicklisp.

I've created a patch that adds MULF and DIVF, which do what you might
expect (modify macros for * and /). I also added some numerical
predicates that I myself like, as well as others: POSITIVEP,
NEGATIVEP, NON-POSITIVE-P, NON-NEGATIVE-P, NON-ZERO-P. As you might
notice, they sound especially familiar to those who read mathematics
literature.

Also, would it be possible for me to have push permissions?

I hope you'll take these attached patches into consideration.

Thanks,

Robert Smith

[1] https://bitbucket.org/tarballs_are_good/qtility/src
_______________________________________________
(Continue reading)

Hans Hübner | 22 Apr 15:35
Picon
Gravatar

Proposed addition of temporary file creation utilities

Hi,

following up on an IRC discussion yesterday, I am proposing the
addition of the OPEN-TEMPORARY function and WITH-OPEN-TEMPORARY-FILE
macro below (and on http://paste.lisp.org/display/129090#14).  It
implements functionality that is commonly required, but that is not
available in any other library in a portable fashion.  osicat has been
suggested, but it does not implement temporary file handling on
Windows.

This posting is to determine whether there is opposition regarding
inclusion in Alexandria.  I'll re-post as a proper patch including
symbol exports when there is agreement to include it.

-Hans

(in-package :alexandria)

(defparameter *default-temporary-directory* #P"/tmp/")

(eval-when (:load-toplevel :execute)
  (when (and (null (logical-pathname-translations "TEMPORARY-FILES"))
             (probe-file *default-temporary-directory*))
    (setf (logical-pathname-translations "temporary-files") `(("*.*.*"
,*default-temporary-directory*)))))

(defparameter *max-tries* 10000)

(defun generate-random-name (prefix)
  (format nil "~A-~36R-~36R" prefix (random 100000000)
(Continue reading)

Anton Vodonosov | 18 Apr 01:12
Picon
Favicon

test failures on ACL and CMUCL

Hello. 

I wander if it's a known issue that alexandria tests fail on ACL and CMUCL?
(there also failures on CLISP, but they are marked as "known failres" in the test suite)

For you convenience here is the list of failed tests and what compilers
are affected by each failure (from the test results we collected on the recent Quicklisp):

"alist-hash-table.1" => ("clisp-2.49+-unix")
"copy-hash-table.1" => ("acl-8.2a-linux-x64" "clisp-2.49+-unix")
"copy-sequence.1" => ("cmu-20c_release-20c__20c_unicode_-linux-x86")
"plist-hash-table.1" => ("clisp-2.49+-unix")
"type=.3" => ("acl-8.2a-linux-x64")
"type=.4" => ("acl-8.2a-linux-x64")

More information (with the test run logs where more details may be found):
http://common-lisp.net/project/cl-test-grid/pivot_lib_ql-lisp.html

Best regards,
- Anton
Tomohiro Matsuyama | 11 Apr 04:10
Gravatar

Reminder alexandria:curry is not currying

Hi,

Is there any progress on this discussion?

http://www.mail-archive.com/alexandria-devel <at> common-lisp.net/msg00199.html

I really won't use `curry' as partial application. I hope `partial-apply' will be soon available.

--

-- 
 Tomohiro Matsuyama <tomo <at> cx4a.org>
Zach Beane | 7 Apr 22:53
Gravatar

Re: Some problem with alexandria

Juan Jose Garcia-Ripoll <juanjose.garciaripoll <at> googlemail.com> writes:

> This wasn't happening before. Seems some upgrade of quicklisp pulled a version
> with this tiny bug. ECL is a bit picky about the order of arguments in LOOP. I
> will change this to a warning in the next release, though.

Does the latest version of alexandria in source control fix things? I
intend to release a new update today and it would be nice if it was
working properly.

Zach
Benjamin Saunders | 7 Apr 22:25
Picon

[PATCH] PROG1-LET

PROG1-LET is a binding macro modeled closely after WHEN-LET and
friends, which I have regularly found useful in code to implement the
"create, modify, return" pattern common in some imperative
code. As a simple and, I believe, widely useful macro, I'd like to see
this enter into Alexandria proper. Docstring follows:

Creates new variable bindings and executes FORMS, returning the
initial value of the first binding.

BINDINGS must be either single binding of the form:

 (variable initial-form)

or a list of bindings of the form:

 ((variable   initial-form)
  (variable-2 initial-form-2)
  ...
  (variable-n initial-form-n))

All initial-forms are executed sequentially in the specified order,
then all the variables are bound to the corresponding values and FORMS
are executed as an implicit PROGN. Finally, the value returned by
INITIAL-FORM is returned.
From cbccc782f34477c924ea8ff7b6000cd52511a768 Mon Sep 17 00:00:00 2001
From: Benjamin Saunders <ralith <at> gmail.com>
Date: Sat, 7 Apr 2012 13:19:19 -0700
Subject: [PATCH] Added PROG1-LET
(Continue reading)

Jasper | 20 Mar 21:34
Picon

destructuring-case

Hello all,

The `destructuring-case` macro imo is a little different than I would
think it would be upon just hearing the name.

The thing is, i'd have made the clauses to basically the
`destructuring-bind` form, except that a clause is executed if the
'nested lists-shape' matches, and all non-symbols, keywords match. I'd
add `quote` as special, something that also must match exactly, and
maybe `lambda`/`function` to indicate a function that must return
true.(which now i think of it is an idea for the next section.)

(shameless plug)Maybe the reason is that i wrote a `destructuring-regex`
https://github.com/o-jasper/j-basic/blob/master/src/destructuring-regex.lisp
of which the idea is that the variables can simply be written on the
matches/space between the matches.(Further each lisp object can add a
method giving the regular expression for it, and also provide a parser)
It uses the regex package though, is cl-ppcre more commonly used as
dependency?

But basically, i have a `regex-case` for it. Them being regexes and
either matching or not make it obvious how that should work!

Looking at the git log it was added Sep23 2010, so i am probably too
late to change `destructuring-case`? I dont know, i see there are no
official releases, and it might sneakily be that many people are using
the link from the cliki page!(from 2008)

- Ending a hopefully not too inane post, Jasper
(Continue reading)


Gmane