Hi,

See answers in between.

Op zondag 15 januari 2023 23:38:07 CET schreef flywire:
> This exercise has left me with a few questions about
> https://github.com/flywire/gnucash/blob/Hello/gnucash/report/reports/example
> /options-example.scm
> 
>    1. I'm not clear on the scheme terminology. What are the lines in the
>    top-level definitions I labelled initialise values? I understand they are
> not constants and I'd normally call it initialising or assigning variables.

It's exactly that. These are variable assignments. Though "assignment" is 
probably not the exact term used in guile but close enough.

> 2. Why does the section referred to in the above point normally only
> contain option name and help but not default, section, or sort order?

I think the most common reason to do so it because the variables defined above 
would be used in multiple location throughout the code, while those that 
aren't will be used only once.

In the past it may also have been a habit to group translatable strings at the 
top of the file, but that's no longer standard practice.

Keep in mind that the report you're working on is a very artificial and 
extremely limited one. It may have copied and simplified sections coming from 
other reports and it may not all be logical still.

> 3. If option sections are defined, does a default section need to be set?

Setting a default section is optional. If not set, the default section will be 
the first section.

> 4. Can a default General section be added to?
> It seems not and the whole thig must be created.

I'm not sure I understand what you mean. But you can look in other reports 
that have a General section how that is done.

> 5. The formatting style is different to most standard reports.
> Does it need updating?

I think this report has been neglected for ages as it's only purpose was to be 
a lightweight illustration of how options work. It would probably be good to 
update the formatting style while you're at it. Be sure to do that in a 
separate commit though. Debugging gets ugly if formatting changes are mixed 
with actual code changes in the same commit.

>    6. How can I make the version number bold:
>   
> https://github.com/flywire/gnucash/blob/3a949c269735709b47e02f181d80ad7e8c6
> 71982/gnucash/report/reports/example/options-example.scm#L340-L345

Have you tried html markup in the format string ?

> 7. What is the best way of understanding/searching the api? Things like html
> format and date interval below or tracing from date interval in other
> reports back to the specific date.

That's a weak point of our code. There's no guile oriented api documentation. 
So you'll have to resort to the C api documentation, which is also incomplete.

In general if you find functions of the format gnc-some-thing those are C-
functions really with the name gnc_some_thing (note the conversion of dashed 
into underscores). Functions names gnc:something are written in guile directly 
and will be found somewhere in the other parts of the guile code. The use-
modules directives at the top give hints to which other guile code is 
referenced.

>    8. I'm still not clear on things like let, let*, and nested let.

Those are very much lisp/guile concepts. As Michael suggested you may want to 
get somewhat familiar with the concepts of such functional rather than 
procedural language. Another good place to start may be the guile user manual 
which you can find on the gnu.org website somewhere.

I have to admit it has taken me a very long time as well to get used to the 
functional programming style vs the for me more familiar procedural or object 
oriented programming styles. I'm still not fluent in it, but sufficient to 
work with the gnucash code base.

>    9. There seems to be some sort of git corruption. How can I move this
>    forward as a contribution?

Without more details, it's hard to tell what your problem really is.

>    10. > [raised previously] I'm not sure if version or report-guid should
>    be updated.

IMO, no.

Regards,

Geert



_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to