From: David Bakhash
Subject: Lisp stuff (MOP and series)
Date: 
Message-ID: <cxj4sz3pfrw.fsf@hawk.bu.edu>
Joao Cachopo writes:
> "The" Meta-Object Protocol.
> 
> I quoted "the" because it is not the only one, and it is not part of
> ANSI CommonLisp (the standard, that is).

I now have 2 questions for you.

1) why are these MOPs useful?

the second question I'm gonna ask is related to a chapter in Steele's
latest addition, which talks about `Series'.  I havn't seen that
functionality in any of the implementations I've played with (ACL,
CLISP).  Where is it?  and, does anyone have first-hand experience w/
it that can commont on its utility?

dave

From: Raymond Toy
Subject: Re: Lisp stuff (MOP and series)
Date: 
Message-ID: <4ng1injrpy.fsf@rtp.ericsson.se>
David Bakhash <·····@bu.edu> writes:

> the second question I'm gonna ask is related to a chapter in Steele's
> latest addition, which talks about `Series'.  I havn't seen that
> functionality in any of the implementations I've played with (ACL,
> CLISP).  Where is it?  and, does anyone have first-hand experience w/
> it that can commont on its utility?

You can find a version in the CMU Lisp archives.  There's a slightly
different version on www.cons.org/cmucl.  The CLISP site also has
(used to have?) a version specific for CLISP.

I've used it and find it pretty useful and reasonably efficient.  I
rarely use loop now.

Unfortunately, I've never been able to get it to work with ACL.  Works 
well with CMUCL but fails a handful of the 500+ tests.

Ray
From: David Bakhash
Subject: Re: Lisp stuff (MOP and series)
Date: 
Message-ID: <cxj1zu7p7ph.fsf@hawk.bu.edu>
Raymond Toy <···@rtp.ericsson.se> writes:

> David Bakhash <·····@bu.edu> writes:
> 
> > the second question I'm gonna ask is related to a chapter in Steele's
> > latest addition, which talks about `Series'.  I havn't seen that
> > functionality in any of the implementations I've played with (ACL,
> > CLISP).  Where is it?  and, does anyone have first-hand experience w/
> > it that can commont on its utility?
> 
> I've used it and find it pretty useful and reasonably efficient.  I
> rarely use loop now.

can you send me a snippet/example which shows it being used?  it
sounds cool, but I'm a big loop fan.  for example, I just had to write 
this massive sum, and `loop' does a nice job:

(defun hmm-train-sigma (&optional (sigma-seed SIGMA))
  "train the DTW by finding a good sigma"
  (labels ((coerce-matrix-to-long-floats (mat)
				    (declare (type array mat))
				    (loop for i to (array-total-size mat) do
				      (setf (row-major-aref mat i)
					    (coerce (row-major-aref mat i) 'long-float)))))
    (setq sigma-seed (coerce-matrix-to-long-floats sigma-seed))
    (loop for template in *templates*
      for L-template = (length template)
      sum (loop for run in *data*
	    sum (loop for trainchar in run
		  for L-trainchar = (length trainchar)
		  sum (loop for time from 0 to (1- L-trainchar)
			sum (loop for j from 0 to (1- L-template)
			      sum ... (you get the picture :-)

I can't see a more attractive way of writing it.  Loop is really nice.

dave
From: David Bakhash
Subject: Re: Lisp stuff (MOP and series)
Date: 
Message-ID: <cxjyawfns6y.fsf@hawk.bu.edu>
oh.  I looked in the CLISP distribution for anything having to do with 
series, but found nothing.

dave
From: Raymond Toy
Subject: Re: Lisp stuff (MOP and series)
Date: 
Message-ID: <4nhg3383kg.fsf@rtp.ericsson.se>
David Bakhash <·····@bu.edu> writes:

> can you send me a snippet/example which shows it being used?  it
> sounds cool, but I'm a big loop fan.  for example, I just had to write 
> this massive sum, and `loop' does a nice job:

I have some examples of series in actual code, but they're not
particularly interesting because they're not much more than what you
would find in CLTL2, or in Water's report.

If you would still like to see them, I'll send some to you.

Ideally, I'd give you a way cool replacement using series for your
example, but I can't. :-(

Ray
From: Robert Monfera
Subject: Re: Lisp stuff (MOP and series)
Date: 
Message-ID: <355A6078.E76E770@ibm.net>
Hello !

Raymond Toy wrote:

> You can find a version [of series implementation] in the CMU Lisp
> archives.

Unfortunately it did not even compile on LWW. I suspect it is a problem
with compiler-let.It still exists in LWW, but does something different to
what previous versions (2.1) did. Has anyone got a solution? Would it be
possible to ANSI-ize it?

Thanks,
Robert
From: Sunil Mishra
Subject: Re: Lisp stuff (MOP and series)
Date: 
Message-ID: <efyvhrj1gxd.fsf@xenia.cc.gatech.edu>
In article <···············@hawk.bu.edu> David Bakhash <·····@bu.edu> writes:

   Joao Cachopo writes:
   > "The" Meta-Object Protocol.
   > 
   > I quoted "the" because it is not the only one, and it is not part of
   > ANSI CommonLisp (the standard, that is).

   I now have 2 questions for you.

   1) why are these MOPs useful?

The RTFM response would be, "Buy the art of the meta-object protocol."

The short answer is that MOP allows you to modify the basic behavior of
CLOS (though the idea is not specific to CLOS), giving you more flexibility
and *potentially* greater efficiency in how you design your OO program. All
classes are essentially instances of a meta-class, which can be subclassed
and modified.

And there is no standard MOP yet.

Sunil