On 10.04.2014, at 13:18, Igor Stasenko <siguctua@gmail.com> wrote:
On 10 April 2014 11:44, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
On 09 Apr 2014, at 5:30 , Max Leske <maxleske@gmail.com> wrote:
On 09.04.2014, at 17:25, Sean P. DeNigris <sean@clipperadams.com> wrote:
Max Leske wrote
In NB, how do I pass NULL into a function call without modifying the argument type? e.g. my argument has type String. passing something like `NBExternalAddress null` will be converted into a C string instead of being passed through (I know, that seems to be the point in this case but I couldn't find any other way to create NULL). Any suggestions?
I think you just pass nil, no?
One would think so, but no⦠:) NB will signal an exception because UndefinedObject is not of the expected type.
I remember an optCoerceNilToNull, but that seems to 1) Only apply to pointer types (which could mean having to use char *, not String, and thus need to do encoding/decoding manually) 2) Be scoped to entire call, not single parameter (may or may not be more than a philosophical objection)
Might be worth a shot though?
- optCoerceNilToNull is for pointers
for strings, there's an option: - optStringOrNull
That should work for most cases. Thanks Igor
which, if enabled, adds additional check for nil in generated marshaller code, so that by passing nil it will pass NULL to calling function.
Cheers, Henry
-- Best regards, Igor Stasenko.