I am pleased to announce the release of version 1.2 of FSet, my
functional set-theoretic collections library for Common Lisp.
http://common-lisp.net/project/fset/
There is a new tutorial, which should make it easier to get going with
FSet.
Please give it a try -- and please do let me know if you have any
trouble.
-- Scott
On Sun, 02 Nov 2008 21:54:44 -0800, Scott Burson wrote:
> I am pleased to announce the release of version 1.2 of FSet, my
> functional set-theoretic collections library for Common Lisp.
>
> http://common-lisp.net/project/fset/
>
> There is a new tutorial, which should make it easier to get going with
> FSet.
>
> Please give it a try -- and please do let me know if you have any
> trouble.
>
> -- Scott
It seems to be missing :lexical-contexts, and the tinaa doc link, http://
common-lisp.net/project/fset/Site/Tinaa-Doc-1.2/index.html gives a 404
error.
Matt
--
When angry, count four; when very angry, swear.
-- Mark Twain, "Pudd'nhead Wilson's Calendar"
On Nov 3, 5:48 pm, Matthew D Swank <··················@gmail.com>
wrote:
> On Sun, 02 Nov 2008 21:54:44 -0800, Scott Burson wrote:
> > I am pleased to announce the release of version 1.2 of FSet, my
> > functional set-theoretic collections library for Common Lisp.
>
> >http://common-lisp.net/project/fset/
>
> > There is a new tutorial, which should make it easier to get going with
> > FSet.
>
> > Please give it a try -- and please do let me know if you have any
> > trouble.
>
> It seems to be missing :lexical-contexts, and the tinaa doc link, http://
> common-lisp.net/project/fset/Site/Tinaa-Doc-1.2/index.html gives a 404
> error.
Thanks for the note.
Okay, I've fixed the Tinaa doc link. Re lexical-contexts: how are you
downloading it -- are you using ASDF-Install? If not, sounds like you
need to update your copy of Misc-Extensions.
-- Scott
On Mon, 03 Nov 2008 18:40:22 -0800, Scott Burson wrote:
> On Nov 3, 5:48 pm, Matthew D Swank <··················@gmail.com> wrote:
>> On Sun, 02 Nov 2008 21:54:44 -0800, Scott Burson wrote:
>> > I am pleased to announce the release of version 1.2 of FSet, my
>> > functional set-theoretic collections library for Common Lisp.
>>
>> >http://common-lisp.net/project/fset/
>>
>> > There is a new tutorial, which should make it easier to get going
>> > with FSet.
>>
>> > Please give it a try -- and please do let me know if you have any
>> > trouble.
>>
>> It seems to be missing :lexical-contexts
...
> Re lexical-contexts: how are you downloading it -- are you using
> ASDF-Install? If not, sounds like you need to update your copy of
> Misc-Extensions.
>
> -- Scott
Yes, updating misc-extensions fixes that.
Matt
--
Q: How can you tell when a Burroughs salesman is lying?
A: When his lips move.
On Thu, 06 Nov 2008 08:35:19 -0800, Scott Burson wrote:
> So, are you actually trying out FSet, or just helping me check the
> release (which I certainly appreciate)?
>
> -- Scott
It's on my "to try" list as I favor functional lisp. However, it is a
highly idiosyncratic library, and the span of my attention is short :)
Matt
--
You will be married within a year, and divorced within two.
Scott Burson <········@gmail.com> writes:
> So, are you actually trying out FSet, or just helping me check the
> release (which I certainly appreciate)?
>
> -- Scott
I will certainly poke around with it in the coming weeks. Maybe my first
presentation at the local lisp group will be on it.
Keep up the good work.
On Nov 7, 9:29 am, J Kenneth King <·····@agentultra.com> wrote:
>
> I will certainly poke around with it in the coming weeks. Maybe my first
> presentation at the local lisp group will be on it.
>
> Keep up the good work.
Thanks!
-- Scott
On Tue, 04 Nov 2008 01:48:27 +0000, Matthew D Swank wrote:
> On Sun, 02 Nov 2008 21:54:44 -0800, Scott Burson wrote:
>
>> I am pleased to announce the release of version 1.2 of FSet, my
>> functional set-theoretic collections library for Common Lisp.
>>
>> http://common-lisp.net/project/fset/
>>
>> There is a new tutorial, which should make it easier to get going with
>> FSet.
>>
>> Please give it a try -- and please do let me know if you have any
>> trouble.
>>
>> -- Scott
>
> It seems to be missing :lexical-contexts, and the tinaa doc link,
> http:// common-lisp.net/project/fset/Site/Tinaa-Doc-1.2/index.html gives
> a 404 error.
>
> Matt
In Code/port.lisp you use mp:with-process-lock in the
#+(and sbcl sb-thread) section of the portability code. This not in the
current threading API, though I'm not sure what the current equivalent is.
Matt.
On Nov 3, 6:21 pm, Matthew D Swank <··················@gmail.com>
wrote:
>
> In Code/port.lisp you use mp:with-process-lock in the
> #+(and sbcl sb-thread) section of the portability code. This not in the
> current threading API, though I'm not sure what the current equivalent is.
Oops -- it should be `sb-thread:with-mutex'.
I haven't actually tested on SBCL with threads. I don't have a
threaded build handy; could I trouble you to make the above change,
recompile, and then do
(in-package :fset)
(run-test-suite 100)
?
-- Scott
On Mon, 03 Nov 2008 18:46:21 -0800, Scott Burson wrote:
> On Nov 3, 6:21 pm, Matthew D Swank <··················@gmail.com> wrote:
>>
>> In Code/port.lisp you use mp:with-process-lock in the #+(and sbcl
>> sb-thread) section of the portability code. This not in the current
>> threading API, though I'm not sure what the current equivalent is.
>
> Oops -- it should be `sb-thread:with-mutex'.
>
> I haven't actually tested on SBCL with threads. I don't have a threaded
> build handy; could I trouble you to make the above change, recompile,
> and then do
>
> (in-package :fset)
> (run-test-suite 100)
>
> ?
>
> -- Scott
FSET> (run-test-suite 100)
=> NIL
-----------------------------------------%<------------------------
Index: Code/port.lisp
===================================================================
--- Code/port.lisp (revision 22)
+++ Code/port.lisp (working copy)
@@ -106,11 +106,11 @@
(deflex *Memory-Barrier-Lock*
(sb-thread:make-mutex :name "Memory Barrier Lock"))
(defmacro read-memory-barrier ()
- '(mp:with-process-lock (*Memory-Barrier-Lock*)
- nil))
+ '(sb-thread:with-mutex (*Memory-Barrier-Lock*)
+ nil))
(defmacro write-memory-barrier ()
- '(mp:with-process-lock (*Memory-Barrier-Lock*)
- nil)))
+ '(sb-thread:with-mutex (*Memory-Barrier-Lock*)
+ nil)))
#+scl
-----------------------------------------%<------------------------
--
The devil can cite Scripture for his purpose.
-- William Shakespeare, "The Merchant of Venice"
On Nov 3, 7:23 pm, Matthew D Swank <··················@gmail.com>
wrote:
>
> FSET> (run-test-suite 100)
> => NIL
Great, thanks!! (Heh -- I suppose I should make it return T on
success. Had it failed it would have signalled an error -- don't know
if that's obvious.)
And thanks for the reports. I'll get the patch out right away.
-- Scott
On Nov 3, 12:54 am, Scott Burson <········@gmail.com> wrote:
> I am pleased to announce the release of version 1.2 of FSet, my
> functional set-theoretic collections library for Common Lisp.
>
> http://common-lisp.net/project/fset/
>
> There is a new tutorial, which should make it easier to get going with
> FSet.
>
> Please give it a try -- and please do let me know if you have any
> trouble.
>
> -- Scott
Hi Scott,
Thanks for sharing the nicely done library!
I've been using it for a while, mostly text book kind of programs to
get a feeling of functional style in CL. I can say FSet goes a long
way to make it a pleasant experience.
As much as I like functional style iterations that FSet provides, I
was curious how FSet and iterate macro play together. It seems FSet
iterator is all I needed to write iterate drivers. Here is the code.
(iter:defmacro-driver (FOR var IN-FSEQ s)
(let ((iter (gensym))
(kwd (if iter:generate 'iter:generate 'iter:for)))
`(progn
(iter:with ,iter = (iterator ,s))
(,kwd ,var next (if (funcall ,iter :done?)
(iter:terminate)
(funcall ,iter :get))))))
;;; a sample run
(iter (for i in-fseq (seq 1 4 7 2 5 8 3 6))
(maximize i))
=> 8
(iter:defmacro-driver (FOR pair IN-FMAP m)
(unless (consp pair)
(error "FOR var is not in the form of (key val)."))
(let ((iter (gensym))
(kwd (if iter:generate 'iter:generate 'iter:for)))
`(progn
(iter:with ,iter = (cond ((map? ,m) (iterator ,m))
((bag? ,m) (iterator ,m :pairs? t))
(t (error "The collection is neither map nor bag."))))
(,kwd ,pair do-next (if (funcall ,iter :done?)
(iter:terminate)
(multiple-value-setq ,pair (funcall ,iter :get)))))))
;;; a sample run
(iter (for (k v) in-fmap (map (:a 1) (:b 3) (:c 2)))
(finding k maximizing v))
=> :B
A few questions:
1) Although FSet iterators are stateful, iterate clause effectively
hides them from iterate body, and more important, any possibility of
aliasing iterators. This seems a safe (thus good) style to use
iterators. Do you agree?
2) It appears that FSet iterators are snapshot consistent w.r.t the
time they created from collection. Is this true if iterate body, or
even other threads update the collection concurrently? If not, how
hard to make it so.
3) I wish to enhance iterate clauses to iterate sub range of
collections, or backwards. such as,
(for i in-fseq a-seq from start-elt) ;iterate a-seq from member start-
elt to the end.
or
(for i in-fseq a-seq from start-elt downto end-elt) ;iterate a-seq
from start-elt to end-elt backwards.
I tried to do it using rant/at-rank/iterator, but haven't been
success. One possible solution is to make iterator find the position
of start-elt, as well as considering direction, something like
(iterator collection &key :start-from start-elt :decending t). Then,
iterate macro can use it and (compare? current-elt stop-elt) to
control where to start, where to stop. Do you consider this as a
possible enhancement?
Regards,
- Feng