From: Nicolas Neuss on
RG <rNOSPAMon(a)flownet.com> writes:

> That's a tall order, particularly since LOOP is non-extensible. (Also,
> there is a pretty strong anti-loop faction in the CL community as
> well.)

But I'm not part of it:-)

>> [And, yes, I also use my own generic "dictionary" interface given mostly
>> by DIC-REF, DIC-FOR-EACH, DIC-REMOVE and DIC-EMPTY-P.]
>
> That's just my point: everyone who wants a generic collection rolls
> their own. The discussion does not seem to proceed from the premise
> that such things are desirable and focus on aspects of the design,
> instead the discussion hangs up on whether or not such things are even
> worth doing in the first place.
>
> So let me try to change that. *My* generic collection library (yes, I
> rolled my own as well) is even more generic than yours. It has only a
> single REF form that can be applied to almost everything dereferencable
> in CL:
>
> ? (ref '(a b c d e f) 3)
> D
> ? (ref "abcdef" 3)
> #\d
> ? (ref #(a b c d e f) 3)
> D
>
> It supports negative indices which count from the end of a sequence:
>
> ? (ref "abcdef" -1)
> #\f
>
> It replaces slot-value:
>
> ? (defclass c1 () ((a :initform 'one)))
> #<STANDARD-CLASS C1>
> ? (ref (make-instance 'c1) 'a)
> ONE
>
> It supports arrays:
>
> ? (ref #2a((a b c) (d e f)) '(1 2))
> F
>
> And all this is even before we get to dictionaries, which work like this:
>
> ? (dict 'a 1 'b 2 'c 3)
> #<DICTIONARY HASH-TABLE { A 1 C 3 B 2 }>
> ? (setf d1 *)
> #<DICTIONARY HASH-TABLE { A 1 C 3 B 2 }>
> ? (ref d1 'a)
> 1
> T
> ? (ref d1 'q)
> NIL
> ? (ref d1 'q 'default)
> DEFAULT
>
>
> And of course it lets you change implementations on the fly:
>
> ? (change-implementation d1 'plist)
> #<DICTIONARY PLIST { B 2 C 3 A 1 }>
>
> It is not integrated into loop, but it is integrated into my iterator
> library which expands into LOOP (and thus allows many of LOOP's features
> to be used):
>
> ? (for (k v) in d1 collect (cons k v))
> ((B . 2) (C . 3) (A . 1))
>
> FOR...IN is based on an iterator protocol, and it *is* extensible, so
> using FOR you can loop over anything for which you can define an
> iterator:
>
> ? (for c in "abc" collect c)
> (#\a #\b #\c)
> ? (with-input-from-string (s "abc") (for c in s collect c))
> (#\a #\b #\c)
>
> Iterators are composable so you can do things like this:
>
> ? (setf s "line1
> line2")
> "line1
> line2"
>
> ? (for c in (lines s) collect c)
> ("line1" "line2")
>
> ? (with-input-from-string (s s) (for c in (lines s) collect c))
> ("line1" "line2")
>
> And just in case Bjorn is reading this (and no doubt recoiling in
> horror) I also have my own class-defining form that automatically
> defines appropriate accessors, so I don't *have* to go generic when I
> know what kind of object I'm dealing with:
>
> ? (define-class frob slot1 slot2)
> #<STANDARD-CLASS FROB>
> ? (frob-slot1 (make-frob :slot1 'foo))
> FOO
>
> So, does my design meet your criteria?
>
> rg

As much as I can see from the above, I like it. Some questions:

- Can you iterate with FOR over keys/values seperately?
- Does FOR expand in some generic "FOR-EACH"?
- Does it work (or would it be possible to make it work) on FSet
collections?

Anyway, you probably should publish that code. I would be interested in
trying it, especially if it comes under a reasonably liberal license
like BSD or LLGPL.

Nicolas
From: Pascal J. Bourguignon on
RG <rNOSPAMon(a)flownet.com> writes:

>> I would be interested in
>> trying it, especially if it comes under a reasonably liberal license
>> like BSD or LLGPL.
>
> I released it to the public domain last year.

Which means that you remains the only one entitled with the right to
make a copy of it, and your heirs until 70 years after your death.

Since I'll be dead probably before then, you won't reproach me if I
don't thank you.


Could you please try the GPL?



--
__Pascal Bourguignon__ http://www.informatimago.com/
From: RG on
In article <877hjwandt.fsf(a)kuiper.lan.informatimago.com>,
pjb(a)informatimago.com (Pascal J. Bourguignon) wrote:

> RG <rNOSPAMon(a)flownet.com> writes:
>
> >> I would be interested in
> >> trying it, especially if it comes under a reasonably liberal license
> >> like BSD or LLGPL.
> >
> > I released it to the public domain last year.
>
> Which means that you remains the only one entitled with the right to
> make a copy of it, and your heirs until 70 years after your death.

I don't know where you got that idea, but you are absolutely wrong.
Releasing the work to the public domain means I have forfeited all my
intellectual property rights and anyone can do anything they want with
it, including use it in commercial software without any constraints
whatsoever.

http://en.wikipedia.org/wiki/Public_domain

> Could you please try the GPL?

Actually, I can't. The GPL requires that the work be copyrighted. Once
a work enters the public domain then by definition it is no longer (and
can no longer be) copyrighted.

rg
From: Alessio Stalla on
On 11 Ago, 23:05, RG <rNOSPA...(a)flownet.com> wrote:
> In article <877hjwandt....(a)kuiper.lan.informatimago.com>,
>  p...(a)informatimago.com (Pascal J. Bourguignon) wrote:
>
> > RG <rNOSPA...(a)flownet.com> writes:
>
> > >> I would be interested in
> > >> trying it, especially if it comes under a reasonably liberal license
> > >> like BSD or LLGPL.
>
> > > I released it to the public domain last year.
>
> > Which means that you remains the only one entitled with the right to
> > make a copy of it, and your heirs until 70 years after your death.
>
> I don't know where you got that idea, but you are absolutely wrong.  
> Releasing the work to the public domain means I have forfeited all my
> intellectual property rights and anyone can do anything they want with
> it, including use it in commercial software without any constraints
> whatsoever.
>
> http://en.wikipedia.org/wiki/Public_domain
>
> > Could you please try the GPL?
>
> Actually, I can't.  The GPL requires that the work be copyrighted.  Once
> a work enters the public domain then by definition it is no longer (and
> can no longer be) copyrighted.

AFAIK, not all legislations have the concept of public domain. In some
countries, you cannot give up your copyright on your work. So in
general, if you really want your work to be accessible to anyone, the
best option is to use a liberal open source license (such as MIT or
BSD).
From: RG on
In article
<f1786719-65bc-44c4-bc2f-ba2105e89df8(a)f6g2000yqa.googlegroups.com>,
Alessio Stalla <alessiostalla(a)gmail.com> wrote:

> On 11 Ago, 23:05, RG <rNOSPA...(a)flownet.com> wrote:
> > In article <877hjwandt....(a)kuiper.lan.informatimago.com>,
> >  p...(a)informatimago.com (Pascal J. Bourguignon) wrote:
> >
> > > RG <rNOSPA...(a)flownet.com> writes:
> >
> > > >> I would be interested in
> > > >> trying it, especially if it comes under a reasonably liberal license
> > > >> like BSD or LLGPL.
> >
> > > > I released it to the public domain last year.
> >
> > > Which means that you remains the only one entitled with the right to
> > > make a copy of it, and your heirs until 70 years after your death.
> >
> > I don't know where you got that idea, but you are absolutely wrong.  
> > Releasing the work to the public domain means I have forfeited all my
> > intellectual property rights and anyone can do anything they want with
> > it, including use it in commercial software without any constraints
> > whatsoever.
> >
> > http://en.wikipedia.org/wiki/Public_domain
> >
> > > Could you please try the GPL?
> >
> > Actually, I can't.  The GPL requires that the work be copyrighted.  Once
> > a work enters the public domain then by definition it is no longer (and
> > can no longer be) copyrighted.
>
> AFAIK, not all legislations have the concept of public domain.

I am quite certain you are quite mistaken.

> In some countries, you cannot give up your copyright on your work.

Which countries are those exactly? What country do you live in?

> So in
> general, if you really want your work to be accessible to anyone, the
> best option is to use a liberal open source license (such as MIT or
> BSD).

OK, fine. I'll get right on that.

rg