How to cast/wrap scheme procedures to delegate types?

Nov 27, 2011 at 8:51 PM

Hello,

I tried to use ironscheme threading and after a call to make-thread I got the error:

Unhandled CLR exception during evaluation:
CLR Exception: System.ArgumentException
System.ArgumentException: The type or method has 1 generic parameter(s), but 0 g
eneric argument(s) were provided. A generic argument must be provided for each g
eneric parameter.
   at System.RuntimeType.SanityCheckGenericArguments(RuntimeType[] genericArgume
nts, RuntimeType[] genericParamters)
   at System.Reflection.RuntimeMethodInfo.MakeGenericMethod(Type[] methodInstant
iation)
   at IronScheme.Runtime.Helpers.MakeVoidTypedCallable(Type[] argtypes, Callable
 c)
   at IronScheme.Runtime.Helpers.ConvertToDelegate[T](Object proc)
   at threading.ironscheme.threading::make-thread(Object proc)
   at #.ironscheme.exceptions::dynamic-wind(Object in, Object proc, Object out)
   at #.ironscheme.exceptions::dynamic-wind(Object in, Object proc, Object out)
   at IronScheme.Runtime.Builtins.CallWithCurrentContinuation(Object fc1)
   at IronScheme.Runtime.R6RS.Exceptions.WithClrExceptionHandler(Object handler,
 Object thunk)

I tried to map another method using a delegate as a parameter and I get the same error.

So I am wondering how to cast/wrap scheme procedures to delegate types?

Thanks

 

Coordinator
Nov 28, 2011 at 3:57 AM

Hi

Show some Scheme code please.

Procedures should automatically convert given you have the correct number of arguments.

IIRC ThreadStart delegate has none, so you need to provide a thunk. Eg

(lambda () ... )

Cheers

leppie

Coordinator
Nov 28, 2011 at 4:05 AM

Hi again

Just ran a small test. Seems a bug have crept in somewhere, getting same error :(

Will fix ASAP :)

Thanks

leppie

Coordinator
Nov 28, 2011 at 4:05 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Nov 28, 2011 at 4:14 AM

I have fixed it the bug locally and will push the fixes tonite. See bug item for solution if needed now.