[Please use the mailing list.]
On Mon, 25 Dec 2006 13:17:28 -0800, "Richard Fateman" <fateman(a)cs.berkeley.edu> wrote:
> We're using Allegro CL, and microsoft's ink routines, which
> ultimately return to us "strokes" which we can decompose as arrays
> of points, each containing an X and a Y.
>
> This decomposition, as we have written it, crosses the lisp - .net
> boundary too often. Presumably with the right magic, we can just
> access the arrays once. Suggestions? (I'd rather do this
> extraction in Lisp....)
>
> ;;; Here's our way convert a stroke to a list of (x . y) points.
>
> (defun decode-one-stroke (as) ;a stroke
> (let ((netarray
> [GetPoints as])
> (list-of-points nil))
> (do-rdnzl-array (v netarray (nreverse list-of-points))
> (push (cons [%X v ][%Y v]) list-of-points)
> )))
Have you tried "direct calls"?
http://weitz.de/rdnzl/#direct
This might yield a noticeable performance gain, but the main problem
of crossing the boundary too often will still be there.
Right now, there's no way to overcome this. You'd have to write low
level C++ code using something like (the equivalent of) LispWork's
WITH-DYNAMIC-LISP-ARRAY-POINTER on the Lisp side to get a .NET array
into the Lisp world in one fell swoop. But this would solve only half
of it, as you'd still have to get at the x/y coordinates of each
point, crossing the boundary once again. ATM I have no idea how a
general solution could look like.
Cheers,
Edi.
On Wed, 29 Nov 2006 22:11:02 -0800, "Richard Fateman" <fateman(a)cs.berkeley.edu> wrote:
> An example that displays some of the possibilities for using rdnzl
> for a drop-down menu cascade showing lisp trees is in
> http://www.cs.berkeley.edu/~fateman/speech-lisp/outline.lisp
>
> Feel free to redistribute if it catches your fancy. You can put your
> blurb in there if you want.
>
> Maybe you would want to polish it up some. I'm hardly a .NET
> expert. The application, suitably elaborated would be used for
> displaying huge mathematical expressions in some more understandable
> way.
Thanks Richard,
I'm too busy right now to do anything with the code, but I've added a
link to the example section of the RDNZL website.
Cheers,
Edi.