|Newbie questions about Pliant
Passing null object to external functions.
Pliant passes all arguments of non-atomic types by reference.
This is also useful in most external functions. But what If I
want to pass a null object?
|Message posted by mujtaba on 2003/01/03 16:14:02
|Pliant passes all arguments of non-atomic types by reference, by default. This
makes interfacing with external functions cleaner; no need to reference types when
passing to functions and no need to dereference types when accessing its members.
But how can I send a null object to an external function if the Pliant prototype
specifies an actual Type as one of its arguments?
The only way it seems to me is to make the argument of an Address type, then
create implicit casting functions to reference and dereference the type I want to
pass. Only then will null be an acceptable paramater. Isn't there another way? I
shouldn't have to create two implicit cast functions for each type I
define, unless I want to.
Plus it makes function prototypes ambiguous to other programmers, since key
arguments are written as Address types. I would have to leave comments telling
what each Address type argument is supposed to reference. Sorry, I didn't mean
to complain here.
|Message posted by hubert.tonneau on 2003/01/03 16:19:15
|If the type of the argument is 'Foo' then just pass
null map Foo
as the argument