[rdnzl-devel] Problem with an even-handler callback

Kai E remarvinator at gmail.com
Sun Jul 31 10:56:00 UTC 2005


Thanks for your reply.

> No, sorry, not from the description above.  

Aight, was just hoping to be lucky and that you had seen it before. :)

> Could you send a small
> self-contained example (Lisp and C# code) which is sufficient to
> reproduce the error?

Yep, will try to do.  I don't have the source for the assembly I'm
using, but I'm trying to get it now, as well as information about how
it was compiled.

The following testcase works like a dream, but it's what I'll try to
modify to fail if I'm able to get my hands on the code in question.

<code>
using System;

namespace DT // short for DelegateTest
{
  public delegate void DTDelegate(int count);

  class DTClass
  {
    public event DTDelegate DTEvent;

    public void Start()
    {
      for( int i = 0; i < 10; i++ ) 
        DTEvent(i);
    }
  }
}
</code>

<code>
c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\csc.exe /target:library DT.cs
</code>

<code>
(import-types "DT" "DTDelegate" "DTClass")

(use-namespace "DT")

(defun try-it ()
  (let ((dt (new "DTClass")))
    [+DTEvent dt (new "DTDelegate" #'handle-event)]
    [Start dt]))

(defun handle-event (counter)
  (format t "~a~%" counter))
</code>



More information about the rdnzl-devel mailing list