Thatd be great! Then we could create our own functions to keep track of however many previous values we wanted. I suppose something like
(let ((previous-vals ...)) (add-eval-hook (lambda ...)) (lambda (amount-back-to-get) ...)) Though then we would need an initialization file to put that code in that is loaded on startup.
Technically, i haven't really sorted out the interface issue. To give you a general picture, i have my two little functions:
(defn (create-trade-desk) (cast ITradeDeskAut (: CreateTradeDesk (cast CoreAut (new CoreAutClass)) "trader"))) ;;<--- casting does nothing
(defn (login user pass
(assert (or (equal? connection "Demo")
(equal? connection "Real")))
(let ((trade-desk (create-trade-desk)))
(: Login trade-desk user pass url connection)
The : function uses the (ironscheme clr dynamic) library and memoization to call the members of an object. However. (create-trade-desk) returns an object of type System.__ComObject. This makes sense because
the CreateTradeDesk method returns an object. However, when i attempt to cast it to the interface ITradeDeskAut, nothing happens: it still remains a System.__ComObject. Coming down to the (: Login) method an error is thrown:
(login "sdf" "sdf")
Unhandled exception during evaluation:
&message: "no candidates found for method"
&irritants: (Login #<clr-type System.RuntimeType "System.__ComObject">)
Which wouldn't happen if the cast had been successful. I can 'get around' this by changing the (: login) line to
(clr-call ITradeDeskAut Login trade-desk ...) which works. However I would prefer to cast it once and then let reflection do its thing.
As a mini test i tried to do this:
(cast CoreAut (new CoreAutClass))
but it again returns
While it should now be of type CoreAut. In the c# code they succesfully do the casts, but in this scheme code the casts aren't working.
Now I really dont know too much about c#, in fact im learning only via interfacing it with ironscheme, so there must be something I'm missing!