Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fields don't show default value #78

Open
ennosigaeus opened this issue Dec 19, 2012 · 2 comments
Open

Fields don't show default value #78

ennosigaeus opened this issue Dec 19, 2012 · 2 comments

Comments

@ennosigaeus
Copy link

IDLdoc 3.5.1 will properly detect the fields "data" and "some_field". However, I'd like not only to see that "some_field" is "0L", but that "some_field" is set to "10L" (see second code block for actual IDLdoc output). NB: I also tried setting attributes on the fields (e.g. "some_field : type="long", default="10L"), but IDLdoc ignored them.

For now I just decided to add the default value to the comment blocks.

BTW: Would it be possible (in order to reduce duplication) to reuse the field documentation in :fields: in their corresponding :properties:, SetProperties, and GetProperties counterparts (e.g. if left empty)?

;+
; :description:
;    Constructor
;
; :fields:
;    data
;      internal data storage variable (default: fltarr(10))
;    some_field
;      some other internal data storage variable (default: 10L)
;-
pro class_name__define
  compile_opt idl2, hidden

  void = { class_name, $
           data:fltarr(10), $
           some_field:10L $
         }
end
Fields
Fields in class_name

some_field 0L
    some other internal data storage variable (default: 10L)
data fltarr(10)
    internal data storage variable (default: fltarr(10))

@mgalloy
Copy link
Owner

mgalloy commented Dec 19, 2012

I think it would be useful to allow default values be documented like:

some_field : default=10L
  description of some_field

Be careful, though, setting some_field:10L in the definition of the member variables as in the above example does not set the default value for objects of the class!

@ennosigaeus
Copy link
Author

You're right, of course. I do like the idea of allowing to set the default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants