comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Object filenames
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Object filenames [message #71890] Mon, 26 July 2010 11:01
mankoff is currently offline  mankoff
Messages: 131
Registered: March 2004
Senior Member
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()

==============================================

This seems a bit cleaner for an end-user of an object group. Cons are
that you cannot tell that it is an object based on the filename (no
__define), nor when reviewing the code. And you cannot access the
structure of the object as a stand-alone structure by the "f = {foo}"
syntax. As object structures should probably not be accessed directly,
those seem like trivial issues.

-k.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Extract pixel values from HDF-EOS file
Next Topic: Re: Object filenames

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 01:03:53 PDT 2025

Total time taken to generate the page: 0.48202 seconds