From edi at agharta.de Fri Dec 1 09:26:18 2006 From: edi at agharta.de (Edi Weitz) Date: Fri, 01 Dec 2006 10:26:18 +0100 Subject: [rdnzl-devel] Re: small example for rdnzl using windows In-Reply-To: <011a01c71446$50a2eef0$0cd09888@RJFE510> (Richard Fateman's message of "Wed, 29 Nov 2006 22:11:02 -0800") References: <011a01c71446$50a2eef0$0cd09888@RJFE510> Message-ID: On Wed, 29 Nov 2006 22:11:02 -0800, "Richard Fateman" 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. From edi at agharta.de Wed Dec 27 21:56:09 2006 From: edi at agharta.de (Edi Weitz) Date: Wed, 27 Dec 2006 22:56:09 +0100 Subject: [rdnzl-devel] Re: rdnzl, multiprocessing, Allegro, windows, locking In-Reply-To: <003401c7286a$159996a0$210110ac@windsor> (Richard Fateman's message of "Mon, 25 Dec 2006 13:17:28 -0800") References: <003401c7286a$159996a0$210110ac@windsor> Message-ID: [Please use the mailing list.] On Mon, 25 Dec 2006 13:17:28 -0800, "Richard Fateman" 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. From roger at corman.net Wed Dec 27 23:39:49 2006 From: roger at corman.net (Roger Corman) Date: Wed, 27 Dec 2006 15:39:49 -0800 Subject: [rdnzl-devel] Re: rdnzl, multiprocessing, Allegro, windows, locking In-Reply-To: References: <003401c7286a$159996a0$210110ac@windsor> Message-ID: <200612272339.kBRNdoUQ022873@b.mail.sonic.net> I think if I were doing this, I would write a C++ function which converts the .NET array to a native array (of native point structs). This could be called via the Lisp native interface (exporting it via a DLL) and then use the native interface to operate on it. Allegro CL should be able to handle that part very efficiently with its built-in FFI. Roger -------------- At 01:56 PM 12/27/2006, Edi Weitz wrote: >[Please use the mailing list.] > >On Mon, 25 Dec 2006 13:17:28 -0800, "Richard Fateman" 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. >_______________________________________________ >rdnzl-devel mailing list >rdnzl-devel at common-lisp.net >http://common-lisp.net/cgi-bin/mailman/listinfo/rdnzl-devel