Hi! Andy Wingo <wi...@pobox.com> skribis:
> On Tue 06 Mar 2012 18:20, l...@gnu.org (Ludovic Courtès) writes: > >> Andy Wingo <wi...@pobox.com> skribis: >> >>> I have pushed a patch to master that changes the implementation of the >>> dynamic stack >> >> The “dynwind stack” actually (I misread it the first time.) > > Yes, it did have this name before. (More often, "the wind list".) But > since "dynwind" is overloaded so much (dynamic-wind operator, <dynwind>, > scm_dynwind_*), and the dynamic stack can have other things on it like > prompts, I thought it best to give it a new name. Indeed, very good point. That said, when I first saw the topic, I was expecting something about the VM stack, which could now be grown dynamically upon stack overflow. :-) Now, what would be a better name? As you say, in an ideal world, there’d be only one stack so... >> Could you please add comments in dynstack.c (above each function), and >> make sure to follow GCS-style (no hanging brace, for example)? > > What do you mean by "no hanging brace"? Anything reported by: grep -nH -e '[[:graph:]]\+[[:blank:]]*{$' *.[ch] such as: typedef enum { SCM_DYNSTACK_TYPE_NONE = 0, SCM_DYNSTACK_TYPE_FRAME, SCM_DYNSTACK_TYPE_UNWINDER, SCM_DYNSTACK_TYPE_REWINDER, SCM_DYNSTACK_TYPE_WITH_FLUIDS, SCM_DYNSTACK_TYPE_PROMPT, SCM_DYNSTACK_TYPE_DYNWIND, } scm_t_dynstack_item_type; Also, “Don't declare both a structure tag and variables or typedefs in the same declaration” (info "(standards) Syntactic Conventions"). > What sorts of comments would you like to see? I have been working with > this code a lot, so perhaps some things which are obvious to me from > names, types, assertions, etc that might not actually be obvious. I > don't see what I can write that isn't wholly redundant. Perhaps you > will let me know :-) Comments above functions would be nice. For instance, I can’t tell what this does: scm_t_dynstack * scm_dynstack_capture (scm_t_dynstack *dynstack, scm_t_bits *item) A two-line comment above mentioning DYNSTACK and ITEM would be great (info "(standards) Comments"). (And we could use the neat M-x semantic-ia-show-doc, which gives a Geiser feel to this dull C world. ;-)) And I think it wouldn’t be redundant for many/most of the functions in that file. Thanks, Ludo’.