J being a shared library has nothing to do with
ownership of memory, it's the libraries for malloc/free
that are important. J most probably uses private
static malloc/free, which means if I assume ownership
if its memory block and then release it with my
free, J's memory lib will not know about it.

On the other hand, VARIANT and BSTR are per se
very simple structures and it's not a problem
to use them under Unix. The problem is who will
allocate and release them.

If somebody needs output, it is not possible
to obtain it in the session form (as was recently 
discussed even before the Mac example), unless you 
have JDoR or output from JSM or J socket API.

For wd and gl2 (gl3 is DLL) stuff JSM itself will not be
fully enough, in the sense that some of the J demos
will not work. Jga provides the "output stream"
of wd/gl commands. However, it'll still suffice
for unidirectional graphical output, such as
printing a plot, etc. But it is possible already now
by overriding the glxxx calls in J scripts, as it 
was done in the Hardware Java OpenGL demos.

On a second thought, provided that all naked 
session-related (not engine, but possibly IO) foreign 
conjunction uses are replaced with names, and given 
you have pcall interface, you don't need JSM or Jga.
That can count as separate use case for pcall. :)

With small exceptions, like 0!:xxx writes directly
to the mythical output bypassing user API, so there
is a layer of separation missing.


--- bill lam <[EMAIL PROTECTED]> wrote:

> IMO ownership need not the issue because j is called as an shared object, but 
> the in the signature
>    int JDoR(int h, char* s, VARIANT* v)
> VARIANT is supposed to be a OLE2 data structure and OLE2 is not generally 
> available in linux.
> 
> I think that JSM is not much useful in this context unless it is intended to 
> implement 11!:x, I'm also waiting for its documentation in the coming J602.
> 
> Oleg Kobchenko wrote:
> > As I understand, unavailability of JDoR in Unix is
> > because of the result string ownership. Whereas in
> > Windows it's ownership is passed on to caller and
> > together with J they can access the shared SysAlloc's
> > API, the malloc/free are different; so either a free'er must
> > me provided or ownership is retained by J by means of
> > output callback, as it is done now. Is that correct reasoning?
> > 
> > 
> > --- Eric Iverson <[EMAIL PROTECTED]> wrote:
> > 
> >> JSM and Jga are just undocumented. And as such have been subject to some 
> >> changes over release versions. I intend to have JSM as a stable, 
> >> documented, 
> >> and exampled part of the 602 release. JSM makes writing JFE much easier 
> >> (witness the complications in Mike's new Mac JFE). My feeling is that Jga 
> >> is 
> >> much less important and there are easy workarounds so it may not make it 
> >> into the open this time round. The main thing that JSM lets you do is to 
> >> set 
> >> the JE callback for formatted output.
> >>
> >> ----- Original Message ----- 
> >> From: "Oleg Kobchenko" <[EMAIL PROTECTED]>
> >> To: "General forum" <[EMAIL PROTECTED]>
> >> Sent: Thursday, April 12, 2007 7:27 PM
> >> Subject: [Jgeneral] JSM and Jga
> >>
> >>
> >>> So is the interface to JSM and Jga proprietory (closed)
> >>> or just undocumented?
> >>>
> >>> For example, in Unix, there is no JDoR, and it
> >>> resulted in a partial workaround of representing
> >>> output in a recent Mac client example, which was
> >>> pointed out to be unsatisfactory.
> >>>
> >>> http://www.jsoftware.com/pipermail/general/2006-November/028220.html
> >>>
> >>> http://www.jsoftware.com/pipermail/beta/2006-February/000521.html
> >>>
> >>> http://www.jsoftware.com/pipermail/general/2003-August/014953.html
> >>>  BTW, the brinker server is still running unattended circa 2003.




       
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to