You can subscribe to this list here.
2002 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(19) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(7) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Dirk G. <di...@di...> - 2005-01-27 21:19:01
|
Raymond Toy <ray...@er...> writes: > I've checked in the changes. Let me know how it goes. (Might have to > wait a day for anoncvs to catch up.) Seems to work fine in both CMUCL and SBCL. Thanks again. Kind regards, Dirk Gerrits |
From: Dirk G. <di...@di...> - 2005-01-26 22:13:13
|
Raymond Toy <ray...@er...> writes: > I do think there is a problem with your code. > > SCAN-VEC should probably be written as > > (defun scan-vec (vec) > (declare (optimizable-series-function)) > (to-alter (make-series (vec-x vec) (vec-y vec) (vec-z vec)) > #'(lambda (new-value index v) > (ecase index > (0 (setf (vec-x v) new-value)) > (1 (setf (vec-x v) new-value)) > (2 (setf (vec-x v) new-value)))) > (scan-range :from 0) > (make-series vec vec vec))) > > I don't think the function can capture variables, so you need to pass > in the desired variable. Oh I didn't know that. But passing the extra series is not much of a problem... By the way, any particular reason to use (make-series vec vec vec) instead of (series vec)? > (Plus there's a typo. vec-x is used 3 times, but you probably wanted > vec-y and vec-z.) Oops... :) > With the above change and my fix for series, > > (let ((vec (make-vec :x 1 :y 2 :z 3))) > (alter (scan-vec vec) (series 0)) > vec) > > will return #s(vec :x 0 :y 0 :z 0) now. > > I need to run some tests and I'll let you know when I've updated the > cvs sources. Cool, thanks. I guess I'll hear from you then. Kind regards, Dirk Gerrits |
From: Dirk G. <di...@di...> - 2005-01-16 15:43:02
|
Hi, does anyone know what I'm doing wrong in the following code? I'm trying to make a scanner for a 3D vector data structure that supports alteration. As you can see the scanning works fine, but ALTER has no effect: > (defstruct vec x y z) VEC > (defun scan-vec (vec) (declare (optimizable-series-function)) (to-alter (make-series (vec-x vec) (vec-y vec) (vec-z vec)) #'(lambda (new-value index) (ecase index (0 (setf (vec-x vec) new-value)) (1 (setf (vec-x vec) new-value)) (2 (setf (vec-x vec) new-value)))) (scan-range :from 0))) SCAN-VEC > (collect (scan-vec (make-vec :x 1 :y 2 :z 3))) (1 2 3) > (let ((vec (make-vec :x 1 :y 2 :z 3))) (alter (scan-vec vec) (series 0)) vec) #S(VEC :X 1 :Y 2 :Z 3) ; <-- should be #S(VEC :X 0 :Y 0 :Z 0) I'm using the dev-lisp/cl-series-2.2.7 package in Gentoo Linux. This contains some patches of mine to make it work for SBCL, but I've also tried the above in CMUCL with the same results. Thanks in advance for any help. Kind regards, Dirk Gerrits |
From: Hoehle, Joerg-C. <Joe...@t-...> - 2002-02-18 14:17:04
|
Dear users of the series package, I thought reimplementing lots of functions (here SCAN-ALIST) would help in getting used to series... Let's gradually start with: (defun my-scan-alist (alist &optional (test #'eql)) (declare (optimizable-series-function 1)) ;is needed (declare (off-line-port 0)) (let* ((assoc (choose-if #'consp (scan alist))) (keys (#Mcar assoc)) ;;(vals (#Mcdr assoc)) (bools (map-fn t (unseen-before :test test) keys))) (choose bools keys))) MY-SCAN-ALIST However I need to return two values (like scan-plist and scan-alist = do): Restriction violation 7 in series expression: (DEFUN MY-SCAN-ALIST (ALIST &OPTIONAL (TEST #'EQL)) (DECLARE (OPTIMIZABLE-SERIES-FUNCTION 2)) (DECLARE (OFF-LINE-PORT 0 1)) (LET* ((ASSOC (CHOOSE-IF #'CONSP (SCAN ALIST))) (KEYS (SERIES::|#M| CAR ASSOC)) (VALS (SERIES::|#M| CDR ASSOC)) (BOOLS (MAP-FN T (UNSEEN-BEFORE :TEST TEST) KEYS))) (VALUES (CHOOSE BOOLS KEYS) (CHOOSE BOOLS VALS)))) VALUES returns multiple series: (VALUES (CHOOSE BOOLS KEYS) (CHOOSE BOOLS VALS)) WARNING: MY-SCAN-ALIST [568]>=20 What's this obvious message? Of course VALUES returns 2 values, which are both series. The user manual (MIT memo) talks p.52 about using COTRUNCATE to indicate that the two output series are in sync. I obtain: Restriction violation 22 in series expression: (DEFUN MY-SCAN-ALIST (ALIST &OPTIONAL (TEST #'EQL)) (DECLARE (OPTIMIZABLE-SERIES-FUNCTION 2)) (DECLARE (OFF-LINE-PORT 0 1)) (LET* ((ASSOC (CHOOSE-IF #'CONSP (SCAN ALIST))) (KEYS (SERIES::|#M| CAR ASSOC)) (VALS (SERIES::|#M| CDR ASSOC)) (BOOLS (MAP-FN T (UNSEEN-BEFORE :TEST TEST) KEYS))) (COTRUNCATE (CHOOSE BOOLS KEYS) (CHOOSE BOOLS VALS)))) Constraint cycle passes through the off-line output at the start of the = data flow from: (CHOOSE BOOLS KEYS) to: (LET* ((ASSOC (CHOOSE-IF #'CONSP (SCAN ALIST))) (KEYS (SERIES::|#M| CAR = ASSOC)) (VALS (SERIES::|#M| CDR ASSOC)) (BOOLS (MAP-FN T (UNSEEN-BEFORE :TEST TEST) KEYS))) (COTRUNCATE (CHOOSE BOOLS KEYS) (CHOOSE BOOLS VALS))) WARNING: MY-SCAN-ALIST [15]>=20 How can I get this to work? I can't seem to find my way to work on two series in parallel (and I haven't even tackled scan-plist). I have a different version that works, but I'd like to understand the difference or I'll become frustrated: (defun my-scan-alist (alist &optional (test #'eql)) (declare (optimizable-series-function 2)) ;is needed (map-fn '(values t t) (lambda (association) (values (car association) (cdr association))) (choose-if (unseen-before :key #'car :test test) (choose-if #'consp (scan alist))))) My helper function is: (defun unseen-before (&rest hash-table-options &key (key #'identity) &allow-other-keys) ;;Note: using plain alist is faster on small sets (let ((seen (apply #'make-hash-table ;;TODO use my reuse-cons-based remove-keys (loop for (k v) on hash-table-options by #'cddr unless (eq k :key) collect k and collect v)))) (lambda (item &aux (elt (funcall key item))) (unless (gethash elt seen) (setf (gethash elt seen) t))))) BTW, I submitted some bug-reports to series at sourceforge, if you're = curious. http://sourceforge.net/tracker/?group_id=3D3235&atid=3D103235 Using series 2.2.5 on clisp-2.27-win32 on MS-Windows-2k Any help would be appreciated, J=F6rg H=F6hle. |