Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Array as return type

0
0
Yes, for better and worse, ClearScript is all about seamless access rather than conversion :)

The idea is that with seamless access, conversion (should you need it) is easy and can be tailored to your requirements. We agree however that the need to pass the engine around might be painful.

What if ClearScript allowed something like this:
[ScriptMember(Name = "text", Flags = ScriptMemberFlags.ConvertArray)]
public string[] Text()
{
    // ...
}
The conversion from (one-dimensional) .NET arrays to script arrays is unambiguous and probably useful in many scenarios. Hmm... :)

Viewing all articles
Browse latest Browse all 2297