Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 20, 2005 DMDScript and D interaction | ||||
---|---|---|---|---|
| ||||
How many of you were/are trying to do the same that I am? That is, try to integrate DMDScript with D. What I have done is modified slightly Walter's testscript so it becomes a sort of interactive shell (it really isn't, but it takes its input from console instead from a file). Anyway, I could create a DMDScript variable from a D one. What I did was prepend to the user input code of my own, just like this: buffer = "var myValue = " ~ format(myValue) ~ ";" ~ userInput; So the user can use "myValue", and she can even modify it. The problem is that past that point, I want to recover in D the value of "myValue" and see if it changed. Can it be done? How? (extra points if there's a way to notify from DMDScript to D the moment "myValue" changes ;) ). _______________________ Carlos Santander Bernal |
January 21, 2005 Re: DMDScript and D interaction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <csantander619@gmail.com> wrote in message news:csp8s9$tcc$1@digitaldaemon.com... > How many of you were/are trying to do the same that I am? That is, try to integrate DMDScript with D. > > What I have done is modified slightly Walter's testscript so it becomes a sort of interactive shell (it really isn't, but it takes its input from console instead from a file). Anyway, I could create a DMDScript variable from a D one. What I did was prepend to the user input code of my own, just like this: > > buffer = "var myValue = " ~ format(myValue) ~ ";" ~ userInput; > > So the user can use "myValue", and she can even modify it. The problem is that past that point, I want to recover in D the value of "myValue" and see if it changed. Can it be done? How? (extra points if there's a way to notify from DMDScript to D the moment "myValue" changes ;) ). The way to do that is create your own object (by deriving from DObject). Then, override the Put() functions to notify when a property gets a new value. |
January 22, 2005 Re: DMDScript and D interaction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > The way to do that is create your own object (by deriving from DObject). > Then, override the Put() functions to notify when a property gets a new > value. > > Thanks. I managed to get it working: http://dblinux.sis.epn.edu.ec/~csantand/dmdscript.html Maybe I'll upload the executables tomorrow (if someone requests them). _______________________ Carlos Santander Bernal |
January 22, 2005 Re: DMDScript and D interaction | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander B. | "Carlos Santander B." <csantander619@gmail.com> wrote in message news:cssgst$1mn4$1@digitaldaemon.com... > Walter wrote: > > The way to do that is create your own object (by deriving from DObject). > > Then, override the Put() functions to notify when a property gets a new > > value. > > > > > > Thanks. I managed to get it working: > http://dblinux.sis.epn.edu.ec/~csantand/dmdscript.html > Maybe I'll upload the executables tomorrow (if someone requests them). Great! |
Copyright © 1999-2021 by the D Language Foundation