Re: Object filenames [message #71888] |
Mon, 26 July 2010 11:06 |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Jul 26, 3:01 pm, mankoff <mank...@gmail.com> wrote:
> Hi Group,
>
> Standard IDL syntax is to have an object "foo" in a file called
> "foo__define.pro" that contains, perhaps, something like this:
>
> PRO foo__define, class
> class = { foo:42, bar:"baz" }
> END
>
> And then to instantiate said object like this:
> IDL> f = obj_new('foo')
>
> ==============================================
>
> Would it be simpler, and does anyone see any negatives, to the
> following setup:
>
> 1) Rename the file from "foo__define.pro" to "foo.pro"
> 2) Keep the contents exactly as before
> 3) Append the following to the bottom:
>
> FUNCTION foo, _EXTRA=e
> return, obj_new('foo', _EXTRA=e)
> END
>
> 4) Instantiate the object with the simpler syntax:
> IDL> f = foo()
>
I do not see a problem, and have seen this been done. In fact, this
has become unnecessary in IDL 8, as this kind of wrapper is
automatically available to every class.
|
|
|