Author Topic: access global lisp var, that is in separate namespace?  (Read 3114 times)

0 Members and 1 Guest are viewing this topic.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
access global lisp var, that is in separate namespace?
« on: November 19, 2008, 03:03:48 PM »
Just checking if anyone knows this, I know its been asked before.
I compile my lisps to separate namespace vlx's, and want .net to access the global vars those lisp progs set up.
I know how to access the normal lisp vars back and forth to .net, but how about the separate namespace ones?
This is a critical detail when trying to mix lisp with .net.

thx
James Maeding

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: access global lisp var, that is in separate namespace?
« Reply #1 on: November 19, 2008, 09:18:20 PM »
I don’t know but, why would you need to, when you can send the variable via a parameter?
Or why not just put all your global variables in a static class that you can retrieve via a lispmethod?
« Last Edit: November 19, 2008, 09:26:43 PM by Daniel »

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: access global lisp var, that is in separate namespace?
« Reply #2 on: November 21, 2008, 11:29:13 AM »
Its doing modeless dialogs that I am thinking of.
So I have a modeless dialog done in .net, and it needs to read some var from a lisp prog.
If it cannot do it by name directly, it would have to rely on a lisp function to send it a result buffer of the variable being asked for.
That seems like it should work.
So my lisp function would be:
(Myprogram-getvar "varname")
to expose the variable.
I would also need a matching:
(Myprogram-setvar "varname")
to allow setting of values.

Not sure why I did not accept that as a nice solution before, I'll have to just try it.
thanks
James Maeding

SomeCallMeDave

  • Guest
Re: access global lisp var, that is in separate namespace?
« Reply #3 on: November 23, 2008, 04:52:08 PM »
I guess I am coming late into this thread,  but I wondering (which means that I haven't tried it yet) if 'vl-propagate' could be used from the vlx to "export" whichever variables were needed by the .net application?

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: access global lisp var, that is in separate namespace?
« Reply #4 on: November 24, 2008, 07:04:22 PM »
vl-proagate allows the vlx to access non-namespace (document) vars, its the reverse of what is needed, and it has side effects not wanted too.
Good thinking though, namespace stuff does not come up often.
James Maeding

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: access global lisp var, that is in separate namespace?
« Reply #5 on: November 24, 2008, 07:45:48 PM »
How does Arx / OpenDCL handle this?

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: access global lisp var, that is in separate namespace?
« Reply #6 on: December 01, 2008, 01:04:12 PM »
The code that involves OpenDcl runs inside the vlx, so no access issues.
OpenDcl does set some document level variables, but the vlx can get those with (vl-doc-ref) function.

James Maeding

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8696
  • AKA Daniel
Re: access global lisp var, that is in separate namespace?
« Reply #7 on: December 02, 2008, 05:21:09 PM »
The code that involves OpenDcl runs inside the vlx, so no access issues.
OpenDcl does set some document level variables, but the vlx can get those with (vl-doc-ref) function.



I believe that .NET communicates with Lisp in the same way ARX does.
I wonder if there is some ARX function that can be wrapped to do what you need.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: access global lisp var, that is in separate namespace?
« Reply #8 on: December 02, 2008, 06:00:05 PM »
right, but I've never seen an ARX that communicated with stuff inside a namespace, unless specifically exposed by some function.
So that is what I will do, make a function in my lisp program, that the .net prog can call.
The function will return the value (as resultbuffer) of some variable within the namespace, thus crossing the boundary.
I don't think its a big deal, should work well enough.
James Maeding