"Drew Crampsie" <drewc@...> writes:
> I support a lot of new lispers, and one of the biggest issues i have
> is people using the packages from their distribution and complaining
> they can't make things (slime etc) work.
Then the packages need fixing. It hurts the adoption of Common Lisp
software a lot, if you cannot use your normal installation tools. I
personally have most of my Common Lisp software installed manually, but
I wouldn't expect someone who wants to try out stumpwm or maxima (or
whatever) to manually install the dependencies. Just as I have no desire
to build ghc in my $HOME to run darcs...
>> The first thing I tell them is to purge all distro related lisp and
> start again. We should not endorse a method of installation that is
> broken by design (debian and gentoo with clc), broken due to age
> (centos) or just plain broken.
What is the problem with CLC? I run Gentoo and although CLC is
installed, it doesn't seem to be used anywhere.
Regards,
--
Julian Stecklina
Well, take it from an old hand: the only reason it would be easier to
program in C is that you can't easily express complex problems in C,
so you don't. - Erik Naggum (in comp.lang.lisp)

On 19 Oct 2008, at 22:40, Bob Hutchison wrote:
> Hi Pascal,
>
> Thanks. Comments and questions below...
>
> On 19-Oct-08, at 3:33 PM, Pascal Costanza wrote:
>
>> You're invoking undefined consequences.
>>
>> See Section 11.1.2.1.2 in the HyperSpec, bullet 19: You're defining
>> a method on a predefined generic function (make-instance) which is
>> applicable when its only required argument is a direct instance of
>> a standardized class (here the class 'symbol, of which 'some-class
>> is an instance: (typep 'some-class 'symbol) => T).
>
> Never would have found that :-) Thanks.
>
>>
>>
>> Common Lisp implementations are allowed to take that restriction
>> into account and, for example, compile away the call to make-
>> instance and replace it with something more efficient in case the
>> first argument is a constant symbol (for example).
>>
>> If you really need :around methods on make-instance, consider
>> defining your own metaclass using the CLOS MOP. But based on your
>> example, I have the impression that an :after method on initialize-
>> instance should be sufficient, which is generally preferable
>> anyway...
>
> That example is simplified. What I'm trying to do is implement a
> cache like thing. If someone calls, say, (make-instance 'thing :id
> "abc") then if there is already a thing with id "abc" return it
> rather than a new instance.
>
> As far as I know there's no way to change the return value of the
> primary method just using an :after method.
>
> So... I suppose either I define my own metaclass (a new adventure
> for me :-) or stop using make-instance.
>
> Better ideas?
Stop using make-instance is not a bad idea. You could define your own
create-instance function (or so), or shadow cl:make-instance in your
own package to replace it with your own version. If the caching
functionality is the only functionality you want to add, the CLOS MOP
may be too big a weapon for this purpose.
Are you sure that you need such caching? Garbage collectors are
nowadays pretty good at recycling short-lived objects, so that you
shouldn't need this for performance purposes - unless this is about
semantics and not performance...
Pascal
--
Lisp50: http://www.lisp50.org
Pascal Costanza, mailto:pc@..., http://p-cos.net
Vrije Universiteit Brussel, Programming Technology Lab
Pleinlaan 2, B-1050 Brussel, Belgium

On Oct 19, 2008, at 4:07 PM, Bob Hutchison wrote:
>> Are you sure that you need such caching? Garbage collectors are
>> nowadays pretty good at recycling short-lived objects, so that you
>> shouldn't need this for performance purposes - unless this is about
>> semantics and not performance...
>
> It's semantics I'm afraid. A simple situation is where there is a
> cycle of objects -- only the id of the object is available to identify
> that an object exists twice.
Then I'd suggest using a function with a different name, as changing
make-instance in this way would violate the standard, and shadowing it
will probably be confusing for users who expect make-instance to act
like cl:make-instance. From the HyperSpec:
"The generic function make-instance creates and returns a new instance
of the given class."
If you're not always creating a new instance, I'd suggest something
like "intern-instance".
--
Brian Mastenbrook
brian@...
http://brian.mastenbrook.net/

On 19-Oct-08, at 4:46 PM, Pascal Costanza wrote:
>
> On 19 Oct 2008, at 22:40, Bob Hutchison wrote:
>> That example is simplified. What I'm trying to do is implement a
>> cache like thing. If someone calls, say, (make-instance 'thing :id
>> "abc") then if there is already a thing with id "abc" return it
>> rather than a new instance.
>>
>> As far as I know there's no way to change the return value of the
>> primary method just using an :after method.
>>
>> So... I suppose either I define my own metaclass (a new adventure
>> for me :-) or stop using make-instance.
>>
>> Better ideas?
>
> Stop using make-instance is not a bad idea. You could define your
> own create-instance function (or so), or shadow cl:make-instance in
> your own package to replace it with your own version.
Ohhh... Shadowing is an interesting idea... I'll check into it. Though
I suppose that it might be a little confusing.
> If the caching functionality is the only functionality you want to
> add, the CLOS MOP may be too big a weapon for this purpose.
Only the caching. I already had everything else in the initialize-
instance :after method.
>
>
> Are you sure that you need such caching? Garbage collectors are
> nowadays pretty good at recycling short-lived objects, so that you
> shouldn't need this for performance purposes - unless this is about
> semantics and not performance...
It's semantics I'm afraid. A simple situation is where there is a
cycle of objects -- only the id of the object is available to identify
that an object exists twice.
Yes, I agree, the GC is really quite good... and I take full advantage
of that elsewhere :-)
Cheers,
Bob
>
>
>
> Pascal
>
> --
> Lisp50: http://www.lisp50.org
>
> Pascal Costanza, mailto:pc@..., http://p-cos.net
> Vrije Universiteit Brussel, Programming Technology Lab
> Pleinlaan 2, B-1050 Brussel, Belgium
>
>
>
>
>
>
>

Hi Pascal,
Thanks. Comments and questions below...
On 19-Oct-08, at 3:33 PM, Pascal Costanza wrote:
> You're invoking undefined consequences.
>
> See Section 11.1.2.1.2 in the HyperSpec, bullet 19: You're defining
> a method on a predefined generic function (make-instance) which is
> applicable when its only required argument is a direct instance of a
> standardized class (here the class 'symbol, of which 'some-class is
> an instance: (typep 'some-class 'symbol) => T).
Never would have found that :-) Thanks.
>
>
> Common Lisp implementations are allowed to take that restriction
> into account and, for example, compile away the call to make-
> instance and replace it with something more efficient in case the
> first argument is a constant symbol (for example).
>
> If you really need :around methods on make-instance, consider
> defining your own metaclass using the CLOS MOP. But based on your
> example, I have the impression that an :after method on initialize-
> instance should be sufficient, which is generally preferable anyway...
That example is simplified. What I'm trying to do is implement a cache
like thing. If someone calls, say, (make-instance 'thing :id "abc")
then if there is already a thing with id "abc" return it rather than a
new instance.
As far as I know there's no way to change the return value of the
primary method just using an :after method.
So... I suppose either I define my own metaclass (a new adventure for
me :-) or stop using make-instance.
Better ideas?
Cheers,
Bob
>
>
> Pascal
>
> --
> Lisp50: http://www.lisp50.org
>
> Pascal Costanza, mailto:pc@..., http://p-cos.net
> Vrije Universiteit Brussel, Programming Technology Lab
> Pleinlaan 2, B-1050 Brussel, Belgium