Frank Ruben
Frank Ruben

Reputation: 105

How to invoke IronScheme clr-call with type parameter

I'm trying to use IronScheme with the Open XML SDK to read an XLSX file.

The Open XML SDK API contains a method, which in C# is written as worksheetPart.Worksheet.Elements<SheetData>(), where passing the type parameter is helpful to filter the elements of the given type.

How would I translate that to IronScheme so that I can pass the SheetData type parameter? I tried the following calls, but they all returned all elements:

(clr-call Worksheet Elements sheet)             ; sure, will return all
(clr-call Worksheet (Elements Object) sheet)    ; syntax test -> allowed, but returns all
(clr-call Worksheet (Elements SheetData) sheet) ; sadly this also returns all

Thanks in advance, Frank

Upvotes: 1

Views: 157

Answers (1)

leppie
leppie

Reputation: 117240

You are using 'type hint' syntax (which is really a bug as it should be reported as not found).

The generic syntax is:

(clr-call Worksheet (Elements #(SheetData)) sheet)

You pass generic type parameters in as a vector for methods.

Sadly this is different from specifying generic type parameters for types.

I will put it on a TODO list.

Upvotes: 0

Related Questions